Fix DoOtboy timed choices, validate UI endings and rename Katya
This commit is contained in:
@@ -74,6 +74,7 @@ func label(text: String, size: int = 18, color: Color = INK) -> Label:
|
||||
func button(text: String, action: String, parent: Node = null) -> Button:
|
||||
var b := Button.new()
|
||||
b.text = text
|
||||
b.set_meta("action", action)
|
||||
b.alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||
b.custom_minimum_size.y = 48
|
||||
b.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
|
||||
@@ -84,6 +85,17 @@ func button(text: String, action: String, parent: Node = null) -> Button:
|
||||
parent.add_child(b)
|
||||
return b
|
||||
|
||||
func action_button(id: String, node: Node = null) -> Button:
|
||||
if node == null:
|
||||
node = root
|
||||
for child in node.get_children():
|
||||
if child is Button and child.is_visible_in_tree() and child.get_meta("action", "") == id:
|
||||
return child
|
||||
var found := action_button(id, child)
|
||||
if found != null:
|
||||
return found
|
||||
return null
|
||||
|
||||
func build_hud() -> void:
|
||||
var top := PanelContainer.new()
|
||||
root.add_child(top)
|
||||
@@ -143,7 +155,7 @@ func build_hud() -> void:
|
||||
var stack := VBoxContainer.new()
|
||||
stack.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
bottom.add_child(stack)
|
||||
objective = label("Найдите телефон. Лера ждёт ответа.",19)
|
||||
objective = label("Найдите телефон. Катя ждёт ответа.",19)
|
||||
stack.add_child(objective)
|
||||
stack.add_child(label("ЛКМ — идти / предмет WASD — движение E — взаимодействие J — память R — новая петля M — звук",13,MUTED))
|
||||
hint = label("",17,AMBER)
|
||||
@@ -238,7 +250,7 @@ func show_start() -> void:
|
||||
margin.add_child(splash_box)
|
||||
splash_box.add_child(label("ИНТЕРАКТИВНЫЙ ПРОТОТИП / GODOT 4",13,AMBER))
|
||||
splash_box.add_child(label("ДО ОТБОЯ",60))
|
||||
var intro := label("21:42. Лера везёт вашего сына домой.\nПо телефону она спрашивает, почему вы отправили их к школе. Вы ничего такого не помните.\n\nДо удара — семь реальных минут. Квартира вернётся в начало. Всё, что вы узнаете, останется с вами.",21)
|
||||
var intro := label("21:42. Катя везёт вашего сына домой.\nПо телефону она спрашивает, почему вы отправили их к школе. Вы ничего такого не помните.\n\nДо удара — семь реальных минут. Квартира вернётся в начало. Всё, что вы узнаете, останется с вами.",21)
|
||||
intro.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
splash_box.add_child(intro)
|
||||
button("Начать вечер →","start",splash_box)
|
||||
|
||||
Reference in New Issue
Block a user