HUDs, hunger, mobs, mapgen, splash, mainmemu etc

master
4aiman 2015-07-01 12:27:28 +03:00
parent df0b656909
commit 169fa6f29f
29 changed files with 197 additions and 138 deletions

View File

@ -42,6 +42,9 @@ local function add_server_formspec(dialogdata)
end
local function add_server_buttonhandler(this, fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["server_add_cancel"] then
this:delete()

View File

@ -119,6 +119,9 @@ end
local function handle_buttons(this, fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["world_config_modlist"] ~= nil then
local event = core.explode_textlist_event(fields["world_config_modlist"])

View File

@ -83,6 +83,9 @@ local function create_world_formspec(dialogdata)
end
local function create_world_buttonhandler(this, fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["world_create_cancel"] then
this:delete()

View File

@ -35,6 +35,10 @@ end
--------------------------------------------------------------------------------
local function delete_mod_buttonhandler(this, fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["dlg_delete_mod_confirm"] ~= nil then
if this.data.mod.path ~= nil and

View File

@ -31,22 +31,23 @@ local function delete_world_formspec(dialogdata)
end
local function delete_world_buttonhandler(this, fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["world_delete_confirm"] then
if this.data.delete_index > 0 and
this.data.delete_index <= #menudata.worldlist:get_raw_list() then
core.delete_world(this.data.delete_index)
menudata.worldlist:refresh()
end
this:delete()
return true
if this.data.delete_index > 0 and
this.data.delete_index <= #menudata.worldlist:get_raw_list() then
core.delete_world(this.data.delete_index)
menudata.worldlist:refresh()
end
this:delete()
return true
end
if fields["world_delete_cancel"] then
this:delete()
return true
this:delete()
return true
end
return false
end

View File

@ -37,6 +37,10 @@ end
--------------------------------------------------------------------------------
local function rename_modpack_buttonhandler(this, fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["dlg_rename_modpack_confirm"] ~= nil then
local oldpath = core.get_modpath() .. DIR_DELIM .. this.data.mod.name
local targetpath = core.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"]

View File

@ -79,6 +79,10 @@ end
--------------------------------------------------------------------------------
local function main_button_handler2(tabview, fields, name, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
local index = ''
if fields["btn_show_singleplayer"] then index = "singleplayer" end
if fields["btn_show_multiplayer"] then index = "multiplayer" end

View File

@ -35,7 +35,7 @@ function modstore.init()
modstore.lastmodtitle = ""
modstore.last_search = ""
modstore.searchlist = filterlist.create(
function()
if modstore.modlist_unsorted ~= nil and
@ -57,18 +57,18 @@ function modstore.init()
return false
end
substring = substring:upper()
if element.title ~= nil and
element.title:upper():find(substring) ~= nil then
return true
end
if element.details ~= nil and
element.details.author ~= nil and
element.details.author:upper():find(substring) ~= nil then
return true
end
if element.details ~= nil and
element.details.description ~= nil and
element.details.description:upper():find(substring) ~= nil then
@ -102,15 +102,15 @@ function modstore.getsuccessfuldialog()
if modstore.lastmodentry ~= nil then
retval = retval .. "label[0,0.25;" .. fgettext("Successfully installed:") .. "]"
retval = retval .. "label[3,0.25;" .. modstore.lastmodentry.moddetails.title .. "]"
retval = retval .. "label[0,0.75;" .. fgettext("Shortname:") .. "]"
retval = retval .. "label[3,0.75;" .. core.formspec_escape(modstore.lastmodentry.moddetails.basename) .. "]"
end
retval = retval .. "button[2.5,1.5;1,0.5;btn_confirm_mod_successfull;" .. fgettext("ok") .. "]"
return retval
end
@ -165,6 +165,10 @@ end
--------------------------------------------------------------------------------
-- @function [parent=#modstore] handle_buttons
function modstore.handle_buttons(current_tab,fields)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["modstore_tab"] then
local index = tonumber(fields["modstore_tab"])
@ -182,14 +186,14 @@ function modstore.handle_buttons(current_tab,fields)
data = filterlist.get_list(modstore.searchlist),
}
end
return {
current_tab = modstore.tabnames[index],
is_dialog = true,
show_buttons = false
}
end
end
if fields["btn_modstore_page_up"] then
@ -244,8 +248,8 @@ function modstore.handle_buttons(current_tab,fields)
data = filterlist.get_list(modstore.searchlist),
}
end
if fields["btn_modstore_close"] then
return {
is_dialog = false,
@ -253,7 +257,7 @@ function modstore.handle_buttons(current_tab,fields)
current_tab = core.setting_get("main_menu_tab")
}
end
for key,value in pairs(fields) do
local foundat = key:find("btn_install_mod_")
if ( foundat == 1) then
@ -265,15 +269,15 @@ function modstore.handle_buttons(current_tab,fields)
if modstore.lastmodtitle ~= "" then
modstore.lastmodtitle = modstore.lastmodtitle .. ", "
end
modstore.lastmodtitle = modstore.lastmodtitle .. moddetails.title
core.handle_async(
function(param)
local fullurl = core.setting_get("modstore_download_url") ..
param.moddetails.download_url
if param.version ~= nil then
local found = false
for i=1,#param.moddetails.versions, 1 do
@ -283,7 +287,7 @@ function modstore.handle_buttons(current_tab,fields)
found = true
end
end
if not found then
return {
moddetails = param.moddetails,
@ -291,7 +295,7 @@ function modstore.handle_buttons(current_tab,fields)
}
end
end
if core.download_file(fullurl,param.filename) then
return {
texturename = param.texturename,
@ -319,7 +323,7 @@ function modstore.handle_buttons(current_tab,fields)
else
gamedata.errormessage = "Failed to download " .. result.moddetails.title
end
if gamedata.errormessage == nil then
core.button_handler({btn_hidden_close_download=result})
else
@ -327,7 +331,7 @@ function modstore.handle_buttons(current_tab,fields)
end
end
)
return {
current_tab = "modstore_downloading",
is_dialog = true,
@ -410,25 +414,25 @@ function modstore.getscreenshot(ypos,listentry)
if listentry.details ~= nil and
(listentry.details.screenshot_url == nil or
listentry.details.screenshot_url == "") then
if listentry.texturename == nil then
listentry.texturename = modstore.basetexturedir .. "no_screenshot.png"
end
return "image[0,".. ypos .. ";3,2;" ..
core.formspec_escape(listentry.texturename) .. "]"
end
if listentry.details ~= nil and
listentry.texturename == nil then
--make sure we don't download multiple times
listentry.texturename = "in progress"
--prepare url and filename
local fullurl = core.setting_get("modstore_download_url") ..
listentry.details.screenshot_url
local filename = os.tempfolder() .. "_MID_" .. listentry.id
--trigger download
core.handle_async(
--first param is downloadfct
@ -468,7 +472,7 @@ function modstore.getscreenshot(ypos,listentry)
return "image[0,".. ypos .. ";3,2;" ..
core.formspec_escape(listentry.texturename) .. "]"
end
return ""
end
@ -476,7 +480,7 @@ end
--@function [parent=#modstore] getshortmodinfo
function modstore.getshortmodinfo(ypos,listentry,details)
local retval = ""
retval = retval .. "box[0," .. ypos .. ";11.4,1.75;#FFFFFF]"
--screenshot
@ -490,13 +494,13 @@ function modstore.getshortmodinfo(ypos,listentry,details)
local descriptiony = ypos + 0.5
retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.55;;" ..
core.formspec_escape(details.description) .. ";]"
--rating
local ratingy = ypos
retval = retval .."label[7," .. ratingy .. ";" ..
fgettext("Rating") .. ":]"
retval = retval .. "label[8.7," .. ratingy .. ";" .. details.rating .."]"
--versions (IMPORTANT has to be defined AFTER rating)
if details.versions ~= nil and
#details.versions > 1 then
@ -507,7 +511,7 @@ function modstore.getshortmodinfo(ypos,listentry,details)
if versions ~= "" then
versions = versions .. ","
end
versions = versions .. details.versions[i].date:sub(1,10)
end
retval = retval .. versions .. ";1]"
@ -524,7 +528,7 @@ function modstore.getshortmodinfo(ypos,listentry,details)
retval = retval .. fgettext("Install") .."]"
end
end
return retval
end
@ -533,11 +537,11 @@ end
function modstore.getmodlist(list,yoffset)
modstore.current_list = list
if #list.data == 0 then
return ""
end
if yoffset == nil then
yoffset = 0
end
@ -578,13 +582,13 @@ function modstore.getmodlist(list,yoffset)
if details ~= nil then
local screenshot_ypos =
yoffset +(i-1 - (list.page * modstore.modsperpage))*1.9 +0.2
retval = retval .. modstore.getshortmodinfo(screenshot_ypos,
list.data[i],
details)
end
end
return retval .. scrollbar
end
@ -593,7 +597,7 @@ end
function modstore.getsearchpage()
local retval = ""
local search = ""
if modstore.last_search ~= nil then
search = modstore.last_search
end
@ -602,7 +606,7 @@ function modstore.getsearchpage()
"button[9.5,0.2;2.5,0.5;btn_modstore_search;".. fgettext("Search") .. "]" ..
"field[0.5,0.5;9,0.5;te_modstore_search;;" .. search .. "]"
--show 4 mods only
modstore.modsperpage = 4
retval = retval ..

View File

@ -187,6 +187,10 @@ end
--------------------------------------------------------------------------------
-- @function [parent=#modstore] handle_buttons
function modstore.handle_buttons(parent, fields, name, data)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["btn_modstore_page_up"] then
if modstore.current_list ~= nil and modstore.current_list.page > 0 then

View File

@ -28,8 +28,8 @@ tab_credits = {
"box[-100,-10;200,12;#999999]" ..
"image_button[12,9.55;4,0.8;"..core.formspec_escape(mm_texture.basetexturedir).."menu_button.png;btn_cancel;".. fgettext("OK") .. ";true;true;"..core.formspec_escape(mm_texture.basetexturedir).."menu_button_b.png]"..
"label[3.5,9.75;Magichet 1.0 (based on FM " .. core.get_version() .. ")]" ..
"image[0.25,9;2,2;"..core.formspec_escape(logofile).."]"..
"label[3.5,9.75;Multicraft (" .. core.get_version() .. ")]" ..
-- "image[0.25,9;2,2;"..core.formspec_escape(logofile).."]"..
"textlist[0,2.0;15.8,6.25;list_credits;" ..
"#FFFF00" .. fgettext("Core Developers") .."," ..
" Perttu Ahola (celeron55) <celeron55@gmail.com>,"..
@ -48,7 +48,7 @@ tab_credits = {
" paramat,"..
" ...,"..
","..
"#FFFF00" .. fgettext("Magichet Developers") .. "," ..
"#FFFF00" .. fgettext("Multicraft Developers") .. "," ..
" 4aiman Konsorumaniakku <4aiman@inbox.ru>,"..
" ...,"..
"," ..
@ -70,6 +70,10 @@ tab_credits = {
";0;true]"
end,
cbf_button_handler = function(tabview, fields, name, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["btn_cancel"] ~= nil then
tabview:hide()
tabview.parent:show()

View File

@ -111,6 +111,10 @@ end
--------------------------------------------------------------------------------
local function handle_buttons(tabview, fields, tabname, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["modlist"] ~= nil then
local event = core.explode_textlist_event(fields["modlist"])
tabdata.selected_mod = event.index

View File

@ -118,6 +118,10 @@ end
--------------------------------------------------------------------------------
local function main_button_handler(tabview, fields, name, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if not tabdata then tabdata = {} end
if fields["add_server"] ~= nil then

View File

@ -77,6 +77,9 @@ end
--------------------------------------------------------------------------------
local function main_button_handler(this, fields, name, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
local world_doubleclick = false
@ -114,7 +117,7 @@ local function main_button_handler(this, fields, name, tabdata)
bool = 'true'
end
core.setting_set("enable_damage", bool)
-- print(bool)
minetest.setting_save()
return true
end

View File

@ -81,6 +81,9 @@ local function dlg_confirm_reset_formspec(data)
end
local function dlg_confirm_reset_btnhandler(this, fields, dialogdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["dlg_reset_singleplayer_confirm"] ~= nil then
local worldlist = core.get_worlds()

View File

@ -34,8 +34,7 @@ local function singleplayer_refresh_gamebar()
for key,value in pairs(fields) do
for j=1,#gamemgr.games,1 do
if ("game_btnbar_" .. gamemgr.games[j].id == key) then
mm_texture.update("singleplayer", gamemgr.games[j])
--core.set_topleft_text(gamemgr.games[j].name)
-- mm_texture.update("singleplayer", gamemgr.games[j])
core.setting_set("menu_last_game",gamemgr.games[j].id)
menudata.worldlist:set_filtercriteria(gamemgr.games[j].id)
return true
@ -124,6 +123,9 @@ local function get_formspec(tabview, name, tabdata)
end
local function main_button_handler(this, fields, name, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
--assert(name == "singleplayer")
@ -155,13 +157,22 @@ local function main_button_handler(this, fields, name, tabdata)
return true
end
if fields["cb_creative_mode"] then
core.setting_set("creative_mode", fields["cb_creative_mode"])
return true
end
if fields["cb_creative_mode"] then
core.setting_set("creative_mode", fields["cb_creative_mode"])
local bool = fields["cb_creative_mode"]
if bool == 'true' then
bool = 'false'
else
bool = 'true'
end
core.setting_set("enable_damage", bool)
minetest.setting_save()
return true
end
if fields["cb_enable_damage"] then
core.setting_set("enable_damage", fields["cb_enable_damage"])
minetest.setting_save()
return true
end
@ -169,7 +180,6 @@ local function main_button_handler(this, fields, name, tabdata)
world_doubleclick or
fields["key_enter"] then
local selected = core.get_textlist_index("sp_worlds")
print(selected)
if selected ~= nil then
gamedata.selected_world = menudata.worldlist:get_raw_index(selected)
gamedata.singleplayer = true
@ -184,7 +194,6 @@ local function main_button_handler(this, fields, name, tabdata)
create_world_dlg:set_parent(this)
this:hide()
create_world_dlg:show()
mm_texture.update("singleplayer",current_game())
return true
end
@ -201,7 +210,6 @@ local function main_button_handler(this, fields, name, tabdata)
delete_world_dlg:set_parent(this)
this:hide()
delete_world_dlg:show()
mm_texture.update("singleplayer",current_game())
end
end
@ -219,7 +227,7 @@ local function main_button_handler(this, fields, name, tabdata)
configdialog:set_parent(this)
this:hide()
configdialog:show()
mm_texture.update("singleplayer",current_game())
--mm_texture.update("singleplayer",current_game())
end
end
@ -249,14 +257,14 @@ local function on_change(type, old_tab, new_tab)
if game then
menudata.worldlist:set_filtercriteria(game.id)
--core.set_topleft_text(game.name)
mm_texture.update("singleplayer",game)
-- mm_texture.update("singleplayer",game)
end
buttonbar:show()
else
menudata.worldlist:set_filtercriteria(nil)
buttonbar:hide()
--core.set_topleft_text("")
mm_texture.update(new_tab,nil)
--mm_texture.update(new_tab,nil)
end
end

View File

@ -87,6 +87,10 @@ end
--------------------------------------------------------------------------------
local function main_button_handler(tabview, fields, name, tabdata)
core.set_clouds(false)
core.set_background("background",core.formspec_escape(mm_texture.basetexturedir)..'background.png')
core.set_background("header",core.formspec_escape(mm_texture.basetexturedir)..'header.png')
if fields["TPs"] ~= nil then
local event = core.explode_textlist_event(fields["TPs"])
if event.type == "CHG" or event.type == "DCL" then

View File

@ -34,7 +34,6 @@ function mm_texture.update(tab,gamedetails)
if gamedetails == nil then
return
end
mm_texture.update_game(gamedetails)
end

View File

@ -282,11 +282,11 @@ public:
Check if a node is pointable
*/
inline bool isPointableNode(const MapNode &n,
Client *client, bool liquids_pointable)
Client *client, bool liquids_pointable)
{
const ContentFeatures &features = client->getNodeDefManager()->get(n);
return features.pointable ||
(liquids_pointable && features.isLiquid());
(liquids_pointable && features.isLiquid());
}
/*
@ -321,8 +321,8 @@ PointedThing getPointedThing(Client *client, v3f player_position,
v3f pos = selected_object->getPosition();
hilightboxes.push_back(aabb3f(
selection_box->MinEdge + pos - intToFloat(camera_offset, BS),
selection_box->MaxEdge + pos - intToFloat(camera_offset, BS)));
selection_box->MinEdge + pos - intToFloat(camera_offset, BS),
selection_box->MaxEdge + pos - intToFloat(camera_offset, BS)));
}
mindistance = (selected_object->getPosition() - camera_position).getLength();
@ -902,8 +902,8 @@ bool nodePlacementPrediction(Client &client,
if (prediction != "" && !nodedef->get(node).rightclickable) {
verbosestream << "Node placement prediction for "
<< playeritem_def.name << " is "
<< prediction << std::endl;
<< playeritem_def.name << " is "
<< prediction << std::endl;
v3s16 p = neighbourpos;
// Place inside node itself if buildable_to
@ -925,9 +925,9 @@ bool nodePlacementPrediction(Client &client,
if (!found) {
errorstream << "Node placement prediction failed for "
<< playeritem_def.name << " (places "
<< prediction
<< ") - Name not known" << std::endl;
<< playeritem_def.name << " (places "
<< prediction
<< ") - Name not known" << std::endl;
return false;
}
@ -1000,9 +1000,9 @@ bool nodePlacementPrediction(Client &client,
}
} catch (InvalidPositionException &e) {
errorstream << "Node placement prediction failed for "
<< playeritem_def.name << " (places "
<< prediction
<< ") - Position not loaded" << std::endl;
<< playeritem_def.name << " (places "
<< prediction
<< ") - Position not loaded" << std::endl;
}
}
@ -1017,7 +1017,7 @@ static inline void create_formspec_menu(GUIFormSpecMenu **cur_formspec,
if (*cur_formspec == 0) {
*cur_formspec = new GUIFormSpecMenu(device, guiroot, -1, &g_menumgr,
invmgr, gamedef, tsrc, fs_src, txt_dest, client);
invmgr, gamedef, tsrc, fs_src, txt_dest, client);
(*cur_formspec)->doPause = false;
/*
@ -1035,13 +1035,13 @@ static inline void create_formspec_menu(GUIFormSpecMenu **cur_formspec,
}
#ifdef __ANDROID__
# define SIZE_TAG "size[11,5.5]"
# define PAUSE_MENU_SIZE_TAG "size[6,3.5]"
# define PAUSE_MENU_BUTTON_LEFT 1.5
# define SIZE_TAG "size[11,5.5]"
# define PAUSE_MENU_SIZE_TAG "size[6,3.5]"
# define PAUSE_MENU_BUTTON_LEFT 1.5
#else
# define SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop
# define PAUSE_MENU_SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop
# define PAUSE_MENU_BUTTON_LEFT 4
# define SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop
# define PAUSE_MENU_SIZE_TAG "size[11,5.5,true]" // Fixed size on desktop
# define PAUSE_MENU_BUTTON_LEFT 4
#endif
static void show_chat_menu(GUIFormSpecMenu **cur_formspec,
@ -1093,19 +1093,19 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec,
bool singleplayermode)
{
#ifdef __ANDROID__
// std::string control_text = wide_to_narrow(wstrgettext("Default Controls:\n"
// "No menu visible:\n"
// "- single tap: button activate\n"
// "- double tap: place/use\n"
// "- slide finger: look around\n"
// "Menu/Inventory visible:\n"
// "- double tap (outside):\n"
// " -->close\n"
// "- touch stack, touch slot:\n"
// " --> move stack\n"
// "- touch&drag, tap 2nd finger\n"
// " --> place single item to slot\n"
// ));
// std::string control_text = wide_to_narrow(wstrgettext("Default Controls:\n"
// "No menu visible:\n"
// "- single tap: button activate\n"
// "- double tap: place/use\n"
// "- slide finger: look around\n"
// "Menu/Inventory visible:\n"
// "- double tap (outside):\n"
// " -->close\n"
// "- touch stack, touch slot:\n"
// " --> move stack\n"
// "- touch&drag, tap 2nd finger\n"
// " --> place single item to slot\n"
// ));
#else
std::string control_text = wide_to_narrow(wstrgettext("Default Controls:\n"
"- WASD: move\n"
@ -1118,7 +1118,7 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec,
"- Mouse right: place/use\n"
"- Mouse wheel: select item\n"
"- T: chat\n"
));
));
#endif
float ypos = singleplayermode ? 0.5 : 0.1;
@ -1134,14 +1134,14 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec,
}
#ifndef __ANDROID__
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_sound;"
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_sound;"
<< wide_to_narrow(wstrgettext("Sound Volume")) << "]";
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_key_config;"
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_key_config;"
<< wide_to_narrow(wstrgettext("Change Keys")) << "]";
#endif
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_exit_menu;"
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_exit_menu;"
<< wide_to_narrow(wstrgettext("Exit to Menu")) << "]";
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_exit_os;"
os << "button_exit[" << PAUSE_MENU_BUTTON_LEFT << "," << (ypos++) << ";3,0.5;btn_exit_os;"
<< wide_to_narrow(wstrgettext("Exit to OS")) << "]"
#ifndef __ANDROID__
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]"
@ -1200,13 +1200,13 @@ static void updateChat(Client &client, f32 dtime, bool show_debug,
// first pass to calculate height of text to be set
s32 width = std::min(g_fontengine->getTextWidth(recent_chat) + 10,
porting::getWindowSize().X - 20);
porting::getWindowSize().X - 20);
core::rect<s32> rect(10, chat_y, width, chat_y + porting::getWindowSize().Y);
guitext_chat->setRelativePosition(rect);
//now use real height of text and adjust rect according to this size
rect = core::rect<s32>(10, chat_y, width,
chat_y + guitext_chat->getTextHeight());
chat_y + guitext_chat->getTextHeight());
guitext_chat->setRelativePosition(rect);
@ -1574,7 +1574,7 @@ private:
GUIChatConsole *gui_chat_console; // Free using ->Drop()
MapDrawControl *draw_control;
Camera *camera;
Clouds *clouds; // Free using ->Drop()
Clouds *clouds; // Free using ->Drop()
Sky *sky; // Free using ->Drop()
Inventory *local_inventory;
Hud *hud;
@ -1605,7 +1605,7 @@ private:
gui::IGUIStaticText *guitext2; // Second line of debug text
gui::IGUIStaticText *guitext_info; // At the middle of the screen
gui::IGUIStaticText *guitext_status;
gui::IGUIStaticText *guitext_chat; // Chat text
gui::IGUIStaticText *guitext_chat; // Chat text
gui::IGUIStaticText *guitext_profiler; // Profiler text
std::wstring infotext;
@ -1671,7 +1671,7 @@ Game::Game() :
m_cache_mouse_sensitivity = rangelim(m_cache_mouse_sensitivity, 0.001, 100.0);
#ifdef __ANDROID__
m_cache_hold_aux1 = false; // This is initialised properly later
m_cache_hold_aux1 = false; // This is initialised properly later
#endif
}
@ -1973,7 +1973,7 @@ bool Game::createSingleplayerServer(const std::string map_dir,
}
server = new Server(map_dir, gamespec, simple_singleplayer_mode,
bind_addr.isIPv6());
bind_addr.isIPv6());
server->start(bind_addr);
@ -2036,7 +2036,7 @@ bool Game::createClient(const std::string &playername,
/* Skybox
*/
sky = new Sky(smgr->getRootSceneNode(), smgr, -1, texture_src);
skybox = NULL; // This is used/set later on in the main run loop
skybox = NULL; // This is used/set later on in the main run loop
local_inventory = new Inventory(itemdef_manager);
@ -2152,7 +2152,7 @@ bool Game::connectToServer(const std::string &playername,
const std::string &password, std::string *address, u16 port,
bool *connect_ok, bool *aborted)
{
*connect_ok = false; // Let's not be overly optimistic
*connect_ok = false; // Let's not be overly optimistic
*aborted = false;
bool local_server_mode = false;
@ -2197,7 +2197,7 @@ bool Game::connectToServer(const std::string &playername,
if (!client)
return false;
gamedef = client; // Client acts as our GameDef
gamedef = client; // Client acts as our GameDef
infostream << "Connecting to server at ";
connect_address.print(&infostream);
@ -2397,19 +2397,19 @@ inline bool Game::handleCallbacks()
if (g_gamecallback->changepassword_requested) {
(new GUIPasswordChange(guienv, guiroot, -1,
&g_menumgr, client))->drop();
&g_menumgr, client))->drop();
g_gamecallback->changepassword_requested = false;
}
if (g_gamecallback->changevolume_requested) {
(new GUIVolumeChange(guienv, guiroot, -1,
&g_menumgr, client))->drop();
&g_menumgr, client))->drop();
g_gamecallback->changevolume_requested = false;
}
if (g_gamecallback->keyconfig_requested) {
(new GUIKeyChangeMenu(guienv, guiroot, -1,
&g_menumgr))->drop();
&g_menumgr))->drop();
g_gamecallback->keyconfig_requested = false;
}
@ -2643,10 +2643,10 @@ void Game::processKeyboardInput(VolatileRunFlags *flags,
else if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_DEBUG_STACKS])) {
// Print debug stacks
dstream << "-----------------------------------------"
<< std::endl;
<< std::endl;
dstream << DTIME << "Printing debug stacks:" << std::endl;
dstream << "-----------------------------------------"
<< std::endl;
<< std::endl;
debug_stacks_print();
}
@ -2675,7 +2675,7 @@ void Game::processItemSelection(u16 *new_playeritem)
s32 wheel = input->getMouseWheel();
u16 max_item = MYMIN(PLAYER_INVENTORY_SIZE - 1,
player->hud_hotbar_itemcount - 1);
player->hud_hotbar_itemcount - 1);
if (wheel < 0)
*new_playeritem = *new_playeritem < max_item ? *new_playeritem + 1 : 0;
@ -2894,7 +2894,7 @@ void Game::toggleProfiler(float *statustext_time, u32 *profiler_current_page,
if (*profiler_current_page != 0) {
std::wstringstream sstr;
sstr << "Profiler shown (page " << *profiler_current_page
<< " of " << profiler_max_page << ")";
<< " of " << profiler_max_page << ")";
statustext = sstr.str();
} else {
statustext = L"Profiler hidden";
@ -3061,7 +3061,7 @@ inline void Game::step(f32 *dtime)
bool can_be_and_is_paused =
(simple_singleplayer_mode && g_menumgr.pausesGame());
if (can_be_and_is_paused) { // This is for a singleplayer server
if (can_be_and_is_paused) { // This is for a singleplayer server
*dtime = 0; // No time passes
} else {
if (server != NULL) {
@ -3104,7 +3104,7 @@ void Game::processClientEvents(CameraOrientation *cam, float *damage_flash)
show_deathscreen(&current_formspec, client, gamedef, texture_src,
device, client);
chat_backend->addMessage(L"", L"You died.");
// chat_backend->addMessage(L"", L"You died.");
/* Handle visualization */
*damage_flash = 0;
@ -3118,7 +3118,7 @@ void Game::processClientEvents(CameraOrientation *cam, float *damage_flash)
new TextDestPlayerInventory(client, *(event.show_formspec.formname));
create_formspec_menu(&current_formspec, client, gamedef,
texture_src, device, fs_src, txt_dst, client);
texture_src, device, fs_src, txt_dst, client);
delete(event.show_formspec.formspec);
delete(event.show_formspec.formname);
@ -3322,7 +3322,7 @@ void Game::updateCamera(VolatileRunFlags *flags, u32 busy_time,
tool_reload_ratio = MYMIN(tool_reload_ratio, 1.0);
camera->update(player, dtime, busy_time / 1000.0f, tool_reload_ratio,
client->getEnv());
client->getEnv());
camera->step(dtime);
v3f camera_position = camera->getPosition();
@ -3352,13 +3352,13 @@ void Game::updateSound(f32 dtime)
// Update sound listener
v3s16 camera_offset = camera->getOffset();
sound->updateListener(camera->getCameraNode()->getPosition() + intToFloat(camera_offset, BS),
v3f(0, 0, 0), // velocity
camera->getDirection(),
camera->getCameraNode()->getUpVector());
v3f(0, 0, 0), // velocity
camera->getDirection(),
camera->getCameraNode()->getUpVector());
sound->setListenerGain(g_settings->getFloat("sound_volume"));
// Update sound maker
// Update sound maker
soundmaker->step(dtime);
LocalPlayer *player = client->getEnv().getLocalPlayer();
@ -3411,7 +3411,7 @@ void Game::processPlayerInteraction(std::vector<aabb3f> &highlight_boxes,
camera_position + camera_direction * BS * (d + 1));
} else {
// prevent player pointing anything in front-view
// prevent player pointing anything in front-view
if (camera->getCameraMode() == CAMERA_MODE_THIRD_FRONT)
shootline = core::line3d<f32>(0, 0, 0, 0, 0, 0);
}
@ -3457,7 +3457,7 @@ void Game::processPlayerInteraction(std::vector<aabb3f> &highlight_boxes,
if (runData->digging) {
if (input->getLeftReleased()) {
infostream << "Left button released"
<< " (stopped digging)" << std::endl;
<< " (stopped digging)" << std::endl;
runData->digging = false;
} else if (pointed != runData->pointed_old) {
if (pointed.type == POINTEDTHING_NODE
@ -3468,7 +3468,7 @@ void Game::processPlayerInteraction(std::vector<aabb3f> &highlight_boxes,
// Don't reset.
} else {
infostream << "Pointing away from node"
<< " (stopped digging)" << std::endl;
<< " (stopped digging)" << std::endl;
runData->digging = false;
}
}
@ -3584,7 +3584,7 @@ void Game::handlePointingAtNode(GameRunData *runData,
TextDest *txt_dst = new TextDestNodeMetadata(nodepos, client);
create_formspec_menu(&current_formspec, client, gamedef,
texture_src, device, fs_src, txt_dst, client);
texture_src, device, fs_src, txt_dst, client);
current_formspec->setFormSpec(meta->getString("formspec"), inventoryloc);
} else {
@ -3829,7 +3829,7 @@ void Game::updateFrame(std::vector<aabb3f> &highlight_boxes,
direct_brightness = client->getEnv().getClientMap()
.getBackgroundBrightness(MYMIN(runData->fog_range * 1.2, 60 * BS),
daynight_ratio, (int)(old_brightness * 255.5), &sunlight_seen)
/ 255.0;
/ 255.0;
}
float time_of_day = runData->time_of_day;
@ -3868,7 +3868,7 @@ void Game::updateFrame(std::vector<aabb3f> &highlight_boxes,
clouds->setVisible(true);
clouds->step(dtime);
clouds->update(v2f(player_position.X, player_position.Z),
sky->getCloudColor());
sky->getCloudColor());
} else {
clouds->setVisible(false);
}
@ -4264,20 +4264,20 @@ void Game::extendedResourceCleanup()
// Extended resource accounting
infostream << "Irrlicht resources after cleanup:" << std::endl;
infostream << "\tRemaining meshes : "
<< device->getSceneManager()->getMeshCache()->getMeshCount() << std::endl;
<< device->getSceneManager()->getMeshCache()->getMeshCount() << std::endl;
infostream << "\tRemaining textures : "
<< driver->getTextureCount() << std::endl;
<< driver->getTextureCount() << std::endl;
for (unsigned int i = 0; i < driver->getTextureCount(); i++) {
irr::video::ITexture *texture = driver->getTextureByIndex(i);
infostream << "\t\t" << i << ":" << texture->getName().getPath().c_str()
<< std::endl;
<< std::endl;
}
clearTextureNameCache();
infostream << "\tRemaining materials: "
<< driver-> getMaterialRendererCount()
<< " (note: irrlicht doesn't support removing renderers)" << std::endl;
<< driver-> getMaterialRendererCount()
<< " (note: irrlicht doesn't support removing renderers)" << std::endl;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 47 KiB