diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-29 11:21:18 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-29 11:21:18 +0100 |
commit | 6360c7a2faeb21d797e8b6feae4db79908399534 (patch) | |
tree | 690864fed62c005195b22bf81d016bbdda082d55 /scripts/control.gd | |
parent | 7b09cbabdf0461e7b15d161206f643e3ce73af9c (diff) |
dict add
Diffstat (limited to 'scripts/control.gd')
-rw-r--r-- | scripts/control.gd | 23 |
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() |