فهرست منبع

Remove excessive code

nordsoft 2 سال پیش
والد
کامیت
d7b0770b71
2فایلهای تغییر یافته به همراه6 افزوده شده و 7 حذف شده
  1. 1 5
      client/lobby/RandomMapTab.cpp
  2. 5 2
      client/widgets/Buttons.cpp

+ 1 - 5
client/lobby/RandomMapTab.cpp

@@ -544,7 +544,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab):
 				}
 				else
 				{
-					button->addOverlay(buildWidget(variables["unchecked"]));
+					button->addOverlay(nullptr);
 				}
 			}
 		}));
@@ -554,11 +554,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab):
 		{
 			variables["point"]["x"].Integer() = variables["cellOffset"]["x"].Integer() + plId * variables["cellMargin"]["x"].Integer();
 			variables["point"]["y"].Integer() = variables["cellOffset"]["y"].Integer() + teamId * variables["cellMargin"]["y"].Integer();
-			//Point p(40 + plId * 32, 20 + teamId * 32);
-			placeholders.push_back(buildWidget(variables["placeholder"]));
 			auto button = buildWidget(variables["button"]);
-			button->pos.w = variables["cellMargin"]["x"].Integer();
-			button->pos.h = variables["cellMargin"]["y"].Integer();
 			players.back()->addToggle(teamId, std::dynamic_pointer_cast<CToggleBase>(button));
 		}
 		

+ 5 - 2
client/widgets/Buttons.cpp

@@ -84,8 +84,11 @@ void CButton::addTextOverlay(const std::string & Text, EFonts font, SDL_Color co
 void CButton::addOverlay(std::shared_ptr<CIntObject> newOverlay)
 {
 	overlay = newOverlay;
-	addChild(newOverlay.get());
-	overlay->moveTo(overlay->pos.centerIn(pos).topLeft());
+	if(overlay)
+	{
+		addChild(newOverlay.get());
+		overlay->moveTo(overlay->pos.centerIn(pos).topLeft());
+	}
 	update();
 }