Functioning output table
This commit is contained in:
parent
8b55f4d71e
commit
ad17db85b5
14
crafting.lua
14
crafting.lua
@ -11,12 +11,18 @@ crafting_y = 350
|
|||||||
craft_inv_x = 120
|
craft_inv_x = 120
|
||||||
craft_inv_y = 50
|
craft_inv_y = 50
|
||||||
|
|
||||||
|
craft_output_x = 380
|
||||||
|
craft_output_y = 134
|
||||||
|
|
||||||
crafting_selection_x = 1
|
crafting_selection_x = 1
|
||||||
crafting_selection_y = 1
|
crafting_selection_y = 1
|
||||||
|
|
||||||
craft_inventory_selection_x = 0
|
craft_inventory_selection_x = 0
|
||||||
craft_inventory_selection_y = 0
|
craft_inventory_selection_y = 0
|
||||||
|
|
||||||
|
craft_output_selection_x = 0
|
||||||
|
craft_output_selection_y = 0
|
||||||
|
|
||||||
crafting.craft_inventory = {}
|
crafting.craft_inventory = {}
|
||||||
|
|
||||||
--create crafting inventory
|
--create crafting inventory
|
||||||
@ -27,6 +33,14 @@ end
|
|||||||
--draw entire inventory
|
--draw entire inventory
|
||||||
function crafting.render_crafting()
|
function crafting.render_crafting()
|
||||||
if crafting_open == true then
|
if crafting_open == true then
|
||||||
|
--draw output table
|
||||||
|
love.graphics.draw(inventory_slot, craft_output_x, craft_output_y,0, 1, 1)
|
||||||
|
|
||||||
|
--draw output selection
|
||||||
|
if craft_output_selection_x > 0 and craft_output_selection_y > 0 then
|
||||||
|
love.graphics.draw(inventory_slot_selection, craft_output_x, craft_output_y,0, 1, 1)
|
||||||
|
end
|
||||||
|
|
||||||
--draw crafting table
|
--draw crafting table
|
||||||
local xstep = 0
|
local xstep = 0
|
||||||
local ystep = 0
|
local ystep = 0
|
||||||
|
15
menu.lua
15
menu.lua
@ -201,15 +201,24 @@ function menu.cursor()
|
|||||||
if x > crafting_x and x < crafting_x + (inventory_size*84) and y > crafting_y and y < crafting_y + (inventory_height*84) then
|
if x > crafting_x and x < crafting_x + (inventory_size*84) and y > crafting_y and y < crafting_y + (inventory_height*84) then
|
||||||
crafting_selection_x = math.ceil((x-crafting_x)/84)
|
crafting_selection_x = math.ceil((x-crafting_x)/84)
|
||||||
crafting_selection_y = math.ceil((y-crafting_y)/84)
|
crafting_selection_y = math.ceil((y-crafting_y)/84)
|
||||||
elseif x > craft_inv_x and x < craft_inv_x + (crafting.craft_size*84) and y > craft_inv_y and y < craft_inv_y + (crafting.craft_size*84) then
|
|
||||||
craft_inventory_selection_x = math.ceil((x-craft_inv_x)/84)
|
|
||||||
craft_inventory_selection_y = math.ceil((y-craft_inv_y)/84)
|
|
||||||
else
|
else
|
||||||
crafting_selection_x = -1
|
crafting_selection_x = -1
|
||||||
crafting_selection_y = -1
|
crafting_selection_y = -1
|
||||||
|
end
|
||||||
|
if x > craft_inv_x and x < craft_inv_x + (crafting.craft_size*84) and y > craft_inv_y and y < craft_inv_y + (crafting.craft_size*84) then
|
||||||
|
craft_inventory_selection_x = math.ceil((x-craft_inv_x)/84)
|
||||||
|
craft_inventory_selection_y = math.ceil((y-craft_inv_y)/84)
|
||||||
|
else
|
||||||
craft_inventory_selection_x = -1
|
craft_inventory_selection_x = -1
|
||||||
craft_inventory_selection_y = -1
|
craft_inventory_selection_y = -1
|
||||||
end
|
end
|
||||||
|
if x > craft_output_x and x < craft_output_x + 84 and y > craft_output_y and y < craft_output_y + 84 then
|
||||||
|
craft_output_selection_x = math.ceil((x-craft_output_x)/84)
|
||||||
|
craft_output_selection_y = math.ceil((y-craft_output_y)/84)
|
||||||
|
else
|
||||||
|
craft_output_selection_x = -1
|
||||||
|
craft_output_selection_y = -1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user