Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 20 additions & 29 deletions Default.tres

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions assets/styles/slider/GrabberDisabledIcon.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" format=3 uid="uid://v7pot38x2my5"]

[ext_resource type="Texture2D" uid="uid://bmxqeqo65xwt" path="res://assets/sprites/spritesheet-default.png" id="1_fqsrr"]

[resource]
atlas = ExtResource("1_fqsrr")
region = Rect2(362, 576, 24, 24)
7 changes: 7 additions & 0 deletions assets/styles/slider/GrabberHighlightIcon.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" format=3 uid="uid://dvdaifyptlp0u"]

[ext_resource type="Texture2D" uid="uid://bmxqeqo65xwt" path="res://assets/sprites/spritesheet-default.png" id="1_00h6h"]

[resource]
atlas = ExtResource("1_00h6h")
region = Rect2(338, 576, 24, 24)
7 changes: 7 additions & 0 deletions assets/styles/slider/GrabberIcon.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" format=3 uid="uid://bwk64fvh6mqmw"]

[ext_resource type="Texture2D" uid="uid://bmxqeqo65xwt" path="res://assets/sprites/spritesheet-default.png" id="1_urye3"]

[resource]
atlas = ExtResource("1_urye3")
region = Rect2(314, 576, 24, 24)
24 changes: 16 additions & 8 deletions de.po
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,16 @@ msgstr ""
"Wenn diese Aktion aktiv ist, wird die Runde automatisch nach n Sekunden "
"beendet"

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "AI_THINK_SPEED_DESCRIPTION"
msgstr ""
"Stelle ein wie schnell die KI Ihre Züge vollzieht, ein höhere Wert bedeutet "
"das die KI weniger Zeit pro Zug benötigt"

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "AI_THINK_SPEED"
msgstr "KI Geschwindigkeit: %03.0f %%"

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "RESET_TUTORIAL_TOOLTIP"
msgstr "Wenn du diesen Knopf drückst wird das Tutorial zurückgesetzt"
Expand All @@ -1450,21 +1460,19 @@ msgstr ""
msgid "UI_SCALE"
msgstr "UI: %03.0f %%"

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "UI_SCALE_DECREASE"
msgstr "UI Skalierung verkleinern"

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "UI_SCALE_INCREASE"
msgstr "UI Skalierung vergrößern"

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "RESET_SCALING"
msgstr "UI Skalierung zurücksetzten"

msgid "Samory"
msgstr ""

#~ msgid "UI_SCALE_DECREASE"
#~ msgstr "UI Skalierung verkleinern"

#~ msgid "UI_SCALE_INCREASE"
#~ msgstr "UI Skalierung vergrößern"

#~ msgid "SETTINGS"
#~ msgstr "Einstellungen"

Expand Down
24 changes: 16 additions & 8 deletions en.po
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,16 @@ msgstr "Test effect volume"
msgid "AUTO_COMPLETE_ROUND_TOOLTIP"
msgstr "If enabled this will automatically wrap up a round after n seconds"

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "AI_THINK_SPEED_DESCRIPTION"
msgstr ""
"The speed modifier for the AI, higher values will reduce the thinking time "
"of the AI agents"

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "AI_THINK_SPEED"
msgstr "AI think speed: %03.0f %%"

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "RESET_TUTORIAL_TOOLTIP"
msgstr "If you press this button the tutorial will be reset"
Expand All @@ -1357,21 +1367,19 @@ msgstr ""
msgid "UI_SCALE"
msgstr "UI Scale: %03.0f %%"

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "UI_SCALE_DECREASE"
msgstr "Decrease UI scaling"

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "UI_SCALE_INCREASE"
msgstr "Increase UI scaling"

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "RESET_SCALING"
msgstr "Reset UI scaling"

msgid "Samory"
msgstr ""

#~ msgid "UI_SCALE_DECREASE"
#~ msgstr "Decrease UI scaling"

#~ msgid "UI_SCALE_INCREASE"
#~ msgstr "Increase UI scaling"

#~ msgid "SETTINGS"
#~ msgstr "Settings"

Expand Down
7 changes: 4 additions & 3 deletions entities/game/memory_game/scripts/GameAI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class_name AiAgent extends Node

@export var cards_node: GameCardGrid
@export var players: PlayerManager
@export var min_wait_milliseconds: float = 500
@export var max_wait_milliseconds: float = 3000
@export var min_wait_seconds: float = 0.5
@export var max_wait_seconds: float = 3
var timer: Timer = null;
var triggered_cards: int = 0

Expand Down Expand Up @@ -56,7 +56,8 @@ func player_changed(current_player:PlayerResource) -> void:
func prepare_and_start_timer() -> void:
if !timer.is_stopped():
return
timer.wait_time = randf_range(min_wait_milliseconds, max_wait_milliseconds) / 1000
var settings: SettingsResource = SettingsRepository.load_settings()
timer.wait_time = randf_range(min_wait_seconds * settings.ai_think_time, max_wait_seconds * settings.ai_think_time)
timer.start()

func timer_triggered() -> void:
Expand Down
51 changes: 35 additions & 16 deletions entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[ext_resource type="Resource" uid="uid://t4b63t07og3" path="res://shared/resources/translations/assets/TimeForCompletion.tres" id="4_gju51"]
[ext_resource type="Texture2D" uid="uid://xn3vywapxb7e" path="res://assets/icons/ResetIcon.tres" id="5_dr4ec"]
[ext_resource type="Script" uid="uid://chfatpxf8ucxr" path="res://shared/entities/clickable_button/ClickableButton.gd" id="6_jdnnp"]
[ext_resource type="Script" uid="uid://ccdakiql2b0aa" path="res://entities/ui/gameplay_settings/scripts/AiThinkSpeedLabel.gd" id="6_lwke5"]
[ext_resource type="PackedScene" uid="uid://cf4ydk76w8s3l" path="res://entities/ui/button_scroll_bar/scene/ButtonScrollBar.tscn" id="8_dr4ec"]

[node name="GameplaySettings" type="PanelContainer" unique_id=1855353257]
Expand Down Expand Up @@ -42,31 +43,43 @@ tooltip_text = "LOAD_CUSTOM_DECK_SETTING_TOOLTIP"
text = "LOAD_CUSTOM_DECKS"
script = ExtResource("1_b80m5")

[node name="HBoxContainer2" type="VBoxContainer" parent="VBoxContainer" unique_id=1700082779]
layout_mode = 2

[node name="AutoCompleteRound" type="CheckButton" parent="VBoxContainer/HBoxContainer2" unique_id=679192431]
[node name="AutoCompleteRound" type="CheckButton" parent="VBoxContainer" unique_id=679192431]
layout_mode = 2
tooltip_text = "AUTO_COMPLETE_ROUND_TOOLTIP"
text = "AUTO_COMPLETE_ROUND"
script = ExtResource("2_6p414")

[node name="TimeForCompletionGroup" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2" unique_id=878333817]
[node name="AiThinkSpeed" type="VBoxContainer" parent="VBoxContainer" unique_id=67296299]
layout_mode = 2

[node name="AiThinkSpeedLabel" type="Label" parent="VBoxContainer/AiThinkSpeed" unique_id=1893052298]
layout_mode = 2
tooltip_text = "AI_THINK_SPEED_DESCRIPTION"
mouse_filter = 1
text = "AI_THINK_SPEED"
script = ExtResource("6_lwke5")
max_allowed_value = 4.0

[node name="AiThinkSpeedSlider" parent="VBoxContainer/AiThinkSpeed" unique_id=789511813 instance=ExtResource("8_dr4ec")]
layout_mode = 2
min_value = 1.0
max_value = 4.0

[node name="TimeForCompletionGroup" type="VBoxContainer" parent="VBoxContainer" unique_id=878333817]
layout_mode = 2
script = ExtResource("3_rlq5l")
completion_time_translation = ExtResource("4_gju51")

[node name="TimeForCompletionLabel" type="Label" parent="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" unique_id=470050768]
[node name="TimeForCompletionLabel" type="Label" parent="VBoxContainer/TimeForCompletionGroup" unique_id=470050768]
auto_translate_mode = 2
layout_mode = 2
size_flags_vertical = 1
tooltip_auto_translate_mode = 2
text = "TIME_FOR_COMPLETION"
vertical_alignment = 1

[node name="ButtonScrollBar" parent="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" unique_id=789511813 instance=ExtResource("8_dr4ec")]
[node name="ButtonScrollBar" parent="VBoxContainer/TimeForCompletionGroup" unique_id=62650575 instance=ExtResource("8_dr4ec")]
layout_mode = 2
initial_value = 1.0
min_value = 1.0
max_value = 5.0
step_size = 1.0
Expand All @@ -78,16 +91,22 @@ text = "RESET_TUTORIAL"
icon = ExtResource("5_dr4ec")
script = ExtResource("6_jdnnp")

[connection signal="language_changed" from="." to="VBoxContainer/AiThinkSpeed/AiThinkSpeedLabel" method="language_changed"]
[connection signal="language_changed" from="." to="VBoxContainer/TimeForCompletionGroup" method="language_changed"]
[connection signal="settings_changed" from="." to="VBoxContainer/LanguageSelection" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/LoadCustomDecks" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/HBoxContainer2/AutoCompleteRound" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/AutoCompleteRound" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/AiThinkSpeed/AiThinkSpeedLabel" method="settings_updated"]
[connection signal="settings_changed" from="." to="VBoxContainer/TimeForCompletionGroup" method="settings_loaded"]
[connection signal="language_changed" from="VBoxContainer/LanguageSelection" to="." method="change_language"]
[connection signal="toggled" from="VBoxContainer/LoadCustomDecks" to="." method="change_custom_deck_loading"]
[connection signal="toggled" from="VBoxContainer/HBoxContainer2/AutoCompleteRound" to="." method="change_auto_close_round"]
[connection signal="toggled" from="VBoxContainer/HBoxContainer2/AutoCompleteRound" to="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" method="toggle_visibility"]
[connection signal="completion_time_changed" from="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" to="VBoxContainer/HBoxContainer2/TimeForCompletionGroup/TimeForCompletionLabel" method="set_text"]
[connection signal="update_slider_value" from="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" to="VBoxContainer/HBoxContainer2/TimeForCompletionGroup/ButtonScrollBar" method="set_value"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/TimeForCompletionGroup/ButtonScrollBar" to="." method="change_time_to_completion"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/TimeForCompletionGroup/ButtonScrollBar" to="VBoxContainer/HBoxContainer2/TimeForCompletionGroup" method="slider_changed"]
[connection signal="toggled" from="VBoxContainer/AutoCompleteRound" to="." method="change_auto_close_round"]
[connection signal="toggled" from="VBoxContainer/AutoCompleteRound" to="VBoxContainer/TimeForCompletionGroup" method="toggle_visibility"]
[connection signal="ai_think_time_changed" from="VBoxContainer/AiThinkSpeed/AiThinkSpeedLabel" to="." method="change_ai_think_time"]
[connection signal="setting_changed" from="VBoxContainer/AiThinkSpeed/AiThinkSpeedLabel" to="VBoxContainer/AiThinkSpeed/AiThinkSpeedSlider" method="set_value"]
[connection signal="value_changed" from="VBoxContainer/AiThinkSpeed/AiThinkSpeedSlider" to="VBoxContainer/AiThinkSpeed/AiThinkSpeedLabel" method="set_new_value"]
[connection signal="completion_time_changed" from="VBoxContainer/TimeForCompletionGroup" to="VBoxContainer/TimeForCompletionGroup/TimeForCompletionLabel" method="set_text"]
[connection signal="update_slider_value" from="VBoxContainer/TimeForCompletionGroup" to="VBoxContainer/TimeForCompletionGroup/ButtonScrollBar" method="set_value"]
[connection signal="value_changed" from="VBoxContainer/TimeForCompletionGroup/ButtonScrollBar" to="." method="change_time_to_completion"]
[connection signal="value_changed" from="VBoxContainer/TimeForCompletionGroup/ButtonScrollBar" to="VBoxContainer/TimeForCompletionGroup" method="slider_changed"]
[connection signal="pressed" from="VBoxContainer/ResetTutorial" to="." method="tutorial_reset"]
36 changes: 36 additions & 0 deletions entities/ui/gameplay_settings/scripts/AiThinkSpeedLabel.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
extends Label

signal setting_changed(new_value: float)
signal ai_think_time_changed(new_value: float)

@export var max_allowed_value: float = 3

var _initial_text: String = ""
var _last_think_speed: float = 1

func _ready() -> void:
_initial_text = text

func set_new_value(new_value: float) -> void:
_last_think_speed = new_value
_update_text_table(new_value)

var real_value: float = _convert_value(new_value)
real_value = real_value / max_allowed_value
ai_think_time_changed.emit(real_value)

func _convert_value(new_value: float) -> float:
return (max_allowed_value + 1) - new_value

func _update_text_table(new_value: float) -> void:
text = tr(_initial_text) % (new_value * 100.0)

func language_changed(_language_code: String) -> void:
_update_text_table(_last_think_speed)

func settings_updated(settings: SettingsResource) -> void:
var base_value: float = settings.ai_think_time * max_allowed_value
base_value = _convert_value(base_value)
print(base_value)
_update_text_table(base_value)
setting_changed.emit(base_value)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://ccdakiql2b0aa
4 changes: 4 additions & 0 deletions entities/ui/gameplay_settings/scripts/GameplaySettings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ signal language_changed(language_code: String)
signal load_custom_deck_changed(state: bool)
signal time_for_completion_changed(time: float)
signal auto_complete_changed(state: bool)
signal ai_think_time_changed(new_value: float)
signal reset_tutorial()

func change_language(language_code: String) -> void:
Expand All @@ -20,6 +21,9 @@ func change_auto_close_round(state: bool) -> void:
func change_time_to_completion(time: float) -> void:
time_for_completion_changed.emit(time)

func change_ai_think_time(new_value: float) -> void:
ai_think_time_changed.emit(new_value)

func tutorial_reset() -> void:
reset_tutorial.emit()

Expand Down
2 changes: 1 addition & 1 deletion entities/ui/graphic_settings/scenes/GraphicSettings.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ script = ExtResource("6_fnqnv")

[node name="ButtonScrollBar" parent="VBoxContainer/UiScale" unique_id=789511813 instance=ExtResource("7_r24jl")]
layout_mode = 2
initial_value = 1.0
min_value = 0.7999999999999999
max_value = 1.8

[node name="ResetScale" type="Button" parent="VBoxContainer" unique_id=2004485175]
layout_mode = 2
text = "RESET_SCALING"

[connection signal="language_changed" from="." to="VBoxContainer/UiScale/UiScaleLabel" method="language_changed"]
[connection signal="settings_changed" from="." to="VBoxContainer/WindowModeSelection" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/VSync" method="settings_loaded"]
[connection signal="settings_changed" from="." to="VBoxContainer/UiScale" method="settings_changed"]
Expand Down
6 changes: 5 additions & 1 deletion entities/ui/graphic_settings/scripts/GraphicSettings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ signal window_mode_changed(new_mode: DisplayServer.WindowMode)
signal v_sync_changed(state: bool)
signal ui_scale_changed(new_scale: float)
signal settings_changed(setting: SettingsResource)
signal language_changed(language_code: String)

func change_window_mode(new_mode: DisplayServer.WindowMode) -> void:
window_mode_changed.emit(new_mode)
Expand All @@ -15,4 +16,7 @@ func change_ui_scale(new_scale: float) -> void:
ui_scale_changed.emit(new_scale)

func settings_loaded(settings: SettingsResource) -> void:
settings_changed.emit(settings)
settings_changed.emit(settings)

func change_language(language_code: String) -> void:
language_changed.emit(language_code)
3 changes: 2 additions & 1 deletion entities/ui/settings_menu/scenes/SettingsMenu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ script = ExtResource("19_3ip51")
[connection signal="pressed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/SettingSelection/AudioSettings" to="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" method="hide"]
[connection signal="pressed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/SettingSelection/AudioSettings" to="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings" method="hide"]
[connection signal="pressed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/SettingSelection/AudioSettings" to="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/AudioScene" method="show"]
[connection signal="ai_think_time_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="." method="ai_think_time_updated"]
[connection signal="auto_complete_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="." method="auto_complete_round_changed"]
[connection signal="language_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="." method="language_changed"]
[connection signal="language_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings" method="change_language"]
[connection signal="load_custom_deck_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="." method="load_custom_deck_changed"]
[connection signal="reset_tutorial" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="." method="reset_tutorial"]
[connection signal="time_for_completion_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GameplaySettings" to="." method="time_for_completion_changed"]
[connection signal="settings_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings" to="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings/VBoxContainer/UiScale" method="settings_changed"]
[connection signal="ui_scale_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings" to="." method="ui_scale_changed"]
[connection signal="v_sync_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings" to="." method="v_sync_changed"]
[connection signal="window_mode_changed" from="CenterContainer/PanelContainer/MarginContainer/SettingsMenu/GraphicSettings" to="." method="window_mode_changed"]
Expand Down
3 changes: 3 additions & 0 deletions entities/ui/settings_menu/scripts/SettingsMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ func v_sync_changed(new_value: bool) -> void:
if not new_value:
mode = DisplayServer.VSYNC_DISABLED
DisplayServer.window_set_vsync_mode(mode)

func ai_think_time_updated(new_value: float) -> void:
_current_settings.ai_think_time = new_value
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ class_name SettingsResource extends Save

@export_group("Multiplayer")
@export var default_multiplayer_name: String = ""
@export var last_used_ip: String = "127.0.0.1"
@export var last_used_ip: String = "127.0.0.1"

@export_group("AI")
@export var ai_think_time: float = 1
16 changes: 8 additions & 8 deletions translations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,14 @@ msgstr ""
msgid "AUTO_COMPLETE_ROUND_TOOLTIP"
msgstr ""

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "AI_THINK_SPEED_DESCRIPTION"
msgstr ""

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "AI_THINK_SPEED"
msgstr ""

#: entities/ui/gameplay_settings/scenes/GameplaySettings.tscn
msgid "RESET_TUTORIAL_TOOLTIP"
msgstr ""
Expand All @@ -1293,14 +1301,6 @@ msgstr ""
msgid "UI_SCALE"
msgstr ""

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "UI_SCALE_DECREASE"
msgstr ""

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "UI_SCALE_INCREASE"
msgstr ""

#: entities/ui/graphic_settings/scenes/GraphicSettings.tscn
msgid "RESET_SCALING"
msgstr ""
Expand Down