diff --git a/builtin/fstk/tabview.lua b/builtin/fstk/tabview.lua index 3f424d1b6..1ad1e1999 100644 --- a/builtin/fstk/tabview.lua +++ b/builtin/fstk/tabview.lua @@ -56,24 +56,34 @@ local function add_tab(self,tab) end end +local function get_bg(tsize, tabname) + tabname = tabname or "common" + return "background[0,0;" .. tsize.width .. "," .. tsize.height .. ";" .. + core.formspec_escape(defaulttexturedir .. + "multicraft_" .. tabname .. "_bg.png") .. ";true]" +end + -------------------------------------------------------------------------------- local function get_formspec(self) local formspec = "" + local name = self.tablist[self.last_tab_index].name + local tabname = name == "local" and name or nil if not self.hidden and (self.parent == nil or not self.parent.hidden) then - if self.parent == nil then local tsize = self.tablist[self.last_tab_index].tabsize or {width=self.width, height=self.height} + formspec = formspec .. - string.format("size[%f,%f,%s]",tsize.width,tsize.height, - dump(self.fixed_size)) + string.format("size[%f,%f,%s]",tsize.width,tsize.height, + dump(self.fixed_size)) + + formspec = formspec .. get_bg(tsize, tabname) end formspec = formspec .. self:tab_header() formspec = formspec .. self.tablist[self.last_tab_index].get_formspec( - self, - self.tablist[self.last_tab_index].name, + self, name, self.tablist[self.last_tab_index].tabdata, self.tablist[self.last_tab_index].tabsize ) diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index 8791efec9..3bb2aa43d 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -31,20 +31,31 @@ local function get_formspec(tabview, name, tabdata) ) retval = retval .. - "button[3.5,4.5;2.6,0.5;world_delete;".. fgettext("Delete") .. "]" .. - "button[6,4.5;2.8,0.5;world_create;".. fgettext("New") .. "]" + "image_button[0.45,4.9;2.9,0.8;" .. + core.formspec_escape(defaulttexturedir .. + "multicraft_local_delete_btn.png") .. ";world_delete;;true;false]" .. + "image_button[3.14,4.9;2.9,0.8;" .. + core.formspec_escape(defaulttexturedir .. + "multicraft_local_new_btn.png") .. ";world_create;;true;false]" + + local creative_mode = core.settings:get_bool("creative_mode") + retval = retval .. - "button[8.7,4.5;3.30,0.5;play;".. fgettext("Play") .. "]" .. - "checkbox[0.0,4.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" .. - dump(core.settings:get_bool("creative_mode")) .. "]".. - "textlist[0,0;11.75,3.7;sp_worlds;" .. + "image_button[7,1.5;4.5,1.27;" .. + core.formspec_escape(defaulttexturedir .. + "multicraft_local_play_btn.png") .. ";play;;true;false]" .. + "image_button[7.25,3.15;4.05,0.8;" .. + core.formspec_escape(defaulttexturedir .. + "multicraft_local_creative_" .. + tostring(creative_mode) .. "_btn.png") .. + ";cb_creative_mode;;true;false]" .. + "textlist[0,0;6.25,4.63;sp_worlds;" .. menu_render_worldlist() .. ";" .. index .. ";true]" return retval end local function main_button_handler(this, fields, name, tabdata) - assert(name == "local") local world_doubleclick = false @@ -70,17 +81,13 @@ local function main_button_handler(this, fields, name, tabdata) return true end - if fields["cb_creative_mode"] then - core.settings:set("creative_mode", fields["cb_creative_mode"]) - local bool = fields["cb_creative_mode"] - if bool == 'true' then - bool = 'false' - else - bool = 'true' - end - core.settings:set("enable_damage", bool) - return true - end + if fields.cb_creative_mode then + local creative_mode = core.settings:get_bool("creative_mode") + core.settings:set("creative_mode", tostring((not creative_mode))) + core.settings:set("enable_damage", tostring(creative_mode)) + + return true + end if fields["cb_server"] then core.settings:set("enable_server", fields["cb_server"]) diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index f9273b206..8448daad1 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -33,8 +33,8 @@ local function get_formspec(tabview, name, tabdata) local retval = -- Search - "field[0.15,0.35;6.05,0.27;te_search;;"..core.formspec_escape(tabdata.search_for).."]".. - "button[5.8,0.1;2,0.1;btn_mp_search;" .. fgettext("Search") .. "]" .. + "field[0.15,0.5;6.05,0.27;te_search;;"..core.formspec_escape(tabdata.search_for).."]".. + "button[5.8,0.25;2,0.1;btn_mp_search;" .. fgettext("Search") .. "]" .. -- Address / Port "label[7.75,-0.25;" .. fgettext("Address / Port") .. "]" .. @@ -79,7 +79,7 @@ local function get_formspec(tabview, name, tabdata) image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" .. "color,span=1;" .. "text,padding=1]" .. - "table[-0.15,0.6;7.75,5.15;favourites;" + "table[-0.15,0.8;7.75,4.75;favourites;" if menudata.search_result then for i = 1, #menudata.search_result do diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 5b8016ca6..d05b87b84 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -166,7 +166,7 @@ void set_default_settings(Settings *settings) settings->setDefault("crosshair_alpha", "255"); settings->setDefault("hud_scaling", "1.0"); settings->setDefault("gui_scaling", "1.0"); - settings->setDefault("gui_scaling_filter", "false"); + settings->setDefault("gui_scaling_filter", "true"); settings->setDefault("gui_scaling_filter_txr2img", "true"); settings->setDefault("desynchronize_mapblock_texture_animation", "true"); settings->setDefault("hud_hotbar_max_width", "1.0"); diff --git a/textures/base/multicraft_common_bg.png b/textures/base/multicraft_common_bg.png new file mode 100644 index 000000000..a2abbb6ec Binary files /dev/null and b/textures/base/multicraft_common_bg.png differ diff --git a/textures/base/multicraft_local_bg.png b/textures/base/multicraft_local_bg.png new file mode 100644 index 000000000..0968add91 Binary files /dev/null and b/textures/base/multicraft_local_bg.png differ diff --git a/textures/base/multicraft_local_creative_false_btn.png b/textures/base/multicraft_local_creative_false_btn.png new file mode 100644 index 000000000..4a595f437 Binary files /dev/null and b/textures/base/multicraft_local_creative_false_btn.png differ diff --git a/textures/base/multicraft_local_creative_true_btn.png b/textures/base/multicraft_local_creative_true_btn.png new file mode 100644 index 000000000..9139a217f Binary files /dev/null and b/textures/base/multicraft_local_creative_true_btn.png differ diff --git a/textures/base/multicraft_local_delete_btn.png b/textures/base/multicraft_local_delete_btn.png new file mode 100644 index 000000000..58ee85bb1 Binary files /dev/null and b/textures/base/multicraft_local_delete_btn.png differ diff --git a/textures/base/multicraft_local_new_btn.png b/textures/base/multicraft_local_new_btn.png new file mode 100644 index 000000000..bd0464a21 Binary files /dev/null and b/textures/base/multicraft_local_new_btn.png differ diff --git a/textures/base/multicraft_local_play_btn.png b/textures/base/multicraft_local_play_btn.png new file mode 100644 index 000000000..6faf6e14c Binary files /dev/null and b/textures/base/multicraft_local_play_btn.png differ diff --git a/worlds/World 1/world.mt b/worlds/World 1/world.mt index 9fcd09097..8e2686024 100644 --- a/worlds/World 1/world.mt +++ b/worlds/World 1/world.mt @@ -1 +1 @@ -gameid = default \ No newline at end of file +gameid = default diff --git a/worlds/World 2/world.mt b/worlds/World 2/world.mt index 9fcd09097..8e2686024 100644 --- a/worlds/World 2/world.mt +++ b/worlds/World 2/world.mt @@ -1 +1 @@ -gameid = default \ No newline at end of file +gameid = default diff --git a/worlds/World 3/world.mt b/worlds/World 3/world.mt index 9fcd09097..8e2686024 100644 --- a/worlds/World 3/world.mt +++ b/worlds/World 3/world.mt @@ -1 +1 @@ -gameid = default \ No newline at end of file +gameid = default diff --git a/worlds/World 4/world.mt b/worlds/World 4/world.mt index 9fcd09097..8e2686024 100644 --- a/worlds/World 4/world.mt +++ b/worlds/World 4/world.mt @@ -1 +1 @@ -gameid = default \ No newline at end of file +gameid = default diff --git a/worlds/World 5 Flat/world.mt b/worlds/World 5 Flat/world.mt index 9fcd09097..8e2686024 100644 --- a/worlds/World 5 Flat/world.mt +++ b/worlds/World 5 Flat/world.mt @@ -1 +1 @@ -gameid = default \ No newline at end of file +gameid = default