mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-09 20:08:07 -06:00
Merge branch 'experimental' into experimental-gui
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
Version: 1.2.14
|
Version: 1.2.14
|
||||||
Date: 2023-3-14
|
Date: 2023-3-14
|
||||||
Features:
|
Features:
|
||||||
- Added opt-in WIP train and station manager gui (highly experimental, use at your own risk)
|
- Added opt-in WIP inventory and station manager gui (highly experimental, use at your own risk)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Provider override thresholds now correctly override the required train capacity as well; fix contributed by shopt
|
- Provider override thresholds now correctly override the required train capacity as well; fix contributed by shopt
|
||||||
- Fixed a rare crash relating to an uninitialized network mask on a new station
|
- Fixed a rare crash relating to an uninitialized network mask on a new station
|
||||||
|
|||||||
@@ -360,30 +360,35 @@ styles.ltnm_tabbed_pane = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
data:extend({
|
if settings.startup["cybersyn-manager-enabled"].value then
|
||||||
-- custom inputs
|
|
||||||
--{
|
data:extend({
|
||||||
-- type = "custom-input",
|
-- custom inputs
|
||||||
-- name = "cybersyn-toggle-gui",
|
{
|
||||||
-- key_sequence = "CONTROL + T",
|
type = "custom-input",
|
||||||
--},
|
name = "cybersyn-toggle-gui",
|
||||||
--{
|
key_sequence = "CONTROL + T",
|
||||||
-- type = "custom-input",
|
action = "lua",
|
||||||
-- name = "ltnm-linked-focus-search",
|
},
|
||||||
-- key_sequence = "",
|
--{
|
||||||
-- linked_game_control = "focus-search",
|
-- type = "custom-input",
|
||||||
--},
|
-- name = "ltnm-linked-focus-search",
|
||||||
-- shortcuts
|
-- key_sequence = "",
|
||||||
{
|
-- linked_game_control = "focus-search",
|
||||||
type = "shortcut",
|
--},
|
||||||
name = "cybersyn-toggle-gui",
|
-- shortcuts
|
||||||
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),
|
type = "shortcut",
|
||||||
small_icon = data_util.build_sprite(nil, { 0, 32 }, util.paths.shortcut_icons, 24, 2),
|
name = "cybersyn-toggle-gui",
|
||||||
disabled_small_icon = data_util.build_sprite(nil, { 36, 32 }, util.paths.shortcut_icons, 24, 2),
|
icon = data_util.build_sprite(nil, { 0, 0 }, util.paths.shortcut_icons, 32, 2),
|
||||||
toggleable = true,
|
disabled_icon = data_util.build_sprite(nil, { 48, 0 }, util.paths.shortcut_icons, 32, 2),
|
||||||
action = "lua",
|
small_icon = data_util.build_sprite(nil, { 0, 32 }, util.paths.shortcut_icons, 24, 2),
|
||||||
--associated_control_input = "cybersyn-toggle-gui",
|
disabled_small_icon = data_util.build_sprite(nil, { 36, 32 }, util.paths.shortcut_icons, 24, 2),
|
||||||
technology_to_unlock = "cybersyn-train-network",
|
toggleable = true,
|
||||||
},
|
action = "lua",
|
||||||
})
|
associated_control_input = "cybersyn-toggle-gui",
|
||||||
|
technology_to_unlock = "cybersyn-train-network",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ end
|
|||||||
local manager_gui = {}
|
local manager_gui = {}
|
||||||
|
|
||||||
function manager_gui.on_lua_shortcut(e)
|
function manager_gui.on_lua_shortcut(e)
|
||||||
if e.prototype_name == "cybersyn-toggle-gui" then
|
if e.prototype_name == "cybersyn-toggle-gui" or e.input_name == "cybersyn-toggle-gui" then
|
||||||
manager.wrapper(e, manager.handle.manager_toggle)
|
manager.wrapper(e, manager.handle.manager_toggle)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ function manager.create(player)
|
|||||||
tooltip = { "cybersyn-gui.dispatcher-disabled-description" },
|
tooltip = { "cybersyn-gui.dispatcher-disabled-description" },
|
||||||
visible = not settings.global["cybersyn-enable-planner"].value,
|
visible = not settings.global["cybersyn-enable-planner"].value,
|
||||||
},
|
},
|
||||||
templates.frame_action_button("manager_pin_button", "ltnm_pin", { "cybersyn-gui.keep-open" }, manager.handle.manager_pin),--on_gui_clicked
|
--templates.frame_action_button("manager_pin_button", "ltnm_pin", { "cybersyn-gui.keep-open" }, manager.handle.manager_pin),--on_gui_clicked
|
||||||
templates.frame_action_button("manager_refresh_button", "ltnm_refresh", { "cybersyn-gui.refresh-tooltip" }, manager.handle.manager_refresh_click),--on_gui_clicked
|
--templates.frame_action_button("manager_refresh_button", "ltnm_refresh", { "cybersyn-gui.refresh-tooltip" }, manager.handle.manager_refresh_click),--on_gui_clicked
|
||||||
templates.frame_action_button(nil, "utility/close", { "gui.close-instruction" }, manager.handle.manager_close),--on_gui_clicked
|
templates.frame_action_button(nil, "utility/close", { "gui.close-instruction" }, manager.handle.manager_close),--on_gui_clicked
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -69,7 +69,6 @@ function manager.create(player)
|
|||||||
clear_and_focus_on_right_click = true,
|
clear_and_focus_on_right_click = true,
|
||||||
handler = manager.handle.manager_update_text_search, --on_gui_text_changed
|
handler = manager.handle.manager_update_text_search, --on_gui_text_changed
|
||||||
},
|
},
|
||||||
--item search box commented out. It *works*, but, the filtering logic only checks delivieres, so I'm not sure what Mami intended it for, so I'm leaving it off for now...
|
|
||||||
{ type = "label", style = "subheader_caption_label", caption = { "cybersyn-gui.search-item-label" } },
|
{ type = "label", style = "subheader_caption_label", caption = { "cybersyn-gui.search-item-label" } },
|
||||||
{ type= "choose-elem-button", name="manager_item_filter", style="slot_button_in_shallow_frame", elem_type="signal", handler=manager.handle.manager_update_item_search, },
|
{ type= "choose-elem-button", name="manager_item_filter", style="slot_button_in_shallow_frame", elem_type="signal", handler=manager.handle.manager_update_item_search, },
|
||||||
{ type = "empty-widget", style = "flib_horizontal_pusher" },
|
{ type = "empty-widget", style = "flib_horizontal_pusher" },
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ local manager = require('gui.main')
|
|||||||
local ceil = math.ceil
|
local ceil = math.ceil
|
||||||
local table_insert = table.insert
|
local table_insert = table.insert
|
||||||
local table_remove = table.remove
|
local table_remove = table.remove
|
||||||
local mod_gui = require("__core__.lualib.mod-gui")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -955,16 +954,11 @@ local function main()
|
|||||||
script.on_event(defines.events.on_player_removed, manager.on_player_removed)
|
script.on_event(defines.events.on_player_removed, manager.on_player_removed)
|
||||||
script.on_event(defines.events.on_player_created, manager.on_player_created)
|
script.on_event(defines.events.on_player_created, manager.on_player_created)
|
||||||
script.on_event(defines.events.on_lua_shortcut, manager.on_lua_shortcut)
|
script.on_event(defines.events.on_lua_shortcut, manager.on_lua_shortcut)
|
||||||
|
script.on_event("cybersyn-toggle-gui", manager.on_lua_shortcut)
|
||||||
-- TODO: rework this to work as a per-player runtime setting
|
-- TODO: rework this to work as a per-player runtime setting
|
||||||
script.on_nth_tick(mod_settings.manager_update_rate, function()
|
script.on_nth_tick(mod_settings.manager_update_rate, function()
|
||||||
manager.tick(global)
|
manager.tick(global)
|
||||||
end)
|
end)
|
||||||
else
|
|
||||||
local button_flow = mod_gui.get_button_flow(player)
|
|
||||||
local button = button_flow["top_left_button"]
|
|
||||||
if button then
|
|
||||||
button.destroy()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user