Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause Menu Style Changes #146

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions COGITO/EasyMenus/Scripts/pause_menu_controller.gd
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
class_name CogitoPauseMenu
extends Control
## This class controls the pause menu which can be found here:
## res://COGITO/EasyMenus/Scenes/PauseMenu.tscn
## You can override this class to add buttons to your pause menu
## look at the function open_options_menu for an example of showing a submenu
## also remember to add a hide call for your menu in _input

signal resume
signal back_to_main_pressed

#region Variables
@export var nodes_to_focus: Array[Control]
@export var sound_hover : AudioStream
@export var sound_click : AudioStream

var playback : AudioStreamPlaybackPolyphonic
var temp_screenshot : Image

@onready var resume_game_button: Button = %ResumeGameButton
@onready var save_button: CogitoUiButton = %SaveButton
@onready var load_button: CogitoUiButton = %LoadButton
@onready var label_active_slot: Label = %Label_ActiveSlot
@onready var options_tab_menu: OptionsTabMenu = $Content/OptionsTabMenu
@onready var game_menu: MarginContainer = $Content/GameMenu

@export var nodes_to_focus: Array[Control]

#region UI AUDIO
@export var sound_hover : AudioStream
@export var sound_click : AudioStream
var playback : AudioStreamPlaybackPolyphonic
var temp_screenshot : Image
#endregion


func _enter_tree() -> void:
Expand Down Expand Up @@ -49,7 +57,6 @@ func _play_hover() -> void:

func _play_pressed() -> void:
playback.play_stream(sound_click, 0, 0, 1)
#endregion


func open_pause_menu():
Expand Down Expand Up @@ -130,7 +137,6 @@ func _input(event):
close_pause_menu()



func _on_save_button_pressed() -> void:
CogitoSceneManager._current_scene_name = get_tree().get_current_scene().get_name()
CogitoSceneManager._current_scene_path = get_tree().current_scene.scene_file_path
Expand All @@ -139,7 +145,7 @@ func _on_save_button_pressed() -> void:
CogitoSceneManager.save_scene_state(CogitoSceneManager._current_scene_name,CogitoSceneManager._active_slot)

_on_resume_game_button_pressed()


func _on_load_button_pressed() -> void:
print("LOAD BUTTON PRESSED")
Expand Down