Initial Commit
Initial commit of Code Base.
This commit is contained in:
parent
293b1213e1
commit
c11a4ebbc2
653 changed files with 36893 additions and 1 deletions
31
addons/twitcher/lib/oOuch/oauth_scopes.gd
Normal file
31
addons/twitcher/lib/oOuch/oauth_scopes.gd
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
@icon("./scope-icon.svg")
|
||||
@tool
|
||||
extends Resource
|
||||
|
||||
## Contains the information about a set of scopes.
|
||||
class_name OAuthScopes
|
||||
|
||||
## Called when new scopes was added or removed
|
||||
signal scopes_changed
|
||||
|
||||
@export var used_scopes: Array[StringName] = []:
|
||||
set(val):
|
||||
used_scopes = val;
|
||||
scopes_changed.emit()
|
||||
|
||||
|
||||
## Returns the scopes space separated
|
||||
func ssv_scopes() -> String:
|
||||
return " ".join(used_scopes)
|
||||
|
||||
|
||||
func add_scopes(scopes: Array[StringName]) -> void:
|
||||
for scope in scopes:
|
||||
if used_scopes.find(scope) != -1: continue
|
||||
used_scopes.append(scope)
|
||||
scopes_changed.emit()
|
||||
|
||||
|
||||
func remove_scopes(scopes: Array[StringName]) -> void:
|
||||
used_scopes = used_scopes.filter(func(s): return scopes.find(s) != -1)
|
||||
scopes_changed.emit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue