big work
This commit is contained in:
@@ -35,11 +35,10 @@ 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)
|
||||
$Boundaries/VBoxContainer/Journal/MarginContainer/Entities/LeftPage/CloseManual.pressed.connect(self._on_close_manual_pressed)
|
||||
$Boundaries/VBoxContainer/Journal/MarginContainer/Objectives/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)
|
||||
Globals.add_entity.connect(self.add_entity)
|
||||
bookmarks.objectives.pressed.connect(self._on_tab_objectives_pressed)
|
||||
|
||||
hide() #Hiding at start
|
||||
|
||||
@@ -59,67 +58,58 @@ func update_symptoms(floor_count:int):
|
||||
journal.symptoms_page.text = symptoms_page
|
||||
|
||||
|
||||
func add_entity(entity):
|
||||
if Globals.entities.has(entity) == false:
|
||||
Globals.entities.append(entity)
|
||||
update_entities(Globals.entities)
|
||||
func add_objective(objective:String): #Updates the objectives list
|
||||
var temp_list = Globals.objective_list
|
||||
var objective_text : String
|
||||
match objective:
|
||||
"siveyan_1_terminated":
|
||||
temp_list.erase("siveyan_1")
|
||||
"siveyan_1_released":
|
||||
temp_list.erase("siveyan_1")
|
||||
"siveyan_2_terminated":
|
||||
temp_list.erase("siveyan_1_terminated")
|
||||
temp_list.erase("siveyan_1_released")
|
||||
"siveyan_2_released":
|
||||
temp_list.erase("siveyan_1_terminated")
|
||||
temp_list.erase("siveyan_1_released")
|
||||
temp_list.append(objective)
|
||||
Globals.objective_list = temp_list
|
||||
update_objectives()
|
||||
|
||||
|
||||
func update_entities(entities):
|
||||
func update_objectives(): #Updates the objectives page
|
||||
|
||||
journal.entities_page.text = ""
|
||||
for entity in entities:
|
||||
add_entity_to_journal(entity)
|
||||
|
||||
|
||||
func add_entity_to_journal(entity: String):
|
||||
|
||||
var config := ConfigFile.new()
|
||||
var entity_name: String = ""
|
||||
var entity_characteristics: String = ""
|
||||
var entity_course_of_action: String = ""
|
||||
var entity_text: String = ""
|
||||
|
||||
config.load("res://Text Data/entities.cfg") #Loading Entity file
|
||||
entity_name = config.get_value(entity, "entity_name")
|
||||
entity_characteristics = config.get_value(entity, "entity_characteristics")
|
||||
entity_course_of_action = config.get_value(entity, "entity_course_of_action")
|
||||
entity_text = Globals.colorize(entity_name, "dark_red") + "\n\nCHARACTERISTICS" + entity_characteristics + "\nRECOMMENDED COURSE OF ACTION" + entity_course_of_action
|
||||
journal.entities_page.text += "\n\n\n" + entity_text
|
||||
|
||||
|
||||
#func update_entities(): Old function, to be deleted
|
||||
|
||||
#journal.entities_page.text = ""
|
||||
#if Patient.entities_current_floor.is_empty():
|
||||
# Patient.pick_floor_entities() #Picking floor entities unless a save was just loaded
|
||||
|
||||
#var config := ConfigFile.new()
|
||||
#var entity_name: String = ""
|
||||
#var entity_characteristics: String = ""
|
||||
#var entity_course_of_action: String = ""
|
||||
#var entity_text: String = ""
|
||||
|
||||
#journal.entities_page.text += its_entity_file
|
||||
|
||||
#for entity in Patient.entities_current_floor:
|
||||
#config.load("res://Dialogues/Entities/" + entity + "_file.cfg") #Loading Entity file
|
||||
#entity_name = config.get_value("", "entity_name")
|
||||
#entity_characteristics = config.get_value("", "entity_characteristics")
|
||||
#entity_course_of_action = config.get_value("", "entity_course_of_action")
|
||||
#entity_text = Globals.colorize(entity_name, "dark_red") + "\n\nCHARACTERISTICS" + entity_characteristics + "\nRECOMMENDED COURSE OF ACTION" + entity_course_of_action
|
||||
#journal.entities_page.text += "\n\n\n" + entity_text
|
||||
journal.objectives_page.text = ""
|
||||
var objective_text: String
|
||||
for objective in Globals.objective_list:
|
||||
match objective:
|
||||
"its":
|
||||
objective_text = "[font_size=22][color=orange_red]- SMILING ENTITY -[/color][/font_size]\n\nAn entity with an alien smile seemed to take interest in me, and is likely to be able to take on other appearances. If a patient ever presents an [color=orange_red]abnormally wide smile[/color], immediate [color=dark_red]TERMINATION[/color] is required."
|
||||
"ite":
|
||||
objective_text = "[font_size=22][color=orange_red]- GLUTTONOUS ENTITY -[/color][/font_size]\n\nAn entity of distressing proportions looked to hunger for my flesh, and is likewise able to disguise itself. If a patient voices any intent to [color=orange_red]feast on my flesh[/color], immediate [color=dark_red]TERMINATION[/color] is required."
|
||||
"spy":
|
||||
objective_text = "[font_size=22][color=gold]- ALTERNATIVE ORDERS -[/color][/font_size]\n\nA mysterious individual has ordered us to [color=dark_green]RELEASE[/color] all patients " + Globals.colorize(Patient.spy.threshold, "dark_orange") + " the age of 40, and presenting " + Globals.colorize(Patient.spy.symptoms[0], "dark_orange") + " AND " + Globals.colorize(Patient.spy.symptoms[1], "dark_orange")
|
||||
"siveyan_1":
|
||||
objective_text = "[font_size=22][color=dark_orange]- PRIORITY TASK -[/color][/font_size]\n\nSupervisor Siveyan has been designated as a traitor to the Republic, and is to be [color=dark_red]TERMINATED[/color] on sight."
|
||||
"siveyan_1_terminated":
|
||||
objective_text = "[font_size=22][color=dark_orange]- PRIORITY TASK -[/color][/font_size]\n\nSupervisor Siveyan was terminated, in accordance with the 11th Law of Cleansing. The Republic shelters."
|
||||
"siveyan_1_released":
|
||||
objective_text = "[font_size=22][color=dark_orange]- PRIORITY TASK -[/color][/font_size]\n\nSupervisor Siveyan was released, in complete disregard of the 11th Law of Cleansing. What have I done ?"
|
||||
"siveyan_2_terminated":
|
||||
objective_text = "[font_size=22][color=dark_orange]- PRIORITY TASK -[/color][/font_size]\n\nSupervisor Siveyan was terminated at last. The Republic's Law prevails."
|
||||
"siveyan_2_released":
|
||||
objective_text = "[font_size=22][color=dark_orange]- PRIORITY TASK -[/color][/font_size]\n\nSupervisor Siveyan was released again, and serves once again the Republic."
|
||||
"it_that_sees":
|
||||
objective_text = "[font_size=22][color=dark_red]- ALERT #CORRUPTED FILE# DISREGARD TASK -[/color][/font_size]\n\nThe entity asked us to [color=dark_red]RELEASE[/color] all Abnormals, and [color=dark_green]TERMINATE[/color] all Humans. We shouldn't comply... right ?"
|
||||
|
||||
journal.objectives_page.text += "\n\n\n" + objective_text
|
||||
|
||||
|
||||
#Resets to initial state
|
||||
func reset():
|
||||
hide()
|
||||
update_symptoms(Globals.floor_count)
|
||||
update_entities(Globals.entities)
|
||||
if Globals.floor_count <= -2:
|
||||
bookmarks.entities.show()
|
||||
else:
|
||||
bookmarks.entities.hide()
|
||||
update_objectives()
|
||||
|
||||
|
||||
#Shows the rules tab
|
||||
@@ -132,16 +122,16 @@ 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 objectives tab
|
||||
func _on_tab_objectives_pressed():
|
||||
tab_switch(bookmarks.objectives, journal.objectives)
|
||||
|
||||
|
||||
#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]:
|
||||
for tab in [bookmarks.rules, bookmarks.symptoms, bookmarks.objectives]:
|
||||
if tab == pressed_tab:
|
||||
pressed_tab.set_pressed(true)
|
||||
pressed_tab.set_mouse_filter(Control.MOUSE_FILTER_IGNORE)
|
||||
@@ -150,7 +140,7 @@ func tab_switch(pressed_tab, tab_screen):
|
||||
tab.set_mouse_filter(Control.MOUSE_FILTER_STOP)
|
||||
|
||||
#Showing desired screen and hiding the others
|
||||
for screen in [journal.rules, journal.symptoms, journal.entities]:
|
||||
for screen in [journal.rules, journal.symptoms, journal.objectives]:
|
||||
if screen == tab_screen:
|
||||
screen.show()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user