From da810cef5583dd3f3e6eaf21442d4214ae27891b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:15:49 -0300 Subject: [PATCH 01/15] fix: game_outfit custom compatible with canary --- data/styles/40-outfitwindow.otui | 3 -- .../game_attachedeffects/attachedeffects.lua | 3 -- .../game_cyclopedia/tab/bestiary/bestiary.lua | 7 +--- modules/game_outfit/outfit.lua | 12 +++++- src/client/game.cpp | 4 +- src/client/game.h | 4 +- src/client/protocolcodes.h | 1 + src/client/protocolgame.h | 1 + src/client/protocolgameparse.cpp | 37 ++++++++++++++----- 9 files changed, 44 insertions(+), 28 deletions(-) diff --git a/data/styles/40-outfitwindow.otui b/data/styles/40-outfitwindow.otui index ecb2779ff2..f5e36ba775 100644 --- a/data/styles/40-outfitwindow.otui +++ b/data/styles/40-outfitwindow.otui @@ -103,9 +103,6 @@ SelectionButton < Panel focusable: true phantom: false - $hover: - image-color: #ffffff - $focus: border: 1 white image-color: #ffffff diff --git a/modules/game_attachedeffects/attachedeffects.lua b/modules/game_attachedeffects/attachedeffects.lua index a3968c2ebb..90c18586fa 100644 --- a/modules/game_attachedeffects/attachedeffects.lua +++ b/modules/game_attachedeffects/attachedeffects.lua @@ -58,7 +58,6 @@ function controller:onTerminate() g_attachedEffects.clear() end --- @ note: sorry, I couldn't find any other way to do it function getCategory(id) return AttachedEffectManager.get(id).thingCategory end @@ -84,5 +83,3 @@ function thingId(id) return "None" end end - --- @ diff --git a/modules/game_cyclopedia/tab/bestiary/bestiary.lua b/modules/game_cyclopedia/tab/bestiary/bestiary.lua index 5b34d7ddea..0b3cdefdab 100644 --- a/modules/game_cyclopedia/tab/bestiary/bestiary.lua +++ b/modules/game_cyclopedia/tab/bestiary/bestiary.lua @@ -124,12 +124,7 @@ function Cyclopedia.CreateCreatureItems(data) itemWidget.Stackable:setText("1") end end - - local price, rarity = ItemsDatabase.getSellValueAndColor(itemWidget.id) - if price > 0 then - itemWidget:setImageSource("/images/ui/rarity_" .. rarity) - end - + ItemsDatabase.setRarityItem(itemWidget, itemWidget:getItem()) itemWidget.onMouseRelease = onAddLootClick end end diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index ece28278b8..18b28fd658 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -846,8 +846,11 @@ function showOutfits() if thingType:getRealSize() > 0 then button.outfit:setCreatureSize(thingType:getRealSize() + 32) end - --button.outfit:setBorderColor('red') - --button.outfit:setBorderWidth(2) + + if outfitData[4] and outfitData[4] ~= 0 then + -- mode: 0x00 - available, 0x01 store (requires U32 store offerId), 0x02 golden outfit tooltip (hardcoded) + button:setImageColor("#49ABFF") + end button.name:setText(outfitData[2]) if tempOutfit.type == outfitData[1] then @@ -904,6 +907,11 @@ function showMounts() if tempOutfit.mount == mountData[1] then focused = mountData[1] end + + if mountData[3] and mountData[3] ~= 0 then + -- mode: 0x00 - available, 0x01 store (requires U32 store offerId) + button:setImageColor("#49ABFF") + end end if #ServerData.mounts == 1 then diff --git a/src/client/game.cpp b/src/client/game.cpp index 28cad81b75..bcab831192 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -404,8 +404,8 @@ void Game::processRemoveAutomapFlag(const Position& pos, const uint8_t icon, con g_lua.callGlobalField("g_game", "onRemoveAutomapFlag", pos, icon, message); } -void Game::processOpenOutfitWindow(const Outfit& currentOutfit, const std::vector>& outfitList, - const std::vector>& mountList, +void Game::processOpenOutfitWindow(const Outfit& currentOutfit, const std::vector>& outfitList, + const std::vector>& mountList, const std::vector>& wingsList, const std::vector>& aurasList, const std::vector>& effectList, diff --git a/src/client/game.h b/src/client/game.h index ae4c25b231..74fd7fd93b 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -475,8 +475,8 @@ class Game static void processRemoveAutomapFlag(const Position& pos, const uint8_t icon, const std::string_view message); // outfit - void processOpenOutfitWindow(const Outfit& currentOutfit, const std::vector>& outfitList, - const std::vector>& mountList, + void processOpenOutfitWindow(const Outfit& currentOutfit, const std::vector>& outfitList, + const std::vector>& mountList, const std::vector>& wingsList, const std::vector>& aurasList, const std::vector>& effectsList, diff --git a/src/client/protocolcodes.h b/src/client/protocolcodes.h index 957a07ffc3..fcbcb0803f 100644 --- a/src/client/protocolcodes.h +++ b/src/client/protocolcodes.h @@ -77,6 +77,7 @@ namespace Proto GameServerCreatureShader = 54, GameServerMapShader = 55, GameServerCreatureTyping = 56, + GameServerFeatures = 67, GameServerFloorDescription = 75, // original tibia ONLY diff --git a/src/client/protocolgame.h b/src/client/protocolgame.h index 3549e9bc2c..c3d5806831 100644 --- a/src/client/protocolgame.h +++ b/src/client/protocolgame.h @@ -200,6 +200,7 @@ class ProtocolGame : public Protocol void parseFloorDescription(const InputMessagePtr& msg); void parseMapDescription(const InputMessagePtr& msg); void parseCreatureTyping(const InputMessagePtr& msg); + void parseFeatures(const InputMessagePtr& msg); void parseMapMoveNorth(const InputMessagePtr& msg); void parseMapMoveEast(const InputMessagePtr& msg); void parseMapMoveSouth(const InputMessagePtr& msg); diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 6d9705b279..da04251be2 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -145,6 +145,9 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg) case Proto::GameServerCreatureTyping: parseCreatureTyping(msg); break; + case Proto::GameServerFeatures: + parseFeatures(msg); + break; case Proto::GameServerFloorDescription: parseFloorDescription(msg); break; @@ -2552,7 +2555,7 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) const msg->getU16(); // current familiar looktype } - std::vector> outfitList; + std::vector> outfitList; if (g_game.getFeature(Otc::GameNewOutfitProtocol)) { const uint16_t outfitCount = g_game.getClientVersion() >= 1281 ? msg->getU16() : msg->getU8(); @@ -2560,15 +2563,15 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) const const uint16_t outfitId = msg->getU16(); const auto& outfitName = msg->getString(); const uint8_t outfitAddons = msg->getU8(); - + uint8_t outfitMode = 0; if (g_game.getClientVersion() >= 1281) { - const uint8_t outfitMode = msg->getU8(); // mode: 0x00 - available, 0x01 store (requires U32 store offerId), 0x02 golden outfit tooltip (hardcoded) + outfitMode = msg->getU8(); // mode: 0x00 - available, 0x01 store (requires U32 store offerId), 0x02 golden outfit tooltip (hardcoded) if (outfitMode == 1) { msg->getU32(); } } - outfitList.emplace_back(outfitId, outfitName, outfitAddons); + outfitList.emplace_back(outfitId, outfitName, outfitAddons,outfitMode); } } else { uint16_t outfitStart; @@ -2582,26 +2585,26 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) const } for (auto i = outfitStart; i <= outfitEnd; ++i) { - outfitList.emplace_back(i, "", 0); + outfitList.emplace_back(i, "", 0, 0); } } - std::vector> mountList; + std::vector> mountList; if (g_game.getFeature(Otc::GamePlayerMounts)) { const uint16_t mountCount = g_game.getClientVersion() >= 1281 ? msg->getU16() : msg->getU8(); for (auto i = 0; i < mountCount; ++i) { const uint16_t mountId = msg->getU16(); // mount type const auto& mountName = msg->getString(); // mount name - + uint8_t mountMode = 0; if (g_game.getClientVersion() >= 1281) { - const uint8_t mountMode = msg->getU8(); // mode: 0x00 - available, 0x01 store (requires U32 store offerId) + mountMode = msg->getU8(); // mode: 0x00 - available, 0x01 store (requires U32 store offerId) if (mountMode == 1) { msg->getU32(); } } - mountList.emplace_back(mountId, mountName); + mountList.emplace_back(mountId, mountName, mountMode); } } @@ -3200,7 +3203,7 @@ Outfit ProtocolGame::getOutfit(const InputMessagePtr& msg, const bool parseMount outfit.setMount(mount); } - if (g_game.getFeature(Otc::GameWingsAurasEffectsShader)) { + if (g_game.getFeature(Otc::GameWingsAurasEffectsShader) && parseMount) { const uint16_t wings = msg->getU16(); outfit.setWing(wings); @@ -5192,6 +5195,20 @@ void ProtocolGame::parseCreatureTyping(const InputMessagePtr& msg) creature->setTyping(typing); } +void ProtocolGame::parseFeatures(const InputMessagePtr& msg) +{ + const uint16_t features = msg->getU16(); + for (auto i = 0; i < features; ++i) { + Otc::GameFeature feature = (Otc::GameFeature)msg->getU8(); + bool enabled = msg->getU8() > 0; + if (enabled) { + g_game.enableFeature(feature); + } else { + g_game.disableFeature(feature); + } + } +} + void ProtocolGame::parseHighscores(const InputMessagePtr& msg) { const bool isEmpty = static_cast(msg->getU8()); From dcb3214707fd3d175eb2b8c4ed383fe04b74008d Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:50:30 -0300 Subject: [PATCH 02/15] review sonarcloud --- src/client/protocolgameparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index da04251be2..74e0d155f1 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -5199,7 +5199,7 @@ void ProtocolGame::parseFeatures(const InputMessagePtr& msg) { const uint16_t features = msg->getU16(); for (auto i = 0; i < features; ++i) { - Otc::GameFeature feature = (Otc::GameFeature)msg->getU8(); + auto feature = (Otc::GameFeature)msg->getU8(); bool enabled = msg->getU8() > 0; if (enabled) { g_game.enableFeature(feature); From ec50c06f42513f5972a12697495c11004c1ca29b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:44:35 -0300 Subject: [PATCH 03/15] Update src/client/protocolgameparse.cpp Co-authored-by: Luan Luciano --- src/client/protocolgameparse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 74e0d155f1..4d0e39bdeb 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -5199,8 +5199,8 @@ void ProtocolGame::parseFeatures(const InputMessagePtr& msg) { const uint16_t features = msg->getU16(); for (auto i = 0; i < features; ++i) { - auto feature = (Otc::GameFeature)msg->getU8(); - bool enabled = msg->getU8() > 0; + const auto feature = static_cast(msg->getU8()); + const bool enabled = static_cast(getU8()); if (enabled) { g_game.enableFeature(feature); } else { From 9817d8fc524c80cdaa4a4e2af3e761a1029ba87b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:44:41 -0300 Subject: [PATCH 04/15] Update src/client/protocolgameparse.cpp Co-authored-by: Luan Luciano --- src/client/protocolgameparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 4d0e39bdeb..fe613419fe 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -2571,7 +2571,7 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) const } } - outfitList.emplace_back(outfitId, outfitName, outfitAddons,outfitMode); + outfitList.emplace_back(outfitId, outfitName, outfitAddons, outfitMode); } } else { uint16_t outfitStart; From 9e3ebdccc4cbfb25b9f851a8a1fd7ec30a1fafd9 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:28:37 -0300 Subject: [PATCH 05/15] fix compilation post review --- src/client/protocolgameparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index fe613419fe..6246728218 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -5200,7 +5200,7 @@ void ProtocolGame::parseFeatures(const InputMessagePtr& msg) const uint16_t features = msg->getU16(); for (auto i = 0; i < features; ++i) { const auto feature = static_cast(msg->getU8()); - const bool enabled = static_cast(getU8()); + const bool enabled = static_cast(msg->getU8()); if (enabled) { g_game.enableFeature(feature); } else { From 313eb99d371bfa673036ee3c7dfb4929d0459103 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:40:02 -0300 Subject: [PATCH 06/15] review: sonarcloud --- src/client/protocolgameparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index 01c2da1306..f8fbe89e65 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -5204,7 +5204,7 @@ void ProtocolGame::parseFeatures(const InputMessagePtr& msg) const uint16_t features = msg->getU16(); for (auto i = 0; i < features; ++i) { const auto feature = static_cast(msg->getU8()); - const bool enabled = static_cast(msg->getU8()); + const auto enabled = static_cast(msg->getU8()); if (enabled) { g_game.enableFeature(feature); } else { From 310eb24eb41597a561b5f28a843a09587767258b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 00:48:01 -0300 Subject: [PATCH 07/15] feat: familiar (need test) --- README.md | 1 - data/styles/40-outfitwindow.otui | 72 ++++++++++++- modules/game_features/features.lua | 1 + modules/game_outfit/outfit.lua | 158 ++++++++++++++++++++++++++--- modules/gamelib/const.lua | 1 + src/client/const.h | 1 + src/client/game.cpp | 9 +- src/client/game.h | 1 + src/client/outfit.cpp | 1 + src/client/outfit.h | 4 + src/client/protocolgameparse.cpp | 12 ++- src/client/protocolgamesend.cpp | 5 +- 12 files changed, 241 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 87d01e242f..820c0c8988 100644 --- a/README.md +++ b/README.md @@ -534,7 +534,6 @@ Have found a bug? Please create an issue in our [bug tracker](https://github.com | TO-DO list | Status | PR | |----------------------- |----------------------------------- |------ | | Android compatibility | ![](https://geps.dev/progress/50) | [Branch](https://github.com/mehah/otclient/tree/mobile-working) | -| Familiar outfit | ![](https://geps.dev/progress/30) | [#39](https://github.com/Nottinghster/otclient/pull/39) | | wheel of destiny | ![](https://geps.dev/progress/1) | None | | Forge | ![](https://geps.dev/progress/1) | None | | Analyzer | ![](https://geps.dev/progress/10) | [#802](https://github.com/mehah/otclient/pull/802) | diff --git a/data/styles/40-outfitwindow.otui b/data/styles/40-outfitwindow.otui index f5e36ba775..1fd9089fb8 100644 --- a/data/styles/40-outfitwindow.otui +++ b/data/styles/40-outfitwindow.otui @@ -192,6 +192,28 @@ OutfitWindow < MainWindow anchors.right: parent.right text: Show Mount + FlatPanel + id: showFamiliar + height: 22 + padding: 5 + @onSetup: | + if not g_game.getFeature(GamePlayerFamiliars) then + self:hide() + self:setHeight(0) + self:setPadding(0) + end + + CheckBox + id: check + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: parent.right + text: Show Familiar + @onSetup: | + if not g_game.getFeature(GamePlayerFamiliars) then + self:hide() + end + FlatPanel id: showWings height: 22 @@ -284,7 +306,16 @@ OutfitWindow < MainWindow type: grid cell-size: 64 64 flow: true - + + UICreature + id: UIfamiliar + anchors.centerIn: parent + size: 256 256 + @onSetup: | + if not g_game.getFeature(GamePlayerFamiliars) then + self:hide() + end + UICreature id: creature anchors.centerIn: parent @@ -496,7 +527,40 @@ OutfitWindow < MainWindow anchors.bottom: parent.bottom anchors.left: prev.right anchors.right: parent.right - + + Panel + id: familiar + height: 20 + @onSetup: | + if not g_game.getFeature(GamePlayerFamiliars) then + self:hide() + self:setHeight(0) + end + + CheckBox + id: check + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + image-source: /images/ui/outfits/checkbox_round + text-offset: 15 0 + text: Familiar: + width: 84 + @onSetup: | + if not g_game.getFeature(GamePlayerFamiliars) then + self:hide() + end + + FlatPanel + id: name + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.left: prev.right + anchors.right: parent.right + @onSetup: | + if not g_game.getFeature(GamePlayerFamiliars) then + self:hide() + end + Panel id: wings height: 20 @@ -587,7 +651,7 @@ OutfitWindow < MainWindow anchors.left: parent.left image-source: /images/ui/outfits/checkbox_round text-offset: 15 0 - text: Effects Bar: + text: Effects: width: 84 FlatPanel @@ -597,8 +661,6 @@ OutfitWindow < MainWindow anchors.left: prev.right anchors.right: parent.right - - Panel id: title height: 20 diff --git a/modules/game_features/features.lua b/modules/game_features/features.lua index fcd0f702f3..6040095eff 100644 --- a/modules/game_features/features.lua +++ b/modules/game_features/features.lua @@ -205,6 +205,7 @@ controller:registerEvents(g_game, { end if version >= 1281 then + g_game.enableFeature(GamePlayerFamiliars) g_game.disableFeature(GameEnvironmentEffect) g_game.disableFeature(GameItemAnimationPhase) end diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 18b28fd658..397f795462 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -19,7 +19,7 @@ local showShaderCheck = nil local showBarsCheck = nil local showTitleCheck = nil local showEffectsCheck = nil - +local showFamiliarCheck = nil local colorBoxes = {} local currentColorBox = nil @@ -33,6 +33,7 @@ local ServerData = { currentOutfit = {}, outfits = {}, mounts = {}, + familiars = {}, wings = {}, auras = {}, shaders = {}, @@ -140,7 +141,7 @@ local function showSelectionList(data, tempValue, tempField, onSelectCallback) window.listSearch:show() end -local AppearanceData = {"preset", "outfit", "mount", "wings", "aura", "effects", "shader", "healthBar", "title"} +local AppearanceData = {"preset", "outfit", "mount", "familiar", "wings", "aura", "effects", "shader", "healthBar", "title"} function init() if opcodeSystem.enable then @@ -178,10 +179,18 @@ function terminate() end function onMovementChange(checkBox, checked) - if checked == true then - previewCreature:getCreature():setStaticWalking(1000) - else - previewCreature:getCreature():setStaticWalking(0) + local walkingSpeed = checked and 1000 or 0 + + local mainCreature = previewCreature:getCreature() + if mainCreature then + mainCreature:setStaticWalking(walkingSpeed) + end + + if g_game.getFeature(GamePlayerFamiliars) then + local familiarCreature = previewFamiliar:getCreature() + if familiarCreature then + familiarCreature:setStaticWalking(walkingSpeed) + end end settings.movement = checked @@ -245,9 +254,15 @@ function onShowMountChange(checkBox, checked) updatePreview() end +function onShowFamiliarChange(checkBox, checked) + settings.showFamiliar = checked + updatePreview() +end + function onShowOutfitChange(checkBox, checked) settings.showOutfit = checked showMountCheck:setEnabled(settings.showOutfit) + showFamiliarCheck:setEnabled(settings.showOutfit) showWingsCheck:setEnabled(settings.showOutfit) showAuraCheck:setEnabled(settings.showOutfit) showShaderCheck:setEnabled(settings.showOutfit) @@ -290,6 +305,7 @@ local PreviewOptions = { ["showFloor"] = onShowFloorChange, ["showOutfit"] = onShowOutfitChange, ["showMount"] = onShowMountChange, + ["showFamiliar"] = onShowFamiliarChange, ["showWings"] = onShowWingsChange, ["showAura"] = onShowAuraChange, ["showShader"] = onShowShaderChange, @@ -298,7 +314,7 @@ local PreviewOptions = { ["showEffects"] = onShowEffectsChange } -function create(player, outfitList, creatureMount, mountList, wingsList, auraList, effectsList, shaderList) +function create(player, outfitList, creatureMount, mountList, familiarList, wingsList, auraList, effectsList, shaderList) if ignoreNextOutfitWindow and g_clock.millis() < ignoreNextOutfitWindow + 1000 then return end @@ -312,11 +328,11 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis end loadSettings() - ServerData = { currentOutfit = currentOutfit, outfits = outfitList, mounts = mountList, + familiars = familiarList, wings = wingsList, auras = auraList, effects = effectsList, @@ -365,6 +381,10 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis previewCreature = window.preview.panel.creature previewCreature:setCreatureSize(200) previewCreature:setCenter(true) + + previewFamiliar = window.preview.panel.UIfamiliar + previewFamiliar:setCreatureSize(200) + previewFamiliar:setCenter(true) -- previewCreature:setBorderColor('red') -- previewCreature:setBorderWidth(2) @@ -415,6 +435,7 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis showFloorCheck = window.preview.options.showFloor.check showOutfitCheck = window.preview.options.showOutfit.check showMountCheck = window.preview.options.showMount.check + showFamiliarCheck = window.preview.options.showFamiliar.check showWingsCheck = window.preview.options.showWings.check showAuraCheck = window.preview.options.showAura.check showShaderCheck = window.preview.options.showShader.check @@ -432,6 +453,7 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis if not settings.showOutfit then showMountCheck:setEnabled(false) + showFamiliarCheck:setEnabled(false) showWingsCheck:setEnabled(false) showAuraCheck:setEnabled(false) showShaderCheck:setEnabled(false) @@ -442,6 +464,7 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis showOutfitCheck:setChecked(settings.showOutfit) showMountCheck:setChecked(settings.showMount) + showFamiliarCheck:setChecked(settings.showFamiliar) showWingsCheck:setChecked(settings.showWings) showAuraCheck:setChecked(settings.showAura) showShaderCheck:setChecked(settings.showShader) @@ -472,6 +495,7 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis appearanceGroup:addWidget(window.appearance.settings.preset.check) appearanceGroup:addWidget(window.appearance.settings.outfit.check) appearanceGroup:addWidget(window.appearance.settings.mount.check) + appearanceGroup:addWidget(window.appearance.settings.familiar.check) appearanceGroup:addWidget(window.appearance.settings.aura.check) appearanceGroup:addWidget(window.appearance.settings.wings.check) appearanceGroup:addWidget(window.appearance.settings.shader.check) @@ -493,6 +517,10 @@ function create(player, outfitList, creatureMount, mountList, wingsList, auraLis window.preview.options.showMount:setVisible(g_game.getFeature(GamePlayerMounts)) window.configure.mount:setVisible(g_game.getFeature(GamePlayerMounts)) window.appearance.settings.mount:setVisible(g_game.getFeature(GamePlayerMounts)) + + window.preview.options.showFamiliar:setVisible(g_game.getFeature(GamePlayerFamiliars)) + window.appearance.settings.familiar:setVisible(g_game.getFeature(GamePlayerFamiliars)) + window.listSearch.search.onKeyPress = onFilterSearch previewCreature:getCreature():setDirection(2) end @@ -504,6 +532,7 @@ function destroy() showFloorCheck = nil showOutfitCheck = nil showMountCheck = nil + showFamiliarCheck = nil showWingsCheck = nil showAuraCheck = nil showShaderCheck = nil @@ -525,6 +554,7 @@ function destroy() currentOutfit = {}, outfits = {}, mounts = {}, + familiars = {}, wings = {}, auras = {}, shaders = {}, @@ -588,7 +618,8 @@ function newPreset() effects = "None", wings = "None", shader = "None", - mounted = window.configure.mount.check:isChecked() + mounted = window.configure.mount.check:isChecked(), + familiar = "None" } presetWidget:focus() @@ -656,7 +687,7 @@ function savePreset() settings.presets[presetId].outfit = outfitCopy settings.presets[presetId].mounted = window.configure.mount.check:isChecked() - + settings.presets[presetId].familiar = tempOutfit.familiar or 0 settings.presets[presetId].shader = "Outfit - Default" settings.presets[presetId].auras = lastSelectAura or "None" settings.presets[presetId].effects = lastSelectEffects or "None" @@ -739,7 +770,8 @@ function onAppearanceChange(widget, selectedWidget) showOutfits() elseif id == "mount" then showMounts() - -- numbers + elseif id == "familiar" then + showFamiliars() elseif id == "aura" then showSelectionList(ServerData.auras, tempOutfit.auras, "aura", onAuraSelect) elseif id == "wings" then @@ -834,6 +866,7 @@ function showOutfits() outfit.type = outfitData[1] outfit.addons = outfitData[3] outfit.mount = 0 + outfit.familiar = 0 outfit.auras = 0 outfit.wings = 0 outfit.shader = "Outfit - Default" @@ -936,6 +969,53 @@ function showMounts() window.listSearch:show() end +function showFamiliars() + window.presetsList:hide() + window.presetsScroll:hide() + window.presetButtons:hide() + + window.selectionList.onChildFocusChange = nil + window.selectionList:destroyChildren() + + local focused = nil + + local button = g_ui.createWidget("SelectionButton", window.selectionList) + button:setId(0) + button.name:setText("None") + focused = 0 + for _, familiarData in ipairs(ServerData.familiars) do + local button = g_ui.createWidget("SelectionButton", window.selectionList) + button:setId(familiarData[1]) + + button.outfit:setOutfit({ + type = familiarData[1] + }) + + button.name:setText(familiarData[2]) + if tempOutfit.familiar == familiarData[1] then + focused = familiarData[1] + end + end + + if #ServerData.familiars == 1 then + window.selectionList:focusChild(nil) + end + + if focused then + local w = window.selectionList[focused] + w:focus() + window.selectionList:ensureChildVisible(w, { + x = 0, + y = 196 + }) + end + + window.selectionList.onChildFocusChange = onFamiliarSelect + window.selectionList:show() + window.selectionScroll:show() + window.listSearch:show() +end + function showShaders() window.presetsList:hide() window.presetsScroll:hide() @@ -1199,6 +1279,34 @@ function onMountSelect(list, focusedChild, unfocusedChild, reason) end end +function onFamiliarSelect(list, focusedChild, unfocusedChild, reason) + if focusedChild then + local familiarType = tonumber(focusedChild:getId()) + + tempOutfit.familiar = familiarType + + deselectPreset() + + previewFamiliar:setOutfit({ + type = familiarType + }) + + updatePreview() + + if settings.showFamiliar and g_game.getFeature(GamePlayerFamiliars) and familiarType > 0 then + previewCreature:setMarginRight(50) + previewFamiliar:setCreatureSize(200) + previewFamiliar:setCenter(true) + previewFamiliar:setMarginLeft(70) + else + previewCreature:setMarginRight(0) + previewFamiliar:setMarginLeft(0) + end + + updateAppearanceText("familiar", focusedChild.name:getText()) + end +end + function onAuraSelect(list, focusedChild, unfocusedChild, reason) local auraName = window.appearance.settings["aura"].name:getText() if auraName ~= "None" then @@ -1453,6 +1561,22 @@ function updatePreview() previewOutfit.mount = 0 end + if not settings.showFamiliar then + previewOutfit.familiar = 0 + previewCreature:setMarginRight(0) + previewFamiliar:setMarginLeft(0) + previewFamiliar:setVisible(settings.showFamiliar) + else + if previewOutfit.familiar and previewOutfit.familiar > 0 then + previewFamiliar:setVisible(true) + previewCreature:setMarginRight(50) + previewFamiliar:setCreatureSize(200) + previewFamiliar:setCenter(true) + previewFamiliar:setMarginLeft(70) + end + + end + if settings.showAura then attachOrDetachEffect(lastSelectAura, true) else @@ -1536,7 +1660,9 @@ function rotate(value) end previewCreature:getCreature():setDirection(direction) - + if g_game.getFeature(GamePlayerFamiliars) then + previewFamiliar:getCreature():setDirection(direction) + end floor:setMargin(0) end @@ -1624,6 +1750,7 @@ function loadDefaultSettings() showFloor = true, showOutfit = true, showMount = true, + showFamiliar = true, showWings = true, showAura = true, showShader = true, @@ -1666,7 +1793,12 @@ function accept() settings.presets[settings.currentPreset].mounted = isMountedChecked end end - + if g_game.getFeature(GamePlayerFamiliars) then + local player = g_game.getLocalPlayer() + if settings.currentPreset > 0 then + settings.presets[settings.currentPreset].mounted = window.configure.familiar.check:isChecked() + end + end g_game.changeOutfit(tempOutfit) if opcodeSystem.enable then sendAction("changeOutfit", { diff --git a/modules/gamelib/const.lua b/modules/gamelib/const.lua index 5323f505c1..cf9a62f38a 100644 --- a/modules/gamelib/const.lua +++ b/modules/gamelib/const.lua @@ -203,6 +203,7 @@ GameWingsAurasEffectsShader = 118 GameForgeConvergence = 119 GameAllowCustomBotScripts = 120 GameColorizedLootValue = 121 +GamePlayerFamiliars = 122 TextColors = { red = '#f55e5e', -- '#c83200' diff --git a/src/client/const.h b/src/client/const.h index 66a82f1821..64f4cd69b7 100644 --- a/src/client/const.h +++ b/src/client/const.h @@ -550,6 +550,7 @@ namespace Otc GameForgeConvergence = 119, GameAllowCustomBotScripts = 120, GameColorizedLootValue = 121, + GamePlayerFamiliars = 122, LastGameFeature }; diff --git a/src/client/game.cpp b/src/client/game.cpp index 2ef75fd099..49403f0774 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -406,6 +406,7 @@ void Game::processRemoveAutomapFlag(const Position& pos, const uint8_t icon, con void Game::processOpenOutfitWindow(const Outfit& currentOutfit, const std::vector>& outfitList, const std::vector>& mountList, + const std::vector>& familiarList, const std::vector>& wingsList, const std::vector>& aurasList, const std::vector>& effectList, @@ -430,7 +431,13 @@ void Game::processOpenOutfitWindow(const Outfit& currentOutfit, const std::vecto virtualMountCreature->setOutfit(mountOutfit); } - g_lua.callGlobalField("g_game", "onOpenOutfitWindow", virtualOutfitCreature, outfitList, virtualMountCreature, mountList, wingsList, aurasList, effectList, shaderList); + if (getFeature(Otc::GamePlayerMounts)) { + Outfit familiarOutfit; + familiarOutfit.setId(currentOutfit.getMount()); + familiarOutfit.setCategory(ThingCategoryCreature); + } + + g_lua.callGlobalField("g_game", "onOpenOutfitWindow", virtualOutfitCreature, outfitList, virtualMountCreature, mountList, familiarList, wingsList, aurasList, effectList, shaderList); } void Game::processOpenNpcTrade(const std::vector>& items) diff --git a/src/client/game.h b/src/client/game.h index b902e9d94e..7e444abb80 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -477,6 +477,7 @@ class Game // outfit void processOpenOutfitWindow(const Outfit& currentOutfit, const std::vector>& outfitList, const std::vector>& mountList, + const std::vector>& familiarList, const std::vector>& wingsList, const std::vector>& aurasList, const std::vector>& effectsList, diff --git a/src/client/outfit.cpp b/src/client/outfit.cpp index 5f190f941f..05845575c8 100644 --- a/src/client/outfit.cpp +++ b/src/client/outfit.cpp @@ -118,6 +118,7 @@ void Outfit::resetClothes() setLegs(0); setFeet(0); setMount(0); + setFamiliar(0); setWing(0); setAura(0); setEffect(0); diff --git a/src/client/outfit.h b/src/client/outfit.h index ad7e6c1e29..81b647d2ee 100644 --- a/src/client/outfit.h +++ b/src/client/outfit.h @@ -39,6 +39,7 @@ class Outfit void setId(uint16_t id) { m_id = id; } void setAuxId(uint16_t id) { m_auxId = id; } void setMount(uint16_t mount) { m_mount = mount; } + void setFamiliar(uint16_t familiar) { m_familiar = familiar; } void setWing(uint16_t Wing) { m_wing = Wing; } void setAura(uint16_t Aura) { m_aura = Aura; } void setEffect(uint16_t Effect) { m_effect = Effect; } @@ -58,6 +59,7 @@ class Outfit uint16_t getId() const { return m_id; } uint16_t getAuxId() const { return m_auxId; } uint16_t getMount() const { return m_mount; } + uint16_t getFamiliar() const { return m_familiar; } uint16_t getWing() const { return m_wing; } uint16_t getAura() const { return m_aura; } uint16_t getEffect() const { return m_effect; } @@ -94,6 +96,7 @@ class Outfit m_feet == other.m_feet && m_addons == other.m_addons && m_mount == other.m_mount && + m_familiar == other.m_familiar && m_wing == other.m_wing && m_aura == other.m_aura && m_effect == other.m_effect && @@ -109,6 +112,7 @@ class Outfit uint16_t m_id{ 0 }; uint16_t m_auxId{ 0 }; uint16_t m_mount{ 0 }; + uint16_t m_familiar{ 0 }; uint16_t m_wing{ 0 }; uint16_t m_aura{ 0 }; uint16_t m_effect{ 0 }; diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index f8fbe89e65..8ece278aac 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -2608,17 +2608,21 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) const } } - if (g_game.getClientVersion() >= 1281) { + std::vector > familiarList; + if (g_game.getFeature(Otc::GamePlayerFamiliars)) { const uint16_t familiarCount = msg->getU16(); for (auto i = 0; i < familiarCount; ++i) { - msg->getU16(); // familiar lookType - msg->getString(); // familiar name + const uint16_t familiarLookType = msg->getU16(); // familiar lookType + const auto& familiarName = msg->getString(); // familiar name const uint8_t familiarMode = msg->getU8(); // 0x00 // mode: 0x00 - available, 0x01 store (requires U32 store offerId) if (familiarMode == 1) { msg->getU32(); } + familiarList.emplace_back(familiarLookType, familiarName); } + } + if (g_game.getClientVersion() >= 1281) { msg->getU8(); // Try outfit mode (?) msg->getU8(); // (bool) mounted msg->getU8(); // (bool) randomize mount @@ -2659,7 +2663,7 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg) const } } - g_game.processOpenOutfitWindow(currentOutfit, outfitList, mountList, wingList, auraList, effectList, shaderList); + g_game.processOpenOutfitWindow(currentOutfit, outfitList, mountList, familiarList, wingList, auraList, effectList, shaderList); } void ProtocolGame::parseKillTracker(const InputMessagePtr& msg) diff --git a/src/client/protocolgamesend.cpp b/src/client/protocolgamesend.cpp index 3ab53739af..1ae31cd9b1 100644 --- a/src/client/protocolgamesend.cpp +++ b/src/client/protocolgamesend.cpp @@ -792,8 +792,11 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit) msg->addU8(static_cast(outfit.hasMount())); } + if (g_game.getFeature(Otc::GamePlayerFamiliars)) { + msg->addU16(outfit.getFamiliar()); //familiars + } + if (g_game.getClientVersion() >= 1281) { - msg->addU16(0x00); //familiars msg->addU8(0x00); //randomizeMount } if (g_game.getFeature(Otc::GameWingsAurasEffectsShader)) { From 6e3d65b8517fbbc9949171cb9f6619f5259ad2c9 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:02:52 -0300 Subject: [PATCH 08/15] fix typo --- modules/game_outfit/outfit.lua | 2 +- src/client/game.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 397f795462..162018ef7d 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -1796,7 +1796,7 @@ function accept() if g_game.getFeature(GamePlayerFamiliars) then local player = g_game.getLocalPlayer() if settings.currentPreset > 0 then - settings.presets[settings.currentPreset].mounted = window.configure.familiar.check:isChecked() + settings.presets[settings.currentPreset].familiar = window.configure.familiar.check:isChecked() end end g_game.changeOutfit(tempOutfit) diff --git a/src/client/game.cpp b/src/client/game.cpp index 49403f0774..fae99b6b0a 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -433,7 +433,7 @@ void Game::processOpenOutfitWindow(const Outfit& currentOutfit, const std::vecto if (getFeature(Otc::GamePlayerMounts)) { Outfit familiarOutfit; - familiarOutfit.setId(currentOutfit.getMount()); + familiarOutfit.setId(currentOutfit.getFamiliar()); familiarOutfit.setCategory(ThingCategoryCreature); } From b0ef25be046f87e09ff9372346595482a816743c Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:13:34 -0300 Subject: [PATCH 09/15] fix visible --- modules/game_outfit/outfit.lua | 48 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 162018ef7d..da77fd0d20 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -345,29 +345,6 @@ function create(player, outfitList, creatureMount, mountList, familiarList, wing window = g_ui.displayUI("outfitwindow") - local checks = {{window.preview.options.showWings, ServerData.wings}, - {window.preview.options.showAura, ServerData.auras}, - {window.preview.options.showShader, ServerData.shaders}, - {window.preview.options.showBars, ServerData.healthBars}, - {window.preview.options.showEffects, ServerData.effects}, - {window.preview.options.showTitle, ServerData.title}, - - {window.appearance.settings.wings, ServerData.wings}, - {window.appearance.settings.aura, ServerData.auras}, - {window.appearance.settings.shader, ServerData.shaders}, - {window.appearance.settings.healthBar, ServerData.healthBars}, - {window.appearance.settings.effects, ServerData.effects}, - {window.appearance.settings.title, ServerData.title}} - - for _, check in ipairs(checks) do - local widget, data = check[1], check[2] - if not table.empty(data) then - widget:setVisible(true) - else - widget:setVisible(false) - end - end - floor = window.preview.panel.floor for i = 1, floorTiles * floorTiles do g_ui.createWidget("FloorTile", floor) @@ -520,6 +497,31 @@ function create(player, outfitList, creatureMount, mountList, familiarList, wing window.preview.options.showFamiliar:setVisible(g_game.getFeature(GamePlayerFamiliars)) window.appearance.settings.familiar:setVisible(g_game.getFeature(GamePlayerFamiliars)) + + local checks = {{window.preview.options.showWings, ServerData.wings}, + {window.preview.options.showAura, ServerData.auras}, + {window.preview.options.showShader, ServerData.shaders}, + {window.preview.options.showBars, ServerData.healthBars}, + {window.preview.options.showEffects, ServerData.effects}, + {window.preview.options.showTitle, ServerData.title}, + {window.preview.options.showFamiliar, ServerData.familiars}, + + {window.appearance.settings.familiar, ServerData.familiars}, + {window.appearance.settings.wings, ServerData.wings}, + {window.appearance.settings.aura, ServerData.auras}, + {window.appearance.settings.shader, ServerData.shaders}, + {window.appearance.settings.healthBar, ServerData.healthBars}, + {window.appearance.settings.effects, ServerData.effects}, + {window.appearance.settings.title, ServerData.title}} + + for _, check in ipairs(checks) do + local widget, data = check[1], check[2] + if not table.empty(data) then + widget:setVisible(true) + else + widget:setVisible(false) + end + end window.listSearch.search.onKeyPress = onFilterSearch previewCreature:getCreature():setDirection(2) From e35c8ea52ca358724c0f196dd826391662890e90 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:24:24 -0300 Subject: [PATCH 10/15] fix typo again --- src/client/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/game.cpp b/src/client/game.cpp index fae99b6b0a..31cff5e678 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -431,7 +431,7 @@ void Game::processOpenOutfitWindow(const Outfit& currentOutfit, const std::vecto virtualMountCreature->setOutfit(mountOutfit); } - if (getFeature(Otc::GamePlayerMounts)) { + if (getFeature(Otc::GamePlayerFamiliars)) { Outfit familiarOutfit; familiarOutfit.setId(currentOutfit.getFamiliar()); familiarOutfit.setCategory(ThingCategoryCreature); From d681cc87372c8c640975dae5408d3937c478ee08 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:46:44 -0300 Subject: [PATCH 11/15] feat: show Only Mine game_outfit --- data/styles/40-outfitwindow.otui | 12 ++++++-- modules/game_outfit/outfit.lua | 47 ++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/data/styles/40-outfitwindow.otui b/data/styles/40-outfitwindow.otui index 1fd9089fb8..826a12c3a8 100644 --- a/data/styles/40-outfitwindow.otui +++ b/data/styles/40-outfitwindow.otui @@ -774,12 +774,20 @@ OutfitWindow < MainWindow margin-left: 5 height: 50 text: Filter + + QtCheckBox + id: onlyMine + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + text: "Only mine" + width: 84 TextEdit id: search - anchors.fill: parent + anchors.left: prev.right + anchors.right: parent.right placeholder: Search by name - placeholder-color: #00000077 + placeholder-color: #c0c0c0c0 ScrollablePanel id: presetsList diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index da77fd0d20..1d7e04f4d5 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -3,6 +3,12 @@ local opcodeSystem = { id = 213 } +local statesOutft ={ + available = 0, + store = 1, + goldenOutfitTooltip = 2 +} + local window = nil local appearanceGroup = nil local colorModeGroup = nil @@ -522,9 +528,9 @@ function create(player, outfitList, creatureMount, mountList, familiarList, wing widget:setVisible(false) end end - - window.listSearch.search.onKeyPress = onFilterSearch previewCreature:getCreature():setDirection(2) + window.listSearch.search.onKeyPress = onFilterSearch + window.listSearch.onlyMine.onCheckChange = onFilterOnlyMine end function destroy() @@ -882,9 +888,12 @@ function showOutfits() button.outfit:setCreatureSize(thingType:getRealSize() + 32) end - if outfitData[4] and outfitData[4] ~= 0 then - -- mode: 0x00 - available, 0x01 store (requires U32 store offerId), 0x02 golden outfit tooltip (hardcoded) - button:setImageColor("#49ABFF") + local state = outfitData[4] + if state then + button.state = state + if state ~= statesOutft.available then + button:setImageColor("#49ABFF") + end end button.name:setText(outfitData[2]) @@ -943,8 +952,7 @@ function showMounts() focused = mountData[1] end - if mountData[3] and mountData[3] ~= 0 then - -- mode: 0x00 - available, 0x01 store (requires U32 store offerId) + if mountData[3] and mountData[3] ~= statesOutft.available then button:setImageColor("#49ABFF") end end @@ -1540,17 +1548,6 @@ end function updatePreview() local direction = previewCreature:getDirection() - - --[[ - without c++ - g_lua.bindClassMemberFunction("getDirection", &UICreature::getDirection); - - local direction = previewCreature:getCreature():getDirection() -> Not work - local direction= previewCreature:getDirection() ->not work - print(g_game.getLocalPlayer():getCreature():getDirection()) -> - - ]] - local previewOutfit = table.copy(tempOutfit) if not settings.showOutfit then @@ -1668,6 +1665,20 @@ function rotate(value) floor:setMargin(0) end +function onFilterOnlyMine(self, checked) + addEvent(function() + local children = window.selectionList:getChildren() + for _, child in ipairs(children) do + if checked and (not child.state or child.state ~= 0) then + child:hide() + else + child:show() + end + end + end) +end + + function onFilterSearch() addEvent(function() local searchText = window.listSearch.search:getText():lower():trim() From bb7ccf6b46b204feda284f7efc1ad23cd5c8887a Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 02:05:23 -0300 Subject: [PATCH 12/15] fix only mine mount --- data/styles/40-outfitwindow.otui | 4 ++-- modules/game_outfit/outfit.lua | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/data/styles/40-outfitwindow.otui b/data/styles/40-outfitwindow.otui index 826a12c3a8..092aca8885 100644 --- a/data/styles/40-outfitwindow.otui +++ b/data/styles/40-outfitwindow.otui @@ -45,7 +45,7 @@ PresetButton < Panel $focus: border: 1 white - image-color: #ffffff + UICreature id: creature @@ -105,7 +105,7 @@ SelectionButton < Panel $focus: border: 1 white - image-color: #ffffff + UICreature id: outfit diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 1d7e04f4d5..5fc19dfb09 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -952,8 +952,12 @@ function showMounts() focused = mountData[1] end - if mountData[3] and mountData[3] ~= statesOutft.available then - button:setImageColor("#49ABFF") + local state = mountData[3] + if state then + button.state = state + if state ~= statesOutft.available then + button:setImageColor("#49ABFF") + end end end @@ -1670,6 +1674,7 @@ function onFilterOnlyMine(self, checked) local children = window.selectionList:getChildren() for _, child in ipairs(children) do if checked and (not child.state or child.state ~= 0) then + window.selectionList:focusChild(nil) child:hide() else child:show() From 597a3c5d55e58af8c758e6aa58e403c47a77fd23 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 02:07:12 -0300 Subject: [PATCH 13/15] Update outfit.lua --- modules/game_outfit/outfit.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 5fc19dfb09..d077edfed9 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -931,6 +931,7 @@ function showMounts() local button = g_ui.createWidget("SelectionButton", window.selectionList) button:setId(0) button.name:setText("None") + button.state = 0 focused = 0 for _, mountData in ipairs(ServerData.mounts) do From aac3d8fda95f81c85ab03f13e63ccf54caadf9d5 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:58:15 -0300 Subject: [PATCH 14/15] fix: button qt --- .../images/ui/button-blue-qt.png | Bin data/images/ui/button-grey-qt.png | Bin 0 -> 10760 bytes data/styles/40-outfitwindow.otui | 6 ++---- modules/game_outfit/outfit.lua | 4 ++-- modules/game_store/style/ui.otui | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) rename modules/game_store/images/button-blue-down.png => data/images/ui/button-blue-qt.png (100%) create mode 100644 data/images/ui/button-grey-qt.png diff --git a/modules/game_store/images/button-blue-down.png b/data/images/ui/button-blue-qt.png similarity index 100% rename from modules/game_store/images/button-blue-down.png rename to data/images/ui/button-blue-qt.png diff --git a/data/images/ui/button-grey-qt.png b/data/images/ui/button-grey-qt.png new file mode 100644 index 0000000000000000000000000000000000000000..8af3f94e247ab83b77ebfd54cad76ce44b2cebea GIT binary patch literal 10760 zcmb_?2|UyP|M=)4(nd*=V<^h8nLDA3ko)LxHf%YXVb)xsQs#(gZc%bYqYvg@WIj}` zN=9argtQDvBiH}k=lXsB|Ht=tJbsV=`|;TJe!t$&*YiGJ&(~`Sb~b1B?3UaO0)h5e zm?Is4UoYTeC%_MUV+lH2z>i>%`9(YkBqa9h!w1UEmjHowX8Ji@2)$r!rSFZys-b*v zUTC#2Y!Cnq0vQ;E1);nH(4n$k=*xbAC!zB#ZBSW1pOet@TGlY@AQQB&pLs+G+A+e$ z$vYyzTh9k-WGHJ8rVk*%qC-)#Vc08yc>S=G&_D3%1NXm%)uFO~fP@B|gr53EQ1*hg zovaBi1TCwl23Pfl!8Bxb^wfO3PzWCsLPb^srh!n0YpBB!sxU2mn6|#Ap6p*26d)Jk zgVA?Dn*Bu#csdF74Gj&_S63$ziE2cI8ZP9rI$TdrPaUSAuA!j{K&axw14B_^s)2a< zzcC=uc<&Iupin1^zNR(+qzXg)2Poh(KB!RCe+%s6t&hQlU{Qd;epu9Hw0cnBWvJ{w zYScHuUBQI_gaPgle{f-Kt#1*C4@Cufqb-mpp@7V4ettgs+IpH^2pv65RUec#TvZpN zsi~@`3&W^td1JKUJ{lTmT^;n_^N~1j!Y|AIn*XPl`{29*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=z3Ok!bE%N+zlO2otU z%T|1vGe+5Kx;Dhpda-hsN5x}Jw<iN;^1HjRt6{k6R`Bsnm z&kjf$as_a!tZNe@?E?ezhS5>0UxXS8dAE#=+9o}>ey+W)T?5kez)DBk8ux_ZeQ9>v z76#YH5>SqsfK*Ouvdtb~b46$kY^^RI(uiy7<-7eeIvBID!xn*dmIuq=C3Otd&DX&&cLai^Nv2#%8Az1sBVB?1-cg z@eOSIj$Pl%Z5(CqBk%^MA|LoP=rGw!FBPLV7H1QTqE@DX^o%+T?aUUK&c`b+?#>Sr zWwU@%rrGxROQ>%7k7n%kZZ3HKLt@$|1J9egI%SX7EBjngNIZp!lNK{=Y&yjLe$OE> z_tua?Lg<`g7TC#TYm`AHe+)!nHUfzDlJs7d?!0-?oBfW!N|~WGF1{m zc7x5%kl+T}Lc_)G)IuOSNsZLNY2s{U10yik>_wj3>ugtpjMuJ0RZ>&1-I=5-)UHAN zvo?KfwK9dOA?&}i;f!$hq)@RZC+y^d{TLv<7jng4Wu)03K)g8hrtw!W`>JUIyO!tn@Bb!~x)tQqthCN) zh8i0b@Ba*u1VK2I1P(0=^;s1&xlaM?4BJqqW;+BPc z$MQL4Rg7UneG+RQ=%eW_Vr~j@5*8=Pa!DGd2rM1eVI2<2ntBvZnorDBR1y%%i?FOo zYD1o2H_2c69t$Y1(5Nly!x%>6dN4}mSehY z;j@gkwU)NEytdUm_Rw=nb|Fy+cNnn?#**}1Tzj4f)UawsV~^x@X*({|vqjvWb_{fhn?`&S p!rvYf)T0|TQtOIzncq5a?Y!j7?MlhsU;ov#FttHeoxXJA{{U)g8GQf% literal 0 HcmV?d00001 diff --git a/data/styles/40-outfitwindow.otui b/data/styles/40-outfitwindow.otui index 092aca8885..eea0cc5a1a 100644 --- a/data/styles/40-outfitwindow.otui +++ b/data/styles/40-outfitwindow.otui @@ -95,14 +95,12 @@ PresetButton < Panel text: Save SelectionButton < Panel - image-source: /images/ui/button - image-color: #dfdfdf - image-clip: 0 0 22 23 + image-source: /images/ui/button-grey-qt + image-clip: 0 0 98 40 image-border: 3 border: 1 alpha focusable: true phantom: false - $focus: border: 1 white diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index d077edfed9..18f4107b83 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -892,7 +892,7 @@ function showOutfits() if state then button.state = state if state ~= statesOutft.available then - button:setImageColor("#49ABFF") + button:setImageSource("/images/ui/button-blue-qt") end end @@ -957,7 +957,7 @@ function showMounts() if state then button.state = state if state ~= statesOutft.available then - button:setImageColor("#49ABFF") + button:setImageSource("/images/ui/button-blue-qt") end end end diff --git a/modules/game_store/style/ui.otui b/modules/game_store/style/ui.otui index 0cfd3c6a1a..d84d40c384 100644 --- a/modules/game_store/style/ui.otui +++ b/modules/game_store/style/ui.otui @@ -288,7 +288,7 @@ confirmarSHOP < UIMessageBox anchors.left: Box.right anchors.top: content.bottom margin-left:16 - image-source: /game_store/images/button-blue-down + image-source: /images/ui/button-blue-qt image-border: 1 text-wrap: true image-clip: 0 0 98 40 From c3429ebab9190e16f7c826fb7b09a13395a7c69b Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:56:15 -0300 Subject: [PATCH 15/15] bad merge of Nottinghster --- src/client/outfit.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/outfit.h b/src/client/outfit.h index 41d77dd2fd..42964bfd99 100644 --- a/src/client/outfit.h +++ b/src/client/outfit.h @@ -36,13 +36,13 @@ class Outfit public: static Color getColor(int color); - void setId(uint16_t id) { m_id = id; } - void setAuxId(uint16_t id) { m_auxId = id; } - void setMount(uint16_t mount) { m_mount = mount; } - void setFamiliar(uint16_t familiar) { m_familiar = familiar; } - void setWing(uint16_t Wing) { m_wing = Wing; } - void setAura(uint16_t Aura) { m_aura = Aura; } - void setEffect(uint16_t Effect) { m_effect = Effect; } + void setId(const uint16_t id) { m_id = id; } + void setAuxId(const uint16_t id) { m_auxId = id; } + void setMount(const uint16_t mount) { m_mount = mount; } + void setFamiliar(const uint16_t familiar) { m_familiar = familiar; } + void setWing(const uint16_t Wing) { m_wing = Wing; } + void setAura(const uint16_t Aura) { m_aura = Aura; } + void setEffect(const uint16_t Effect) { m_effect = Effect; } void setShader(const std::string& shader) { m_shader = shader; } void setHead(uint8_t head);