Compare commits
No commits in common. "6b9a338a20411eef3b89d9cf2cac669a18baa417" and "1d9a2643242b5d5c42c118459f4e2ab3a08bf6f5" have entirely different histories.
6b9a338a20
...
1d9a264324
|
|
@ -47,7 +47,6 @@ func _update_events():
|
|||
# TODO: Find a cleaner way to cast these values
|
||||
var tmp: Array = []
|
||||
if Engine.is_editor_hint():
|
||||
print("reading project settings")
|
||||
tmp = ProjectSettings.get_setting("input/" + action)["events"]
|
||||
else:
|
||||
tmp = InputMap.action_get_events(action)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ import/blender/enabled=false
|
|||
interactables=""
|
||||
signage2=""
|
||||
signage1=""
|
||||
prompts="All PromptButton inheritors."
|
||||
|
||||
[gui]
|
||||
|
||||
|
|
|
|||
|
|
@ -111,6 +111,10 @@ var last_mode := DisplayServer.WINDOW_MODE_WINDOWED
|
|||
func _unhandled_input(event: InputEvent) -> void:
|
||||
#if event.is_action_type(): print_debug("Unhandled Input", event)
|
||||
|
||||
if event.is_action_pressed("ui_pause") and state == AppState.PLAY:
|
||||
state = AppState.PAUSE
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
if not Engine.is_editor_hint():
|
||||
if event.is_action_pressed("toggle_fullscreen"):
|
||||
get_viewport().set_input_as_handled()
|
||||
|
|
|
|||
|
|
@ -16,15 +16,12 @@ func _ready() -> void:
|
|||
helpline_button.pressed.connect(func(): OS.shell_open("https://findahelpline.com/"))
|
||||
#skip_story_button.pressed.connect(_process)
|
||||
|
||||
func _on_help_pressed() -> void:
|
||||
func _on_help_pressed():
|
||||
OS.shell_open("https://findahelpline.com/")
|
||||
|
||||
var last_mouse_mode: Input.MouseMode
|
||||
func appear() -> void:
|
||||
if State.save_game:
|
||||
State.save_game.save_to_file(get_tree().root.get_texture())
|
||||
else:
|
||||
push_warning("No save game exists.")
|
||||
func appear():
|
||||
State.save_game.save_to_file(get_tree().root.get_texture())
|
||||
|
||||
get_tree().paused = true
|
||||
show()
|
||||
|
|
@ -33,17 +30,12 @@ func appear() -> void:
|
|||
%ResumeButton.grab_focus.call_deferred()
|
||||
|
||||
|
||||
func disappear() -> void:
|
||||
func disappear():
|
||||
Main.state = Main.AppState.PLAY
|
||||
hide()
|
||||
Input.mouse_mode = last_mouse_mode
|
||||
get_tree().paused = false
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if not visible:
|
||||
return
|
||||
|
||||
if event.is_action_pressed("ui_pause") and Main.state == Main.AppState.PLAY:
|
||||
Main.state = Main.AppState.PAUSE
|
||||
get_viewport().set_input_as_handled()
|
||||
func _unhandled_input(_event: InputEvent) -> void:
|
||||
if not visible: return
|
||||
get_viewport().set_input_as_handled()
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
extends Node
|
||||
|
||||
func _gui_input(event : InputEvent):
|
||||
for child in get_children():
|
||||
if child.has_method("_gui_input"):
|
||||
child._gui_input(event)
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cjhic61ivhauc
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
@tool
|
||||
extends Button
|
||||
## A button representing a specific action, and offering a default prompt that can be changed
|
||||
class_name PromptButton
|
||||
|
||||
var _action : StringName
|
||||
|
||||
@export_custom(PROPERTY_HINT_INPUT_NAME, "show_builtin") var action : StringName = &"ui_accept":
|
||||
set(value):
|
||||
_action = value
|
||||
if is_node_ready():
|
||||
_update_action()
|
||||
else:
|
||||
_update_action.call_deferred()
|
||||
|
||||
get: return _action
|
||||
|
||||
|
||||
func _update_action():
|
||||
text = _action
|
||||
$ActionPrompt.action = _action
|
||||
|
||||
|
||||
func _override_prompt(prompt: String):
|
||||
if prompt:
|
||||
text = prompt
|
||||
else:
|
||||
text = action
|
||||
|
||||
|
||||
func appear(prompt: String = "") -> void:
|
||||
_override_prompt(prompt)
|
||||
show()
|
||||
|
||||
|
||||
func vanish() -> void:
|
||||
hide()
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://d3gymb7uc8pkc
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://nvbffevo54eh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d3gymb7uc8pkc" path="res://ui/prompter/prompt_button.gd" id="1_j4nun"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7breoabkyifr" path="res://addons/input_prompts/icons/xbox/A.png" id="2_3b7la"]
|
||||
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="3_flaeu"]
|
||||
|
||||
[sub_resource type="InputEventKey" id="InputEventKey_j4nun"]
|
||||
keycode = 4194309
|
||||
unicode = 4194309
|
||||
|
||||
[sub_resource type="InputEventKey" id="InputEventKey_3b7la"]
|
||||
keycode = 4194310
|
||||
unicode = 4194310
|
||||
|
||||
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_flaeu"]
|
||||
device = -1
|
||||
pressed = true
|
||||
|
||||
[node name="PromptButton" type="Button" groups=["prompts"]]
|
||||
text = "ui_accept"
|
||||
script = ExtResource("1_j4nun")
|
||||
|
||||
[node name="ActionPrompt" type="TextureRect" parent="."]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(58, 58)
|
||||
layout_mode = 1
|
||||
anchors_preset = 4
|
||||
anchor_top = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -64.0
|
||||
offset_top = -29.0
|
||||
offset_right = -6.0
|
||||
offset_bottom = 29.0
|
||||
grow_vertical = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("2_3b7la")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
script = ExtResource("3_flaeu")
|
||||
action = "ui_accept"
|
||||
icon = 0
|
||||
events = Array[InputEvent]([SubResource("InputEventKey_j4nun"), SubResource("InputEventKey_3b7la"), SubResource("InputEventJoypadButton_flaeu")])
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
extends Control
|
||||
## Provides methods and pre-instantiated prompts that can be easily arranged.
|
||||
class_name Prompter
|
||||
|
||||
|
||||
signal action_performed(action: String)
|
||||
|
||||
var _prompts : Dictionary[StringName, Control] = {}
|
||||
|
||||
func _ready() -> void:
|
||||
for prompt in get_tree().get_nodes_in_group("prompts"):
|
||||
_prompts[prompt.name] = prompt
|
||||
prompt.get_parent().remove_child(prompt)
|
||||
print(prompt)
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://de6ettn5s20va
|
||||
|
|
@ -1,23 +1,17 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://btmlxxbucfqa7"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://btmlxxbucfqa7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://de6ettn5s20va" path="res://ui/prompter/prompter.gd" id="1_ba0r8"]
|
||||
[ext_resource type="FontFile" uid="uid://c5ql8u7tpd10j" path="res://import/fonts/KleeOne-SemiBold.ttf" id="3_xtx06"]
|
||||
[ext_resource type="PackedScene" uid="uid://nvbffevo54eh" path="res://ui/prompter/prompt_button.tscn" id="5_fbpt0"]
|
||||
[ext_resource type="Texture2D" uid="uid://615hvpuiacvm" path="res://addons/input_prompts/icons/xbox/X.png" id="1_uowr1"]
|
||||
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="2_xtx06"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ba0r8"]
|
||||
bg_color = Color(0, 0, 0, 0.5019608)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
[sub_resource type="InputEventKey" id="InputEventKey_uowr1"]
|
||||
device = -1
|
||||
physical_keycode = 88
|
||||
unicode = 120
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_fbpt0"]
|
||||
font = ExtResource("3_xtx06")
|
||||
font_size = 48
|
||||
outline_size = 4
|
||||
outline_color = Color(0, 0, 0, 1)
|
||||
shadow_size = 4
|
||||
shadow_color = Color(0, 0, 0, 0.78431374)
|
||||
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_xtx06"]
|
||||
device = -1
|
||||
button_index = 2
|
||||
pressed = true
|
||||
|
||||
[node name="Prompter" type="MarginContainer"]
|
||||
anchors_preset = 15
|
||||
|
|
@ -29,146 +23,42 @@ theme_override_constants/margin_left = 42
|
|||
theme_override_constants/margin_top = 42
|
||||
theme_override_constants/margin_right = 42
|
||||
theme_override_constants/margin_bottom = 42
|
||||
script = ExtResource("1_ba0r8")
|
||||
|
||||
[node name="SafeZone" type="Control" parent="."]
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="SafeZone"]
|
||||
layout_mode = 0
|
||||
offset_right = 1836.0
|
||||
offset_bottom = 996.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="SafeZone/CenterContainer"]
|
||||
custom_minimum_size = Vector2(700, 700)
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_top = 42
|
||||
theme_override_constants/margin_right = 42
|
||||
|
||||
[node name="TopCenter" type="PanelContainer" parent="SafeZone/CenterContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ba0r8")
|
||||
|
||||
[node name="Label" type="Label" parent="SafeZone/CenterContainer/MarginContainer/TopCenter"]
|
||||
layout_mode = 2
|
||||
text = "object to interact with"
|
||||
label_settings = SubResource("LabelSettings_fbpt0")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Control" type="Control" parent="SafeZone/CenterContainer/MarginContainer"]
|
||||
[node name="VPrompt" type="VBoxContainer" parent="CenterContainer/MarginContainer"]
|
||||
custom_minimum_size = Vector2(480, 80)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="SafeZone/CenterContainer/MarginContainer/Control"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -157.0
|
||||
offset_top = -144.0
|
||||
offset_right = 253.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
theme_override_constants/separation = 48
|
||||
alignment = 2
|
||||
[node name="CenterContainer" type="CenterContainer" parent="CenterContainer/MarginContainer/VPrompt"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="collect_memento_ui" parent="SafeZone/CenterContainer/MarginContainer/Control/VBoxContainer" instance=ExtResource("5_fbpt0")]
|
||||
[node name="ActionPrompt" type="TextureRect" parent="CenterContainer/MarginContainer/VPrompt/CenterContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(48, 48)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("1_uowr1")
|
||||
stretch_mode = 5
|
||||
script = ExtResource("2_xtx06")
|
||||
action = "scene_skip"
|
||||
icon = 0
|
||||
events = Array[InputEvent]([null, SubResource("InputEventKey_uowr1"), SubResource("InputEventJoypadButton_xtx06")])
|
||||
|
||||
[node name="SkipButton" type="Button" parent="CenterContainer/MarginContainer/VPrompt"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "collect_memento_ui"
|
||||
action = &"collect_memento_ui"
|
||||
size_flags_vertical = 3
|
||||
text = "reveal full text (hold)"
|
||||
|
||||
[node name="option_memento_ui" parent="SafeZone/CenterContainer/MarginContainer/Control/VBoxContainer" instance=ExtResource("5_fbpt0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "option_memento_ui"
|
||||
action = &"option_memento_ui"
|
||||
|
||||
[node name="Top" type="PanelContainer" parent="SafeZone"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -230.5
|
||||
offset_right = 230.5
|
||||
offset_bottom = 98.33334
|
||||
grow_horizontal = 2
|
||||
|
||||
[node name="Label" type="Label" parent="SafeZone/Top"]
|
||||
layout_mode = 2
|
||||
text = "a general explanation or hint about what is going on
|
||||
or an evaluation such as on the card-board"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="LeftBottom" type="Control" parent="SafeZone"]
|
||||
anchors_preset = 0
|
||||
offset_top = 996.0
|
||||
offset_bottom = 996.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="SafeZone/LeftBottom"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 64.0
|
||||
offset_top = -240.0
|
||||
offset_right = 386.0
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 48
|
||||
alignment = 2
|
||||
|
||||
[node name="Accept" parent="SafeZone/LeftBottom/VBox" instance=ExtResource("5_fbpt0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Cancel" parent="SafeZone/LeftBottom/VBox" instance=ExtResource("5_fbpt0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "ui_cancel"
|
||||
action = &"ui_cancel"
|
||||
|
||||
[node name="Skip" parent="SafeZone/LeftBottom/VBox" instance=ExtResource("5_fbpt0")]
|
||||
layout_mode = 2
|
||||
text = "scene_skip"
|
||||
action = &"scene_skip"
|
||||
|
||||
[node name="RightBottom" type="Control" parent="SafeZone"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -40.0
|
||||
offset_top = -40.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="SafeZone/RightBottom"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -322.0
|
||||
offset_top = -240.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 48
|
||||
alignment = 2
|
||||
[connection signal="button_down" from="CenterContainer/MarginContainer/VPrompt/SkipButton" to="CenterContainer/MarginContainer/VPrompt" method="_on_skip_button_button_down"]
|
||||
[connection signal="button_up" from="CenterContainer/MarginContainer/VPrompt/SkipButton" to="CenterContainer/MarginContainer/VPrompt" method="_on_skip_button_button_up"]
|
||||
[connection signal="toggled" from="CenterContainer/MarginContainer/VPrompt/SkipButton" to="CenterContainer/MarginContainer/VPrompt" method="_on_skip_button_toggled"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue