Extensive work on the sideview and initial work on player profiles, inventory display, and renaming adventurerdata vs adventurer to adventurer vs adventurersprite

This commit is contained in:
2025-08-27 08:02:11 -04:00
parent 38845e26fa
commit 2a236ea041
55 changed files with 1975 additions and 417 deletions

View File

@@ -2,19 +2,26 @@ extends Node
var player : Player = null
var panel : GamePanel = null
var player_profile : Window = null
var quest_log : QuestLog = null
var top_menu : TopMenu = null
var active : bool = true
var open : bool = true
var end_shift_confirmation : ConfirmationDialog
var end_shift_confirm_template = preload("res://templates/end_shift_confirmation.tscn")
var player_profile_template = preload("res://templates/player_profile_window.tscn")
func _ready() -> void:
DisplayServer.register_additional_output(self)
end_shift_confirmation = end_shift_confirm_template.instantiate()
add_child(end_shift_confirmation)
func _process(delta: float) -> void:
if active and Input.is_action_just_pressed("switch modes"):
confirm_end_shift()
if open:
if Input.is_action_just_pressed("profile"):
toggle_player_profile()
if Input.is_action_just_pressed("switch modes"):
confirm_end_shift()
func add_quest_progress_bar(quest : Quest) -> void:
panel.add_quest_progress_bar(quest)
@@ -25,10 +32,22 @@ func confirm_end_shift() -> void:
func setup_visitor_ui(spawner: VisitorSpawner)-> void:
if panel:
panel.connect_visitor_spawner(spawner)
func toggle_player_profile():
if player_profile != null:
player_profile.queue_free()
player_profile = null
else:
player_profile = player_profile_template.instantiate()
add_child(player_profile)
player_profile.setup(player.data)
func end_shift() -> void:
active = false
panel.switch_panel(active)
open = false
if player_profile != null:
toggle_player_profile()
panel.switch_panel(open)
var window = get_window()
window.mode = Window.MODE_WINDOWED
var size = DisplayServer.screen_get_size()
@@ -45,7 +64,11 @@ func end_shift() -> void:
top_menu.hide()
panel.get_parent().global_position = Vector2i(5,5)
window.size = Vector2i(415,700)
panel.populate_quest_views()
panel.populate_quest_bars()
func notice(msg : String, time : float = 1) -> void:
panel.notice(msg, time)
func calculate_kill_exp(killer : QuestSprite, killed : QuestSprite) -> int:
return clamp(1, (killed.level - killer.level) * 5, 100)