From 9e83c219e7bc707c9366a7d5814850615ae12b7a Mon Sep 17 00:00:00 2001 From: Maksym H Date: Tue, 22 Nov 2022 12:03:13 +0200 Subject: [PATCH] Move GUI textures in separate folder --- builtin/fstk/buttonbar.lua | 18 +++++++++++------- builtin/fstk/tabview.lua | 14 ++++++++------ builtin/mainmenu/common.lua | 2 +- builtin/mainmenu/init.lua | 1 + textures/base/pack/btn_play.png | Bin 1005 -> 0 bytes textures/base/pack/btn_play_hover.png | Bin 984 -> 0 bytes textures/base/pack/{ => gui}/authors_menu.png | Bin .../pack/{ => gui}/authors_menu_hover.png | Bin .../pack/{ => gui}/authors_menu_selected.png | Bin textures/base/pack/{ => gui}/btn_down.png | Bin .../base/pack/{ => gui}/btn_down_hover.png | Bin textures/base/pack/{ => gui}/btn_download.png | Bin .../pack/{ => gui}/btn_download_hover.png | Bin textures/base/pack/{ => gui}/btn_up.png | Bin textures/base/pack/{ => gui}/btn_up_hover.png | Bin .../base/pack/{ => gui}/settings_menu.png | Bin .../pack/{ => gui}/settings_menu_hover.png | Bin .../pack/{ => gui}/settings_menu_selected.png | Bin textures/base/pack/{ => gui}/side_menu.png | Bin .../base/pack/{ => gui}/side_menu_divider.png | Bin .../base/pack/{ => gui}/side_menu_left.png | Bin .../pack/{ => gui}/upper_buttons_left.png | Bin .../{ => gui}/upper_buttons_left_hover.png | Bin .../{ => gui}/upper_buttons_left_selected.png | Bin .../pack/{ => gui}/upper_buttons_middle.png | Bin .../{ => gui}/upper_buttons_middle_hover.png | Bin .../upper_buttons_middle_selected.png | Bin .../pack/{ => gui}/upper_buttons_right.png | Bin .../{ => gui}/upper_buttons_right_hover.png | Bin .../upper_buttons_right_selected.png | Bin textures/base/pack/select_btn.png | Bin 525 -> 0 bytes 31 files changed, 21 insertions(+), 14 deletions(-) delete mode 100644 textures/base/pack/btn_play.png delete mode 100644 textures/base/pack/btn_play_hover.png rename textures/base/pack/{ => gui}/authors_menu.png (100%) rename textures/base/pack/{ => gui}/authors_menu_hover.png (100%) rename textures/base/pack/{ => gui}/authors_menu_selected.png (100%) rename textures/base/pack/{ => gui}/btn_down.png (100%) rename textures/base/pack/{ => gui}/btn_down_hover.png (100%) rename textures/base/pack/{ => gui}/btn_download.png (100%) rename textures/base/pack/{ => gui}/btn_download_hover.png (100%) rename textures/base/pack/{ => gui}/btn_up.png (100%) rename textures/base/pack/{ => gui}/btn_up_hover.png (100%) rename textures/base/pack/{ => gui}/settings_menu.png (100%) rename textures/base/pack/{ => gui}/settings_menu_hover.png (100%) rename textures/base/pack/{ => gui}/settings_menu_selected.png (100%) rename textures/base/pack/{ => gui}/side_menu.png (100%) rename textures/base/pack/{ => gui}/side_menu_divider.png (100%) rename textures/base/pack/{ => gui}/side_menu_left.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_left.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_left_hover.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_left_selected.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_middle.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_middle_hover.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_middle_selected.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_right.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_right_hover.png (100%) rename textures/base/pack/{ => gui}/upper_buttons_right_selected.png (100%) delete mode 100644 textures/base/pack/select_btn.png diff --git a/builtin/fstk/buttonbar.lua b/builtin/fstk/buttonbar.lua index c051d7aa8..5b480d82f 100644 --- a/builtin/fstk/buttonbar.lua +++ b/builtin/fstk/buttonbar.lua @@ -23,7 +23,8 @@ local function buttonbar_formspec(self) end local formspec = string.format("background9[%f,%f;%f,%f;%sside_menu_left.png;false;30]", - self.pos.x, self.pos.y - 0.1, self.size.x + 0.025, self.size.y + 0.35, defaulttexturedir_esc) + self.pos.x, self.pos.y - 0.1, self.size.x + 0.025, self.size.y + 0.35, + defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc) for i=self.startbutton,#self.buttons,1 do local btn_name = self.buttons[i].name @@ -59,9 +60,10 @@ local function buttonbar_formspec(self) end if button.cdb then + local tpath = defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc formspec = formspec .. - "style[" .. btn_name .. ";bgimg=" .. defaulttexturedir_esc .. - "btn_download.png;bgimg_hovered=" .. defaulttexturedir_esc .. "btn_download_hover.png]" .. + "style[" .. btn_name .. ";bgimg=" .. tpath .. + "btn_download.png;bgimg_hovered=" .. tpath .. "btn_download_hover.png]" .. ("image_button[%f,%f;%f,%f;;%s;%s;true;%s]tooltip[%s;%s]"):format( btn_pos.x, btn_pos.y, self.btn_size, self.btn_size, @@ -117,16 +119,18 @@ local function buttonbar_formspec(self) btn_inc_pos.x, btn_inc_pos.y, btn_size.x, btn_size.y, self.name, text_inc) else + local tpath = defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc + formspec = formspec .. - "style[btnbar_dec_" .. self.name .. ";bgimg=" .. defaulttexturedir_esc .. - "btn_up.png;bgimg_hovered=" .. defaulttexturedir_esc .. "btn_up_hover.png]" .. + "style[btnbar_dec_" .. self.name .. ";bgimg=" .. tpath .. + "btn_up.png;bgimg_hovered=" .. tpath .. "btn_up_hover.png]" .. ("image_button[%f,%f;%f,%f;;btnbar_dec_%s;;true;false]"):format( btn_dec_pos.x, btn_dec_pos.y, btn_size.x, btn_size.y, self.name) formspec = formspec .. - "style[btnbar_inc_" .. self.name .. ";bgimg=" .. defaulttexturedir_esc .. - "btn_down.png;bgimg_hovered=" .. defaulttexturedir_esc .. "btn_down_hover.png]" .. + "style[btnbar_inc_" .. self.name .. ";bgimg=" .. tpath .. + "btn_down.png;bgimg_hovered=" .. tpath .. "btn_down_hover.png]" .. ("image_button[%f,%f;%f,%f;;btnbar_inc_%s;;true;false]"):format( btn_inc_pos.x, btn_inc_pos.y, btn_size.x, btn_size.y, self.name) diff --git a/builtin/fstk/tabview.lua b/builtin/fstk/tabview.lua index 8c54ea93f..9360839a2 100644 --- a/builtin/fstk/tabview.lua +++ b/builtin/fstk/tabview.lua @@ -69,13 +69,14 @@ end -------------------------------------------------------------------------------- local function make_side_pane_tab(y, tab_name, tooltip, selected) + local tpath = defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc local formspec = "style[" .. tab_name .. "_tab;bgimg=" .. - defaulttexturedir_esc .. tab_name + tpath .. tab_name if selected then formspec = formspec .. "_menu_selected.png]" else formspec = formspec .. "_menu.png;bgimg_hovered=" .. - defaulttexturedir_esc .. tab_name .. "_menu_hover.png]" + tpath .. tab_name .. "_menu_hover.png]" end return formspec .. @@ -92,6 +93,7 @@ local function get_formspec(self) if self.parent == nil then local tsize = self.tablist[self.last_tab_index].tabsize or {width=self.width, height=self.height} + local tpath = defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc formspec = formspec .. string.format("size[%f,%f,%s]",tsize.width + 2,tsize.height + 1, dump(self.fixed_size)) .. @@ -102,9 +104,9 @@ local function get_formspec(self) tsize.height + 1.75 .. ";" .. defaulttexturedir_esc .. "bg_common.png;false;40]" .. - "background9[12.13,1.05;0.9,2.6;" .. defaulttexturedir_esc .. "side_menu.png;false;30]" .. + "background9[12.13,1.05;0.9,2.6;" .. tpath .. "side_menu.png;false;30]" .. make_side_pane_tab(0.9, "settings", fgettext("Settings"), name == "settings") .. - "image[12.15,2.26;0.9,0.06;" .. defaulttexturedir_esc .. "side_menu_divider.png]" .. + "image[12.15,2.26;0.9,0.06;" .. tpath .. "side_menu_divider.png]" .. make_side_pane_tab(2.3, "authors", fgettext("Credits"), name == "credits") end @@ -237,13 +239,13 @@ local function button_header(self) local btn_name = self.name .. "_" .. i toadd = toadd .. "style[" .. btn_name .. ";padding=-10;bgimg=" .. defaulttexturedir_esc .. - texture + DIR_DELIM_esc .. "gui" .. DIR_DELIM_esc .. texture if i == math.abs(self.last_tab_index) then toadd = toadd .. "_selected.png;" else toadd = toadd .. ".png;bgimg_hovered=" .. defaulttexturedir_esc .. - texture .. "_hover.png;" + DIR_DELIM_esc .. "gui" .. DIR_DELIM_esc .. texture .. "_hover.png;" end toadd = toadd .. "bgimg_middle=20;content_offset=0]" .. diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index 4bea5fdec..7c31a3649 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -314,7 +314,7 @@ function is_high_dpi() end -------------------------------------------------------------------------------- function btn_style(field, color) - local button_path = defaulttexturedir_esc .. "gui" .. DIR_DELIM + local button_path = defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc local btn_size = is_high_dpi() and ".x2" or "" color = (color and "_" .. color) or "" diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 516b0609e..6bfc861bb 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -27,6 +27,7 @@ local mobile = PLATFORM == "Android" or PLATFORM == "iOS" defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" .. DIR_DELIM .. "pack" .. DIR_DELIM defaulttexturedir_esc = core.formspec_escape(defaulttexturedir) +DIR_DELIM_esc = core.formspec_escape(DIR_DELIM) -- for use in formspecs only dofile(basepath .. "common" .. DIR_DELIM .. "filterlist.lua") dofile(basepath .. "fstk" .. DIR_DELIM .. "buttonbar.lua") diff --git a/textures/base/pack/btn_play.png b/textures/base/pack/btn_play.png deleted file mode 100644 index c59fde69f15c7574b87fa1aca3f9a11ca5c19d37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1005 zcmV0001TP)t-sb)MR0 zl-5{^(n^5OvBB=d(DJ0V>!Y>nn5^iKrRIpAWmg0St;evvK-{0R}US5Bg;xksRho9w$pyrjT=pa6a z9Xx6=RjqzGB}f1O12#!SK~#7F?cD`(BQX$#VQ0w9%((Zz;>y!@I;1Mqv=yl*@81nd z4(LnCY&WR4x5Sj9NJ^3h2O|IsM#zYwLFH}Wu3A#?RJSt2N8&pq$ql2 zImJ*+#R1D>gw!_;280Bn_=#wn>-C1iEE`p9JeD4k-pXg&=LimAndL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