New Inventory System
3
.gitignore
vendored
@ -14,4 +14,5 @@ Zepha
|
|||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
src/CMakeFiles
|
src/CMakeFiles
|
||||||
test/CMakeFiles
|
test/CMakeFiles
|
||||||
|
/subgames/minimal/
|
||||||
|
@ -10,47 +10,71 @@ local menu = zepha.build_gui(function()
|
|||||||
key = "inventory",
|
key = "inventory",
|
||||||
position = { pc(50), pc(50) },
|
position = { pc(50), pc(50) },
|
||||||
position_anchor = { pc(50), pc(55) },
|
position_anchor = { pc(50), pc(55) },
|
||||||
size = { 218, 160 },
|
size = { 237, 187 },
|
||||||
|
|
||||||
Gui.Rect {
|
Gui.Rect {
|
||||||
key = "inventory_background",
|
key = "backpack",
|
||||||
|
|
||||||
position = { 0, 45 },
|
position = { 1, 0 },
|
||||||
size = { 218, 100 },
|
size = { 106, 187 },
|
||||||
padding = { 20, 10, 8, 10 },
|
padding = { 19, 9, 8, 9 },
|
||||||
background = "zeus:inventory:inventory",
|
background = "zeus:inventory:backpack",
|
||||||
|
|
||||||
Gui.InventoryList {
|
Gui.InventoryList {
|
||||||
position = { 1, 1 },
|
position = { 0, 0 },
|
||||||
slot_spacing = { 2, 2 },
|
slot_spacing = { 2, 2 },
|
||||||
source = "current_player",
|
source = "current_player",
|
||||||
list = "main",
|
list = "main",
|
||||||
|
},
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 0, 18*3 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "hot_wheel_1",
|
||||||
|
},
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 0, 18*4 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "hot_wheel_2",
|
||||||
|
},
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 0, 18*5 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "hot_wheel_3",
|
||||||
|
},
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 0, 18*6 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "hot_wheel_4",
|
||||||
|
},
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 0, 18*7 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "hot_wheel_5",
|
||||||
|
},
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 0, 18*8 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "hot_wheel_6",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Gui.Rect {
|
Gui.Rect {
|
||||||
key = "crafting_background",
|
key = "equipment",
|
||||||
|
|
||||||
position = { 0, -5 },
|
position = { 106, 1 },
|
||||||
size = { 218, 72 },
|
size = { 132, 80 },
|
||||||
padding = { 20, 10, 8, 10 },
|
padding = { 18, 8, 8, 8 },
|
||||||
background = "zeus:inventory:crafting",
|
background = "zeus:inventory:equipment",
|
||||||
|
|
||||||
Gui.InventoryList {
|
|
||||||
position = { 111, 1 },
|
|
||||||
slot_spacing = { 2, 2 },
|
|
||||||
source = "current_player",
|
|
||||||
list = "craft",
|
|
||||||
},
|
|
||||||
Gui.InventoryList {
|
|
||||||
position = { 163, 10 },
|
|
||||||
slot_spacing = { 2, 2 },
|
|
||||||
source = "current_player",
|
|
||||||
list = "craft_result",
|
|
||||||
},
|
|
||||||
Gui.Rect {
|
Gui.Rect {
|
||||||
key = "player_clamp",
|
key = "player_clamp",
|
||||||
|
|
||||||
position = { 41, -8 },
|
position = { 41, 1 },
|
||||||
size = { 34, 52 },
|
size = { 34, 52 },
|
||||||
overflow = "hidden",
|
overflow = "hidden",
|
||||||
|
|
||||||
@ -66,45 +90,31 @@ local menu = zepha.build_gui(function()
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Gui.Rect {
|
Gui.Rect {
|
||||||
position = { 2, 160 },
|
key = "dynamic",
|
||||||
size = { 214, 67 },
|
|
||||||
background = "zeus:inventory:inventory_wheel",
|
position = { 106, 80 },
|
||||||
|
size = { 132, 107 },
|
||||||
|
padding = { 8, 8, 8, 8 },
|
||||||
|
background = "zeus:inventory:dynamic",
|
||||||
|
|
||||||
Gui.InventoryList {
|
Gui.InventoryList {
|
||||||
position = { 9, 1 },
|
position = { 1, 1 },
|
||||||
slot_spacing = { 2, 2 },
|
slot_spacing = { 2, 2 },
|
||||||
source = "current_player",
|
source = "current_player",
|
||||||
list = "hot_wheel_1",
|
list = "mod",
|
||||||
|
},
|
||||||
|
|
||||||
|
Gui.InventoryList {
|
||||||
|
position = { 41, 32 },
|
||||||
|
slot_spacing = { 2, 2 },
|
||||||
|
source = "current_player",
|
||||||
|
list = "craft",
|
||||||
},
|
},
|
||||||
Gui.InventoryList {
|
Gui.InventoryList {
|
||||||
position = { 117, 1 },
|
position = { 81, 41 },
|
||||||
slot_spacing = { 2, 2 },
|
slot_spacing = { 2, 2 },
|
||||||
source = "current_player",
|
source = "current_player",
|
||||||
list = "hot_wheel_2",
|
list = "craft_result",
|
||||||
},
|
|
||||||
Gui.InventoryList {
|
|
||||||
position = { 125, 25 },
|
|
||||||
slot_spacing = { 2, 2 },
|
|
||||||
source = "current_player",
|
|
||||||
list = "hot_wheel_3",
|
|
||||||
},
|
|
||||||
Gui.InventoryList {
|
|
||||||
position = { 117, 50 },
|
|
||||||
slot_spacing = { 2, 2 },
|
|
||||||
source = "current_player",
|
|
||||||
list = "hot_wheel_4",
|
|
||||||
},
|
|
||||||
Gui.InventoryList {
|
|
||||||
position = { 9, 50 },
|
|
||||||
slot_spacing = { 2, 2 },
|
|
||||||
source = "current_player",
|
|
||||||
list = "hot_wheel_5",
|
|
||||||
},
|
|
||||||
Gui.InventoryList {
|
|
||||||
position = { 1, 25 },
|
|
||||||
slot_spacing = { 2, 2 },
|
|
||||||
source = "current_player",
|
|
||||||
list = "hot_wheel_6",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,13 @@ zepha.bind("new_player", function(p)
|
|||||||
local inv = p:get_inventory()
|
local inv = p:get_inventory()
|
||||||
|
|
||||||
-- Resize the main inventory
|
-- Resize the main inventory
|
||||||
inv:get_list("main"):resize(44, 11);
|
inv:get_list("main"):resize(15, 5);
|
||||||
|
|
||||||
|
-- Create inventory mod slot
|
||||||
|
inv:add_list("mod", 1, 1);
|
||||||
|
|
||||||
-- Create and bind crafting inventories
|
-- Create and bind crafting inventories
|
||||||
local craft_input = inv:add_list("craft", 4, 2)
|
local craft_input = inv:add_list("craft", 4, 2)
|
||||||
local craft_output = inv:add_list("craft_result", 2, 2)
|
local craft_output = inv:add_list("craft_result", 1, 1)
|
||||||
crafting.bind(craft_input, craft_output)
|
crafting.bind(craft_input, craft_output)
|
||||||
end)
|
end)
|
BIN
subgames/zeus/mods/zeus_inventory/textures/backpack.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
subgames/zeus/mods/zeus_inventory/textures/dynamic.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
subgames/zeus/mods/zeus_inventory/textures/equipment.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
subgames/zeus/mods/zeus_inventory/textures/inventory_new.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
subgames/zeus/mods/zeus_inventory/textures/inventory_new.xcf
Normal file
BIN
subgames/zeus/mods/zeus_inventory/textures/inventory_new_alt.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
subgames/zeus/mods/zeus_inventory/textures/inventory_new_alt.xcf
Normal file
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |