Bookmarks WIP 2
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var journal_symptoms = $Boundaries/VBoxContainer/Journal/MarginContainer/Symptoms/RightPage/Symptoms
|
||||
@onready var bookmarks = $Boundaries/VBoxContainer/Bookmarks
|
||||
@onready var journal = $Boundaries/VBoxContainer/Journal
|
||||
|
||||
#Journal Settings
|
||||
var symptoms_detailed: Array[Array] = [
|
||||
@@ -25,9 +27,16 @@ var symptoms_detailed: Array[Array] = [
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
||||
#Connecting signals
|
||||
$Boundaries/VBoxContainer/Journal/MarginContainer/Rules/LeftPage/CloseManual.pressed.connect(self._on_close_manual_pressed)
|
||||
$Boundaries/VBoxContainer/Journal/MarginContainer/Symptoms/LeftPage/CloseManual.pressed.connect(self._on_close_manual_pressed)
|
||||
hide()
|
||||
$Boundaries/VBoxContainer/Journal/MarginContainer/Entities/LeftPage/CloseManual.pressed.connect(self._on_close_manual_pressed)
|
||||
bookmarks.rules.pressed.connect(self._on_tab_rules_pressed)
|
||||
bookmarks.symptoms.pressed.connect(self._on_tab_symptoms_pressed)
|
||||
bookmarks.entities.pressed.connect(self._on_tab_entities_pressed)
|
||||
|
||||
hide() #Hiding at start
|
||||
|
||||
func _on_close_manual_pressed():
|
||||
hide()
|
||||
@@ -48,3 +57,38 @@ func update_journal(floor_count:int):
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
hide()
|
||||
|
||||
|
||||
#Shows the rules tab
|
||||
func _on_tab_rules_pressed():
|
||||
tab_switch(bookmarks.rules, journal.rules)
|
||||
|
||||
|
||||
#Shows the symptoms tab
|
||||
func _on_tab_symptoms_pressed():
|
||||
tab_switch(bookmarks.symptoms, journal.symptoms)
|
||||
|
||||
|
||||
#Shows the entities tab
|
||||
func _on_tab_entities_pressed():
|
||||
tab_switch(bookmarks.entities, journal.entities)
|
||||
|
||||
|
||||
#Shows the correct screen according to the pressed tab
|
||||
func tab_switch(pressed_tab, tab_screen):
|
||||
|
||||
#Highlights pressed tab and unpress the others
|
||||
for tab in [bookmarks.rules, bookmarks.symptoms, bookmarks.entities]:
|
||||
if tab == pressed_tab:
|
||||
pressed_tab.set_pressed(true)
|
||||
pressed_tab.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
|
||||
else:
|
||||
tab.set_pressed(false)
|
||||
tab.set_mouse_filter(Control.MOUSE_FILTER_STOP)
|
||||
|
||||
#Showing desired screen and hiding the others
|
||||
for screen in [journal.rules, journal.symptoms, journal.entities]:
|
||||
if screen == tab_screen:
|
||||
screen.show()
|
||||
else:
|
||||
screen.hide()
|
||||
|
||||
Reference in New Issue
Block a user