diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 18:16:13 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 18:16:13 -0400 |
commit | c96db866eaa188ea73548a58716f3c0a46bc011c (patch) | |
tree | 694344242820533697fd36baa531c3f60daef17e /Main.gd | |
parent | febc05f628793d252066a173e8fce0826b2190fd (diff) | |
download | Planner-c96db866eaa188ea73548a58716f3c0a46bc011c.tar.gz Planner-c96db866eaa188ea73548a58716f3c0a46bc011c.zip |
tabs to spaces
Diffstat (limited to 'Main.gd')
-rw-r--r-- | Main.gd | 62 |
1 files changed, 31 insertions, 31 deletions
@@ -5,42 +5,42 @@ onready var body_container = $"%BodyContent" var nav_history = [] class nav_history_item: - var screen_name - var data_model_type - var lookup_method - var lookup_args - func _init(screen_name, data_model_type, lookup_method, lookup_args): - self.screen_name = screen_name - self.data_model_type = data_model_type - self.lookup_method = lookup_method - self.lookup_args = lookup_args + var screen_name + var data_model_type + var lookup_method + var lookup_args + func _init(screen_name, data_model_type, lookup_method, lookup_args): + self.screen_name = screen_name + self.data_model_type = data_model_type + self.lookup_method = lookup_method + self.lookup_args = lookup_args func nav_screen(screen_name, data_model_type, lookup_method, lookup_args): - var screen = nav_history_item.new(screen_name, data_model_type, lookup_method, lookup_args) - nav_history.push_back(screen) - swap_screen(screen) + var screen = nav_history_item.new(screen_name, data_model_type, lookup_method, lookup_args) + nav_history.push_back(screen) + swap_screen(screen) func nav_back(): - if nav_history.size() > 1: - nav_history.pop_back() - swap_screen(nav_history[-1]) + if nav_history.size() > 1: + nav_history.pop_back() + swap_screen(nav_history[-1]) func swap_screen(screen): - #queue cleanup of old screen - if header_container.get_child_count() > 0: - header_container.get_child(0).queue_free() - if body_container.get_child_count() > 0: - body_container.get_child(0).queue_free() - #load new screen - var header = load("res://screens/"+screen.screen_name+"/Header.tscn").instance() - var body = load("res://screens/"+screen.screen_name+"/Body.tscn").instance() - #load data - var data = screen.data_model_type.callv(screen.lookup_method,screen.lookup_args) - header.populate(data) - body.populate(data) - #set new screen - header_container.add_child(header) - body_container.add_child(body) + #queue cleanup of old screen + if header_container.get_child_count() > 0: + header_container.get_child(0).queue_free() + if body_container.get_child_count() > 0: + body_container.get_child(0).queue_free() + #load new screen + var header = load("res://screens/"+screen.screen_name+"/Header.tscn").instance() + var body = load("res://screens/"+screen.screen_name+"/Body.tscn").instance() + #load data + var data = screen.data_model_type.callv(screen.lookup_method,screen.lookup_args) + header.populate(data) + body.populate(data) + #set new screen + header_container.add_child(header) + body_container.add_child(body) func _ready(): - nav_screen("TimeSlot", TimeSlot, "get_by_id", [2]) + nav_screen("TimeSlot", TimeSlot, "get_by_id", [2]) |