|
|
|
extends PanelContainer
|
|
|
|
|
|
|
|
onready var action = $HBox/Content/Game/VBox/HBox2/VBox/Action
|
|
|
|
onready var prose = $HBox/Content/Game/VBox/Prose
|
|
|
|
onready var partner = $HBox/Content/Game/VBox/HBox2/Partner
|
|
|
|
onready var PDA = $HBox/Content/Game/VBox/HBox/PDA
|
|
|
|
onready var whatnow = $HBox/Content/Game/VBox/HBox2/VBox/WhatNow
|
|
|
|
onready var view = $HBox/Content/Game/VBox/HBox/Scene/View
|
|
|
|
onready var portrait = $HBox/Content/Game/VBox/HBox/Scene/Portrait
|
|
|
|
|
|
|
|
# Change Dialogue Portrait of NPC
|
|
|
|
func change_portrait(packet):
|
|
|
|
portrait.texture = load("res://Res/Img/Portrait/" + packet["npc"] + ".png")
|
|
|
|
|
|
|
|
# Change Image of Scene, Room, Environment, etc
|
|
|
|
func change_view(packet):
|
|
|
|
view.texture = load("res://Res/Img/Scene/" + packet["loc"] + ".png")
|
|
|
|
|
|
|
|
func _on_action_decided(action_decided):
|
|
|
|
get_parent().act(action_decided)
|
|
|
|
|
|
|
|
# Modify Available Actions
|
|
|
|
func consider_actions(packet):
|
|
|
|
if packet['clear_box']:
|
|
|
|
for child in action.get_children():
|
|
|
|
child.queue_free()
|
|
|
|
for a in packet['actions']:
|
|
|
|
var b = Button.new()
|
|
|
|
b.set_text(tr(a))
|
|
|
|
action.add_child(b)
|
|
|
|
b.connect("button_up", self, "_on_action_decided", [a])
|
|
|
|
|
|
|
|
# Modify Prose in Dialogue Box
|
|
|
|
func write_prose(packet):
|
|
|
|
if packet['clear_box']:
|
|
|
|
prose.text = ""
|
|
|
|
prose.text += packet['message'] + "\n"
|