Buy/sell dialogue buttons

This commit is contained in:
2ndbeam 2024-05-22 19:09:36 +03:00
commit 53e5dd38b2
8 changed files with 52 additions and 15 deletions

View file

@ -7,6 +7,7 @@ const SELL_FETCH = "BASE_FETCH_SELL"
@onready var dialogue = $DialogueView
@onready var buy_sell = $"../../BuySell"
@onready var actions_menu = $"../Actions/ActionsMenu"
func _ready():
var tween = create_tween() \
@ -17,11 +18,14 @@ func send_message(msg: Message):
match msg.fact:
BUY_FETCH:
format["sell_list"] = buy_sell.get_buy_sell_list(false)
actions_menu.buy = false
actions_menu.buy_sell_options = buy_sell.get_buy_sell_len(false)
SELL_FETCH:
format["buy_list"] = buy_sell.get_buy_sell_list(true)
actions_menu.buy = true
actions_menu.buy_sell_options = buy_sell.get_buy_sell_len(true)
var new_msg = tr(msg.fact + "_RECEIVED").format(format)
print(format)
var old_len = len(dialogue.get_parsed_text())
dialogue.append_text(new_msg)
dialogue.visible_characters = old_len