Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
55d364acae | |||
0a8ae9a3d7 | |||
0e2f233234 | |||
aeeac6ac1b | |||
0c4b4e6c4f | |||
7b31c998de | |||
7ee19e3dc5 | |||
60e21627e1 | |||
7e7422def7 |
2
init.lua
@ -20,7 +20,7 @@ local function lf(path)
|
|||||||
end
|
end
|
||||||
|
|
||||||
i3 = {
|
i3 = {
|
||||||
version = 180,
|
version = 190,
|
||||||
data = core.deserialize(storage:get_string"data") or {},
|
data = core.deserialize(storage:get_string"data") or {},
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
BIN
sounds/i3_heavy_armor.ogg
Normal file
BIN
sounds/i3_heavy_boots.ogg
Normal file
BIN
sounds/i3_heavy_helmet.ogg
Normal file
BIN
sounds/i3_heavy_leggings.ogg
Normal file
BIN
sounds/i3_heavy_shield.ogg
Normal file
BIN
sounds/i3_light_armor.ogg
Normal file
BIN
sounds/i3_light_boots.ogg
Normal file
BIN
sounds/i3_light_helmet.ogg
Normal file
BIN
sounds/i3_light_leggings.ogg
Normal file
BIN
sounds/i3_light_shield.ogg
Normal file
@ -56,7 +56,6 @@ local function cache_groups(group, groups)
|
|||||||
|
|
||||||
if c > 1 then
|
if c > 1 then
|
||||||
sprite = sprite:gsub("WxH", px .. "x" .. px * c)
|
sprite = sprite:gsub("WxH", px .. "x" .. px * c)
|
||||||
|
|
||||||
i3.groups[group].sprite = sprite
|
i3.groups[group].sprite = sprite
|
||||||
i3.groups[group].count = c
|
i3.groups[group].count = c
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ local init_hud = i3.files.hud()
|
|||||||
local set_fs = i3.set_fs
|
local set_fs = i3.set_fs
|
||||||
|
|
||||||
IMPORT("slz", "min", "insert", "copy", "ItemStack")
|
IMPORT("slz", "min", "insert", "copy", "ItemStack")
|
||||||
IMPORT("spawn_item", "reset_data", "get_detached_inv")
|
IMPORT("spawn_item", "reset_data", "get_detached_inv", "play_sound")
|
||||||
|
|
||||||
core.register_on_player_hpchange(function(player, hpchange)
|
core.register_on_player_hpchange(function(player, hpchange)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
@ -66,16 +66,89 @@ core.register_on_player_inventory_action(function(player, _, _, info)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if core.global_exists("armor") then
|
if core.global_exists"armor" then
|
||||||
i3.modules.armor = true
|
i3.modules.armor = true
|
||||||
armor:register_on_update(set_fs)
|
|
||||||
|
local group_indexes = {
|
||||||
|
{"armor_head", "i3_heavy_helmet"},
|
||||||
|
{"armor_torso", "i3_heavy_armor"},
|
||||||
|
{"armor_legs", "i3_heavy_leggings"},
|
||||||
|
{"armor_feet", "i3_heavy_boots"},
|
||||||
|
{"armor_shield", "i3_heavy_shield"},
|
||||||
|
}
|
||||||
|
|
||||||
|
local function check_group(def, group)
|
||||||
|
return def.groups[group] and def.groups[group] > 0
|
||||||
|
end
|
||||||
|
|
||||||
|
armor:register_on_equip(function(player, idx, stack)
|
||||||
|
local _, armor_inv = armor:get_valid_player(player, "3d_armor")
|
||||||
|
local def = stack:get_definition()
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local data = i3.data[name]
|
||||||
|
|
||||||
|
for i, v in ipairs(group_indexes) do
|
||||||
|
local group, sound = unpack(v)
|
||||||
|
local stackname = stack:get_name()
|
||||||
|
|
||||||
|
if stackname:find"wood" or stackname:find"stone" or stackname:find"cactus" then
|
||||||
|
sound = sound:gsub("heavy", "light")
|
||||||
|
end
|
||||||
|
|
||||||
|
if i == idx and check_group(def, group) then
|
||||||
|
data.armor_allow = sound
|
||||||
|
return armor:register_on_update(set_fs)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
data.armor_disallow = true
|
||||||
|
armor_inv:remove_item("armor", stack)
|
||||||
|
end)
|
||||||
|
|
||||||
|
armor:register_on_update(function(player)
|
||||||
|
local _, armor_inv = armor:get_valid_player(player, "3d_armor")
|
||||||
|
if not armor_inv then return end
|
||||||
|
|
||||||
|
for i = 1, 5 do
|
||||||
|
local stack = armor_inv:get_stack("armor", i)
|
||||||
|
local def = stack:get_definition()
|
||||||
|
|
||||||
|
for j, v in ipairs(group_indexes) do
|
||||||
|
local group = v[1]
|
||||||
|
|
||||||
|
if check_group(def, group) and i ~= j then
|
||||||
|
armor_inv:set_stack("armor", i, armor_inv:get_stack("armor", j))
|
||||||
|
armor_inv:set_stack("armor", j, stack)
|
||||||
|
|
||||||
|
return play_sound(player:get_player_name(), "i3_cannot", 0.8)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
core.register_on_player_inventory_action(function(player, action, _, info)
|
||||||
|
if action ~= "take" then return end
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local data = i3.data[name]
|
||||||
|
|
||||||
|
if data.armor_disallow then
|
||||||
|
local inv = player:get_inventory()
|
||||||
|
inv:set_stack("main", info.index, info.stack)
|
||||||
|
data.armor_disallow = nil
|
||||||
|
play_sound(name, "i3_cannot", 0.8)
|
||||||
|
|
||||||
|
elseif data.armor_allow then
|
||||||
|
play_sound(name, data.armor_allow, 0.8)
|
||||||
|
data.armor_allow = nil
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if core.global_exists("skins") then
|
if core.global_exists"skins" then
|
||||||
i3.modules.skins = true
|
i3.modules.skins = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if core.global_exists("awards") then
|
if core.global_exists"awards" then
|
||||||
i3.modules.awards = true
|
i3.modules.awards = true
|
||||||
|
|
||||||
core.register_on_craft(function(_, player)
|
core.register_on_craft(function(_, player)
|
||||||
@ -144,7 +217,7 @@ local function init_data(player, info)
|
|||||||
data.auto_sorting = false
|
data.auto_sorting = false
|
||||||
data.reverse_sorting = false
|
data.reverse_sorting = false
|
||||||
data.inv_compress = true
|
data.inv_compress = true
|
||||||
data.export_counts = {}
|
data.crafting_counts = {}
|
||||||
data.tab = 1
|
data.tab = 1
|
||||||
data.itab = 1
|
data.itab = 1
|
||||||
data.subcat = 1
|
data.subcat = 1
|
||||||
|
@ -408,12 +408,13 @@ end
|
|||||||
local function craft_stack(player, data, craft_rcp)
|
local function craft_stack(player, data, craft_rcp)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local rcp_usg = craft_rcp and "recipe" or "usage"
|
local rcp_usg = craft_rcp and "recipe" or "usage"
|
||||||
|
local rcp_def = rcp_usg == "recipe" and data.recipes[data.rnum] or data.usages[data.unum]
|
||||||
local output = craft_rcp and data.recipes[data.rnum].output or data.usages[data.unum].output
|
local output = craft_rcp and data.recipes[data.rnum].output or data.usages[data.unum].output
|
||||||
output = ItemStack(output)
|
output = ItemStack(output)
|
||||||
local stackname, stackcount, stackmax = output:get_name(), output:get_count(), output:get_stack_max()
|
local stackname, stackcount, stackmax = output:get_name(), output:get_count(), output:get_stack_max()
|
||||||
local scrbar_val = data[fmt("scrbar_%s", craft_rcp and "rcp" or "usg")] or 1
|
local scrbar_val = data[fmt("scrbar_%s", craft_rcp and "rcp" or "usg")] or 1
|
||||||
|
|
||||||
for name, count in pairs(data.export_counts[rcp_usg].rcp) do
|
for name, count in pairs(data.crafting_counts[rcp_usg].rcp) do
|
||||||
local items = {[name] = count}
|
local items = {[name] = count}
|
||||||
|
|
||||||
if is_group(name) then
|
if is_group(name) then
|
||||||
@ -424,7 +425,7 @@ local function craft_stack(player, data, craft_rcp)
|
|||||||
local remaining = count
|
local remaining = count
|
||||||
|
|
||||||
for _, item in ipairs(item_groups) do
|
for _, item in ipairs(item_groups) do
|
||||||
for _name, _count in pairs(data.export_counts[rcp_usg].inv) do
|
for _name, _count in pairs(data.crafting_counts[rcp_usg].inv) do
|
||||||
if item == _name and remaining > 0 then
|
if item == _name and remaining > 0 then
|
||||||
local c = min(remaining, _count)
|
local c = min(remaining, _count)
|
||||||
items[item] = c
|
items[item] = c
|
||||||
@ -441,6 +442,14 @@ local function craft_stack(player, data, craft_rcp)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if rcp_def.replacements then
|
||||||
|
for _, v in ipairs(rcp_def.replacements) do
|
||||||
|
for _, item2 in ipairs(v) do
|
||||||
|
get_stack(player, ItemStack(item2))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local count = stackcount * scrbar_val
|
local count = stackcount * scrbar_val
|
||||||
local iter = ceil(count / stackmax)
|
local iter = ceil(count / stackmax)
|
||||||
local leftover = count
|
local leftover = count
|
||||||
@ -595,10 +604,11 @@ local function reset_data(data)
|
|||||||
data.scrbar_usg = 1
|
data.scrbar_usg = 1
|
||||||
data.query_item = nil
|
data.query_item = nil
|
||||||
data.enable_search = nil
|
data.enable_search = nil
|
||||||
|
data.goto_page = nil
|
||||||
data.recipes = nil
|
data.recipes = nil
|
||||||
data.usages = nil
|
data.usages = nil
|
||||||
data.export_rcp = nil
|
data.crafting_rcp = nil
|
||||||
data.export_usg = nil
|
data.crafting_usg = nil
|
||||||
data.alt_items = nil
|
data.alt_items = nil
|
||||||
data.confirm_trash = nil
|
data.confirm_trash = nil
|
||||||
data.show_settings = nil
|
data.show_settings = nil
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local set_fs = i3.set_fs
|
local set_fs = i3.set_fs
|
||||||
|
|
||||||
IMPORT("vec_eq", "vec_round")
|
|
||||||
IMPORT("reg_items", "reg_aliases")
|
IMPORT("reg_items", "reg_aliases")
|
||||||
|
IMPORT("min", "max", "vec_eq", "vec_round")
|
||||||
IMPORT("S", "random", "translate", "ItemStack")
|
IMPORT("S", "random", "translate", "ItemStack")
|
||||||
IMPORT("sort", "copy", "insert", "remove", "indexof")
|
IMPORT("sort", "copy", "insert", "remove", "indexof")
|
||||||
IMPORT("fmt", "find", "match", "sub", "lower", "split", "toupper")
|
IMPORT("fmt", "find", "match", "sub", "lower", "split", "toupper")
|
||||||
@ -89,6 +89,7 @@ local function inv_fields(player, data, fields)
|
|||||||
data.show_settings = nil
|
data.show_settings = nil
|
||||||
data.waypoint_see = nil
|
data.waypoint_see = nil
|
||||||
data.bag_rename = nil
|
data.bag_rename = nil
|
||||||
|
data.goto_page = nil
|
||||||
|
|
||||||
if data.filter == "" then
|
if data.filter == "" then
|
||||||
data.enable_search = nil
|
data.enable_search = nil
|
||||||
@ -303,8 +304,8 @@ local function select_item(player, data, fields)
|
|||||||
data.unum = 1
|
data.unum = 1
|
||||||
data.scrbar_rcp = 1
|
data.scrbar_rcp = 1
|
||||||
data.scrbar_usg = 1
|
data.scrbar_usg = 1
|
||||||
data.export_rcp = nil
|
data.crafting_rcp = nil
|
||||||
data.export_usg = nil
|
data.crafting_usg = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -323,7 +324,6 @@ local function rcp_fields(player, data, fields)
|
|||||||
|
|
||||||
elseif fields.enable_search then
|
elseif fields.enable_search then
|
||||||
data.enable_search = true
|
data.enable_search = true
|
||||||
return set_fs(player)
|
|
||||||
|
|
||||||
elseif fields.filter and (fields.key_enter_field == "filter" or fields.search) then
|
elseif fields.filter and (fields.key_enter_field == "filter" or fields.search) then
|
||||||
if fields.filter == "" then
|
if fields.filter == "" then
|
||||||
@ -343,6 +343,14 @@ local function rcp_fields(player, data, fields)
|
|||||||
sort_by_category(data)
|
sort_by_category(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
elseif fields.pagenum then
|
||||||
|
data.goto_page = not data.goto_page
|
||||||
|
|
||||||
|
elseif fields.goto_page then
|
||||||
|
local pagenum = tonumber(fields.goto_page)
|
||||||
|
data.pagenum = max(1, min(data.pagemax, pagenum or data.pagenum))
|
||||||
|
data.goto_page = nil
|
||||||
|
|
||||||
elseif fields.prev_page or fields.next_page then
|
elseif fields.prev_page or fields.next_page then
|
||||||
if data.pagemax == 1 then return end
|
if data.pagemax == 1 then return end
|
||||||
data.pagenum -= (fields.prev_page and 1 or -1)
|
data.pagenum -= (fields.prev_page and 1 or -1)
|
||||||
@ -366,13 +374,13 @@ local function rcp_fields(player, data, fields)
|
|||||||
elseif fields.prev_recipe or fields.next_recipe then
|
elseif fields.prev_recipe or fields.next_recipe then
|
||||||
local num = data.rnum + (fields.prev_recipe and -1 or 1)
|
local num = data.rnum + (fields.prev_recipe and -1 or 1)
|
||||||
data.rnum = data.recipes[num] and num or (fields.prev_recipe and #data.recipes or 1)
|
data.rnum = data.recipes[num] and num or (fields.prev_recipe and #data.recipes or 1)
|
||||||
data.export_rcp = nil
|
data.crafting_rcp = nil
|
||||||
data.scrbar_rcp = 1
|
data.scrbar_rcp = 1
|
||||||
|
|
||||||
elseif fields.prev_usage or fields.next_usage then
|
elseif fields.prev_usage or fields.next_usage then
|
||||||
local num = data.unum + (fields.prev_usage and -1 or 1)
|
local num = data.unum + (fields.prev_usage and -1 or 1)
|
||||||
data.unum = data.usages[num] and num or (fields.prev_usage and #data.usages or 1)
|
data.unum = data.usages[num] and num or (fields.prev_usage and #data.usages or 1)
|
||||||
data.export_usg = nil
|
data.crafting_usg = nil
|
||||||
data.scrbar_usg = 1
|
data.scrbar_usg = 1
|
||||||
|
|
||||||
elseif fields.fav then
|
elseif fields.fav then
|
||||||
@ -384,17 +392,17 @@ local function rcp_fields(player, data, fields)
|
|||||||
remove(data.favs, fav)
|
remove(data.favs, fav)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif fields.export_rcp or fields.export_usg then
|
elseif fields.crafting_rcp or fields.crafting_usg then
|
||||||
if fields.export_rcp then
|
if fields.crafting_rcp then
|
||||||
data.export_rcp = not data.export_rcp
|
data.crafting_rcp = not data.crafting_rcp
|
||||||
|
|
||||||
if not data.export_rcp then
|
if not data.crafting_rcp then
|
||||||
data.scrbar_rcp = 1
|
data.scrbar_rcp = 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
data.export_usg = not data.export_usg
|
data.crafting_usg = not data.crafting_usg
|
||||||
|
|
||||||
if not data.export_usg then
|
if not data.crafting_usg then
|
||||||
data.scrbar_usg = 1
|
data.scrbar_usg = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -407,10 +415,10 @@ local function rcp_fields(player, data, fields)
|
|||||||
craft_stack(player, data, fields.craft_rcp)
|
craft_stack(player, data, fields.craft_rcp)
|
||||||
|
|
||||||
if fields.craft_rcp then
|
if fields.craft_rcp then
|
||||||
data.export_rcp = nil
|
data.crafting_rcp = nil
|
||||||
data.scrbar_rcp = 1
|
data.scrbar_rcp = 1
|
||||||
else
|
else
|
||||||
data.export_usg = nil
|
data.crafting_usg = nil
|
||||||
data.scrbar_usg = 1
|
data.scrbar_usg = 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -429,9 +437,8 @@ core.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- No-op buttons
|
-- No-op buttons
|
||||||
if fields.player_name or fields.awards or fields.home_pos or fields.pagenum or
|
if fields.player_name or fields.awards or fields.home_pos or fields.no_item or
|
||||||
fields.no_item or fields.no_rcp or fields.select_sorting or fields.sort_method or
|
fields.no_rcp or fields.select_sorting or fields.sort_method or fields.bg_content then
|
||||||
fields.bg_content then
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
111
src/gui.lua
@ -82,8 +82,8 @@ local function get_stack_max(inv, data, is_recipe, rcp)
|
|||||||
counts_rcp[it] = (counts_rcp[it] or 0) + 1
|
counts_rcp[it] = (counts_rcp[it] or 0) + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
data.export_counts[rcp_usg] = {}
|
data.crafting_counts[rcp_usg] = {}
|
||||||
data.export_counts[rcp_usg].rcp = counts_rcp
|
data.crafting_counts[rcp_usg].rcp = counts_rcp
|
||||||
|
|
||||||
for i = 1, size do
|
for i = 1, size do
|
||||||
local stack = list[i]
|
local stack = list[i]
|
||||||
@ -111,7 +111,7 @@ local function get_stack_max(inv, data, is_recipe, rcp)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
data.export_counts[rcp_usg].inv = counts_inv
|
data.crafting_counts[rcp_usg].inv = counts_inv
|
||||||
|
|
||||||
for name in pairs(counts_rcp) do
|
for name in pairs(counts_rcp) do
|
||||||
counts[name] = floor((counts_inv[name] or 0) / (counts_rcp[name] or 0))
|
counts[name] = floor((counts_inv[name] or 0) / (counts_rcp[name] or 0))
|
||||||
@ -365,7 +365,7 @@ local function get_waypoint_fs(fs, data, player, yextra, ctn_len)
|
|||||||
|
|
||||||
if waypoint_preview then
|
if waypoint_preview then
|
||||||
image(0.25, y - 3.5, 5, 4, PNG.bg_content)
|
image(0.25, y - 3.5, 5, 4, PNG.bg_content)
|
||||||
fs"style[area_preview;font_size=16]"
|
fs"style[area_preview;font_size=16;textcolor=#ddd]"
|
||||||
button(0.25, y - 3.35, 5, 0.55, "area_preview", v.name)
|
button(0.25, y - 3.35, 5, 0.55, "area_preview", v.name)
|
||||||
image_button(4.65, y - 3.25, 0.25, 0.25, PNG.cancel_hover .. "^\\[brighten", "close_preview", "")
|
image_button(4.65, y - 3.25, 0.25, 0.25, PNG.cancel_hover .. "^\\[brighten", "close_preview", "")
|
||||||
|
|
||||||
@ -374,7 +374,7 @@ local function get_waypoint_fs(fs, data, player, yextra, ctn_len)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
fs"style_type[label;font=normal;font_size=16]"
|
fs"style_type[label;font=normal;font_size=16;textcolor=#fff]"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_bag_fs(fs, data, name, esc_name, bag_size, yextra)
|
local function get_bag_fs(fs, data, name, esc_name, bag_size, yextra)
|
||||||
@ -462,7 +462,7 @@ local function get_container(fs, data, player, yoffset, ctn_len, award_list, awa
|
|||||||
end
|
end
|
||||||
|
|
||||||
box(0, yextra + 0.45, ctn_len, 0.045, "#bababa50")
|
box(0, yextra + 0.45, ctn_len, 0.045, "#bababa50")
|
||||||
box((data.subcat - 1) * 1.18, yextra + 0.45, 1, 0.045, "#f9826c")
|
image((data.subcat - 1) * 1.18, yextra + 0.45, 1, 0.045, PNG.highlight)
|
||||||
|
|
||||||
local function not_installed(modname)
|
local function not_installed(modname)
|
||||||
hypertext(0, yextra + 0.9, ctn_len, 0.6, "not_installed",
|
hypertext(0, yextra + 0.9, ctn_len, 0.6, "not_installed",
|
||||||
@ -479,9 +479,39 @@ local function get_container(fs, data, player, yoffset, ctn_len, award_list, awa
|
|||||||
end
|
end
|
||||||
|
|
||||||
local armor_def = armor.def[name]
|
local armor_def = armor.def[name]
|
||||||
fs(fmt("list[detached:%s_armor;armor;0,%f;3,2;]", esc_name, yextra + 0.7))
|
fs(fmt("list[detached:%s_armor;armor;0,%f;5,1;]", esc_name, yextra + 0.7))
|
||||||
label(3.65, yextra + 1.55, fmt("%s: %s", ES"Level", armor_def.level))
|
|
||||||
label(3.65, yextra + 2.05, fmt("%s: %s", ES"Heal", armor_def.heal))
|
for i = 1, 5 do
|
||||||
|
local _, armor_inv = armor:get_valid_player(player, "3d_armor")
|
||||||
|
local stack = armor_inv:get_stack("armor", i)
|
||||||
|
|
||||||
|
if stack:is_empty() then
|
||||||
|
local tips = {ES"Helmet", ES"Chest", ES"Leggings", ES"Boots", ES"Shield"}
|
||||||
|
local x = (i - 1) + ((i - 1) * 0.15)
|
||||||
|
local y = yextra + 0.7
|
||||||
|
|
||||||
|
image(x, y, 1, 1, fmt("i3_armor_%u.png", i))
|
||||||
|
tooltip(x, y, 1, 1, tips[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local box_len, max_level, max_heal = 4, 85, 60
|
||||||
|
local bar_lvl = (armor_def.level * box_len) / max_level
|
||||||
|
local bar_heal = (armor_def.heal * box_len) / max_heal
|
||||||
|
|
||||||
|
fs"style_type[label;font_size=15]"
|
||||||
|
|
||||||
|
box(0.8, yextra + 1.95, box_len, 0.4, "#101010")
|
||||||
|
fs"style_type[box;colors=#9dc34c80,#9dc34c,#9dc34c,#9dc34c80]"
|
||||||
|
box(0.8, yextra + 1.95, bar_lvl, 0.4, "")
|
||||||
|
label(1.1, yextra + 2.15, ES"Armor level")
|
||||||
|
|
||||||
|
box(0.8, yextra + 2.55, box_len, 0.4, "#101010")
|
||||||
|
fs"style_type[box;colors=#4466aa80,#4466aa,#4466aa,#4466aa80]"
|
||||||
|
box(0.8, yextra + 2.55, bar_heal, 0.4, "")
|
||||||
|
label(1.1, yextra + 2.75, ES"Armor healing")
|
||||||
|
|
||||||
|
fs"style_type[label;font_size=16]"
|
||||||
|
|
||||||
elseif data.subcat == 3 then
|
elseif data.subcat == 3 then
|
||||||
if not i3.modules.skins then
|
if not i3.modules.skins then
|
||||||
@ -1074,8 +1104,9 @@ local function get_rcp_lbl(fs, data, panel, rn, is_recipe)
|
|||||||
local rcp = is_recipe and panel.rcp[data.rnum] or panel.rcp[data.unum]
|
local rcp = is_recipe and panel.rcp[data.rnum] or panel.rcp[data.unum]
|
||||||
|
|
||||||
if rcp.custom then
|
if rcp.custom then
|
||||||
hypertext(data.inv_width + 4.8, data.yoffset + 0.12, 3, 0.6, "custom_rcp",
|
local desc = i3.craft_types[rcp.type].description
|
||||||
fmt("<global size=16><right><i>%s</i></right>", ES"Custom recipe"))
|
hypertext(data.inv_width + 4.8, data.yoffset + 0.12, 3, 1, "custom_rcp",
|
||||||
|
fmt("<right><i><global size=16>%s\n<global size=15>%s</i></right>", ES"Custom recipe", desc))
|
||||||
end
|
end
|
||||||
|
|
||||||
local lbl = ES("Usage @1 of @2", data.unum, rn)
|
local lbl = ES("Usage @1 of @2", data.unum, rn)
|
||||||
@ -1205,16 +1236,16 @@ local function get_header(fs, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_export_fs(fs, data, is_recipe, is_usage, max_stacks_rcp, max_stacks_usg)
|
local function get_crafting_fs(fs, data, is_recipe, is_usage, max_stacks_rcp, max_stacks_usg)
|
||||||
local name = is_recipe and "rcp" or "usg"
|
local name = is_recipe and "rcp" or "usg"
|
||||||
local show_export = (is_recipe and data.export_rcp) or (is_usage and data.export_usg)
|
local show_crafting = (is_recipe and data.crafting_rcp) or (is_usage and data.crafting_usg)
|
||||||
|
|
||||||
fs(fmt("style[export_%s;fgimg=%s;fgimg_hovered=%s]",
|
fs(fmt("style[crafting_%s;fgimg=%s;fgimg_hovered=%s;content_offset=0]",
|
||||||
name, fmt("%s", show_export and PNG.export_hover or PNG.export), PNG.export_hover))
|
name, fmt("%s", show_crafting and PNG.crafting_hover or PNG.crafting), PNG.crafting_hover))
|
||||||
image_button(data.inv_width + 7.35, data.yoffset + 0.2, 0.45, 0.45, "", fmt("export_%s", name), "")
|
image_button(data.inv_width + 7.35, data.yoffset + 0.2, 0.45, 0.45, "", fmt("crafting_%s", name), "")
|
||||||
fs(fmt("tooltip[export_%s;%s]", name, ES"Quick crafting"))
|
fs(fmt("tooltip[crafting_%s;%s]", name, ES"Quick crafting"))
|
||||||
|
|
||||||
if not show_export then return end
|
if not show_crafting then return end
|
||||||
|
|
||||||
local craft_max = is_recipe and max_stacks_rcp or max_stacks_usg
|
local craft_max = is_recipe and max_stacks_rcp or max_stacks_usg
|
||||||
local stack_fs = (is_recipe and data.scrbar_rcp) or (is_usage and data.scrbar_usg) or 1
|
local stack_fs = (is_recipe and data.scrbar_rcp) or (is_usage and data.scrbar_usg) or 1
|
||||||
@ -1229,12 +1260,21 @@ local function get_export_fs(fs, data, is_recipe, is_usage, max_stacks_rcp, max_
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local x = data.inv_width + 6.8
|
||||||
|
|
||||||
|
fs"style_type[image,button,image_button;noclip=true]"
|
||||||
|
image(x, data.yoffset + 0.8, 3, 2, PNG.bg_content)
|
||||||
|
fs"style[quick_crafting;font_size=16;textcolor=#ddd]"
|
||||||
|
button(x, data.yoffset + 0.85, 3.05, 0.55, "quick_crafting", ES"Quick Crafting")
|
||||||
|
|
||||||
fs(fmt("style[scrbar_%s;noclip=true]", name),
|
fs(fmt("style[scrbar_%s;noclip=true]", name),
|
||||||
fmt("scrollbaroptions[min=1;max=%u;smallstep=1]", craft_max))
|
fmt("scrollbaroptions[min=1;max=%u;smallstep=1]", craft_max))
|
||||||
|
|
||||||
local x = data.inv_width + 8.1
|
scrollbar(x + 0.2, data.yoffset + 1.45, 2.5, 0.35, "horizontal", fmt("scrbar_%s", name), stack_fs)
|
||||||
scrollbar(x, data.yoffset, 2.5, 0.35, "horizontal", fmt("scrbar_%s", name), stack_fs)
|
button(x + 0.2, data.yoffset + 1.85, 2.5, 0.7, fmt("craft_%s", name), ES("Craft (×@1)", stack_fs))
|
||||||
button(x, data.yoffset + 0.4, 2.5, 0.7, fmt("craft_%s", name), ES("Craft (×@1)", stack_fs))
|
|
||||||
|
fs"style_type[label;font_size=16;textcolor=#fff]"
|
||||||
|
fs"style_type[image,button,image_button;noclip=false]"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_rcp_extra(fs, data, player, panel, is_recipe, is_usage)
|
local function get_rcp_extra(fs, data, player, panel, is_recipe, is_usage)
|
||||||
@ -1256,15 +1296,15 @@ local function get_rcp_extra(fs, data, player, panel, is_recipe, is_usage)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if is_recipe and max_stacks_rcp == 0 then
|
if is_recipe and max_stacks_rcp == 0 then
|
||||||
data.export_rcp = nil
|
data.crafting_rcp = nil
|
||||||
data.scrbar_rcp = 1
|
data.scrbar_rcp = 1
|
||||||
elseif is_usage and max_stacks_usg == 0 then
|
elseif is_usage and max_stacks_usg == 0 then
|
||||||
data.export_usg = nil
|
data.crafting_usg = nil
|
||||||
data.scrbar_usg = 1
|
data.scrbar_usg = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if max_stacks_rcp > 0 or max_stacks_usg > 0 then
|
if max_stacks_rcp > 0 or max_stacks_usg > 0 then
|
||||||
get_export_fs(fs, data, is_recipe, is_usage, max_stacks_rcp, max_stacks_usg)
|
get_crafting_fs(fs, data, is_recipe, is_usage, max_stacks_rcp, max_stacks_usg)
|
||||||
end
|
end
|
||||||
|
|
||||||
get_rcp_lbl(fs, data, panel, rn, is_recipe)
|
get_rcp_lbl(fs, data, panel, rn, is_recipe)
|
||||||
@ -1321,6 +1361,8 @@ local function get_items_fs(fs, data, player, full_height)
|
|||||||
"style[filter;font_size=18;textcolor=#ccc]",
|
"style[filter;font_size=18;textcolor=#ccc]",
|
||||||
fmt("field[%f,0.2;3.35,0.6;filter;;%s]", data.inv_width + 0.85, ESC(data.filter)),
|
fmt("field[%f,0.2;3.35,0.6;filter;;%s]", data.inv_width + 0.85, ESC(data.filter)),
|
||||||
"field_close_on_enter[filter;false]")
|
"field_close_on_enter[filter;false]")
|
||||||
|
|
||||||
|
image(data.inv_width + 0.85, 0.75, 4, 0.01, PNG.search_outline_trim .. "^[opacity:100")
|
||||||
else
|
else
|
||||||
fs"style_type[label;font=italic;font_size=18]"
|
fs"style_type[label;font=italic;font_size=18]"
|
||||||
label(data.inv_width + 0.9, 0.49, clr("#aaa", ES"Search..."))
|
label(data.inv_width + 0.9, 0.49, clr("#aaa", ES"Search..."))
|
||||||
@ -1341,7 +1383,11 @@ local function get_items_fs(fs, data, player, full_height)
|
|||||||
|
|
||||||
data.pagemax = max(1, ceil(#items / ipp))
|
data.pagemax = max(1, ceil(#items / ipp))
|
||||||
|
|
||||||
button(data.inv_width + 5.6, 0.14, 1.88, 0.7, "pagenum",
|
|
||||||
|
fs(fmt("style[pagenum;bgimg=%s;bgimg_hovered=%s;bgimg_middle=9;padding=-9]",
|
||||||
|
data.goto_page and PNG.pagenum_hover or "", PNG.pagenum_hover))
|
||||||
|
|
||||||
|
button(data.inv_width + 5.8, 0.14, 1.48, 0.7, "pagenum",
|
||||||
fmt("%s / %u", clr(colors.yellow, data.pagenum), data.pagemax))
|
fmt("%s / %u", clr(colors.yellow, data.pagenum), data.pagemax))
|
||||||
|
|
||||||
if #items == 0 then
|
if #items == 0 then
|
||||||
@ -1384,6 +1430,19 @@ local function get_items_fs(fs, data, player, full_height)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if data.goto_page then
|
||||||
|
image(data.inv_width + 4.8, 0.85, 2.9, 0.8, PNG.bg_goto)
|
||||||
|
fs"style_type[label;font_size=16;textcolor=#ddd]"
|
||||||
|
label(data.inv_width + 5, 1.25, ES"Go to page" .. ":")
|
||||||
|
box(data.inv_width + 6.5, 1, 1, 0.45, "#bababa10")
|
||||||
|
|
||||||
|
fs(fmt("style[goto_page;font=mono,bold;font_size=16;textcolor=%s]", colors.yellow),
|
||||||
|
fmt("field[%f,%f;1,0.45;goto_page;;%s]", data.inv_width + 6.55, 1.05, data.pagenum),
|
||||||
|
"field_close_on_enter[goto_page;false]")
|
||||||
|
|
||||||
|
fs"style_type[label;font_size=16;textcolor=#fff]"
|
||||||
|
end
|
||||||
|
|
||||||
local _tabs = {"All", "Nodes", "Items"}
|
local _tabs = {"All", "Nodes", "Items"}
|
||||||
local tab_len, tab_hgh = 1.8, 0.5
|
local tab_len, tab_hgh = 1.8, 0.5
|
||||||
|
|
||||||
@ -1395,7 +1454,7 @@ local function get_items_fs(fs, data, player, full_height)
|
|||||||
bgimg_middle=14,0,-14,-14;padding=-14,0,14,14] ]], hover_texture, PNG.tab_small_hover))
|
bgimg_middle=14,0,-14,-14;padding=-14,0,14,14] ]], hover_texture, PNG.tab_small_hover))
|
||||||
|
|
||||||
fs(fmt("style_type[image_button;noclip=true;font_size=16;textcolor=%s;content_offset=0;sound=i3_tab]",
|
fs(fmt("style_type[image_button;noclip=true;font_size=16;textcolor=%s;content_offset=0;sound=i3_tab]",
|
||||||
selected and "#fff" or "#ddd"))
|
selected and "#fff" or "#bbb"))
|
||||||
fs"style_type[image_button:hovered;textcolor=#fff]"
|
fs"style_type[image_button:hovered;textcolor=#fff]"
|
||||||
image_button((data.inv_width - 0.65) + (i * (tab_len + 0.1)),
|
image_button((data.inv_width - 0.65) + (i * (tab_len + 0.1)),
|
||||||
full_height, tab_len, tab_hgh, "", fmt("itab_%u", i), title)
|
full_height, tab_len, tab_hgh, "", fmt("itab_%u", i), title)
|
||||||
|
@ -4,9 +4,11 @@ local PNG = {
|
|||||||
blank = "i3_blank.png",
|
blank = "i3_blank.png",
|
||||||
bg = "i3_bg.png",
|
bg = "i3_bg.png",
|
||||||
bg_full = "i3_bg_full.png",
|
bg_full = "i3_bg_full.png",
|
||||||
|
bg_goto = "i3_bg_goto.png",
|
||||||
bg_content = "i3_bg_content.png",
|
bg_content = "i3_bg_content.png",
|
||||||
bar = "i3_bar.png",
|
bar = "i3_bar.png",
|
||||||
hotbar = "i3_hotbar.png",
|
hotbar = "i3_hotbar.png",
|
||||||
|
highlight = "i3_highlight.png",
|
||||||
search = "i3_search.png",
|
search = "i3_search.png",
|
||||||
heart = "i3_heart.png",
|
heart = "i3_heart.png",
|
||||||
heart_half = "i3_heart_half.png",
|
heart_half = "i3_heart_half.png",
|
||||||
@ -24,8 +26,9 @@ local PNG = {
|
|||||||
book = "i3_book.png",
|
book = "i3_book.png",
|
||||||
sign = "i3_sign.png",
|
sign = "i3_sign.png",
|
||||||
cancel = "i3_cancel.png",
|
cancel = "i3_cancel.png",
|
||||||
export = "i3_export.png",
|
crafting = "i3_crafting.png",
|
||||||
slot = "i3_slot.png^\\[resize:128x128",
|
slot = "i3_slot.png^\\[resize:128x128",
|
||||||
|
pagenum_hover = "i3_slot.png^\\[resize:128x128^\\[opacity:130",
|
||||||
tab = "i3_tab.png",
|
tab = "i3_tab.png",
|
||||||
tab_small = "i3_tab_small.png",
|
tab_small = "i3_tab_small.png",
|
||||||
tab_top = "i3_tab.png^\\[transformFY",
|
tab_top = "i3_tab.png^\\[transformFY",
|
||||||
@ -47,10 +50,11 @@ local PNG = {
|
|||||||
no_result = "i3_no_result.png",
|
no_result = "i3_no_result.png",
|
||||||
find_more = "i3_find_more.png",
|
find_more = "i3_find_more.png",
|
||||||
search_outline = "i3_search_outline.png",
|
search_outline = "i3_search_outline.png",
|
||||||
|
search_outline_trim = "i3_search_outline_trim.png",
|
||||||
|
|
||||||
cancel_hover = "i3_cancel.png^\\[brighten",
|
cancel_hover = "i3_cancel.png^\\[brighten",
|
||||||
search_hover = "i3_search.png^\\[brighten",
|
search_hover = "i3_search.png^\\[brighten",
|
||||||
export_hover = "i3_export.png^\\[brighten",
|
crafting_hover = "i3_crafting.png^\\[brighten",
|
||||||
trash_hover = "i3_trash.png^\\[brighten^\\[colorize:#f00:100",
|
trash_hover = "i3_trash.png^\\[brighten^\\[colorize:#f00:100",
|
||||||
compress_hover = "i3_compress.png^\\[brighten",
|
compress_hover = "i3_compress.png^\\[brighten",
|
||||||
sort_hover = "i3_sort.png^\\[brighten",
|
sort_hover = "i3_sort.png^\\[brighten",
|
||||||
@ -85,6 +89,7 @@ local styles = string.format([[
|
|||||||
style[pagenum,no_item,no_rcp;font=bold;font_size=18]
|
style[pagenum,no_item,no_rcp;font=bold;font_size=18]
|
||||||
style[search;fgimg=%s;content_offset=0]
|
style[search;fgimg=%s;content_offset=0]
|
||||||
style[enable_search:hovered;bgimg=%s]
|
style[enable_search:hovered;bgimg=%s]
|
||||||
|
style[enable_search:pressed;bgimg=%s^[opacity:178]
|
||||||
style[exit;fgimg=%s;fgimg_hovered=%s;content_offset=0]
|
style[exit;fgimg=%s;fgimg_hovered=%s;content_offset=0]
|
||||||
style[cancel;fgimg=%s;fgimg_hovered=%s;content_offset=0]
|
style[cancel;fgimg=%s;fgimg_hovered=%s;content_offset=0]
|
||||||
style[prev_page,prev_recipe,prev_usage,prev_sort,prev_skin;fgimg=%s;fgimg_hovered=%s]
|
style[prev_page,prev_recipe,prev_usage,prev_sort,prev_skin;fgimg=%s;fgimg_hovered=%s]
|
||||||
@ -102,7 +107,7 @@ local styles = string.format([[
|
|||||||
]],
|
]],
|
||||||
PNG.slot,
|
PNG.slot,
|
||||||
PNG.search_hover,
|
PNG.search_hover,
|
||||||
PNG.search_outline,
|
PNG.search_outline, PNG.search_outline,
|
||||||
PNG.exit, PNG.exit_hover,
|
PNG.exit, PNG.exit_hover,
|
||||||
PNG.cancel, PNG.cancel_hover,
|
PNG.cancel, PNG.cancel_hover,
|
||||||
PNG.prev, PNG.prev_hover,
|
PNG.prev, PNG.prev_hover,
|
||||||
|
BIN
textures/i3_armor_1.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
textures/i3_armor_2.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
textures/i3_armor_3.png
Normal file
After Width: | Height: | Size: 175 B |
BIN
textures/i3_armor_4.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
textures/i3_armor_5.png
Normal file
After Width: | Height: | Size: 141 B |
BIN
textures/i3_bg_goto.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
textures/i3_crafting.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.1 KiB |
BIN
textures/i3_highlight.png
Normal file
After Width: | Height: | Size: 70 B |
BIN
textures/i3_search_outline_trim.png
Normal file
After Width: | Height: | Size: 304 B |