mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-07-26 18:36:23 +09:00
clear blueprint changed to selection (#435)
* Update surface.lua * Update en.cfg * Update surface.lua * Update en.cfg * Fix description keys for ground items and blueprints * Update roles.lua * Update surface.lua * Update quick_actions.lua * Update en.cfg * Update en.cfg * Update surface.lua * Update zh-CN.cfg * Update zh-TW.cfg * . * . * . * Many fixes and reverts --------- Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ local addon_artillery = require("modules/exp_scenario/commands/artillery")
|
||||
local addon_trains = require("modules/exp_scenario/commands/trains")
|
||||
local addon_teleport = require("modules/exp_scenario/commands/teleport")
|
||||
local addon_waterfill = require("modules/exp_scenario/commands/waterfill")
|
||||
local addon_surface = require("modules/exp_scenario/commands/surface")
|
||||
local addon_lawnmower = require("modules/exp_scenario/commands/lawnmower")
|
||||
local addon_home = require("modules/exp_scenario/commands/home")
|
||||
local addon_vlayer = require("modules/exp_scenario/commands/vlayer")
|
||||
@@ -21,15 +22,23 @@ local Elements = {}
|
||||
--- @type table<string, { command: ExpCommand, element: ExpElement }>
|
||||
local Actions = {}
|
||||
|
||||
--- @param name string
|
||||
--- @param command ExpCommand | function (this is needed because of the overload on commands)
|
||||
--- @param on_click? ExpElement.EventHandler<EventData.on_gui_click>
|
||||
local function new_quick_action(name, command, on_click)
|
||||
local element = Gui.define("quick_actions/" .. name)
|
||||
local function new_quick_action(command, on_click)
|
||||
local command_name = command.name
|
||||
|
||||
local element = Gui.define("quick_actions/" .. command_name)
|
||||
:draw{
|
||||
type = "button",
|
||||
caption = { "exp-gui_quick-actions.caption-" .. name },
|
||||
tooltip = { "exp-gui_quick-actions.tooltip-" .. name },
|
||||
caption = { "?",
|
||||
{ "exp-gui_quick-actions.caption-" .. command_name },
|
||||
command_name,
|
||||
},
|
||||
tooltip = { "?",
|
||||
{ "exp-gui_quick-actions.tooltip-" .. command_name },
|
||||
command.description,
|
||||
""
|
||||
},
|
||||
}
|
||||
:style{
|
||||
width = 160,
|
||||
@@ -38,26 +47,31 @@ local function new_quick_action(name, command, on_click)
|
||||
command(player)
|
||||
end)
|
||||
|
||||
Elements[name] = element
|
||||
Actions[name] = {
|
||||
Elements[command_name] = element
|
||||
Actions[command_name] = {
|
||||
command = command --[[ @as ExpCommand ]],
|
||||
element = element,
|
||||
}
|
||||
end
|
||||
|
||||
new_quick_action("artillery", addon_artillery.commands.artillery)
|
||||
new_quick_action("trains", addon_trains.commands.set_trains_to_automatic)
|
||||
new_quick_action("spawn", addon_teleport.commands.spawn, function(_def, player, _element, _event)
|
||||
new_quick_action(addon_artillery.commands.artillery)
|
||||
new_quick_action(addon_trains.commands.set_trains_to_automatic)
|
||||
|
||||
new_quick_action(addon_teleport.commands.spawn, function(def, player, element, event)
|
||||
addon_teleport.commands.spawn(player, player)
|
||||
end)
|
||||
new_quick_action("waterfill", addon_waterfill.commands.waterfill)
|
||||
new_quick_action("lawnmower", addon_lawnmower.commands.lawnmower)
|
||||
new_quick_action("home", addon_home.commands.home)
|
||||
new_quick_action("return", addon_home.commands._return)
|
||||
new_quick_action("set-home", addon_home.commands.set_home)
|
||||
new_quick_action("get-home", addon_home.commands.get_home)
|
||||
new_quick_action("vlayer", addon_vlayer.commands.vlayer)
|
||||
new_quick_action("repair", addon_repair.commands.repair)
|
||||
|
||||
new_quick_action(addon_waterfill.commands.waterfill)
|
||||
new_quick_action(addon_lawnmower.commands.lawnmower)
|
||||
new_quick_action(addon_surface.commands.clear_ground_items)
|
||||
new_quick_action(addon_surface.commands.clear_blueprints_surface)
|
||||
new_quick_action(addon_surface.commands.clear_blueprints)
|
||||
new_quick_action(addon_home.commands.home)
|
||||
new_quick_action(addon_home.commands._return)
|
||||
new_quick_action(addon_home.commands.set_home)
|
||||
new_quick_action(addon_home.commands.get_home)
|
||||
new_quick_action(addon_vlayer.commands.vlayer)
|
||||
new_quick_action(addon_repair.commands.repair)
|
||||
|
||||
--- Container added to the left gui flow
|
||||
--- @class ExpGui_QuickActions.elements.container: ExpElement
|
||||
|
||||
Reference in New Issue
Block a user