From f24910e5d2f7e95d8d030e124e33d5da5ac9c05d Mon Sep 17 00:00:00 2001 From: Dydzio Date: Sun, 20 Aug 2023 00:52:03 +0200 Subject: [PATCH 1/6] Artifacts backpack window GUI improvements --- client/widgets/CArtifactsOfHeroBackpack.cpp | 1 + client/windows/CHeroBackpackWindow.cpp | 23 +++++++++++++++++---- client/windows/CHeroBackpackWindow.h | 5 +++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/client/widgets/CArtifactsOfHeroBackpack.cpp b/client/widgets/CArtifactsOfHeroBackpack.cpp index 18a704a19..2bf968cdf 100644 --- a/client/widgets/CArtifactsOfHeroBackpack.cpp +++ b/client/widgets/CArtifactsOfHeroBackpack.cpp @@ -84,6 +84,7 @@ void CArtifactsOfHeroBackpack::scrollBackpack(int offset) slot = slot + 1; } redraw(); + setRedrawParent(true); } void CArtifactsOfHeroBackpack::updateBackpackSlots() diff --git a/client/windows/CHeroBackpackWindow.cpp b/client/windows/CHeroBackpackWindow.cpp index b491bf57d..424388e5b 100644 --- a/client/windows/CHeroBackpackWindow.cpp +++ b/client/windows/CHeroBackpackWindow.cpp @@ -14,17 +14,32 @@ #include "../gui/Shortcut.h" #include "../widgets/Buttons.h" +#include "../widgets/Images.h" +#include "CMessage.h" +#include "render/Canvas.h" CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero) - : CWindowObject(PLAYER_COLORED) + : CWindowObject((EOptions)0) { OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE); - - arts = std::make_shared(Point(-100, -170)); + + stretchedBackground = std::make_shared("DIBOXBCK", Rect(0, 0, 410, 425)); + pos.w = stretchedBackground->pos.w; + pos.h = stretchedBackground->pos.h; + center(); + + + arts = std::make_shared(/*Point(-100, -170)*/Point(10, 10)); arts->setHero(hero); addSet(arts); addCloseCallback(std::bind(&CHeroBackpackWindow::close, this)); - quitButton = std::make_shared(Point(242, 200), "hsbtns.def", CButton::tooltip(""), [this]() { close(); }, EShortcut::GLOBAL_RETURN); + quitButton = std::make_shared(Point(173, 385), "IOKAY32.def", CButton::tooltip(""), [this]() { close(); }, EShortcut::GLOBAL_RETURN); +} + +void CHeroBackpackWindow::showAll(Canvas &to) +{ + CIntObject::showAll(to); + CMessage::drawBorder(PlayerColor(1), to.getInternalSurface(), pos.w+28, pos.h+29, pos.x-14, pos.y-15); } diff --git a/client/windows/CHeroBackpackWindow.h b/client/windows/CHeroBackpackWindow.h index fefd1902d..df9aeb08d 100644 --- a/client/windows/CHeroBackpackWindow.h +++ b/client/windows/CHeroBackpackWindow.h @@ -12,6 +12,8 @@ #include "../widgets/CWindowWithArtifacts.h" #include "CWindowObject.h" +class CFilledTexture; + class CHeroBackpackWindow : public CWindowObject, public CWindowWithArtifacts { public: @@ -20,4 +22,7 @@ public: private: std::shared_ptr arts; std::shared_ptr quitButton; + std::shared_ptr stretchedBackground; + + void showAll(Canvas &to) override; }; From cab6fb76aac20c3137796c26d1eef9b94f5d1d09 Mon Sep 17 00:00:00 2001 From: Dydzio Date: Sun, 20 Aug 2023 17:45:43 +0200 Subject: [PATCH 2/6] Draft version of backpack button + new setting for original H3 UI mode --- Mods/vcmi/Sprites/buttons/backpack.json | 8 ++++++++ Mods/vcmi/Sprites/buttons/backpackNormal.png | Bin 0 -> 3008 bytes Mods/vcmi/Sprites/buttons/backpackPressed.png | Bin 0 -> 2848 bytes Mods/vcmi/config/vcmi/english.json | 2 ++ Mods/vcmi/config/vcmi/polish.json | 2 ++ client/windows/CHeroWindow.cpp | 18 +++++++++++++----- config/schemas/settings.json | 7 ++++++- 7 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 Mods/vcmi/Sprites/buttons/backpack.json create mode 100644 Mods/vcmi/Sprites/buttons/backpackNormal.png create mode 100644 Mods/vcmi/Sprites/buttons/backpackPressed.png diff --git a/Mods/vcmi/Sprites/buttons/backpack.json b/Mods/vcmi/Sprites/buttons/backpack.json new file mode 100644 index 000000000..a74a8c3a1 --- /dev/null +++ b/Mods/vcmi/Sprites/buttons/backpack.json @@ -0,0 +1,8 @@ +{ + "basepath" : "buttons/", + "images" : + [ + { "frame" : 0, "file" : "backpackNormal.png"}, + { "frame" : 1, "file" : "backpackPressed.png"} + ] +} diff --git a/Mods/vcmi/Sprites/buttons/backpackNormal.png b/Mods/vcmi/Sprites/buttons/backpackNormal.png new file mode 100644 index 0000000000000000000000000000000000000000..541ec56c55f3481806c72726246a4a2ec2b1f30b GIT binary patch literal 3008 zcmV;x3qSOUP)q`;I|8)`f?Avg6;c;Pn&A)&Az74nTPu2Uj_w{`- z_fq-yKQWQrk^TBB;=5Pai@!s>S442%m%gvy=I`(OaYY#`#J=?o^!`pe?)T#Lez5kJ zAAhkcBH7C_(ZBxX=dWMC8WH`+ufP2KFaPXO%v{9FBMa#>VHLSnjHcbNxG-l`W{oD- zj9Fq7B4R?LDG`2crr{ppqV3zch{#MUvKy&t6fLjFXl9L5Rp!cMQLby{FuuH0n4W*e zgLlG&rAZW(NgZa(V?|-nj4uzP%qkwnh&eNhs_J8C^ANR&FyT38B#G#p{ychSD#y`; zm?J9igk)w!4bvpMX0X!badf>_Xw#3Od;e+5zwL4essl(B@1mgY`wQ|MF^r{BREY`! zR+);bmL>%L0UFQso_DG!@3XNdyr-x{B~?@$~A(Cj3x5;s{nun35xcNHXIw+MIKA zt4vjWola+UlZ`EITFnIaQto}#Pmjh`SEPt~qCz61`^6~hjZ@SZ?+bOUYD$gr3TjGgMQii~mzPB%i8k^S0LbOo z3>7`Q9mpIoJxrdBJLj|UbC@ajZp~yg&aCUYigWvYz!AIvUD*3?n8Lehd??VTcK&yIHQOW;obV z75M7|O)7MZG3R0dc+iYdO_8o^fuUHyRzI*IqQbn8OH!fU(EfMk486%TjAG-F8Q>{H z3uh#HVMl`UH@(5un|UO-pmDKAB?y$*!|&!@YxdqgQ7nmK6sz)PfzJst1Di(u*QXCd z*S}_}ut!a<-u{RG@zSjuJkXW&c?HYeeH*X|X{oFbM$JJg0VWpEM@BN>DpZkKkK;Jw z9L=&~O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8;CliW$=f(hx-Z1la zSoXEIsqUceZ=j@-Y>a}LgTZs(*aj%an$q7J0{Ta^J!DRB_R~}84p)J#HMMMI{Qc8I zRQ8I7ZDYW6n1MdR&pB8b%2F74y!r1u&$nyMG1`DYPKHg$no5aWk8L*K5^NB@)ZU&T z_RsP~M9ZDva^(~W_>*Wp0+2I{3c~i`WugZty~?N-l11d}9uGGfF-2{`xB&R3ygbfn z;Tv;M6)aQ*#4U-^hhirJD~U13V-FP%KUDm4aQB$$K?7+F7%rk{qzIEz%xOgI>8eW1 zv&}~LraZRaZVHkHXb=;7Y&@eVGgeA~(80RsfRh7q!GmxRXTOBi}Y-m6}`wn`lm_?fwL1|o=M_aD5l??#K6vMC! z1u|0QL>m^!lrR>#XE!H|B6tGw1NF;dyc4a+3%v*(6rt1j`&ZD&7bncjO3|LTfHORp znweqSwmY1gFnn*zV)c|?n4IBYMKc`6hnUY}QU+HZ!@P$FfFyG2yJ$T(^9EC8340HK&;G$?=|N@he{8}IOA!4W_fH>lN0k441pLQuFyum+6<*a86E5{B)-$-ftQVXh zy-s}@PYZ+r3@0Z@J_0Ae*(2eLNFEDS8>;Ot`;;jmUj=`UU+yIVT6}|g^)!MJohdKR z%V~R3!ux<$yOH~u82`Rx4vfy2=5dk*p2xA-0p|&P!yb!zf-Ks*mI@u;4qdee}AH(MC8M19ysfOzZdujVaCx|VRiwaKT}Ch46q(+ zgAHzPjGynp3&Rv7d-Tmy@vxq#b>O&)r?D?r8{H+P7+nanNc;Qk2tu2POmT)2Ks1^i zQ*_X^*XyCG>W-Ge*xP;Zv`jz!{0qJQ03-JPf}y)#v;XVNzrBA)(Qt)6c4H~g3q5bY yuYbQ1e(U}9yuE!ozB}=D^{>C(*PxhRUjGL3Bp{-l;w`QK0000(Point(609, 516), "hsbtns.def", CButton::tooltip(heroscrn[17]), [=](){ close(); }, EShortcut::GLOBAL_RETURN); - dismissLabel = std::make_shared(CGI->generaltexth->jktexts[8], Rect(370, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE); - dismissButton = std::make_shared(Point(454, 429), "hsbtns2.def", CButton::tooltip(heroscrn[28]), [=](){ dismissCurrent(); }, EShortcut::HERO_DISMISS); - - questlogLabel = std::make_shared(CGI->generaltexth->jktexts[9], Rect(510, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE); - questlogButton = std::make_shared(Point(314, 429), "hsbtns4.def", CButton::tooltip(heroscrn[0]), [=](){ LOCPLINT->showQuestLog(); }, EShortcut::ADVENTURE_QUEST_LOG); + if(settings["general"]["enableUiEnhancements"].Bool()) + { + questlogButton = std::make_shared(Point(314, 429), "hsbtns4.def", CButton::tooltip(heroscrn[0]), [=](){ LOCPLINT->showQuestLog(); }, EShortcut::ADVENTURE_QUEST_LOG); + backpackButton = std::make_shared(Point(424, 429), "buttons/backpack", CButton::tooltipLocalized("vcmi.heroWindow.Backpack"), [=](){ createBackpackWindow(); }, EShortcut::HERO_BACKPACK); + dismissButton = std::make_shared(Point(534, 429), "hsbtns2.def", CButton::tooltip(heroscrn[28]), [=](){ dismissCurrent(); }, EShortcut::HERO_DISMISS); + } + else + { + dismissLabel = std::make_shared(CGI->generaltexth->jktexts[8], Rect(370, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE); + questlogLabel = std::make_shared(CGI->generaltexth->jktexts[9], Rect(510, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE); + dismissButton = std::make_shared(Point(454, 429), "hsbtns2.def", CButton::tooltip(heroscrn[28]), [=](){ dismissCurrent(); }, EShortcut::HERO_DISMISS); + questlogButton = std::make_shared(Point(314, 429), "hsbtns4.def", CButton::tooltip(heroscrn[0]), [=](){ LOCPLINT->showQuestLog(); }, EShortcut::ADVENTURE_QUEST_LOG); + } formations = std::make_shared(0); formations->addToggle(0, std::make_shared(Point(481, 483), "hsbtns6.def", std::make_pair(heroscrn[23], heroscrn[29]), 0, EShortcut::HERO_TIGHT_FORMATION)); diff --git a/config/schemas/settings.json b/config/schemas/settings.json index 20699af25..89a9a84f5 100644 --- a/config/schemas/settings.json +++ b/config/schemas/settings.json @@ -38,7 +38,8 @@ "autosaveCountLimit", "useSavePrefix", "savePrefix", - "startTurnAutosave" + "startTurnAutosave", + "enableUiEnhancements" ], "properties" : { "playerName" : { @@ -126,6 +127,10 @@ "startTurnAutosave" : { "type": "boolean", "default": false + }, + "enableUiEnhancements" : { + "type": "boolean", + "default": true } } }, From 3b99f09495b633c4505178372bcaafa621eab168 Mon Sep 17 00:00:00 2001 From: Dydzio Date: Sun, 20 Aug 2023 18:25:57 +0200 Subject: [PATCH 3/6] Update backpack icons --- Mods/vcmi/Sprites/buttons/backpackNormal.png | Bin 3008 -> 4102 bytes Mods/vcmi/Sprites/buttons/backpackPressed.png | Bin 2848 -> 3900 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Mods/vcmi/Sprites/buttons/backpackNormal.png b/Mods/vcmi/Sprites/buttons/backpackNormal.png index 541ec56c55f3481806c72726246a4a2ec2b1f30b..0b7691614c33db18a421e398bd70c8e6e77dd2ac 100644 GIT binary patch literal 4102 zcmV+h5c%(kP)91YaRbOlE;ha0Xd*A%*XFJbBJjRX^r%jrMW>6^|Xc5q&mO=CbLcj+=LI}PT2}=3E z2ZT^*kt&rUl_FYDlTsQwDrpjd>oksCJ9cfy^Ba8M{O)+p*?X^z*169eB>n)-ho__S z_StuxwSVjP`>ll^|BFArdE+JkL;wUpgct#S;wA#n|MgJTl*?pwl-CL6mVf&7;WAlT zUNLSj+kRd?(i>3<=B9!7TSmc%#Qq1=2s#Nmz-+`X-bPh|1E-}})Mg|b5^mkt9R z-a{Gp_U3W>#aQ0_=&yVg0F~P!!0Q(-E-x=@0JweY=EYZE@gX8&1av-dl=NvrMU=ac z7-h9=PKX>Mb4(27MJOU^2t=d_5~Bd*zecOzeF&bE>1GZ9v{o^&)u5CL5uA^KgVEX` zD@BE4Mp77a$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Sprites/buttons/backpackPressed.png index 316ecbdf90c962cb2b4ee7d776e01b22a8e6773f..00471588efa38422f7fa576bf564c805232c1691 100644 GIT binary patch literal 3900 zcmV-C55w?@P)6 zAFnyZ4+^71ZsaB*+Nznnq7g z_uWpNTE6eA0{DOYLIC*QcfY%^umAu8pud0RCFPM%otpfdoSNM6zugWG9{b6QKlQZ9 zy`Or51%QcVH*VaRtbwJKzhdF14^a7dmU2I+pZtl%5dg~zME;L2lMAH0cVgV+#$R51 zM~wr3n>TK}{rb-%>w^R^1ZL6e4WS_{JSUEv(bWi%MVKXVRCxA+78nsNL1GPnp0(C+ z2$3U^9Touqj3Hrh1`JUI2tiob8e@?Skq^vBgi-`a3=|P`soKnrapkJzx&W3WO^uHn zqF6&BJe3(JjZG}7%`B`*AXP^`G8)5?4T1MQ3J{X_F-si^6UNjcAjT*R0)i~e5fV!b zrtpjeMc~v?3~Ve_-DLl42uA=P8z&;_Pf^cN872T==Cm|u5G1is1Q1b+Nf?j>WmpJE zaL&|gF0~X(6SfDz7hcT=GY-KZ37`S72BW%Oay1K6gO;!mE}|eJ0vkiRSpP#0FpXlwNsp<*;d-y3NEp;(`jmHqc`eohUuB+bHCnR-xwx|8H~dF z*L%g7LyX%4pIHLHB5(xoQCK1&Bu+yq2qQ1`itfIMjASBfgw!~q9plQx1p`7FJ*_P& zBV0{LH;x+rvNj z`r*#TaJ^fcyRfp}^Q|gbgo33r;M8E65HVW=RcCV2Js2$0l(ni8lqi%32KykaT5GJS zrsk+YAV!}EAbzJHVZNOnIy(LD=ay!t(^k#gxYv8~%=8x@n>%}&&%N2Xw>p08RC~{C zr8<=!Jy<=mud=xvW?IR`54yFA%?qAuXZ=xl>(cso%$1Cc7M9jf2tiB4M@>#5T}@9t z@Z6+ek&qb(HS-8j3j%D@ujCPe{>YM5H%45k)+U}G@E zm^qt&R1k<@QPYYIYL$~@iP0~DHZcNFuP2T6)EgJO)r`h@SY94IernD-`;#~B{^!N+ zv4?7pou1z6=bPKn2M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asU7T From b53894ac2d93c44460e52a6668fcc81fbf9554cf Mon Sep 17 00:00:00 2001 From: Dydzio Date: Sun, 20 Aug 2023 18:57:53 +0200 Subject: [PATCH 4/6] Add artifact slots backgrounds --- .../Sprites/heroWindow/artifactSlotEmpty.png | Bin 0 -> 133 bytes client/widgets/CArtifactsOfHeroBackpack.cpp | 19 ++++++++++++++---- client/widgets/CArtifactsOfHeroBackpack.h | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 Mods/vcmi/Sprites/heroWindow/artifactSlotEmpty.png diff --git a/Mods/vcmi/Sprites/heroWindow/artifactSlotEmpty.png b/Mods/vcmi/Sprites/heroWindow/artifactSlotEmpty.png new file mode 100644 index 0000000000000000000000000000000000000000..f0dec09728fc1f413e050d6702087aee95298970 GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u%3?!3ZZJGq6cmjMvT!Hk?+1)8#w#I7mhdkHY z1Nkf^L4LsvK#+Olf)|jl;_2cTQo)$)z_w^%!GQ%^x!A&tUmOT6;1~X;5iKfr_2G#^ aUWP9dWghHLS*r|G&*16m=d#Wzp$P!0i6>wH literal 0 HcmV?d00001 diff --git a/client/widgets/CArtifactsOfHeroBackpack.cpp b/client/widgets/CArtifactsOfHeroBackpack.cpp index 2bf968cdf..80aab5d67 100644 --- a/client/widgets/CArtifactsOfHeroBackpack.cpp +++ b/client/widgets/CArtifactsOfHeroBackpack.cpp @@ -14,6 +14,7 @@ #include "../gui/Shortcut.h" #include "Buttons.h" +#include "Images.h" #include "GameSettings.h" #include "IHandlerBase.h" #include "ObjectLists.h" @@ -29,12 +30,22 @@ CArtifactsOfHeroBackpack::CArtifactsOfHeroBackpack(const Point & position) pos += position; const auto backpackCap = VLC->settings()->getInteger(EGameSettings::HEROES_BACKPACK_CAP); - auto visibleCapasityMax = HERO_BACKPACK_WINDOW_SLOT_LINES * HERO_BACKPACK_WINDOW_SLOT_COLUMNS; + auto visibleCapacityMax = HERO_BACKPACK_WINDOW_SLOT_LINES * HERO_BACKPACK_WINDOW_SLOT_COLUMNS; if(backpackCap >= 0) - visibleCapasityMax = visibleCapasityMax > backpackCap ? backpackCap : visibleCapasityMax; + visibleCapacityMax = visibleCapacityMax > backpackCap ? backpackCap : visibleCapacityMax; - backpack.resize(visibleCapasityMax); + backpack.resize(visibleCapacityMax); + backpackSlotsBackgrounds.resize(visibleCapacityMax); size_t artPlaceIdx = 0; + + for(int i = 0; i < HERO_BACKPACK_WINDOW_SLOT_LINES * HERO_BACKPACK_WINDOW_SLOT_COLUMNS; i++) + { + auto artifactSlotBackground = std::make_shared("heroWindow/artifactSlotEmpty", + Point(46 * (i % HERO_BACKPACK_WINDOW_SLOT_COLUMNS), 46 * (i / HERO_BACKPACK_WINDOW_SLOT_COLUMNS))); + + backpackSlotsBackgrounds.emplace_back(artifactSlotBackground); + } + for(auto & artPlace : backpack) { artPlace = std::make_shared( @@ -45,7 +56,7 @@ CArtifactsOfHeroBackpack::CArtifactsOfHeroBackpack(const Point & position) artPlaceIdx++; } - if(backpackCap < 0 || visibleCapasityMax < backpackCap) + if(backpackCap < 0 || visibleCapacityMax < backpackCap) { auto onCreate = [](size_t index) -> std::shared_ptr { diff --git a/client/widgets/CArtifactsOfHeroBackpack.h b/client/widgets/CArtifactsOfHeroBackpack.h index f504ba62c..f3735795e 100644 --- a/client/widgets/CArtifactsOfHeroBackpack.h +++ b/client/widgets/CArtifactsOfHeroBackpack.h @@ -31,6 +31,7 @@ public: private: std::shared_ptr backpackListBox; + std::vector> backpackSlotsBackgrounds; const size_t HERO_BACKPACK_WINDOW_SLOT_COLUMNS = 8; const size_t HERO_BACKPACK_WINDOW_SLOT_LINES = 8; }; From b73f9325ad763a0ddebbdbc4ac409b42026e3e15 Mon Sep 17 00:00:00 2001 From: Dydzio Date: Mon, 21 Aug 2023 16:56:50 +0200 Subject: [PATCH 5/6] Fixes from code review --- client/widgets/CArtifactsOfHeroBackpack.cpp | 17 +++++++++-------- client/widgets/CArtifactsOfHeroBackpack.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/widgets/CArtifactsOfHeroBackpack.cpp b/client/widgets/CArtifactsOfHeroBackpack.cpp index 80aab5d67..90ecd7567 100644 --- a/client/widgets/CArtifactsOfHeroBackpack.cpp +++ b/client/widgets/CArtifactsOfHeroBackpack.cpp @@ -28,20 +28,22 @@ CArtifactsOfHeroBackpack::CArtifactsOfHeroBackpack(const Point & position) { OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE); pos += position; + setRedrawParent(true); const auto backpackCap = VLC->settings()->getInteger(EGameSettings::HEROES_BACKPACK_CAP); - auto visibleCapacityMax = HERO_BACKPACK_WINDOW_SLOT_LINES * HERO_BACKPACK_WINDOW_SLOT_COLUMNS; + auto visibleCapacityMax = HERO_BACKPACK_WINDOW_SLOT_ROWS * HERO_BACKPACK_WINDOW_SLOT_COLUMNS; if(backpackCap >= 0) visibleCapacityMax = visibleCapacityMax > backpackCap ? backpackCap : visibleCapacityMax; backpack.resize(visibleCapacityMax); - backpackSlotsBackgrounds.resize(visibleCapacityMax); size_t artPlaceIdx = 0; - for(int i = 0; i < HERO_BACKPACK_WINDOW_SLOT_LINES * HERO_BACKPACK_WINDOW_SLOT_COLUMNS; i++) + const int slotSizeWithMargin = 46; + + for(int i = 0; i < visibleCapacityMax; i++) { auto artifactSlotBackground = std::make_shared("heroWindow/artifactSlotEmpty", - Point(46 * (i % HERO_BACKPACK_WINDOW_SLOT_COLUMNS), 46 * (i / HERO_BACKPACK_WINDOW_SLOT_COLUMNS))); + Point(slotSizeWithMargin * (i % HERO_BACKPACK_WINDOW_SLOT_COLUMNS), slotSizeWithMargin * (i / HERO_BACKPACK_WINDOW_SLOT_COLUMNS))); backpackSlotsBackgrounds.emplace_back(artifactSlotBackground); } @@ -49,7 +51,7 @@ CArtifactsOfHeroBackpack::CArtifactsOfHeroBackpack(const Point & position) for(auto & artPlace : backpack) { artPlace = std::make_shared( - Point(46 * (artPlaceIdx % HERO_BACKPACK_WINDOW_SLOT_COLUMNS), 46 * (artPlaceIdx / HERO_BACKPACK_WINDOW_SLOT_COLUMNS))); + Point(slotSizeWithMargin * (artPlaceIdx % HERO_BACKPACK_WINDOW_SLOT_COLUMNS), slotSizeWithMargin * (artPlaceIdx / HERO_BACKPACK_WINDOW_SLOT_COLUMNS))); artPlace->setArtifact(nullptr); artPlace->leftClickCallback = std::bind(&CArtifactsOfHeroBase::leftClickArtPlace, this, _1); artPlace->rightClickCallback = std::bind(&CArtifactsOfHeroBase::rightClickArtPlace, this, _1); @@ -67,8 +69,8 @@ CArtifactsOfHeroBackpack::CArtifactsOfHeroBackpack(const Point & position) scrollBackpack(static_cast(pos) * HERO_BACKPACK_WINDOW_SLOT_COLUMNS - backpackPos); }; backpackListBox = std::make_shared( - posMoved, onCreate, Point(0, 0), Point(0, 0), HERO_BACKPACK_WINDOW_SLOT_LINES, 0, 0, 1, - Rect(HERO_BACKPACK_WINDOW_SLOT_COLUMNS * 46 + 10, 0, HERO_BACKPACK_WINDOW_SLOT_LINES * 46 - 5, 0)); + posMoved, onCreate, Point(0, 0), Point(0, 0), HERO_BACKPACK_WINDOW_SLOT_ROWS, 0, 0, 1, + Rect(HERO_BACKPACK_WINDOW_SLOT_COLUMNS * slotSizeWithMargin + 10, 0, HERO_BACKPACK_WINDOW_SLOT_ROWS * slotSizeWithMargin - 5, 0)); } } @@ -95,7 +97,6 @@ void CArtifactsOfHeroBackpack::scrollBackpack(int offset) slot = slot + 1; } redraw(); - setRedrawParent(true); } void CArtifactsOfHeroBackpack::updateBackpackSlots() diff --git a/client/widgets/CArtifactsOfHeroBackpack.h b/client/widgets/CArtifactsOfHeroBackpack.h index f3735795e..e6767a601 100644 --- a/client/widgets/CArtifactsOfHeroBackpack.h +++ b/client/widgets/CArtifactsOfHeroBackpack.h @@ -33,5 +33,5 @@ private: std::shared_ptr backpackListBox; std::vector> backpackSlotsBackgrounds; const size_t HERO_BACKPACK_WINDOW_SLOT_COLUMNS = 8; - const size_t HERO_BACKPACK_WINDOW_SLOT_LINES = 8; + const size_t HERO_BACKPACK_WINDOW_SLOT_ROWS = 8; }; From 28fe28adf59ef9130e6adf9eb2dabf9c7eae691f Mon Sep 17 00:00:00 2001 From: Dydzio Date: Mon, 21 Aug 2023 17:08:15 +0200 Subject: [PATCH 6/6] Fix player coloring --- client/windows/CHeroBackpackWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/windows/CHeroBackpackWindow.cpp b/client/windows/CHeroBackpackWindow.cpp index 424388e5b..46bcfda40 100644 --- a/client/windows/CHeroBackpackWindow.cpp +++ b/client/windows/CHeroBackpackWindow.cpp @@ -17,6 +17,7 @@ #include "../widgets/Images.h" #include "CMessage.h" #include "render/Canvas.h" +#include "CPlayerInterface.h" CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero) : CWindowObject((EOptions)0) @@ -41,5 +42,5 @@ CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero) void CHeroBackpackWindow::showAll(Canvas &to) { CIntObject::showAll(to); - CMessage::drawBorder(PlayerColor(1), to.getInternalSurface(), pos.w+28, pos.h+29, pos.x-14, pos.y-15); + CMessage::drawBorder(PlayerColor(LOCPLINT->playerID), to.getInternalSurface(), pos.w+28, pos.h+29, pos.x-14, pos.y-15); }