summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-02-05 10:03:07 +0100
committerTim <t4im@users.noreply.github.com>2015-02-05 10:03:07 +0100
commit76a9efff71f924b143af8945ce02ed336b6a1090 (patch)
treeb784af07779fa7ce096a398e6665293b41d28572 /init.lua
parent1a1bfc3839ccd3001b4f446b5ad230711fd258b1 (diff)
reduce table lookups during initialization
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua56
1 files changed, 30 insertions, 26 deletions
diff --git a/init.lua b/init.lua
index 85bf293..ebc5fda 100644
--- a/init.lua
+++ b/init.lua
@@ -3,33 +3,37 @@
local modpath = minetest.get_modpath(minetest.get_current_modname())
local worldpath = minetest.get_worldpath()
+
-- Data tables definitions
-unified_inventory = {}
-unified_inventory.activefilter = {}
-unified_inventory.active_search_direction = {}
-unified_inventory.alternate = {}
-unified_inventory.current_page = {}
-unified_inventory.current_searchbox = {}
-unified_inventory.current_index = {}
-unified_inventory.current_item = {}
-unified_inventory.current_craft_direction = {}
-unified_inventory.registered_craft_types = {}
-unified_inventory.crafts_for = { usage = {}, recipe = {} }
-unified_inventory.players = {}
-unified_inventory.items_list_size = 0
-unified_inventory.items_list = {}
-unified_inventory.filtered_items_list_size = {}
-unified_inventory.filtered_items_list = {}
-unified_inventory.pages = {}
-unified_inventory.buttons = {}
-
--- Homepos stuff
-unified_inventory.home_pos = {}
-unified_inventory.home_filename =
- worldpath.."/unified_inventory_home.home"
-
--- Default inventory page
-unified_inventory.default = "craft"
+unified_inventory = {
+ activefilter = {},
+ active_search_direction = {},
+ alternate = {},
+ current_page = {},
+ current_searchbox = {},
+ current_index = {},
+ current_item = {},
+ current_craft_direction = {},
+ registered_craft_types = {},
+ crafts_for = {usage = {}, recipe = {} },
+ players = {},
+ items_list_size = 0,
+ items_list = {},
+ filtered_items_list_size = {},
+ filtered_items_list = {},
+ pages = {},
+ buttons = {},
+
+ -- Homepos stuff
+ home_pos = {},
+ home_filename = worldpath.."/unified_inventory_home.home",
+
+ -- Default inventory page
+ default = "craft",
+
+ -- intllib
+ gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end,
+}
-- Disable default creative inventory
if rawget(_G, "creative_inventory") then