Remove comments

This commit is contained in:
jordan4ibanez 2017-07-26 01:48:23 -04:00
parent c0bb461e18
commit 30e4b336fa

View File

@ -154,6 +154,7 @@ function crafting.move_items()
local left = love.mouse.isDown(1)
local right = love.mouse.isDown(2) --split stack in half
--left click
if crafting_open == true then
if left and old_left_mouse == false then
--the full inventory
@ -163,24 +164,6 @@ function crafting.move_items()
crafting.held_item["id"] = inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["id"]
crafting.held_item["count"] = inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["count"]
inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)] = {}
--[[
print("removeing")
local old_slot = inventory[selected_slot]
inventory_remove(selected_slot,nil)
selected_slot =
inventory_add(old_slot["id"],selected_slot)
crafting_selection_x,crafting_selection_y = -1,-1
selected_slot = -1
old_selected_slot = selected_slot
]]--
--else
-- print("test")
-- selected_slot = crafting_selection_x + ((crafting_selection_y-1) * inventory_size)
else
if not inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["id"] then
inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["id"] = crafting.held_item["id"]
@ -199,24 +182,6 @@ function crafting.move_items()
crafting.held_item["id"] = crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["id"]
crafting.held_item["count"] = crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["count"]
crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))] = {}
--[[
print("removeing")
local old_slot = inventory[selected_slot]
inventory_remove(selected_slot,nil)
selected_slot =
inventory_add(old_slot["id"],selected_slot)
crafting_selection_x,crafting_selection_y = -1,-1
selected_slot = -1
old_selected_slot = selected_slot
]]--
--else
-- print("test")
-- selected_slot = crafting_selection_x + ((crafting_selection_y-1) * inventory_size)
else
if not crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["id"] then
--print("test2")
@ -230,40 +195,18 @@ function crafting.move_items()
--only allow grabbing from output
elseif craft_output_selection_x > 0 and craft_output_selection_y > 0 then
--if not crafting.held_item["id"] then
if not crafting.held_item["id"] then
-- --print("nothing here: "..(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size)))
-- crafting.held_item["id"] = crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"]
-- crafting.held_item["count"] = crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["count"]
-- crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))] = {}
--[[
print("removeing")
local old_slot = inventory[selected_slot]
inventory_remove(selected_slot,nil)
selected_slot =
inventory_add(old_slot["id"],selected_slot)
crafting_selection_x,crafting_selection_y = -1,-1
selected_slot = -1
old_selected_slot = selected_slot
]]--
--else
-- print("test")
-- selected_slot = crafting_selection_x + ((crafting_selection_y-1) * inventory_size)
--else
if not crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"] then
--print("test2")
crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"] = crafting.held_item["id"]
crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["count"] = crafting.held_item["count"]
crafting.held_item = {}
end
--end
crafting.held_item["id"] = crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"]
crafting.held_item["count"] = crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["count"]
crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))] = {}
end
end
--right click
--place 1 or split stack
elseif right and old_right_mouse == false then
--the full inventory
@ -274,24 +217,6 @@ function crafting.move_items()
crafting.held_item["count"] = math.floor(inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["count"]/2)
inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["count"] = math.ceil(inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["count"]/2)
--[[
print("removeing")
local old_slot = inventory[selected_slot]
inventory_remove(selected_slot,nil)
selected_slot =
inventory_add(old_slot["id"],selected_slot)
crafting_selection_x,crafting_selection_y = -1,-1
selected_slot = -1
old_selected_slot = selected_slot
]]--
--else
-- print("test")
-- selected_slot = crafting_selection_x + ((crafting_selection_y-1) * inventory_size)
else
if not inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["id"] then
inventory[crafting_selection_x + ((crafting_selection_y-1) * inventory_size)]["id"] = crafting.held_item["id"]
@ -310,24 +235,6 @@ function crafting.move_items()
crafting.held_item["id"] = crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["id"]
crafting.held_item["count"] = math.floor(crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["count"]/2)
crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["count"] = math.ceil(crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["count"]/2)
--[[
print("removeing")
local old_slot = inventory[selected_slot]
inventory_remove(selected_slot,nil)
selected_slot =
inventory_add(old_slot["id"],selected_slot)
crafting_selection_x,crafting_selection_y = -1,-1
selected_slot = -1
old_selected_slot = selected_slot
]]--
--else
-- print("test")
-- selected_slot = crafting_selection_x + ((crafting_selection_y-1) * inventory_size)
else
if not crafting.craft_inventory[(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size))]["id"] then
--print("test2")
@ -340,31 +247,6 @@ function crafting.move_items()
--only allow grabbing from output
elseif craft_output_selection_x > 0 and craft_output_selection_y > 0 then
--if not crafting.held_item["id"] then
-- --print("nothing here: "..(craft_inventory_selection_x + ((craft_inventory_selection_y-1) * crafting.craft_size)))
-- crafting.held_item["id"] = crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"]
-- crafting.held_item["count"] = crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["count"]
-- crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))] = {}
--[[
print("removeing")
local old_slot = inventory[selected_slot]
inventory_remove(selected_slot,nil)
selected_slot =
inventory_add(old_slot["id"],selected_slot)
crafting_selection_x,crafting_selection_y = -1,-1
selected_slot = -1
old_selected_slot = selected_slot
]]--
--else
-- print("test")
-- selected_slot = crafting_selection_x + ((crafting_selection_y-1) * inventory_size)
--else
if not crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"] then
--print("test2")
crafting.output_inventory[(craft_output_selection_x + ((craft_output_selection_y-1) * 1))]["id"] = crafting.held_item["id"]