Skip to content

Commit

Permalink
neuro integration toggle and overlay input blocker
Browse files Browse the repository at this point in the history
  • Loading branch information
jwapobie committed Jan 4, 2025
1 parent 1d31099 commit d1ed0e0
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 49 deletions.
23 changes: 22 additions & 1 deletion default_theme.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="Theme" load_steps=5 format=3 uid="uid://5c0tm6smuwr6"]
[gd_resource type="Theme" load_steps=7 format=3 uid="uid://5c0tm6smuwr6"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_n0lpc"]
content_margin_left = 10.0
Expand Down Expand Up @@ -44,9 +44,30 @@ corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_m3wfb"]
bg_color = Color(0.699879, 0.453051, 0.323543, 1)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_anxdp"]
content_margin_left = 3.0
content_margin_top = 3.0
content_margin_right = 3.0
content_margin_bottom = 3.0
bg_color = Color(0.270125, 0.184323, 0.24791, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.31568, 0.19885, 0.267815, 1)

[resource]
Button/font_sizes/font_size = 24
Button/styles/focus = SubResource("StyleBoxEmpty_n0lpc")
Button/styles/hover = SubResource("StyleBoxFlat_2g5uo")
Button/styles/normal = SubResource("StyleBoxFlat_smswd")
Button/styles/pressed = SubResource("StyleBoxFlat_xmtrs")
PopupMenu/styles/hover = SubResource("StyleBoxFlat_m3wfb")
PopupMenu/styles/panel = SubResource("StyleBoxFlat_anxdp")
3 changes: 3 additions & 0 deletions fonts/Nebulous Content.otf
Git LFS file not shown
39 changes: 39 additions & 0 deletions fonts/Nebulous Content.otf.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[remap]

importer="font_data_dynamic"
type="FontFile"
uid="uid://bjv5hli5b22x2"
path="res://.godot/imported/Nebulous Content.otf-0b22f1d23cdb2d0a282336d59332910b.fontdata"

[deps]

source_file="res://fonts/Nebulous Content.otf"
dest_files=["res://.godot/imported/Nebulous Content.otf-0b22f1d23cdb2d0a282336d59332910b.fontdata"]

[params]

Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=true
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[{
"chars": [],
"glyphs": [],
"name": "New Configuration",
"size": Vector2i(16, 0)
}]
language_support={}
script_support={}
opentype_features={}
9 changes: 9 additions & 0 deletions objects/neuro_integration_option_button.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends OptionButton


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
item_selected.connect(select_option)

func select_option(option: int) -> void:
GameState.neuro_integration_mode = option
22 changes: 22 additions & 0 deletions objects/neuro_ui/neuro_control_overlay.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends Control
@onready var texture_rect: TextureRect = $TextureRect


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
visible = false
GameState.neuro_wait_started.connect(show_overlay)
GameState.neuro_wait_ended.connect(hide_overlay)


func show_overlay() -> void:
visible = true
texture_rect.modulate = Color.TRANSPARENT
var tween := create_tween()
tween.tween_property(texture_rect, 'modulate', Color.WHITE, 0.25)

func hide_overlay() -> void:
var tween := create_tween()
tween.tween_property(texture_rect, 'modulate', Color.TRANSPARENT, 0.25)
await tween.finished
visible = false
4 changes: 3 additions & 1 deletion objects/tooltip/item_selection.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=7 format=3 uid="uid://db0q2oseq1tiw"]
[gd_scene load_steps=8 format=3 uid="uid://db0q2oseq1tiw"]

[ext_resource type="Texture2D" uid="uid://ec4ody0rmgd0" path="res://icon.svg" id="1_hxeww"]
[ext_resource type="Script" path="res://objects/tooltip/item_selection.gd" id="1_q738r"]
[ext_resource type="Script" path="res://scripts/utility/sound_button.gd" id="2_27dig"]
[ext_resource type="PackedScene" uid="uid://d3urw8d4uyseg" path="res://objects/tooltip/item_description.tscn" id="2_oco1m"]
[ext_resource type="AudioStream" uid="uid://bds1n7s2v17ni" path="res://audio/UIClick_Hand Pop UI Diminished 1_RogueWaves_KawaiiUI.wav" id="3_bolpl"]
[ext_resource type="FontFile" uid="uid://byc1ouwicguue" path="res://fonts/OpenSans-Bold.ttf" id="3_y6osn"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pywe8"]
Expand Down Expand Up @@ -32,6 +33,7 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 1
script = ExtResource("2_27dig")
sound_on_press = ExtResource("3_bolpl")

[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ var items_have_changed: bool = false
func _ready() -> void:
if OS.has_feature("no_particles"):
gpu_particles_2d.visible = false
#show_upgrades()

func _process(_delta: float) -> void:
if items_have_changed:
Expand All @@ -59,6 +58,8 @@ func animate_screen_appear() -> void:

func show_upgrades() -> void:
animate_screen_appear()
if GameState.neuro_integration_mode != GameState.NEURO_INTEGRATION_MODE.Off:
GameState.neuro_wait_started.emit()
var upgrade_choices :Array[PackedScene] = upgrade_prefabs.duplicate()
for i in range(upgrade_choices.size() - 1, -1, -1):
if GameState.upgrades_block.has(i):
Expand Down Expand Up @@ -93,19 +94,23 @@ func show_upgrades() -> void:
item_select_callback.select_callback = on_select
item_select_callbacks.append(item_select_callback)

await get_tree().create_timer(5).timeout
await get_tree().create_timer(0.5).timeout
create_actions(item_select_callbacks)

func on_upgrade_selected(item: PackedScene, is_unique :bool) -> void:
for child in upgrade_buttons.get_children():
var button := child as Button
if button:
button.disabled = true


var event := EventUpgradeSelected.new()
event.upgrade_item = item
EventBus.queue_event(event)
if is_unique:
GameState.upgrades_block.append(upgrade_prefabs.find(item))
if GameState.neuro_integration_mode != GameState.NEURO_INTEGRATION_MODE.Off:
GameState.neuro_wait_ended.emit()


func on_button_hover(item: Item) -> void:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://cbm78yibra6u3"]

[ext_resource type="Script" path="res://scenes/upgrade_screen.gd" id="1_rythi"]
[ext_resource type="Script" path="res://objects/upgrade_screen/upgrade_screen.gd" id="1_rythi"]

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_k11sl"]
particle_flag_disable_z = true
Expand Down
135 changes: 92 additions & 43 deletions scenes/gameplay.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=3 uid="uid://cuwq5a1ylpiw0"]
[gd_scene load_steps=24 format=3 uid="uid://cuwq5a1ylpiw0"]

[ext_resource type="Script" path="res://scenes/gameplay.gd" id="1_cgi25"]
[ext_resource type="Script" path="res://objects/card_player/card_hand.gd" id="2_jcadc"]
Expand All @@ -8,20 +8,32 @@
[ext_resource type="Script" path="res://scripts/utility/sound_button.gd" id="4_ullpb"]
[ext_resource type="AudioStream" uid="uid://bxeun3p5fmv8b" path="res://audio/UIClick_Operating System UI Cursor_RogueWaves_KawaiiUI.wav" id="5_bqihu"]
[ext_resource type="Script" path="res://objects/score_counter/score_display.gd" id="5_f3pnb"]
[ext_resource type="PackedScene" uid="uid://cbm78yibra6u3" path="res://scenes/upgrade_screen.tscn" id="6_6v1j0"]
[ext_resource type="PackedScene" uid="uid://cbm78yibra6u3" path="res://objects/upgrade_screen/upgrade_screen.tscn" id="6_6v1j0"]
[ext_resource type="Script" path="res://scenes/items_container.gd" id="6_bg8mw"]
[ext_resource type="Script" path="res://objects/score_counter/add_display.gd" id="6_yy4x3"]
[ext_resource type="Script" path="res://objects/health_display/health_display.gd" id="7_6u6od"]
[ext_resource type="Script" path="res://objects/health_display/add_display.gd" id="8_lp0fn"]
[ext_resource type="Script" path="res://scenes/past_hands.gd" id="10_oblqp"]
[ext_resource type="Script" path="res://scripts/utility/tooltipped.gd" id="10_xu2qm"]
[ext_resource type="FontFile" uid="uid://bjv5hli5b22x2" path="res://fonts/Nebulous Content.otf" id="14_5g5dt"]
[ext_resource type="Script" path="res://objects/neuro_ui/neuro_control_overlay.gd" id="14_qe8ue"]
[ext_resource type="Script" path="res://scenes/quit_run_button.gd" id="16_3gbey"]
[ext_resource type="Script" path="res://objects/volume_slider.gd" id="17_pimmb"]

[sub_resource type="Curve" id="Curve_gb3ms"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2

[sub_resource type="Gradient" id="Gradient_heoua"]
offsets = PackedFloat32Array(0.442786, 0.895522, 1)
colors = PackedColorArray(0.506929, 0.322586, 0.492271, 0, 0.828305, 0.764115, 0.823202, 0.651786, 1, 1, 1, 1)

[sub_resource type="GradientTexture2D" id="GradientTexture2D_d4tdq"]
gradient = SubResource("Gradient_heoua")
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(1.5, 0)

[sub_resource type="GDScript" id="GDScript_jtk48"]
script/source = "extends Label

Expand Down Expand Up @@ -89,47 +101,6 @@ mouse_filter = 1
text = "Sort Value"
script = ExtResource("4_ullpb")
[node name="SpeedControl" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -279.0
offset_top = 14.0
offset_right = -11.0
offset_bottom = 41.0
grow_horizontal = 0
alignment = 2
script = ExtResource("2_w836i")
[node name="Label" type="Label" parent="SpeedControl"]
layout_mode = 2
text = "Speed:"
[node name="SpeedSlowButton" type="Button" parent="SpeedControl"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 16
toggle_mode = true
text = "0.5x"
script = ExtResource("4_ullpb")
[node name="SpeedNormalButton" type="Button" parent="SpeedControl"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 16
toggle_mode = true
text = "1x"
script = ExtResource("4_ullpb")
[node name="SpeedFastButton" type="Button" parent="SpeedControl"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 16
toggle_mode = true
text = "3x"
script = ExtResource("4_ullpb")
[node name="Button" type="Button" parent="."]
visible = false
layout_mode = 1
Expand Down Expand Up @@ -496,6 +467,84 @@ layout_mode = 1
[node name="EventHandler" type="Node" parent="."]
script = ExtResource("4_c7t3g")
[node name="NeuroControlOverlay" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("14_qe8ue")
[node name="Label" type="Label" parent="NeuroControlOverlay"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -113.5
offset_top = 21.0
offset_right = 113.5
offset_bottom = 44.0
grow_horizontal = 2
theme_override_colors/font_shadow_color = Color(0.748738, 0.0115674, 0.751088, 1)
theme_override_constants/shadow_offset_x = 0
theme_override_constants/shadow_offset_y = 3
theme_override_fonts/font = ExtResource("14_5g5dt")
theme_override_font_sizes/font_size = 24
text = "Neuro is choosing an action..."
horizontal_alignment = 1
[node name="TextureRect" type="TextureRect" parent="NeuroControlOverlay"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 0
texture = SubResource("GradientTexture2D_d4tdq")
[node name="SpeedControl" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -279.0
offset_top = 14.0
offset_right = -11.0
offset_bottom = 41.0
grow_horizontal = 0
alignment = 2
script = ExtResource("2_w836i")
[node name="Label" type="Label" parent="SpeedControl"]
layout_mode = 2
text = "Speed:"
[node name="SpeedSlowButton" type="Button" parent="SpeedControl"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 16
toggle_mode = true
text = "0.5x"
script = ExtResource("4_ullpb")
[node name="SpeedNormalButton" type="Button" parent="SpeedControl"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 16
toggle_mode = true
text = "1x"
script = ExtResource("4_ullpb")
[node name="SpeedFastButton" type="Button" parent="SpeedControl"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 16
toggle_mode = true
text = "3x"
script = ExtResource("4_ullpb")
[node name="PastHands" type="Control" parent="."]
layout_mode = 1
anchors_preset = 11
Expand Down
Loading

0 comments on commit d1ed0e0

Please sign in to comment.