|
@ -24,8 +24,8 @@ local function buttonbar_formspec(self)
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local formspec = string.format("box[%f,%f;%f,%f;%s]",
|
local formspec = string.format("background9[%f,%f;%f,%f;%sside_menu_left.png;false;30]",
|
||||||
self.pos.x,self.pos.y ,self.size.x,self.size.y,self.bgcolor)
|
self.pos.x, self.pos.y - 0.1, self.size.x + 0.025, self.size.y + 0.35, defaulttexturedir)
|
||||||
|
|
||||||
for i=self.startbutton,#self.buttons,1 do
|
for i=self.startbutton,#self.buttons,1 do
|
||||||
local btn_name = self.buttons[i].name
|
local btn_name = self.buttons[i].name
|
||||||
|
@ -36,7 +36,7 @@ local function buttonbar_formspec(self)
|
||||||
(i - self.startbutton) * self.btn_size + --button offset
|
(i - self.startbutton) * self.btn_size + --button offset
|
||||||
self.btn_initial_offset
|
self.btn_initial_offset
|
||||||
else
|
else
|
||||||
btn_pos.x = self.pos.x + (self.btn_size * 0.1)
|
btn_pos.x = self.pos.x + (self.btn_size * 0.05)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.orientation == "vertical" then
|
if self.orientation == "vertical" then
|
||||||
|
@ -99,10 +99,10 @@ local function buttonbar_formspec(self)
|
||||||
else
|
else
|
||||||
btn_size.x = self.btn_size
|
btn_size.x = self.btn_size
|
||||||
btn_size.y = self.btn_size * 0.5
|
btn_size.y = self.btn_size * 0.5
|
||||||
btn_dec_pos.x = self.pos.x + (self.btn_size * 0.1)
|
btn_dec_pos.x = self.pos.x + (self.btn_size * 0.05)
|
||||||
btn_dec_pos.y = self.pos.y + (self.btn_size * 0.05)
|
btn_dec_pos.y = self.pos.y + (self.btn_size * 0.05)
|
||||||
btn_inc_pos.x = self.pos.x + (self.btn_size * 0.1)
|
btn_inc_pos.x = self.pos.x + (self.btn_size * 0.05)
|
||||||
btn_inc_pos.y = self.size.y - (self.btn_size * 0.75)
|
btn_inc_pos.y = self.pos.y + self.size.y - (self.btn_size * 0.45)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.orientation == "horizontal" then
|
if self.orientation == "horizontal" then
|
||||||
|
@ -141,7 +141,7 @@ end
|
||||||
local function buttonbar_buttonhandler(self, fields)
|
local function buttonbar_buttonhandler(self, fields)
|
||||||
|
|
||||||
if fields["btnbar_inc_" .. self.name] ~= nil and
|
if fields["btnbar_inc_" .. self.name] ~= nil and
|
||||||
self.startbutton < #self.buttons - 5 then
|
self.startbutton < #self.buttons - 4 then
|
||||||
|
|
||||||
self.startbutton = self.startbutton + 1
|
self.startbutton = self.startbutton + 1
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -85,6 +85,7 @@ function messagebox(name, message)
|
||||||
return dialog_create(name,
|
return dialog_create(name,
|
||||||
function()
|
function()
|
||||||
return ([[
|
return ([[
|
||||||
|
set_focus[ok;true]
|
||||||
textarea[1,1;10,4;;;%s]
|
textarea[1,1;10,4;;;%s]
|
||||||
button[5,4.5;2,0.8;ok;%s]
|
button[5,4.5;2,0.8;ok;%s]
|
||||||
]]):format(message, fgettext("OK"))
|
]]):format(message, fgettext("OK"))
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
-- element.getFormspec() returns formspec of tabview --
|
-- element.getFormspec() returns formspec of tabview --
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local defaulttexturedir = core.formspec_escape(defaulttexturedir)
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
local function add_tab(self,tab)
|
local function add_tab(self,tab)
|
||||||
assert(tab.size == nil or (type(tab.size) == table and
|
assert(tab.size == nil or (type(tab.size) == table and
|
||||||
|
@ -49,6 +51,7 @@ local function add_tab(self,tab)
|
||||||
-- Hidden tabs have a negative index
|
-- Hidden tabs have a negative index
|
||||||
local i
|
local i
|
||||||
if tab.hidden then
|
if tab.hidden then
|
||||||
|
newtab.tabdata.hidden = true
|
||||||
i = -1
|
i = -1
|
||||||
while self.tablist[i] do
|
while self.tablist[i] do
|
||||||
i = i - 1
|
i = i - 1
|
||||||
|
@ -67,6 +70,21 @@ local function add_tab(self,tab)
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
local function make_side_pane_tab(y, tab_name, tooltip, selected)
|
||||||
|
local formspec = "style[" .. tab_name .. "_tab;bgimg=" ..
|
||||||
|
defaulttexturedir .. tab_name
|
||||||
|
if selected then
|
||||||
|
formspec = formspec .. "_menu_selected.png]"
|
||||||
|
else
|
||||||
|
formspec = formspec .. "_menu.png;bgimg_hovered=" ..
|
||||||
|
defaulttexturedir .. tab_name .. "_menu_hover.png]"
|
||||||
|
end
|
||||||
|
|
||||||
|
return formspec ..
|
||||||
|
"image_button[12.1," .. y .. ";1,1.5;;" .. tab_name .. "_tab;;true;false]" ..
|
||||||
|
"tooltip[" .. tab_name .. "_tab;" .. tooltip .. "]"
|
||||||
|
end
|
||||||
|
|
||||||
local function get_formspec(self)
|
local function get_formspec(self)
|
||||||
local formspec = ""
|
local formspec = ""
|
||||||
|
|
||||||
|
@ -76,7 +94,6 @@ local function get_formspec(self)
|
||||||
if self.parent == nil then
|
if self.parent == nil then
|
||||||
local tsize = self.tablist[self.last_tab_index].tabsize or
|
local tsize = self.tablist[self.last_tab_index].tabsize or
|
||||||
{width=self.width, height=self.height}
|
{width=self.width, height=self.height}
|
||||||
local defaulttexturedir = core.formspec_escape(defaulttexturedir)
|
|
||||||
formspec = formspec ..
|
formspec = formspec ..
|
||||||
string.format("size[%f,%f,%s]",tsize.width + 2,tsize.height + 1,
|
string.format("size[%f,%f,%s]",tsize.width + 2,tsize.height + 1,
|
||||||
dump(self.fixed_size)) ..
|
dump(self.fixed_size)) ..
|
||||||
|
@ -85,19 +102,15 @@ local function get_formspec(self)
|
||||||
"background9[-0.2,-1.26;" .. tsize.width + 0.4 .. "," ..
|
"background9[-0.2,-1.26;" .. tsize.width + 0.4 .. "," ..
|
||||||
tsize.height + 1.75 .. ";" .. defaulttexturedir ..
|
tsize.height + 1.75 .. ";" .. defaulttexturedir ..
|
||||||
"bg_common.png;false;40]" ..
|
"bg_common.png;false;40]" ..
|
||||||
"style[settings_tab;content_offset=0]" ..
|
|
||||||
"image_button[12.02,1.3;1,1.55;" ..
|
"background9[12.13,1.05;0.9,2.6;" .. defaulttexturedir .. "side_menu.png;false;30]" ..
|
||||||
defaulttexturedir .. "settings_menu.png;settings_tab;;true;false;" ..
|
make_side_pane_tab(0.9, "settings", fgettext("Settings"), name == "settings") ..
|
||||||
defaulttexturedir .. "settings_menu_pressed.png]" ..
|
"image[12.15,2.26;0.9,0.06;" .. defaulttexturedir .. "side_menu_divider.png]" ..
|
||||||
"style[authors_tab;content_offset=0]" ..
|
make_side_pane_tab(2.3, "authors", fgettext("Credits"), name == "credits")
|
||||||
"image_button[12.02,2.7;1,1.55;" ..
|
|
||||||
defaulttexturedir .. "authors_menu.png;authors_tab;;true;false;" ..
|
|
||||||
defaulttexturedir .. "authors_menu_pressed.png]"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- formspec = formspec .. self:tab_header()
|
-- formspec = formspec .. self:tab_header()
|
||||||
formspec = formspec .. self:button_header()
|
formspec = formspec .. self:button_header() ..
|
||||||
formspec = formspec ..
|
|
||||||
self.tablist[self.last_tab_index].get_formspec(
|
self.tablist[self.last_tab_index].get_formspec(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
|
@ -269,17 +282,18 @@ end
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
local function handle_tab_buttons(self,fields)
|
local function handle_tab_buttons(self,fields)
|
||||||
--save tab selection to config file
|
--save tab selection to config file
|
||||||
if fields[self.name] then
|
--[[if fields[self.name] then
|
||||||
local index = tonumber(fields[self.name])
|
local index = tonumber(fields[self.name])
|
||||||
switch_to_tab(self, index)
|
switch_to_tab(self, index)
|
||||||
return true
|
return true
|
||||||
end
|
end]]
|
||||||
|
|
||||||
local name_prefix = self.name .. "_"
|
local name_prefix = self.name .. "_"
|
||||||
local name_prefix_len = #name_prefix
|
local name_prefix_len = #name_prefix
|
||||||
for field in pairs(fields) do
|
for field in pairs(fields) do
|
||||||
if field:sub(1, name_prefix_len) == name_prefix then
|
if field:sub(1, name_prefix_len) == name_prefix then
|
||||||
local index = tonumber(field:sub(name_prefix_len + 1))
|
local index = tonumber(field:sub(name_prefix_len + 1))
|
||||||
|
if self.last_tab_index == index then return false end
|
||||||
switch_to_tab(self, index)
|
switch_to_tab(self, index)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,10 @@ end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
function render_serverlist_row(spec, is_favorite)
|
function render_serverlist_row(spec, is_favorite)
|
||||||
|
if not spec then
|
||||||
|
spec = {}
|
||||||
|
end
|
||||||
|
|
||||||
-- Get information from non_mobile_servers.
|
-- Get information from non_mobile_servers.
|
||||||
if is_favorite and not spec.proto_min and spec.address and spec.port and
|
if is_favorite and not spec.proto_min and spec.address and spec.port and
|
||||||
serverlistmgr.non_mobile_servers then
|
serverlistmgr.non_mobile_servers then
|
||||||
|
|
|
@ -1004,6 +1004,11 @@ function create_store_dlg(type)
|
||||||
search_string = ""
|
search_string = ""
|
||||||
cur_page = 1
|
cur_page = 1
|
||||||
|
|
||||||
|
-- ToDo: delete me when MultiCraft ContentDB is ready
|
||||||
|
if type and type ~= "game" then
|
||||||
|
type = "game"
|
||||||
|
end
|
||||||
|
|
||||||
if type then
|
if type then
|
||||||
-- table.indexof does not work on tables that contain `nil`
|
-- table.indexof does not work on tables that contain `nil`
|
||||||
for i, v in pairs(filter_types_type) do
|
for i, v in pairs(filter_types_type) do
|
||||||
|
|
|
@ -388,6 +388,12 @@ local function create_world_buttonhandler(this, fields)
|
||||||
gameindex = gameindex + 1
|
gameindex = gameindex + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not pkgmgr.games[gameindex] then
|
||||||
|
gamedata.errormessage = fgettext("No game selected")
|
||||||
|
this:delete()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
-- For unnamed worlds use the generated name 'World <number>',
|
-- For unnamed worlds use the generated name 'World <number>',
|
||||||
-- where the number increments: it is set to 1 larger than the largest
|
-- where the number increments: it is set to 1 larger than the largest
|
||||||
-- generated name number found.
|
-- generated name number found.
|
||||||
|
@ -457,7 +463,9 @@ local function create_world_buttonhandler(this, fields)
|
||||||
if gameindex >= pkgmgr.default_game_idx then
|
if gameindex >= pkgmgr.default_game_idx then
|
||||||
gameindex = gameindex + 1
|
gameindex = gameindex + 1
|
||||||
end
|
end
|
||||||
core.settings:set("menu_last_game", pkgmgr.games[gameindex].id)
|
local game = pkgmgr.games[gameindex]
|
||||||
|
if not game then return end
|
||||||
|
core.settings:set("menu_last_game", game.id)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,16 @@ end
|
||||||
function create_delete_content_dlg(content)
|
function create_delete_content_dlg(content)
|
||||||
assert(content.name)
|
assert(content.name)
|
||||||
|
|
||||||
|
if content.type == "game" then
|
||||||
|
for _, world in ipairs(menudata.worldlist:get_raw_list()) do
|
||||||
|
if world.gameid == content.id then
|
||||||
|
return messagebox("dlg_delete_content",
|
||||||
|
fgettext("You cannot delete this game!") .. "\n" ..
|
||||||
|
fgettext("You have worlds that use it."))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local retval = dialog_create("dlg_delete_content",
|
local retval = dialog_create("dlg_delete_content",
|
||||||
delete_content_formspec,
|
delete_content_formspec,
|
||||||
delete_content_buttonhandler,
|
delete_content_buttonhandler,
|
||||||
|
|
|
@ -109,6 +109,7 @@ function menudata.init_tabs()
|
||||||
for i = 1, #pkgmgr.games do
|
for i = 1, #pkgmgr.games do
|
||||||
if pkgmgr.games[i].id == "default" then
|
if pkgmgr.games[i].id == "default" then
|
||||||
tv_main:add(tabs.local_default_game)
|
tv_main:add(tabs.local_default_game)
|
||||||
|
tabs.local_game.hidden = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,7 +66,9 @@ local function get_formspec(tabview, name, tabdata)
|
||||||
"table[0,0.25;5.1,4.3;pkglist;" ..
|
"table[0,0.25;5.1,4.3;pkglist;" ..
|
||||||
pkgmgr.render_packagelist(packages) ..
|
pkgmgr.render_packagelist(packages) ..
|
||||||
";" .. tabdata.selected_pkg .. "]" ..
|
";" .. tabdata.selected_pkg .. "]" ..
|
||||||
"button[0,4.85;5.25,0.5;btn_contentdb;".. fgettext("Browse online content") .. "]"
|
"style[btn_contentdb;padding=-5;bgimg=" .. defaulttexturedir ..
|
||||||
|
"select_btn.png;bgimg_middle=10]" ..
|
||||||
|
"image_button[-0.11,4.8;5.5,0.92;;btn_contentdb;" .. fgettext("Browse online content") .. ";true;false]"
|
||||||
|
|
||||||
|
|
||||||
local selected_pkg
|
local selected_pkg
|
||||||
|
@ -144,8 +146,7 @@ local function get_formspec(tabview, name, tabdata)
|
||||||
retval = retval .. "textarea[5.85,2.2;6.35,2.9;;" ..
|
retval = retval .. "textarea[5.85,2.2;6.35,2.9;;" ..
|
||||||
fgettext("Information:") .. ";" .. desc .. "]"
|
fgettext("Information:") .. ";" .. desc .. "]"
|
||||||
|
|
||||||
if core.may_modify_path(selected_pkg.path) and not
|
if core.may_modify_path(selected_pkg.path) then
|
||||||
(selected_pkg.type == "game" and selected_pkg.name == "default") then
|
|
||||||
retval = retval ..
|
retval = retval ..
|
||||||
"button[5.5,4.65;3.25,1;btn_mod_mgr_delete_mod;" ..
|
"button[5.5,4.65;3.25,1;btn_mod_mgr_delete_mod;" ..
|
||||||
fgettext("Uninstall Package") .. "]"
|
fgettext("Uninstall Package") .. "]"
|
||||||
|
|
|
@ -118,17 +118,19 @@ return {
|
||||||
caption = "", -- fgettext("Credits"),
|
caption = "", -- fgettext("Credits"),
|
||||||
cbf_formspec = function(tabview, name, tabdata)
|
cbf_formspec = function(tabview, name, tabdata)
|
||||||
local version = core.get_version()
|
local version = core.get_version()
|
||||||
local fs = "label[0.05,-0.2;" ..
|
local logofile = defaulttexturedir .. "logo.png"
|
||||||
|
local fs = "image[-0.1,-0.3;2,2;" .. logofile .. "]" ..
|
||||||
|
"label[1.4,-0.25;" ..
|
||||||
"MultiCraft Open Source, ver. " .. version.string .. "\n" ..
|
"MultiCraft Open Source, ver. " .. version.string .. "\n" ..
|
||||||
"Copyright (C) 2014-2022 MultiCraft Development Team\n" ..
|
"Copyright (C) 2014-2022 MultiCraft Development Team\n" ..
|
||||||
"License: GNU LGPLv3.0+ and CC BY-SA 4.0\n" ..
|
"License: GNU LGPLv3.0+ and CC BY-SA 4.0\n" ..
|
||||||
"Created and Powered by Minetest Engine, ver. 5.4.1]" ..
|
"Created and Powered by Minetest Engine, ver. 5.4.1]" ..
|
||||||
|
|
||||||
"style[homepage;padding=-10;bgimg=" .. defaulttexturedir ..
|
"style[homepage;padding=-5;bgimg=" .. defaulttexturedir ..
|
||||||
"select_btn.png;bgimg_middle=20]" ..
|
"select_btn.png;bgimg_middle=10]" ..
|
||||||
"image_button[9.5,-0.25;2.5,0.9;;homepage;Home Page;true;false]" ..
|
"image_button[9.5,-0.25;2.5,0.9;;homepage;Home Page;true;false]" ..
|
||||||
"style[privacy;padding=-10;bgimg=" .. defaulttexturedir ..
|
"style[privacy;padding=-5;bgimg=" .. defaulttexturedir ..
|
||||||
"select_btn.png;bgimg_middle=20]" ..
|
"select_btn.png;bgimg_middle=10]" ..
|
||||||
"image_button[9.5,0.6;2.5,0.9;;privacy;Privacy Policy;true;false]" ..
|
"image_button[9.5,0.6;2.5,0.9;;privacy;Privacy Policy;true;false]" ..
|
||||||
|
|
||||||
"background9[0.1,1.5;11.85,4.15;" .. defaulttexturedir ..
|
"background9[0.1,1.5;11.85,4.15;" .. defaulttexturedir ..
|
||||||
|
@ -136,9 +138,9 @@ return {
|
||||||
"tablecolumns[color;text]" ..
|
"tablecolumns[color;text]" ..
|
||||||
"tableoptions[background=#0000;highlight=#00000000;border=false]" ..
|
"tableoptions[background=#0000;highlight=#00000000;border=false]" ..
|
||||||
"table[0.1,1.5;11.65,4;list_credits;" ..
|
"table[0.1,1.5;11.65,4;list_credits;" ..
|
||||||
"#FFFF00," .. fgettext("MultiCraft Developers") .. ",," ..
|
"#FFFF00," .. fgettext("Core Developers") .. " (MultiCraft)" .. ",," ..
|
||||||
buildCreditList(multicraft_developers) .. ",,," ..
|
buildCreditList(multicraft_developers) .. ",,," ..
|
||||||
"#FFFF00," .. fgettext("Minetest Developers") .. ",," ..
|
"#FFFF00," .. fgettext("Core Developers") .. " (Minetest Engine)" .. ",," ..
|
||||||
buildCreditList(core_developers) .. ",,," ..
|
buildCreditList(core_developers) .. ",,," ..
|
||||||
"#FFFF00," .. fgettext("Active Contributors") .. ",," ..
|
"#FFFF00," .. fgettext("Active Contributors") .. ",," ..
|
||||||
buildCreditList(active_contributors) .. ",,," ..
|
buildCreditList(active_contributors) .. ",,," ..
|
||||||
|
|
|
@ -71,7 +71,7 @@ local function singleplayer_refresh_gamebar()
|
||||||
|
|
||||||
local btnbar = buttonbar_create("game_button_bar",
|
local btnbar = buttonbar_create("game_button_bar",
|
||||||
game_buttonbar_button_handler,
|
game_buttonbar_button_handler,
|
||||||
{x=-0.35, y=-0.32}, "vertical", {x=1, y=7.14})
|
{x=-0.15, y=0.18}, "vertical", {x=1, y=6.14})
|
||||||
|
|
||||||
for i=1, #pkgmgr.games do
|
for i=1, #pkgmgr.games do
|
||||||
if pkgmgr.games[i].id ~= "default" then
|
if pkgmgr.games[i].id ~= "default" then
|
||||||
|
@ -103,7 +103,7 @@ local function singleplayer_refresh_gamebar()
|
||||||
btnbar:add_button("game_open_cdb", "", "", fgettext("Install games from ContentDB"), true)
|
btnbar:add_button("game_open_cdb", "", "", fgettext("Install games from ContentDB"), true)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_formspec()
|
local function get_formspec(_, _, tab_data)
|
||||||
local index = filterlist.get_current_index(menudata.worldlist,
|
local index = filterlist.get_current_index(menudata.worldlist,
|
||||||
tonumber(core.settings:get("mainmenu_last_selected_world")))
|
tonumber(core.settings:get("mainmenu_last_selected_world")))
|
||||||
|
|
||||||
|
@ -141,16 +141,19 @@ local function get_formspec()
|
||||||
|
|
||||||
"background9[0,0;6.5,4.8;" .. defaulttexturedir .. "worldlist_bg.png" .. ";false;40]" ..
|
"background9[0,0;6.5,4.8;" .. defaulttexturedir .. "worldlist_bg.png" .. ";false;40]" ..
|
||||||
"tableoptions[background=#0000;border=false]" ..
|
"tableoptions[background=#0000;border=false]" ..
|
||||||
"table[0,0;6.28,4.64;sp_worlds;" .. menu_render_worldlist() .. ";" .. index .. "]" ..
|
"table[0,0;6.28,4.64;sp_worlds;" .. menu_render_worldlist() .. ";" .. index .. "]"
|
||||||
|
|
||||||
|
if tab_data.hidden then
|
||||||
|
retval = retval ..
|
||||||
"style[switch_local_default;fgimg=" .. defaulttexturedir .. "switch_local_default.png;fgimg_hovered=" ..
|
"style[switch_local_default;fgimg=" .. defaulttexturedir .. "switch_local_default.png;fgimg_hovered=" ..
|
||||||
defaulttexturedir .. "switch_local_default_hover.png]" ..
|
defaulttexturedir .. "switch_local_default_hover.png]" ..
|
||||||
"image_button[10.6,-0.1;1.5,1.5;;switch_local_default;;true;false]"
|
"image_button[10.6,-0.1;1.5,1.5;;switch_local_default;;true;false]"
|
||||||
|
end
|
||||||
|
|
||||||
if PLATFORM ~= "Android" and PLATFORM ~= "iOS" then
|
if PLATFORM ~= "Android" and PLATFORM ~= "iOS" then
|
||||||
retval = retval ..
|
retval = retval ..
|
||||||
"style[world_configure;padding=-10;bgimg=" .. defaulttexturedir ..
|
"style[world_configure;padding=-5;bgimg=" .. defaulttexturedir ..
|
||||||
"select_btn.png;bgimg_middle=20]" ..
|
"select_btn.png;bgimg_middle=10]" ..
|
||||||
"image_button[9.3,4.84;2.7,0.92;;world_configure;" .. fgettext("Select Mods") .. ";true;false]"
|
"image_button[9.3,4.84;2.7,0.92;;world_configure;" .. fgettext("Select Mods") .. ";true;false]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -239,7 +242,7 @@ local function main_button_handler(this, fields, name)
|
||||||
local world = menudata.worldlist:get_raw_element(gamedata.selected_world)
|
local world = menudata.worldlist:get_raw_element(gamedata.selected_world)
|
||||||
if world then
|
if world then
|
||||||
local game = pkgmgr.find_by_gameid(world.gameid)
|
local game = pkgmgr.find_by_gameid(world.gameid)
|
||||||
core.settings:set("menu_last_game", game.id)
|
core.settings:set("menu_last_game", (game and game.id or ""))
|
||||||
end
|
end
|
||||||
|
|
||||||
if core.settings:get_bool("enable_server") then
|
if core.settings:get_bool("enable_server") then
|
||||||
|
@ -321,7 +324,14 @@ local function main_button_handler(this, fields, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields["game_open_cdb"] then
|
if fields["game_open_cdb"] then
|
||||||
this:set_tab("content")
|
if #pkgmgr.games > 1 or (pkgmgr.games[1] and pkgmgr.games[1].id ~= "default") then
|
||||||
|
this:set_tab("content")
|
||||||
|
else
|
||||||
|
local dlg = create_store_dlg()
|
||||||
|
dlg:set_parent(this)
|
||||||
|
this:hide()
|
||||||
|
dlg:show()
|
||||||
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -347,7 +357,7 @@ local function on_change(type, old_tab, new_tab)
|
||||||
|
|
||||||
local game = current_game()
|
local game = current_game()
|
||||||
|
|
||||||
if game then
|
if game and game.id ~= "default" then
|
||||||
menudata.worldlist:set_filtercriteria(game.id)
|
menudata.worldlist:set_filtercriteria(game.id)
|
||||||
mm_texture.update("singleplayer",game)
|
mm_texture.update("singleplayer",game)
|
||||||
end
|
end
|
||||||
|
@ -371,7 +381,6 @@ end
|
||||||
return {
|
return {
|
||||||
name = "local",
|
name = "local",
|
||||||
caption = fgettext("Singleplayer"),
|
caption = fgettext("Singleplayer"),
|
||||||
hidden = true,
|
|
||||||
cbf_formspec = get_formspec,
|
cbf_formspec = get_formspec,
|
||||||
cbf_button_handler = main_button_handler,
|
cbf_button_handler = main_button_handler,
|
||||||
on_change = on_change
|
on_change = on_change
|
||||||
|
|
|
@ -118,7 +118,7 @@ local function get_formspec(this)
|
||||||
defaulttexturedir .. "gift_btn_pressed.png]"
|
defaulttexturedir .. "gift_btn_pressed.png]"
|
||||||
end
|
end
|
||||||
|
|
||||||
if PLATFORM ~= "Android" and PLATFORM ~= "iOS" then
|
if PLATFORM ~= "iOS" then
|
||||||
retval = retval ..
|
retval = retval ..
|
||||||
"style[switch_local;fgimg=" .. defaulttexturedir .. "switch_local.png;fgimg_hovered=" ..
|
"style[switch_local;fgimg=" .. defaulttexturedir .. "switch_local.png;fgimg_hovered=" ..
|
||||||
defaulttexturedir .. "switch_local_hover.png]" ..
|
defaulttexturedir .. "switch_local_hover.png]" ..
|
||||||
|
|
|
@ -371,7 +371,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
|
||||||
gamedata.playername = fields.te_name
|
gamedata.playername = fields.te_name
|
||||||
gamedata.password = fields.te_pwd
|
gamedata.password = fields.te_pwd
|
||||||
gamedata.address = fields.te_address
|
gamedata.address = fields.te_address
|
||||||
gamedata.port = tonumber(fields.te_port)
|
gamedata.port = tonumber(fields.te_port) or 30000
|
||||||
gamedata.selected_world = 0
|
gamedata.selected_world = 0
|
||||||
local fav_idx = core.get_table_index("favorites")
|
local fav_idx = core.get_table_index("favorites")
|
||||||
local fav = serverlist[fav_idx]
|
local fav = serverlist[fav_idx]
|
||||||
|
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 354 B |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 193 B |
After Width: | Height: | Size: 570 B |
After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |