Browse Source

Added lines to window to separate UI elements into groups

Ivan Savenko 2 years ago
parent
commit
c011a5a9cf

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


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


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


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


+ 18 - 9
client/windows/settings/SettingsMainWindow.cpp

@@ -9,25 +9,24 @@
  */
 
 #include "StdInc.h"
-
 #include "SettingsMainWindow.h"
 
-#include "GeneralOptionsTab.h"
 #include "AdventureOptionsTab.h"
 #include "BattleOptionsTab.h"
+#include "GeneralOptionsTab.h"
 #include "OtherOptionsTab.h"
 
-#include "filesystem/ResourceID.h"
+#include "CGameInfo.h"
 #include "CGeneralTextHandler.h"
+#include "CPlayerInterface.h"
+#include "CServerHandler.h"
+#include "filesystem/ResourceID.h"
 #include "gui/CGuiHandler.h"
 #include "lobby/CSavingScreen.h"
 #include "widgets/Buttons.h"
 #include "widgets/Images.h"
 #include "widgets/ObjectLists.h"
-#include "CGameInfo.h"
-#include "CPlayerInterface.h"
-#include "CServerHandler.h"
-
+#include "windows/CMessage.h"
 
 SettingsMainWindow::SettingsMainWindow(BattleInterface * parentBattleUi) : InterfaceObjectConfigurable()
 {
@@ -43,7 +42,7 @@ SettingsMainWindow::SettingsMainWindow(BattleInterface * parentBattleUi) : Inter
 	addCallback("closeWindow", [this](int) { backButtonCallback(); });
 	build(config);
 
-	std::shared_ptr<CPicture> background = widget<CPicture>("background");
+	std::shared_ptr<CIntObject> background = widget<CIntObject>("background");
 	pos.w = background->pos.w;
 	pos.h = background->pos.h;
 	pos = center();
@@ -147,4 +146,14 @@ void SettingsMainWindow::closeAndPushEvent(EUserEvent code)
 {
 	close();
 	GH.pushUserEvent(code);
-}
+}
+
+void SettingsMainWindow::showAll(SDL_Surface *to)
+{
+	auto color = LOCPLINT ? LOCPLINT->playerID : PlayerColor(1);
+	if(settings["session"]["spectate"].Bool())
+		color = PlayerColor(1); // TODO: Spectator shouldn't need special code for UI colors
+
+	CIntObject::showAll(to);
+	CMessage::drawBorder(color, to, pos.w+28, pos.h+29, pos.x-14, pos.y-15);
+}

+ 2 - 0
client/windows/settings/SettingsMainWindow.h

@@ -40,5 +40,7 @@ private:
 	void mainMenuButtonCallback();
 public:
 	SettingsMainWindow(BattleInterface * parentBattleInterface = nullptr);
+
+	void showAll(SDL_Surface * to);
 };
 

+ 17 - 10
config/widgets/settings/adventureOptionsTab.json

@@ -1,22 +1,29 @@
 {
 	"items":
 	[
+		{
+			"name": "lineMovementEnd",
+			"type": "texture",
+			"image": "settingsWindow/lineHorizontal",
+			"rect": { "x" : 5, "y" : 240, "w": 365, "h": 3}
+		},
 		{
 			"name": "frameHeroMovement",
 			"type": "picture",
 			"image": "settingsWindow/frameMovement",
-			"position": {"x": 6, "y": 47 }
-		},		{
+			"position": {"x": 6, "y": 57 }
+		},	
+		{
 			"name": "frameEnemyMovement",
 			"type": "picture",
 			"image": "settingsWindow/frameMovement",
-			"position": {"x": 6, "y": 107 }
+			"position": {"x": 6, "y": 117 }
 		},
 		{
 			"name": "frameMapMovement",
 			"type": "picture",
 			"image": "settingsWindow/frameMovement",
-			"position": {"x": 6, "y": 167 }
+			"position": {"x": 6, "y": 177 }
 		},
 
 		{
@@ -28,15 +35,15 @@
 			"items":
 			[
 				{
-					"position": {"x": 100, "y": 60},
+					"position": {"x": 100, "y": 70},
 					"text": "core.genrltxt.569"
 				},
 				{
-					"position": {"x": 100, "y": 120},
+					"position": {"x": 100, "y": 130},
 					"text": "core.genrltxt.570"
 				},
 				{
-					"position": {"x": 100, "y": 180},
+					"position": {"x": 100, "y": 190},
 					"text": "core.genrltxt.571"
 				}
 			]
@@ -45,7 +52,7 @@
 		{
 			"name": "heroMovementSpeedPicker",
 			"type": "toggleGroup",
-			"position": {"x": 10, "y": 70},
+			"position": {"x": 10, "y": 80},
 			"items":
 			[
 				{
@@ -94,7 +101,7 @@
 		{
 			"name": "enemyMovementSpeedPicker",
 			"type": "toggleGroup",
-			"position": {"x": 10, "y": 130},
+			"position": {"x": 10, "y": 140},
 			"items":
 			[
 				{
@@ -135,7 +142,7 @@
 		{
 			"name": "mapScrollSpeedPicker",
 			"type": "toggleGroup",
-			"position": {"x": 10, "y": 190},
+			"position": {"x": 10, "y": 200},
 			"items":
 			[
 				{

+ 19 - 0
config/widgets/settings/battleOptionsTab.json

@@ -1,6 +1,25 @@
 {
 	"items":
 	[
+		{
+			"name": "lineCreatureInfo",
+			"type": "texture",
+			"image": "settingsWindow/lineHorizontal",
+			"rect": { "x" : 5, "y" : 205, "w": 365, "h": 3}
+		},
+		{
+			"name": "lineAnimationSpeed",
+			"type": "texture",
+			"image": "settingsWindow/lineHorizontal",
+			"rect": { "x" : 5, "y" : 295, "w": 365, "h": 3}
+		},
+		{
+			"name": "lineQueueSize",
+			"type": "texture",
+			"image": "settingsWindow/lineHorizontal",
+			"rect": { "x" : 5, "y" : 365, "w": 365, "h": 3}
+		},
+
 		{
 			"name": "animationSpeedLabel",
 			"type": "label",

+ 16 - 3
config/widgets/settings/settingsMainContainer.json

@@ -3,10 +3,23 @@
 	[
 		{
 			"name": "background",
-			"type": "picture",
-			"image": "vcmiSettingsWindow",
-			"position": {"x": 0, "y": 0}
+			"type": "texture",
+			"image": "DiBoxBck",
+			"rect": {"w": 600, "h": 480}
 		},
+		{
+			"name": "lineTabs",
+			"type": "texture",
+			"image": "settingsWindow/lineHorizontal",
+			"rect": { "x" : 10, "y" : 45, "w": 580, "h": 3}
+		},
+		{
+			"name": "lineColumns",
+			"type": "texture",
+			"image": "settingsWindow/lineVertical",
+			"rect": { "x" : 370, "y" : 50, "w": 3, "h": 420}
+		},
+
 
 		{
 			"name": "settingsTabs",