Browse Source

Remove not needed variables

George King 7 months ago
parent
commit
551c1021b9
2 changed files with 8 additions and 8 deletions
  1. 6 6
      client/mainmenu/CCampaignScreen.cpp
  2. 2 2
      client/mainmenu/CCampaignScreen.h

+ 6 - 6
client/mainmenu/CCampaignScreen.cpp

@@ -100,7 +100,7 @@ CCampaignScreen::CCampaignScreen(const JsonNode & config, std::string name)
 			Point(config[name]["nextbutton"]["x"].Integer(), config[name]["nextbutton"]["y"].Integer()),
 			AnimationPath::fromJson(config[name]["nextbutton"]["name"]),
 			std::make_pair("", ""),
-			[this, name]() { switchPage(1, name); }
+			[this, name]() { switchPage(1); }
 		);
 		buttonNext->setHoverable(true);
 		buttonNext->disable();
@@ -113,7 +113,7 @@ CCampaignScreen::CCampaignScreen(const JsonNode & config, std::string name)
 			Point(config[name]["backbutton"]["x"].Integer(), config[name]["backbutton"]["y"].Integer()),
 			AnimationPath::fromJson(config[name]["backbutton"]["name"]),
 			std::make_pair("", ""),
-			[this, name]() { switchPage(-1, name); }
+			[this, name]() { switchPage(-1); }
 		);
 		buttonPrev->setHoverable(true);
 		buttonPrev->disable();
@@ -126,7 +126,7 @@ CCampaignScreen::CCampaignScreen(const JsonNode & config, std::string name)
 		buttonBack->setHoverable(true);
 	}
 
-	updateCampaignButtons(config, campaignSet);
+	updateCampaignButtons(config);
 }
 
 void CCampaignScreen::activate()
@@ -221,17 +221,17 @@ void CCampaignScreen::CCampaignButton::hover(bool on)
 	}
 }
 
-void CCampaignScreen::switchPage(int delta, const std::string & campaignSet)
+void CCampaignScreen::switchPage(int delta)
 {
 	currentPage += delta;
 	currentPage = std::clamp(currentPage, 0, maxPages - 1);
 
 	const auto& campaignConfig = CMainMenuConfig::get().getCampaigns();
 
-	updateCampaignButtons(campaignConfig, campaignSet);
+	updateCampaignButtons(campaignConfig);
 }
 
-void CCampaignScreen::updateCampaignButtons(const JsonNode & parentConfig, const std::string & campaignSet)
+void CCampaignScreen::updateCampaignButtons(const JsonNode & parentConfig)
 {
 	const auto& campaigns = parentConfig[campaignSet]["items"].Vector();
 

+ 2 - 2
client/mainmenu/CCampaignScreen.h

@@ -65,8 +65,8 @@ private:
 	int currentPage = 0;
 	int maxPages = 0;
 
-	void switchPage(int delta, const std::string& campaignSet);
-	void updateCampaignButtons(const JsonNode& parentConfig, const std::string& campaignSet);
+	void switchPage(int delta);
+	void updateCampaignButtons(const JsonNode& parentConfig);
 
 public:
 	CCampaignScreen(const JsonNode & config, std::string campaignSet);