mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-06 05:16:06 -06:00
initial updates to the LTN GUI for 2.0
This commit is contained in:
BIN
cybersyn/graphics/shortcut/shortcut_icon.png
Normal file
BIN
cybersyn/graphics/shortcut/shortcut_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 430 B |
BIN
cybersyn/graphics/shortcut/shortcut_icon_small.png
Normal file
BIN
cybersyn/graphics/shortcut/shortcut_icon_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 497 B |
@@ -389,10 +389,14 @@ if settings.startup["cybersyn-manager-enabled"].value then
|
|||||||
{
|
{
|
||||||
type = "shortcut",
|
type = "shortcut",
|
||||||
name = "cybersyn-toggle-gui",
|
name = "cybersyn-toggle-gui",
|
||||||
icon = data_util.build_sprite(nil, { 0, 0 }, util.paths.shortcut_icons, 32, 2),
|
icon = "__cybersyn__/graphics/shortcut/shortcut_icon.png",
|
||||||
disabled_icon = data_util.build_sprite(nil, { 48, 0 }, util.paths.shortcut_icons, 32, 2),
|
icon_size = 32,
|
||||||
small_icon = data_util.build_sprite(nil, { 0, 32 }, util.paths.shortcut_icons, 24, 2),
|
small_icon = "__cybersyn__/graphics/shortcut/shortcut_icon.png",
|
||||||
disabled_small_icon = data_util.build_sprite(nil, { 36, 32 }, util.paths.shortcut_icons, 24, 2),
|
small_icon_size = 24,
|
||||||
|
--icon = data_util.build_sprite("nil", { 0, 0 }, util.paths.shortcut_icons, 32, 2),
|
||||||
|
--disabled_icon = data_util.build_sprite(nil, { 48, 0 }, util.paths.shortcut_icons, 32, 2),
|
||||||
|
--small_icon = data_util.build_sprite(nil, { 0, 32 }, util.paths.shortcut_icons, 24, 2),
|
||||||
|
--disabled_small_icon = data_util.build_sprite(nil, { 36, 32 }, util.paths.shortcut_icons, 24, 2),
|
||||||
toggleable = true,
|
toggleable = true,
|
||||||
action = "lua",
|
action = "lua",
|
||||||
associated_control_input = "cybersyn-toggle-gui",
|
associated_control_input = "cybersyn-toggle-gui",
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ local actions = {}
|
|||||||
local function toggle_fab(elem, sprite, state)
|
local function toggle_fab(elem, sprite, state)
|
||||||
if state then
|
if state then
|
||||||
elem.style = "flib_selected_frame_action_button"
|
elem.style = "flib_selected_frame_action_button"
|
||||||
elem.sprite = sprite .. "_black"
|
elem.sprite = sprite .. ""
|
||||||
else
|
else
|
||||||
elem.style = "frame_action_button"
|
elem.style = "frame_action_button"
|
||||||
elem.sprite = sprite .. "_white"
|
elem.sprite = sprite .. ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ function inventory_tab.build(map_data, player_data)
|
|||||||
for item, count in pairs(inventory_provided) do
|
for item, count in pairs(inventory_provided) do
|
||||||
i = i + 1
|
i = i + 1
|
||||||
local sprite, img_path, item_string = util.generate_item_references(item)
|
local sprite, img_path, item_string = util.generate_item_references(item)
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
provided_children[#provided_children+1] = {
|
provided_children[#provided_children+1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
style = "flib_slot_button_green",
|
style = "flib_slot_button_green",
|
||||||
@@ -195,7 +195,7 @@ function inventory_tab.build(map_data, player_data)
|
|||||||
for item, count in pairs(inventory_requested) do
|
for item, count in pairs(inventory_requested) do
|
||||||
i = i + 1
|
i = i + 1
|
||||||
local sprite, img_path, item_string = util.generate_item_references(item)
|
local sprite, img_path, item_string = util.generate_item_references(item)
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
requested_children[#requested_children+1] = {
|
requested_children[#requested_children+1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
style = "flib_slot_button_red",
|
style = "flib_slot_button_red",
|
||||||
@@ -219,7 +219,7 @@ function inventory_tab.build(map_data, player_data)
|
|||||||
for item, count in pairs(inventory_in_transit) do
|
for item, count in pairs(inventory_in_transit) do
|
||||||
i = i + 1
|
i = i + 1
|
||||||
local sprite, img_path, item_string = util.generate_item_references(item)
|
local sprite, img_path, item_string = util.generate_item_references(item)
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
in_transit_children[#in_transit_children+1] = {
|
in_transit_children[#in_transit_children+1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
style = "flib_slot_button_blue",
|
style = "flib_slot_button_blue",
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ local function init_items(manager)
|
|||||||
manager.item_order = item_order
|
manager.item_order = item_order
|
||||||
local i = 1
|
local i = 1
|
||||||
|
|
||||||
for _, protos in pairs{prototypes.item, game.fluid_prototypes} do
|
for _, protos in pairs{prototypes.item, prototypes.fluid} do
|
||||||
--- @type (LuaItemPrototype|LuaFluidPrototype)[]
|
--- @type (LuaItemPrototype|LuaFluidPrototype)[]
|
||||||
local all_items = {}
|
local all_items = {}
|
||||||
for _, proto in pairs(protos) do
|
for _, proto in pairs(protos) do
|
||||||
|
|||||||
@@ -180,10 +180,10 @@ end
|
|||||||
local function toggle_fab(elem, sprite, state)
|
local function toggle_fab(elem, sprite, state)
|
||||||
if state then
|
if state then
|
||||||
elem.style = "flib_selected_frame_action_button"
|
elem.style = "flib_selected_frame_action_button"
|
||||||
elem.sprite = sprite .. "_black"
|
elem.sprite = sprite .. ""
|
||||||
else
|
else
|
||||||
elem.style = "frame_action_button"
|
elem.style = "frame_action_button"
|
||||||
elem.sprite = sprite .. "_white"
|
elem.sprite = sprite .. ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ function templates.frame_action_button(name, sprite, tooltip, handler, tags)
|
|||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
name = name,
|
name = name,
|
||||||
style = "frame_action_button",
|
style = "frame_action_button",
|
||||||
sprite = sprite .. "_white",
|
sprite = sprite .. "",
|
||||||
hovered_sprite = sprite .. "_black",
|
hovered_sprite = sprite .. "",
|
||||||
clicked_sprite = sprite .. "_black",
|
clicked_sprite = sprite .. "",
|
||||||
mouse_button_filter = { "left" },
|
mouse_button_filter = { "left" },
|
||||||
tooltip = tooltip,
|
tooltip = tooltip,
|
||||||
handler = handler,
|
handler = handler,
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ function util.generate_item_references(item)
|
|||||||
local sprite = nil
|
local sprite = nil
|
||||||
local image_path = ""
|
local image_path = ""
|
||||||
local item_name
|
local item_name
|
||||||
if game.is_valid_sprite_path("item/" .. item) then
|
if helpers.is_valid_sprite_path("item/" .. item) then
|
||||||
sprite = "item/" .. item
|
sprite = "item/" .. item
|
||||||
image_path = "[img=item." .. item .. "]"
|
image_path = "[img=item." .. item .. "]"
|
||||||
item_name = {"?", { "item-name." .. item }, { "entity-name." .. item }, "LocalizedString failure: " .. item }
|
item_name = {"?", { "item-name." .. item }, { "entity-name." .. item }, "LocalizedString failure: " .. item }
|
||||||
elseif game.is_valid_sprite_path("fluid/" .. item) then
|
elseif helpers.is_valid_sprite_path("fluid/" .. item) then
|
||||||
sprite = "fluid/" .. item
|
sprite = "fluid/" .. item
|
||||||
image_path = "[img=fluid." .. item .. "]"
|
image_path = "[img=fluid." .. item .. "]"
|
||||||
item_name = {"?", { "fluid-name." .. item }, "LocalizedString failure: " .. item }
|
item_name = {"?", { "fluid-name." .. item }, "LocalizedString failure: " .. item }
|
||||||
elseif game.is_valid_sprite_path("virtual-signal/" .. item) then
|
elseif helpers.is_valid_sprite_path("virtual-signal/" .. item) then
|
||||||
sprite = "virtual-signal/" .. item
|
sprite = "virtual-signal/" .. item
|
||||||
image_path = "[img=virtual-signal." .. item .. "]"
|
image_path = "[img=virtual-signal." .. item .. "]"
|
||||||
item_name = {"?", { "virtual-signal." .. item }, "LocalizedString failure: " .. item }
|
item_name = {"?", { "virtual-signal." .. item }, "LocalizedString failure: " .. item }
|
||||||
@@ -69,7 +69,7 @@ function util.slot_table_build_from_manifest(manifest, color)
|
|||||||
local name = item.name
|
local name = item.name
|
||||||
local count = item.count
|
local count = item.count
|
||||||
local sprite, img_path, item_string = util.generate_item_references(name)
|
local sprite, img_path, item_string = util.generate_item_references(name)
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
children[#children + 1] = {
|
children[#children + 1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -112,7 +112,7 @@ function util.slot_table_build_from_station(station)
|
|||||||
else
|
else
|
||||||
color = "red"
|
color = "red"
|
||||||
end
|
end
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
children[#children + 1] = {
|
children[#children + 1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -149,7 +149,7 @@ function util.slot_table_build_from_deliveries(station)
|
|||||||
else
|
else
|
||||||
color = "blue"
|
color = "blue"
|
||||||
end
|
end
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
children[#children + 1] = {
|
children[#children + 1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -188,7 +188,7 @@ function util.slot_table_build_from_control_signals(station, map_data)
|
|||||||
else
|
else
|
||||||
sprite = "virtual-signal" .. "/" .. name
|
sprite = "virtual-signal" .. "/" .. name
|
||||||
end
|
end
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
children[#children + 1] = {
|
children[#children + 1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -230,7 +230,7 @@ function util.slot_table_build_from_control_signals(station, map_data)
|
|||||||
count = count * get_stack_size(map_data, name)
|
count = count * get_stack_size(map_data, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
children[#children + 1] = {
|
children[#children + 1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -248,7 +248,7 @@ function util.slot_table_build_from_control_signals(station, map_data)
|
|||||||
|
|
||||||
elseif item.type == "virtual" then
|
elseif item.type == "virtual" then
|
||||||
sprite = "virtual-signal" .. "/" .. name
|
sprite = "virtual-signal" .. "/" .. name
|
||||||
if game.is_valid_sprite_path(sprite) then
|
if helpers.is_valid_sprite_path(sprite) then
|
||||||
children[#children + 1] = {
|
children[#children + 1] = {
|
||||||
type = "sprite-button",
|
type = "sprite-button",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
|
|||||||
Reference in New Issue
Block a user