MagicNStuff/source/addons/panku_console/modules/history_manager/module.gd
2025-02-25 22:07:11 +01:00

27 lines
605 B
GDScript

class_name PankuModuleHistoryManager extends PankuModule
var window:PankuLynxWindow
func init_module():
# setup ui
var ui = preload("./exp_history.tscn").instantiate()
ui.console = core
core.new_expression_entered.connect(
func(expression, result):
ui.add_history(expression)
)
# bind window
window = core.windows_manager.create_window(ui)
add_auto_save_hook(window)
window.queue_free_on_close = false
window.set_window_title_text("History Manager")
load_window_data(window)
func quit_module():
super.quit_module()
save_window_data(window)
func open_window():
window.show_window()