Pārlūkot izejas kodu

Improved General options tab layout presentation

Ivan Savenko 2 gadi atpakaļ
vecāks
revīzija
2f556ccf60

BIN
Mods/vcmi/Data/settingsWindow/frameAudio.png


BIN
Mods/vcmi/Data/settingsWindow/frameBox.png


BIN
Mods/vcmi/Data/settingsWindow/gear.png


+ 0 - 0
Mods/vcmi/Sprites/settingsWindow/scrollSpeed1.png → Mods/vcmi/Data/settingsWindow/scrollSpeed1.png


+ 0 - 0
Mods/vcmi/Sprites/settingsWindow/scrollSpeed2.png → Mods/vcmi/Data/settingsWindow/scrollSpeed2.png


+ 0 - 0
Mods/vcmi/Sprites/settingsWindow/scrollSpeed3.png → Mods/vcmi/Data/settingsWindow/scrollSpeed3.png


+ 0 - 0
Mods/vcmi/Sprites/settingsWindow/scrollSpeed4.png → Mods/vcmi/Data/settingsWindow/scrollSpeed4.png


+ 0 - 0
Mods/vcmi/Sprites/settingsWindow/scrollSpeed5.png → Mods/vcmi/Data/settingsWindow/scrollSpeed5.png


+ 0 - 0
Mods/vcmi/Sprites/settingsWindow/scrollSpeed6.png → Mods/vcmi/Data/settingsWindow/scrollSpeed6.png


+ 10 - 0
Mods/vcmi/Sprites/settingsWindow/button32.json

@@ -0,0 +1,10 @@
+{
+	"basepath" : "settingsWindow/",
+	"images" :
+	[
+		{ "frame" : 0, "file" : "button32Normal.png"},
+		{ "frame" : 1, "file" : "button32PressedSelected.png"},
+		{ "frame" : 2, "file" : "button32Pressed.png"},
+		{ "frame" : 3, "file" : "button32NormalSelected.png"}
+	]
+}

BIN
Mods/vcmi/Sprites/settingsWindow/button32Normal.png


BIN
Mods/vcmi/Sprites/settingsWindow/button32NormalSelected.png


BIN
Mods/vcmi/Sprites/settingsWindow/button32Pressed.png


BIN
Mods/vcmi/Sprites/settingsWindow/button32PressedSelected.png


+ 24 - 20
Mods/vcmi/config/vcmi/english.json

@@ -34,11 +34,15 @@
 	"vcmi.settingsMainWindow.otherTab.hover"     : "Other Settings",
 	"vcmi.settingsMainWindow.otherTab.help"      : "Switches to Other Settings tab - these options do not fit into other categories for various reasons",
 
+	"vcmi.systemOptions.videoGroup" : "Video Settings",
+	"vcmi.systemOptions.audioGroup" : "Audio Settings",
+	"vcmi.systemOptions.otherGroup" : "Other Settings",
+
 	"vcmi.systemOptions.fullscreenButton.hover" : "Fullscreen",
 	"vcmi.systemOptions.fullscreenButton.help"  : "{Fullscreen}\n\n If selected, VCMI will run in fullscreen mode, otherwise VCMI will run in window",
-	"vcmi.systemOptions.resolutionButton.hover" : "Resolution",
-	"vcmi.systemOptions.resolutionButton.help"  : "{Select resolution}\n\n Change in-game screen resolution. Game restart required to apply new resolution.",
-	"vcmi.systemOptions.resolutionMenu.hover"   : "Select resolution",
+	"vcmi.systemOptions.resolutionButton.hover" : "{Resolution:} %wx%h",
+	"vcmi.systemOptions.resolutionButton.help"  : "{Select Resolution}\n\n Change in-game screen resolution. Game restart required to apply new resolution.",
+	"vcmi.systemOptions.resolutionMenu.hover"   : "Select Resolution",
 	"vcmi.systemOptions.resolutionMenu.help"    : "Change in-game screen resolution.",
 	"vcmi.systemOptions.fullscreenFailed"       : "{Fullscreen}\n\n Failed to switch to fullscreen mode! Current resolution is not supported by display!",
 	"vcmi.systemOptions.framerateButton.hover"  : "Show FPS",
@@ -46,10 +50,10 @@
 
 	"vcmi.adventureOptions.numericQuantities.hover" : "Numeric creatures quantities",
 	"vcmi.adventureOptions.numericQuantities.help" : "{Numeric creatures quantities}\n\n Shows inaccurate enemy creatures quantities in numeric A-B format.",
-	"vcmi.adventureOptions.forceMovementInfo.hover" : "Always show move info in status bar",
-	"vcmi.adventureOptions.forceMovementInfo.help" : "{Always show move info in status bar}\n\n Replaces default status bar info with movement points data without need to hold ALT button.",
-	"vcmi.adventureOptions.showGrid.hover" : "Show grid",
-	"vcmi.adventureOptions.showGrid.help" : "{Show grid}\n\n Shows grid overlay, showing borders between adventure map tiles.",
+	"vcmi.adventureOptions.forceMovementInfo.hover" : "Always Show Move Info",
+	"vcmi.adventureOptions.forceMovementInfo.help" : "{Always Show Move Info}\n\n Replaces default status bar info with movement points data without need to hold ALT button.",
+	"vcmi.adventureOptions.showGrid.hover" : "Show Grid",
+	"vcmi.adventureOptions.showGrid.help" : "{Show Grid}\n\n Shows grid overlay, showing borders between adventure map tiles.",
 	"vcmi.adventureOptions.mapScrollSpeed4.hover": "",
 	"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
 	"vcmi.adventureOptions.mapScrollSpeed6.hover": "",
@@ -57,28 +61,28 @@
 	"vcmi.adventureOptions.mapScrollSpeed5.help": "Set map scrolling speed to extremely fast",
 	"vcmi.adventureOptions.mapScrollSpeed6.help": "Set map scrolling speed to fast, very fast.",
 
-	"vcmi.battleOptions.queueSizeLabel.hover": "Queue size (takes effect on next battle)",
+	"vcmi.battleOptions.queueSizeLabel.hover": "Battle Queue Size",
 	"vcmi.battleOptions.queueSizeNoneButton.hover": "OFF",
-	"vcmi.battleOptions.queueSizeNoneButton.help": "Disables visibility of stack queue in battle",
 	"vcmi.battleOptions.queueSizeAutoButton.hover": "AUTO",
-	"vcmi.battleOptions.queueSizeAutoButton.help": "Sets queue size depending on game resolution (small if width < 700 pixels, big otherwise)",
 	"vcmi.battleOptions.queueSizeSmallButton.hover": "SMALL",
-	"vcmi.battleOptions.queueSizeSmallButton.help": "Sets queue size to small",
 	"vcmi.battleOptions.queueSizeBigButton.hover": "BIG",
+	"vcmi.battleOptions.queueSizeNoneButton.help": "Disables visibility of stack queue in battle",
+	"vcmi.battleOptions.queueSizeAutoButton.help": "Sets queue size depending on game resolution (small if width < 700 pixels, big otherwise)",
+	"vcmi.battleOptions.queueSizeSmallButton.help": "Sets queue size to small",
 	"vcmi.battleOptions.queueSizeBigButton.help": "Sets queue size to big (not supported if game resolution width < 700 pixels)",
-	"vcmi.battleOptions.animationsSpeed4.hover": "4",
+	"vcmi.battleOptions.animationsSpeed4.hover": "",
+	"vcmi.battleOptions.animationsSpeed5.hover": "",
+	"vcmi.battleOptions.animationsSpeed6.hover": "",
 	"vcmi.battleOptions.animationsSpeed4.help": "Sets animation speed to very fast",
-	"vcmi.battleOptions.animationsSpeed5.hover": "5",
 	"vcmi.battleOptions.animationsSpeed5.help": "Sets animation speed to super fast",
-	"vcmi.battleOptions.animationsSpeed6.hover": "6",
 	"vcmi.battleOptions.animationsSpeed6.help": "Sets animation speed to extremely fast",
-	"vcmi.battleOptions.skipBattleIntroMusic.hover": "Skip intro music",
-	"vcmi.battleOptions.skipBattleIntroMusic.help": "{Skip intro music}\n\n Skip short music that plays at beginning of each battle before action starts. Can also be skipped by pressing ESC key.",
+	"vcmi.battleOptions.skipBattleIntroMusic.hover": "Skip Intro Music",
+	"vcmi.battleOptions.skipBattleIntroMusic.help": "{Skip Intro Music}\n\n Skip short music that plays at beginning of each battle before action starts. Can also be skipped by pressing ESC key.",
 
-	"vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Show available creatures in town summary",
-	"vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Show available creatures in town summary}\n\n Shows creatures available to purchase instead of their growth in town summary (bottom-left corner).",
-	"vcmi.otherOptions.compactTownCreatureInfo.hover": "Compact creature info in town summary",
-	"vcmi.otherOptions.compactTownCreatureInfo.help": "{Compact creature info in town summary}\n\n Smaller town creatures information in town summary.",
+	"vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Show Available Creatures in Town",
+	"vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Show Available Creatures in Town}\n\n Shows creatures available to purchase instead of their growth in town summary (bottom-left corner).",
+	"vcmi.otherOptions.compactTownCreatureInfo.hover": "Compact Creature Info in Town",
+	"vcmi.otherOptions.compactTownCreatureInfo.help": "{Compact Creature Info in Town}\n\n Smaller town creatures information in town summary.",
 
 	"vcmi.townHall.missingBase"             : "Base building %s must be built first",
 	"vcmi.townHall.noCreaturesToRecruit"    : "There are no creatures to recruit!",

+ 12 - 5
client/windows/settings/BattleOptionsTab.cpp

@@ -19,8 +19,7 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
-		InterfaceObjectConfigurable()
+BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
 {
 	OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
 
@@ -45,9 +44,9 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner):
 	{
 		showQueueChangedCallback(value, owner);
 	});
-	addCallback("queueSizeChanged", [this](int value)
+	addCallback("queueSizeChanged", [this, owner](int value)
 	{
-		queueSizeChangedCallback(value);
+		queueSizeChangedCallback(value, owner);
 	});
 	addCallback("skipBattleIntroMusicChanged", [this](bool value)
 	{
@@ -155,11 +154,19 @@ void BattleOptionsTab::showQueueChangedCallback(bool value, BattleInterface * pa
 	}
 }
 
-void BattleOptionsTab::queueSizeChangedCallback(int value)
+void BattleOptionsTab::queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface)
 {
+	if (value == -1)
+	{
+		showQueueChangedCallback(false, parentBattleInterface);
+		return;
+	}
+
 	std::string stringifiedValue = getQueueSizeStringFromId(value);
 	Settings size = settings.write["battle"]["queueSize"];
 	size->String() = stringifiedValue;
+
+	showQueueChangedCallback(true, parentBattleInterface);
 }
 
 void BattleOptionsTab::skipBattleIntroMusicChangedCallback(bool value)

+ 4 - 4
client/windows/settings/BattleOptionsTab.h

@@ -22,12 +22,12 @@ private:
 	int getAnimSpeed() const;
 	int getQueueSizeId() const;
 	std::string getQueueSizeStringFromId(int value) const;
-	void viewGridChangedCallback(bool value, BattleInterface * parentBattleInterface = nullptr);
-	void movementShadowChangedCallback(bool value, BattleInterface * parentBattleInterface = nullptr);
+	void viewGridChangedCallback(bool value, BattleInterface * parentBattleInterface);
+	void movementShadowChangedCallback(bool value, BattleInterface * parentBattleInterface);
 	void mouseShadowChangedCallback(bool value);
 	void animationSpeedChangedCallback(int value);
-	void showQueueChangedCallback(bool value, BattleInterface * parentBattleInterface = nullptr);
-	void queueSizeChangedCallback(int value);
+	void showQueueChangedCallback(bool value, BattleInterface * parentBattleInterface);
+	void queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface);
 	void skipBattleIntroMusicChangedCallback(bool value);
 public:
 	BattleOptionsTab(BattleInterface * owner = nullptr);

+ 8 - 7
client/windows/settings/GeneralOptionsTab.cpp

@@ -39,7 +39,12 @@ static void setBoolSetting(std::string group, std::string field, bool value)
 
 static std::string resolutionToString(int w, int h)
 {
-	return std::to_string(w) + 'x' + std::to_string(h);
+	auto string = CGI->generaltexth->translate("vcmi.systemOptions.resolutionButton.hover");
+
+	boost::replace_all(string, "%w", std::to_string(w));
+	boost::replace_all(string, "%h", std::to_string(h));
+
+	return string;
 }
 
 GeneralOptionsTab::GeneralOptionsTab()
@@ -173,11 +178,7 @@ void GeneralOptionsTab::setGameResolution(int index)
 	gameRes["width"].Float() = resolution.x;
 	gameRes["height"].Float() = resolution.y;
 
-	std::string resText;
-	resText += std::to_string(resolution.x);
-	resText += "x";
-	resText += std::to_string(resolution.y);
-	widget<CLabel>("resolutionLabel")->setText(resText);
+	widget<CLabel>("resolutionLabel")->setText(resolutionToString(resolution.x, resolution.y));
 }
 
 void GeneralOptionsTab::setFullscreenMode(bool on)
@@ -226,4 +227,4 @@ void GeneralOptionsTab::fillSelectableResolutions()
 	{
 		return left.x * left.y < right.x * right.y;
 	});
-}
+}

+ 15 - 11
config/widgets/settings/adventureOptionsTab.json

@@ -1,12 +1,6 @@
 {
 	"items":
 	[
-		{
-			"name": "lineMovementEnd",
-			"type": "texture",
-			"image": "settingsWindow/lineHorizontal",
-			"rect": { "x" : 5, "y" : 22, "w": 365, "h": 3}
-		},
 		{
 			"name": "lineLabelsEnd",
 			"type": "texture",
@@ -54,6 +48,16 @@
 				}
 			]
 		},
+		
+		{
+			"name": "heroSpeedLabel",
+			"type": "label",
+			"font": "medium",
+			"alignment": "center",
+			"color": "yellow",
+			"text" : "800%",
+			"position": {"x": 324, "y": 90}
+		},
 
 		{
 			"name": "heroMovementSpeedPicker",
@@ -78,14 +82,14 @@
 				{
 					"index": 100,
 					"type": "toggleButton",
-					"image": "sysopb2",
+					"image": "sysopb5",
 					"help": "core.help.350",
 					"position": {"x": 96, "y": 0}
 				},
 				{
 					"index": 50,
 					"type": "toggleButton",
-					"image": "sysopb3",
+					"image": "sysopb6",
 					"help": "core.help.351",
 					"position": {"x": 144, "y": 0}
 				},
@@ -116,7 +120,7 @@
 				{
 					"index": 150,
 					"type": "toggleButton",
-					"image": "sysopb5",
+					"image": "sysopb1",
 					"help": "core.help.353",
 					"position": {"x": 0, "y": 0}
 				},
@@ -124,7 +128,7 @@
 				{
 					"index": 100,
 					"type": "toggleButton",
-					"image": "sysopb6",
+					"image": "sysopb5",
 					"help": "core.help.353",
 					"position": {"x": 48, "y": 0}
 				},
@@ -140,7 +144,7 @@
 				{
 					"index": 25,
 					"type": "toggleButton",
-					"image": "sysopb7",
+					"image": "sysopb3",
 					"help": "core.help.354",
 					"position": {"x": 144, "y": 0}
 				},

+ 98 - 47
config/widgets/settings/generalOptionsTab.json

@@ -8,17 +8,13 @@
 			"rect": { "x" : 5, "y" : 289, "w": 365, "h": 3}
 		},
 		{
-			"name": "settingGroupTitles",
+			"name": "settingAudioTitles",
 			"type": "labelGroup",
 			"font": "medium",
 			"alignment": "center",
 			"color": "yellow",
 			"items":
 			[
-				{
-					"position": {"x": 100, "y": 60},
-					"text": "vcmi.systemOptions.resolutionButton.hover"
-				},
 				{
 					"position": {"x": 460, "y": 98},
 					"text": "core.genrltxt.394" // Music Volume
@@ -29,24 +25,90 @@
 				}
 			]
 		},
+		{
+			"name": "settingGroupTitles",
+			"type": "labelGroup",
+			"font": "medium",
+			"alignment": "left",
+			"color": "yellow",
+			"items":
+			[
+				{
+					"position": {"x": 10, "y": 55},
+					"text": "vcmi.systemOptions.videoGroup"
+				}
+				{
+					"position": {"x": 380, "y": 55},
+					"text": "vcmi.systemOptions.audioGroup"
+				}
+				{
+					"position": {"x": 10, "y": 295},
+					"text": "vcmi.systemOptions.otherGroup"
+				}
+			]
+		},
 
+		{
+			"name": "resolutionLabel",
+			"type": "label",
+			"font": "medium",
+			"alignment": "left",
+			"color": "white",
+			"position": {"x": 45, "y": 85},
+			"text": "vcmi.systemOptions.resolutionButton.hover"
+		},
 		{
 			"name": "resolutionButton",
 			"type": "button",
-			"position": {"x": 10, "y": 70},
-			"image": "buttons/resolution",
+			"position": {"x": 10, "y": 82},
+			"image": "settingsWindow/button32",
 			"help": "vcmi.systemOptions.resolutionButton",
 			"callback": "setGameResolution",
-			"hotkey": "g"
+			"hotkey": "g",			
+			"items":
+			[
+				{
+					"name": "gearIcon",
+					"type": "picture",
+					"image": "settingsWindow/gear",
+					"position": {"x": 0, "y": 0 }
+				}
+			]
 		},
-
+		
 		{
-			"name": "resolutionLabel",
-			"type": "label",
+			"name": "topCheckboxesLabels",
+			"type": "labelGroup",
 			"font": "medium",
-			"alignment": "center",
-			"color": "yellow",
-			"position": {"x": 160, "y": 85}
+			"alignment": "left",
+			"color": "white",
+			"items":
+			[
+				{
+					"position": {"x": 45, "y": 115},
+					"text": "vcmi.systemOptions.fullscreenButton.hover"
+				},
+				{
+					"position": {"x": 45, "y": 145},
+					"text": "vcmi.systemOptions.framerateButton.hover"
+				}
+			]
+		},
+		{
+			"name": "fullscreenCheckbox",
+			"type": "toggleButton",
+			"image": "sysopchk.def",
+			"help": "vcmi.systemOptions.fullscreenButton",
+			"position": {"x": 10, "y": 112},
+			"callback": "fullscreenChanged"
+		},
+		{
+			"name": "framerateCheckbox",
+			"type": "toggleButton",
+			"image": "sysopchk.def",
+			"help": "vcmi.systemOptions.framerateButton",
+			"position": {"x": 10, "y": 142},
+			"callback": "framerateChanged"
 		},
 
 		{
@@ -55,7 +117,6 @@
 			"image": "settingsWindow/frameAudio",
 			"position": {"x": 380, "y": 80 }
 		},
-
 		{
 			"name": "musicSlider",
 			"type": "slider",
@@ -67,6 +128,15 @@
 			"itemsTotal": 100,
 			"callback": "setMusic"
 		},
+		{
+			"name": "musicValueLabel",
+			"type": "label",
+			"font": "medium",
+			"alignment": "center",
+			"color": "yellow",
+			"text" : "10%",
+			"position": {"x": 565, "y": 98}
+		},
 		
 		{
 			"name": "frameSound",
@@ -86,6 +156,15 @@
 			"itemsTotal": 100,
 			"callback": "setVolume"
 		},
+		{
+			"name": "soundValueLabel",
+			"type": "label",
+			"font": "medium",
+			"alignment": "center",
+			"color": "yellow",
+			"text" : "10%",
+			"position": {"x": 565, "y": 158}
+		},
 
 		{
 			"name": "bottomCheckboxesLabels",
@@ -99,21 +178,13 @@
 					"position": {"x": 45, "y": 325},
 					"text": "core.genrltxt.577"
 				},
-				{
-					"position": {"x": 45, "y": 355},
-					"text": "vcmi.systemOptions.fullscreenButton.hover"
-				},
-				{
-					"position": {"x": 45, "y": 385},
-					"text": "vcmi.systemOptions.framerateButton.hover"
-				},
 				{
 					"text": "vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover",
-					"position": {"x": 45, "y": 415}
+					"position": {"x": 45, "y": 355}
 				},
 				{
 					"text": "vcmi.otherOptions.compactTownCreatureInfo.hover",
-					"position": {"x": 45, "y": 445}
+					"position": {"x": 45, "y": 385}
 				}
 			]
 		},
@@ -126,40 +197,20 @@
 			"position": {"x": 10, "y": 323},
 			"callback": "spellbookAnimationChanged"
 		},
-
-		{
-			"name": "fullscreenCheckbox",
-			"type": "toggleButton",
-			"image": "sysopchk.def",
-			"help": "vcmi.systemOptions.fullscreenButton",
-			"position": {"x": 10, "y": 353},
-			"callback": "fullscreenChanged"
-		},
-
-		{
-			"name": "framerateCheckbox",
-			"type": "toggleButton",
-			"image": "sysopchk.def",
-			"help": "vcmi.systemOptions.framerateButton",
-			"position": {"x": 10, "y": 383},
-			"callback": "framerateChanged"
-		},
-
 		{
 			"name": "availableCreaturesAsDwellingLabelCheckbox",
 			"type": "toggleButton",
 			"image": "sysopchk.def",
 			"help": "vcmi.otherOptions.availableCreaturesAsDwellingLabel",
-			"position": {"x": 10, "y": 413},
+			"position": {"x": 10, "y": 353},
 			"callback": "availableCreaturesAsDwellingLabelChanged"
 		},
-
 		{
 			"name": "compactTownCreatureInfoCheckbox",
 			"type": "toggleButton",
 			"image": "sysopchk.def",
 			"help": "vcmi.otherOptions.compactTownCreatureInfo",
-			"position": {"x": 10, "y": 443},
+			"position": {"x": 10, "y": 383},
 			"callback": "compactTownCreatureInfoChanged"
 		}
 	]