From 6360c7a2faeb21d797e8b6feae4db79908399534 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sat, 29 Jan 2022 11:21:18 +0100 Subject: dict add --- scripts/control.gd | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'scripts/control.gd') 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() -- cgit v1.2.3-54-g00ecf