Browse Source

feat: centralize provider collection

Would love some auto-discovery of providers,
and some automatic settings form generation.
master
Dominique Merle 2 years ago
parent
commit
a1e2094a32
  1. 21
      core/App.gd

21
core/App.gd

@ -44,5 +44,26 @@ func start_poll(poll):
get_tree().current_scene.set_poll(poll)
func get_providers() -> Array:
var registered_providers = [
'MajorityJudgmentTwitchChatProvider',
'MajorityJudgmentDemoProvider',
]
var providers = Array()
for registered_provider in registered_providers:
var enabled = Config.get_parameter(
"provider_%s_enabled" % registered_provider,
false # default
)
if enabled:
var provider = load(
"res://addons/majority_judgment/providers/%s.gd"
%
registered_provider
).new()
providers.append(provider)
return providers
func timer(duration:int) -> SceneTreeTimer:
return get_tree().create_timer(duration)
Loading…
Cancel
Save