Add freemium access economy and token store
This commit is contained in:
+18
-1
@@ -350,6 +350,11 @@ func _build_ui() -> void:
|
||||
donations.main = self
|
||||
screens_container.add_child(donations)
|
||||
screens["donations"] = donations
|
||||
var access_store := preload("res://scripts/ui/access_store_screen.gd").new()
|
||||
access_store.name = "AccessStoreScreen"
|
||||
access_store.main = self
|
||||
screens_container.add_child(access_store)
|
||||
screens["access_store"] = access_store
|
||||
|
||||
feedback_dialog = preload("res://scripts/ui/app_feedback_dialog.gd").new()
|
||||
feedback_dialog.name = "AppFeedbackDialog"
|
||||
@@ -369,10 +374,16 @@ func _build_ui() -> void:
|
||||
|
||||
AuthState.auth_changed.connect(_on_auth_changed)
|
||||
AuthState.session_expired.connect(_on_session_expired)
|
||||
QuestionBankService.access_required.connect(_on_qbank_access_required)
|
||||
_refresh_header_controls()
|
||||
_build_app_menu()
|
||||
|
||||
|
||||
func _on_qbank_access_required(_message: String) -> void:
|
||||
if AuthState.is_logged_in:
|
||||
show_screen("access_store")
|
||||
|
||||
|
||||
func _build_sidebar() -> PanelContainer:
|
||||
var panel := PanelContainer.new()
|
||||
panel.name = "Sidebar"
|
||||
@@ -426,6 +437,7 @@ func _populate_navigation(container: VBoxContainer, include_brand: bool) -> void
|
||||
spacer.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
container.add_child(spacer)
|
||||
container.add_child(HSeparator.new())
|
||||
_add_nav_button(container, "access_store", "Credits & Access", "clock-3", true)
|
||||
_add_nav_button(container, "donations", "Support RanaZe", "heart-pulse", true)
|
||||
_add_nav_button(container, "performance", "Profile", "user-round", true)
|
||||
_add_nav_button(container, "settings", "Settings", "settings", true)
|
||||
@@ -471,6 +483,7 @@ func _on_navigation_pressed(key: String) -> void:
|
||||
"notes": show_screen("notes")
|
||||
"bookmarks": show_screen("bookmarks")
|
||||
"donations": show_screen("donations")
|
||||
"access_store": show_screen("access_store")
|
||||
"logout": _logout()
|
||||
|
||||
|
||||
@@ -489,7 +502,8 @@ func _update_header_title(screen_name: String) -> void:
|
||||
"settings": "Settings",
|
||||
"notes": "Notes",
|
||||
"bookmarks": "Bookmarks",
|
||||
"donations": "Support RanaZe"
|
||||
"donations": "Support RanaZe",
|
||||
"access_store": "Credits & Access"
|
||||
}
|
||||
header_title.text = str(titles.get(screen_name, ""))
|
||||
|
||||
@@ -814,6 +828,9 @@ func _on_theme_changed(is_dark_mode: bool) -> void:
|
||||
var donations = screens.get("donations")
|
||||
if donations != null and donations.has_method("refresh_theme_controls"):
|
||||
donations.refresh_theme_controls()
|
||||
var access_store = screens.get("access_store")
|
||||
if access_store != null and access_store.has_method("refresh_theme_controls"):
|
||||
access_store.refresh_theme_controls()
|
||||
var player = screens.get("player")
|
||||
if player != null and player.has_method("refresh_theme_controls"):
|
||||
player.refresh_theme_controls()
|
||||
|
||||
Reference in New Issue
Block a user