Sfoglia il codice sorgente

adjust text; increase gold input size

Laserlicht 1 anno fa
parent
commit
a8fe8cbcf0

+ 2 - 2
Mods/vcmi/config/vcmi/english.json

@@ -75,8 +75,8 @@
 	"vcmi.lobby.author" : "Author",
 	"vcmi.lobby.handicap" : "Handicap",
 	"vcmi.lobby.handicap.resource" : "Gives players appropriate resources to start with in addition to the normal starting resources. Negative values are allowed, but are limited to 0 in total (the player never starts with negative resources).",
-	"vcmi.lobby.handicap.income" : "Changes the player's various incomes by the percentage. Mines still give at least 1 resource per mine.",
-	"vcmi.lobby.handicap.growth" : "Changes the growth rate of creatures in the towns owned by the player. At least 1 is still generated per creature.",
+	"vcmi.lobby.handicap.income" : "Changes the player's various incomes by the percentage. Is rounded up.",
+	"vcmi.lobby.handicap.growth" : "Changes the growth rate of creatures in the towns owned by the player. Is rounded up.",
 		
 	"vcmi.lobby.login.title" : "VCMI Online Lobby",
 	"vcmi.lobby.login.username" : "Username:",

+ 2 - 2
Mods/vcmi/config/vcmi/german.json

@@ -75,8 +75,8 @@
 	"vcmi.lobby.author" : "Author",
 	"vcmi.lobby.handicap" : "Handicap",
 	"vcmi.lobby.handicap.resource" : "Gibt den Spielern entsprechende Ressourcen zum Start zusätzlich zu den normalen Startressourcen. Negative Werte sind erlaubt, werden aber insgesamt auf 0 begrenzt (der Spieler beginnt nie mit negativen Ressourcen).",
-	"vcmi.lobby.handicap.income" : "Verändert die verschiedenen Einkommen des Spielers um den Prozentsatz. Minen geben aber weiterhin mindestens 1 Ressource pro Mine.",
-	"vcmi.lobby.handicap.growth" : "Verändert die Wachstumsrate der Kreaturen in den Städten, die der Spieler besitzt. Pro Kreatur wird weiterhin mindestens 1 erzeugt.",
+	"vcmi.lobby.handicap.income" : "Verändert die verschiedenen Einkommen des Spielers um den Prozentsatz. Wird aufgerundet.",
+	"vcmi.lobby.handicap.growth" : "Verändert die Wachstumsrate der Kreaturen in den Städten, die der Spieler besitzt. Wird aufgerundet.",
 	
 	"vcmi.lobby.login.title" : "VCMI Online Lobby",
 	"vcmi.lobby.login.username" : "Benutzername:",

+ 10 - 6
client/lobby/OptionsTab.cpp

@@ -801,7 +801,7 @@ OptionsTab::HandicapWindow::HandicapWindow()
 
 	addUsedEvents(LCLICK);
 
-	pos = Rect(0, 0, 650, 100 + SEL->getStartInfo()->playerInfos.size() * 30);
+	pos = Rect(0, 0, 660, 100 + SEL->getStartInfo()->playerInfos.size() * 30);
 
 	backgroundTexture = std::make_shared<FilledTexturePlayerColored>(ImagePath::builtin("DiBoxBck"), pos);
 	backgroundTexture->setPlayerColor(PlayerColor(1));
@@ -828,17 +828,20 @@ OptionsTab::HandicapWindow::HandicapWindow()
 
 			const PlayerSettings &ps = SEL->getStartInfo()->getIthPlayersSettings(player);
 
+			int xPos = 30 + j * 70;
+			xPos += j > 0 ? 10 : 0; // Gold field is larger
+
 			if(i == 0)
 			{
 				if(isIncome)
-					labels.push_back(std::make_shared<CLabel>(30 + j * 70, 35, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("core.jktext.32")));
+					labels.push_back(std::make_shared<CLabel>(xPos, 35, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("core.jktext.32")));
 				else if(isGrowth)
-					labels.push_back(std::make_shared<CLabel>(30 + j * 70, 35, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.194")));
+					labels.push_back(std::make_shared<CLabel>(xPos, 35, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.194")));
 				else
-					anim.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SMALRES"), GameResID(resource), 0, 45 + j * 70, 35));
+					anim.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SMALRES"), GameResID(resource), 0, 15 + xPos + (j == 0 ? 10 : 0), 35));
 			}
 
-			auto area = Rect(30 + j * 70, 60 + i * 30, 50, 16);
+			auto area = Rect(xPos, 60 + i * 30, j == 0 ? 60 : 50, 16);
 			textinputbackgrounds.push_back(std::make_shared<TransparentFilledRectangle>(area.resize(3), ColorRGBA(0,0,0,128), ColorRGBA(64,64,64,64)));
 			textinputs[player][resource] = std::make_shared<CTextInput>(area, FONT_SMALL, ETextAlignment::CENTERLEFT, true);
 			textinputs[player][resource]->setText(std::to_string(isIncome ? ps.handicap.percentIncome : (isGrowth ? ps.handicap.percentGrowth : ps.handicap.startBonus[resource])));
@@ -847,7 +850,8 @@ OptionsTab::HandicapWindow::HandicapWindow()
 				std::string tmp = s;
 				bool negative = std::count_if( s.begin(), s.end(), []( char c ){ return c == '-'; }) == 1 && !isIncome && !isGrowth;
 				tmp.erase(std::remove_if(tmp.begin(), tmp.end(), [](char c) { return !isdigit(c); }), tmp.end());
-				tmp = tmp.substr(0, isIncome || isGrowth ? 3 : 5);
+				int maxLength = isIncome || isGrowth ? 3 : (resource == EGameResID::GOLD ? 6 : 5);
+				tmp = tmp.substr(0, maxLength);
 				textinputs[player][resource]->setText(tmp.length() == 0 ? "0" : (negative ? "-" : "") + std::to_string(stoi(tmp)));
 			});
 			textinputs[player][resource]->setPopupCallback([isIncome, isGrowth](){