Moved global variables into the "default" list/class.

This commit is contained in:
Le_Docteur 2014-12-17 09:20:37 +01:00
parent db0e531877
commit f618237c98
3 changed files with 10 additions and 11 deletions

View File

@ -11,8 +11,9 @@ LAVA_VISC = 3 -- Slower movement in lava.
LIGHT_MAX = 14 -- 15 is reserved for sunlight.
-- GUI related stuff:
gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]"
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]"
function default.get_hotbar_bg(x,y)
local out = ""
@ -22,8 +23,8 @@ function default.get_hotbar_bg(x,y)
return out
end
gui_suvival_form = "size[8,8.5]"..
gui_slots ..
default.gui_suvival_form = "size[8,8.5]"..
default.gui_slots ..
"list[current_player;main; 0, 4.25; 8, 4; ]" ..
"list[current_player;craft; 1.75, 0.5; 3, 3; ]" ..
"list[current_player;craftpreview; 5.75, 1.5; 1, 1; ]" ..

View File

@ -1,7 +1,5 @@
-- mods/default/nodes.lua
gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]"
minetest.register_node("default:stone", {
description = "Stone",
tiles = {"default_stone.png"},
@ -581,7 +579,7 @@ minetest.register_node("default:papyrus", {
default.bookshelf_formspec =
"size[8,7;]" ..
gui_slots ..
default.gui_slots ..
"list[context;books;0, 0.3;8,2;]" ..
"list[current_player;main;0,2.85;8,4;]" ..
default.get_hotbar_bg(0, 2.85) ..
@ -1189,7 +1187,7 @@ minetest.register_node("default:sign_wall", {
default.chest_formspec =
"size[8,9]" ..
gui_slots ..
default.gui_slots ..
"list[current_name;main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,4;]" ..
default.get_hotbar_bg(0, 4.85) ..
@ -1199,7 +1197,7 @@ function default.get_locked_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
local formspec =
"size[8,9]" ..
gui_slots ..
default.gui_slots ..
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,4;]" ..
default.get_hotbar_bg(0, 4.85) ..
@ -1569,7 +1567,7 @@ minetest.register_abm({
meta:set_string("infotext","Furnace active: " .. percent .. " % (owned by "..meta:get_string("owner") .. ")")
swap_node(pos,"default:furnace_locked_active")
meta:set_string("formspec",
"invsize[8,8.5;]" .. gui_slots ..
"invsize[8,8.5;]" .. default.gui_slots ..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:" ..
(100-percent)..":default_furnace_fire_fg.png]" ..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:" ..

View File

@ -147,7 +147,7 @@ minetest.register_on_joinplayer(function(player)
if minetest.setting_getbool("creative_mode") then
-- creative.set_creative_formspec(player, 0, 1)
else
player:set_inventory_formspec(gui_suvival_form)
player:set_inventory_formspec(default.gui_suvival_form)
end
minetest.after(0.5,function()
player:hud_set_hotbar_image("gui_hotbar.png")