From 914ea881a4d4aef397c0d0b9f70e99c7b1f91234 Mon Sep 17 00:00:00 2001 From: Vanic Date: Thu, 26 Mar 2026 21:37:13 +0300 Subject: [PATCH] `PlayerInventoryUI`: update backgrounds textures. #34 --- .../src/PlayerInventoryUI.lua | 36 ++++++------------ .../src/PlayerInventoryUI/getBagPane.lua | 2 +- .../src/PlayerInventoryUI/getCraftPane.lua | 4 +- .../src/PlayerInventoryUI/getEquipPane.lua | 2 +- .../src/PlayerInventoryUI/getRefPane.lua | 2 +- .../PlayerInventoryUI/getSelectPaneMenu.lua | 2 +- .../player_inventory_middle_background.png | Bin 79203 -> 67919 bytes .../player_inventory_pane_background.png | Bin 0 -> 101860 bytes 8 files changed, 18 insertions(+), 30 deletions(-) create mode 100644 mods/UI/PlayerInventoryUI/textures/player_inventory_pane_background.png diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua index 9043b71..d7f9250 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua @@ -1,3 +1,5 @@ +local stringMatch = string.match + local BaseUI, Formspec = Smc.requireBaseUI(), Smc.requireFormspec() local require = Mod.getInfo('smc__ui__player_inventory').require @@ -60,14 +62,15 @@ local function getFormSpecString(self, playerName) InventoryForm: - --bgcolor('#00000000'): - listColors('#00000000', '#C4C4C433'): - list('current_player', 'main', 5.5,9.5, 9,2): - background(0, 9, 22, 3.5, 'player_inventory_middle_background.png', false): + bgcolor('#00000000'): + listColors('#00000000', '#e1b69150'): + list('current_player', 'main', 5.5,9.25, 9,1): + list('current_player', 'main', 5.5,10.75, 9,1, 9): + background(0, 9, 22, 3, 'player_inventory_middle_background.png', false): container(panes[leftPaneName](self, playerName, 'left'), 0, 0): container(panes[rightPaneName](self, playerName, 'right'), 11, 0): - button(10.5, 0, .5, .5, 'close_left_pane', 'x'): - button(21.5, 0, .5, .5, 'close_right_pane', 'x') + button(10.25, 0.25, .5, .5, 'close_left_pane', 'x'): + button(21.25, 0.25, .5, .5, 'close_right_pane', 'x') return InventoryForm:toString() end @@ -80,23 +83,6 @@ end ---@field getContex fun(self:PlayerInventoryUI,player:string|Player,key:PlayerInventoryUI.ContexKey):any local PlayerInventoryUI = BaseUI:new('', getFormSpecString, false) ---[[ ----Shows the player their inventory. ----@param playerName string -function PlayerInventoryUI:showForm(playerName) - local player = core.get_player_by_name(playerName) - assert(player ~= nil) - - player:set_inventory_formspec(self:getFormSpecString(playerName)) - core.show_formspec(playerName, '', '') -end - ----Closes the player's inventory. ----@param playerName string -function PlayerInventoryUI:closeForm(playerName) - core.close_formspec(playerName, '') -end--]] - PlayerInventoryUI:registerOnFormFieldAction('close_left_pane', function(player, fieldName, fieldValue) local playerName = player:get_player_name() @@ -105,7 +91,7 @@ PlayerInventoryUI:registerOnFormFieldAction('close_left_pane', function(player, end) PlayerInventoryUI:registerOnFormFieldActionMatch('select_left_%S+', function(player, fieldName, fieldValue) - local paneName = string.match(fieldName, 'select_%S+_(%S+_%S+)') + local paneName = stringMatch(fieldName, 'select_%S+_(%S+_%S+)') assert(paneName ~= nil) local playerName = player:get_player_name() @@ -124,7 +110,7 @@ PlayerInventoryUI:registerOnFormFieldAction('close_right_pane', function(player, end) PlayerInventoryUI:registerOnFormFieldActionMatch('select_right_%S+', function(player, fieldName, fieldValue) - local paneName = string.match(fieldName, 'select_%S+_(%S+_%S+)') + local paneName = stringMatch(fieldName, 'select_%S+_(%S+_%S+)') assert(paneName ~= nil) local playerName = player:get_player_name() diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getBagPane.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getBagPane.lua index 978b112..13ba4fc 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getBagPane.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getBagPane.lua @@ -8,7 +8,7 @@ local BagPane = Formspec:new() ---@return Formspec local function getBagPane(self, playerName, paneType) BagPane: - image(0, 0, 11, 9, 'player_inventory_background_block.png^[colorize:#BF59EE:120'): + image(0, 0, 11, 9, 'player_inventory_pane_background.png'): label(2,2, 'BAG PANE') return BagPane diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftPane.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftPane.lua index d77291c..cc638d0 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftPane.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftPane.lua @@ -1,3 +1,5 @@ +local PrimitiveCraftHandler = Smc.requireCraftSystemPrimitiveCraftHandler() + local Formspec = Smc.requireFormspec() local CraftPane = Formspec:new() @@ -8,7 +10,7 @@ local CraftPane = Formspec:new() ---@return Formspec local function getCraftPane(self, playerName, paneType) CraftPane: - image(0, 0, 11, 9, 'player_inventory_background_block.png^[colorize:#E7CC35:120'): + image(0, 0, 11, 9, 'player_inventory_pane_background.png'): label(2,2, 'CRAFTING PANE') return CraftPane diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipPane.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipPane.lua index 38348de..19f1730 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipPane.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipPane.lua @@ -8,7 +8,7 @@ local EquipPane = Formspec:new() ---@return Formspec local function getEquipPane(self, playerName, paneType) EquipPane: - image(0, 0, 11, 9, 'player_inventory_background_block.png^[colorize:#72FAC6:120'): + image(0, 0, 11, 9, 'player_inventory_pane_background.png'): label(2,2, 'EQUIPMENT PANE') return EquipPane diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getRefPane.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getRefPane.lua index cc91bc8..674b1a9 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getRefPane.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getRefPane.lua @@ -8,7 +8,7 @@ local RefPane = Formspec:new() ---@return Formspec local function getRefPane(self, playerName, paneType) RefPane: - image(0, 0, 11, 9, 'player_inventory_background_block.png^[colorize:#8072FA:120'): + image(0, 0, 11, 9, 'player_inventory_pane_background.png'): label(2,2, 'REFERENCE PANE') return RefPane diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getSelectPaneMenu.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getSelectPaneMenu.lua index 7f7e00b..bbc485c 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getSelectPaneMenu.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getSelectPaneMenu.lua @@ -9,7 +9,7 @@ local selectPaneMenu = Formspec:new() local function getSelectPaneMenu(self, playerName, paneType) selectPaneMenu: - image(0, 0, 11, 9, 'player_inventory_background_block.png^[colorize:#FA8072:120'): + image(0, 0, 11, 9, 'player_inventory_pane_background.png'): button(3.5,2.5,2,2,'select_'..paneType..'_bag_pane', 'bag'): button(5.5,2.5,2,2,'select_'..paneType..'_craft_pane', 'craft'): button(3.5,4.5,2,2,'select_'..paneType..'_equip_pane', 'equip'): diff --git a/mods/UI/PlayerInventoryUI/textures/player_inventory_middle_background.png b/mods/UI/PlayerInventoryUI/textures/player_inventory_middle_background.png index 26cda8930390a3a0a7646db96bfafe6245d98d93..4fa451ed523559fd8caa012a76a2dd6d5f434921 100644 GIT binary patch literal 67919 zcmeI5PiS049LHxh+S;-di?m_URuGCsNot@7HbGK1G%IAWOE2D5ENBmfN~{!nuxLQ^ z;vYKbw=?fw-seH`X5RefH^2GJ z+wXh(-X!zh3*BSQ9jzTosb*)s-BYU357LLW-yi&*ym)z6uxl*#jvZ}W|MtnZg3Q<} zvkS9IUHxF^otN$l@{hhe-&;`X%>znZSW@br;LwFz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2} zr+J27jdWWS>1u}n%kLcdV$$}q@Lkkh%D%puZs*1&Ww+mY8H(kj8M(HhW&DK_>$Hbo zCyy$nqVX($@A7vcu2 ztTVXM7MVewy<6v&ef&1fCU+{q<7>yc?V1)G{eeIQ0)=DS{ku@*L7Kt{(KR32*81&# zepBH(&;$YyfB*y_009U<00Izz00bZa0SG_<0uX=z1Rwx`-V*rmy~R_;Y?_{$96!|C zGvOTq5P$##AOHafKmY;|fB*y_009U<00Iyg2m-?gAANED>BIYNFjMUj7dr CxTZn? diff --git a/mods/UI/PlayerInventoryUI/textures/player_inventory_pane_background.png b/mods/UI/PlayerInventoryUI/textures/player_inventory_pane_background.png new file mode 100644 index 0000000000000000000000000000000000000000..a2bdf80538ec67f63acd3cd3ebac1e5661a738d0 GIT binary patch literal 101860 zcmeI2J!oEK7>3_Zqe+`)u~6Z2sT3?itP+r-6iV8Z<{J_;1hn`=ii09Z0ei9I|LAICT)DSWg3oZs(tK?)Q1FLVA*X@6Y{Q_eG}j z_EYnRC${#th7cwOvoj0H^ONLjICgLH|3?q3zmhz9#}*DB=w16^^3CLjk(a0ErbGDj z?D);2_ar~>d}(%JE`*a0g>dSv5dKYmb!sDo*B=Yv`ceo_z8}K-Jag#E1LeNPanbd@y%t^!nZX`yPDcm%oqxl^hucGt-MFdSQ8OxY|4a>T|b} zW&DFclmtfBH*SQ-r~2X1sfVK+fY3e({CxG-@Z;4#!(BedXKE`1M$$pP`TTPFEl&u@ z6WGz8*v!aZVEL*Dm_-1Av*_@dJOKojuZVzI1Q0lj4xh;rKw$Zb2$)3xfwSoFnLGgm zmam9_Sp*O`i;mi7ubta=Bz+e^Et^0dWELoa2-OK7aCLU<6d-`W0woZkIspW(&W@b| z1Q1xD1R_)?fWXz+u~UEm0t=Ktgz5wkxH>y_3J^eGff9&Nod5z?XU9$f0thTn0uibc z&=+{=#mRBr1*qPzqn-LPJ1T=w%M(E0^32#FL;!(>${< z802yi1a?`wouLufPM0nxL134)+Zh^x?R4pK5(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