Closed gmt closed 6 years ago
This doesn't quite local the Gui thing because I suspect that would break lots of stuff. But, you know "decoupling," or some buzzword! Speaking seriously, to me something like the above seems more maintainable/comprehensible than what's in data-library now.
Almost forgot, it needs this first:
From: "Gregory M. Turner" <gmt@be-evil.net>
Date: Wed, 14 Feb 2018 22:56:53 -0800
Subject: [PATCH 1/2] gui: make lingering Event.Gui reference direct
Signed-off-by: Gregory M. Turner <gmt@be-evil.net>
---
stdlib/event/gui.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stdlib/event/gui.lua b/stdlib/event/gui.lua
index 037cdd6..99493c9 100644
--- a/stdlib/event/gui.lua
+++ b/stdlib/event/gui.lua
@@ -28,7 +28,7 @@ function Gui.register(event_id, gui_element_pattern, handler)
if not Event._registry[event_id] then
Event._registry[event_id] = {}
- script.on_event(event_id, Event.Gui.dispatch)
+ script.on_event(event_id, Gui.dispatch)
end
if Event._registry[event_id][gui_element_pattern] then
--
2.16.1
Can you post this as a PR, Will make it easier for to check it out and peek at it.
Sure, that is Afforess/Factorio-Stdlib/pull/113. Feels a bit dirty though ... wip PRs are not so OCD friendly...
Anyhow your request inspired me to make a branch for it, Nexela, so even if that's closed you can use gmt/Factorio-Stdlib/tree/data-library_gui-refactor-wip
Closing this issue, to keep all comments on #113