aboutsummaryrefslogtreecommitdiff
path: root/scripts/control.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/control.gd')
-rw-r--r--scripts/control.gd23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/control.gd b/scripts/control.gd
index 68b0bb4..2fd7164 100644
--- a/scripts/control.gd
+++ b/scripts/control.gd
@@ -82,6 +82,13 @@ func build_option (st, sttype):
opts += [ { "type": "text", "name": "back" } ]
Globals.StateType.MODULES:
+ opts += [ { "type": "text", "name": "add" } ]
+ opts += [ { "type": "text", "name": "back" } ]
+
+ Globals.StateType.MODULES_PICK:
+ for k in load_turrets.modules:
+ var mod = load_turrets.modules[k]
+ opts += [ { "type": "text", "name": mod.name } ]
opts += [ { "type": "text", "name": "back" } ]
gui.bottom_bar.picker.build(opts)
@@ -222,9 +229,25 @@ func do (action, par = {}):
Globals.StateType.MODULES:
selected = par.name
match par.name:
+ "add":
+ statetype = Globals.StateType.MODULES_PICK
+ build_option(state, statetype)
"back":
statetype = Globals.StateType.TURRET
build_option(state, statetype)
+
+ Globals.StateType.MODULES_PICK:
+ selected = par.name
+ match par.name:
+ "back":
+ statetype = Globals.StateType.MODULES
+ build_option(state, statetype)
+ _:
+ statetype = Globals.StateType.MODULES
+ var turr = turret_holder.get_node(editing_turret)
+ turr.mods += [par.name]
+ turr.make_info_mod()
+ build_option(state, statetype)
_: to_pick()