From bd901cb0017633f0bf0bb61a974d895060cac725 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sun, 18 Feb 2024 22:47:40 +0200 Subject: [PATCH] Replaced lines in settings with primitives --- Mods/vcmi/Data/settingsWindow/checkBoxEmpty.png | Bin 130 -> 0 bytes Mods/vcmi/Data/settingsWindow/lineHorizontal.png | Bin 90 -> 0 bytes Mods/vcmi/Data/settingsWindow/lineVertical.png | Bin 91 -> 0 bytes client/widgets/GraphicalPrimitiveCanvas.cpp | 2 +- client/widgets/GraphicalPrimitiveCanvas.h | 2 -- config/widgets/commonPrimitives.json | 10 +++++++++- config/widgets/settings/adventureOptionsTab.json | 8 +++++--- config/widgets/settings/battleOptionsTab.json | 11 ++++++----- config/widgets/settings/generalOptionsTab.json | 8 +++++--- config/widgets/settings/library.json | 5 +++-- .../widgets/settings/settingsMainContainer.json | 13 +++++++------ config/widgets/turnOptionsTab.json | 6 ++---- 12 files changed, 38 insertions(+), 27 deletions(-) delete mode 100644 Mods/vcmi/Data/settingsWindow/checkBoxEmpty.png delete mode 100644 Mods/vcmi/Data/settingsWindow/lineHorizontal.png delete mode 100644 Mods/vcmi/Data/settingsWindow/lineVertical.png diff --git a/Mods/vcmi/Data/settingsWindow/checkBoxEmpty.png b/Mods/vcmi/Data/settingsWindow/checkBoxEmpty.png deleted file mode 100644 index f2eae977fdaa3de5e826237005dd57e558049f78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Eu!3HE}2mdz#Ql6eJjv*C{$qY?xjR!d{Y$z`K z?vTKy&}N}<^mLiShK;jqEL0{~emNw;CsBG}1+$y1!K;Qq_8zN*D~yXlLJlTg2l*sE bxM?!%w~48l;=PX>XefiHtDnm{r-UW|7*i-0 diff --git a/Mods/vcmi/Data/settingsWindow/lineHorizontal.png b/Mods/vcmi/Data/settingsWindow/lineHorizontal.png deleted file mode 100644 index 5eb70f1ff0379a41b4fe5c2f9616a42157f2be25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^4M5Dy!3HFwrP%iZDMe2g$B+ufH79>7-6v)G%Bfn}w(!_f=fr=SCUHx3vIVCg!0ABYO(*OVf diff --git a/Mods/vcmi/Data/settingsWindow/lineVertical.png b/Mods/vcmi/Data/settingsWindow/lineVertical.png deleted file mode 100644 index f5c337938b93a1f20cf02b17f1d86377971f088a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^%s|}0!3HGH@mxL$q?9~e978G?lM76P^E3QDXC)*g pWGoO)pJIGU@@Y?zo8@8|2AkGZ6Kb#RuLi1S@O1TaS?83{1OVq;8fE|h diff --git a/client/widgets/GraphicalPrimitiveCanvas.cpp b/client/widgets/GraphicalPrimitiveCanvas.cpp index 23fa62b1f..c37325c55 100644 --- a/client/widgets/GraphicalPrimitiveCanvas.cpp +++ b/client/widgets/GraphicalPrimitiveCanvas.cpp @@ -1,5 +1,5 @@ /* - * MiscWidgets.cpp, part of VCMI engine + * GraphicalPrimitiveCanvas.cpp, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * diff --git a/client/widgets/GraphicalPrimitiveCanvas.h b/client/widgets/GraphicalPrimitiveCanvas.h index 21087f566..2cf508b94 100644 --- a/client/widgets/GraphicalPrimitiveCanvas.h +++ b/client/widgets/GraphicalPrimitiveCanvas.h @@ -13,7 +13,6 @@ class GraphicalPrimitiveCanvas : public CIntObject { -public: enum class PrimitiveType { LINE, @@ -21,7 +20,6 @@ public: FILLED_BOX }; -private: struct PrimitiveEntry { ColorRGBA color; diff --git a/config/widgets/commonPrimitives.json b/config/widgets/commonPrimitives.json index 8520efe25..8edd2deee 100644 --- a/config/widgets/commonPrimitives.json +++ b/config/widgets/commonPrimitives.json @@ -26,7 +26,15 @@ { "type" : "line", "a" : { "x" : 0, "y" : 0}, "b" : { "x" : -1, "y" : 0}, "color" : [ 255, 255, 255, 64 ] }, { "type" : "line", "a" : { "x" : 0, "y" : 1}, "b" : { "x" : -1, "y" : 1}, "color" : [ 0, 0, 0, 64 ] }, ] - } + }, + + "verticalLine" : { + "type": "graphicalPrimitive", + "primitives" : [ + { "type" : "line", "a" : { "x" : 0, "y" : 0}, "b" : { "x" : 0, "y" : -1}, "color" : [ 255, 255, 255, 64 ] }, + { "type" : "line", "a" : { "x" : 1, "y" : 0}, "b" : { "x" : 1, "y" : -1}, "color" : [ 0, 0, 0, 64 ] }, + ] + }, "boxWithBackground" : { "type": "graphicalPrimitive", diff --git a/config/widgets/settings/adventureOptionsTab.json b/config/widgets/settings/adventureOptionsTab.json index faa0d01ab..57886e5e2 100644 --- a/config/widgets/settings/adventureOptionsTab.json +++ b/config/widgets/settings/adventureOptionsTab.json @@ -1,12 +1,14 @@ { - "library" : "config/widgets/settings/library.json", + "library" : [ + "config/widgets/settings/library.json", + "config/widgets/commonPrimitives.json", + ], "items": [ { "name": "lineLabelsEnd", - "type": "texture", - "image": "settingsWindow/lineHorizontal", + "type": "horizontalLine", "rect": { "x" : 5, "y" : 229, "w": 365, "h": 3} }, /////////////////////////////////////// Left section - Hero Speed and Map Scrolling diff --git a/config/widgets/settings/battleOptionsTab.json b/config/widgets/settings/battleOptionsTab.json index 4db262212..08480233f 100644 --- a/config/widgets/settings/battleOptionsTab.json +++ b/config/widgets/settings/battleOptionsTab.json @@ -1,18 +1,19 @@ { - "library" : "config/widgets/settings/library.json", + "library" : [ + "config/widgets/settings/library.json", + "config/widgets/commonPrimitives.json", + ], "items": [ { "name": "lineCreatureInfo", - "type": "texture", - "image": "settingsWindow/lineHorizontal", + "type": "horizontalLine", "rect": { "x" : 5, "y" : 289, "w": 365, "h": 3} }, { "name": "lineAnimationSpeed", - "type": "texture", - "image": "settingsWindow/lineHorizontal", + "type": "horizontalLine", "rect": { "x" : 5, "y" : 349, "w": 365, "h": 3} }, { diff --git a/config/widgets/settings/generalOptionsTab.json b/config/widgets/settings/generalOptionsTab.json index 6a70d457e..03b744272 100644 --- a/config/widgets/settings/generalOptionsTab.json +++ b/config/widgets/settings/generalOptionsTab.json @@ -1,12 +1,14 @@ { - "library" : "config/widgets/settings/library.json", + "library" : [ + "config/widgets/settings/library.json", + "config/widgets/commonPrimitives.json", + ], "items": [ { "name": "lineLabelsEnd", - "type": "texture", - "image": "settingsWindow/lineHorizontal", + "type": "horizontalLine", "rect": { "x" : 5, "y" : 349, "w": 365, "h": 3} }, { diff --git a/config/widgets/settings/library.json b/config/widgets/settings/library.json index c5ea07f95..21096db72 100644 --- a/config/widgets/settings/library.json +++ b/config/widgets/settings/library.json @@ -35,8 +35,9 @@ ] }, "checkboxFake" : { - "type": "picture", - "image": "settingsWindow/checkBoxEmpty" + "type": "boxWithBackground", + "rect": { "x" : 0, "y" : 0, "w": 32, "h": 24} + }, "audioSlider" : { "type": "slider", diff --git a/config/widgets/settings/settingsMainContainer.json b/config/widgets/settings/settingsMainContainer.json index 0e495d73f..48665a5ab 100644 --- a/config/widgets/settings/settingsMainContainer.json +++ b/config/widgets/settings/settingsMainContainer.json @@ -1,4 +1,8 @@ { + "library" : [ + "config/widgets/commonPrimitives.json" + ], + "items": [ { @@ -9,14 +13,12 @@ }, { "name": "lineTabs", - "type": "texture", - "image": "settingsWindow/lineHorizontal", + "type": "horizontalLine", "rect": { "x" : 10, "y" : 45, "w": 580, "h": 3} }, { "name": "lineColumns", - "type": "texture", - "image": "settingsWindow/lineVertical", + "type": "verticalLine", "rect": { "x" : 370, "y" : 50, "w": 3, "h": 420} }, @@ -91,8 +93,7 @@ { "name": "lineButtons", - "type": "texture", - "image": "settingsWindow/lineHorizontal", + "type": "horizontalLine", "rect": { "x" : 375, "y" : 289, "w": 220, "h": 3} }, { diff --git a/config/widgets/turnOptionsTab.json b/config/widgets/turnOptionsTab.json index d642b1b35..0ba76719a 100644 --- a/config/widgets/turnOptionsTab.json +++ b/config/widgets/turnOptionsTab.json @@ -33,10 +33,8 @@ "offset": {"x": 0, "y": 0} }, "timeInputBackground" : { - "type": "transparentFilledRectangle", - "rect": {"x": 0, "y": 0, "w": 86, "h": 23}, - "color": [0, 0, 0, 128], - "colorLine": [64, 80, 128, 128] + "type": "boxWithBackground", + "rect": {"x": 0, "y": 0, "w": 86, "h": 23} } },