Renamed a bunch of player stuff to pawn stuff and implemented extensive work on getting single-address 'netplay' code working. Not sure if I've created issues with single player but in theory it should all transfer across as if the player is simply always the host.

This commit is contained in:
2026-01-08 07:15:20 -05:00
parent 9fe376e27e
commit ec02685065
69 changed files with 1525 additions and 708 deletions

186
templates/pawn_display.tscn Normal file
View File

@@ -0,0 +1,186 @@
[gd_scene load_steps=8 format=3 uid="uid://46rpw0rrd51m"]
[ext_resource type="Script" uid="uid://blljmwvft1g8m" path="res://scripts/pawn_display.gd" id="1_c4qnx"]
[ext_resource type="Texture2D" uid="uid://dri0a20l6kpbj" path="res://visuals/images/icon.svg" id="2_dvd7o"]
[ext_resource type="Script" uid="uid://qwyhu0gexeah" path="res://scripts/cs_trap_display.gd" id="3_ph4cm"]
[sub_resource type="Shader" id="Shader_fa52j"]
code = "shader_type canvas_item;
uniform sampler2D main_texture;
uniform float granularity : hint_range(5, 30) = 15.0;
uniform float opacity_limit;
float random (vec2 uv) {
return fract(sin(dot(uv.xy,
vec2(12.9898,78.233))) * 43758.5453123);
}
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
vec2 uv = UV;
float g = ( pow(granularity, 2));
uv = round((uv * g)) / g;
uv.y = TIME * uv.y + TIME * .05;
uv.x = 10.0 * TIME * uv.x + TIME * 1.0;
float val = random(uv);
float op = random(-uv) / val;
float alpha = 1.0;
if(op < opacity_limit){
alpha = 0.0;
}
vec4 color = vec4(val, val, val, alpha * COLOR.a);
COLOR = color;
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_w1hxv"]
shader = SubResource("Shader_fa52j")
shader_parameter/granularity = 20.0000007125
shader_parameter/opacity_limit = 0.0
[sub_resource type="Gradient" id="Gradient_ak2if"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_fa52j"]
gradient = SubResource("Gradient_ak2if")
width = 1
[node name="PawnDisplay" type="Panel"]
offset_left = 94.0
offset_top = 96.0
offset_right = 794.0
offset_bottom = 796.0
script = ExtResource("1_c4qnx")
[node name="Portrait" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_dvd7o")
expand_mode = 1
[node name="PortraitBlinder" type="TextureRect" parent="."]
material = SubResource("ShaderMaterial_w1hxv")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1
[node name="Control" type="Control" parent="."]
anchors_preset = 0
offset_left = 108.0
offset_top = 286.0
offset_right = 392.0
offset_bottom = 350.0
[node name="PawnName" type="Label" parent="Control"]
unique_name_in_owner = true
modulate = Color(0, 0.3254902, 1, 1)
layout_mode = 0
offset_left = 37.0
offset_top = 288.0
offset_right = 448.0
offset_bottom = 355.0
theme_override_font_sizes/font_size = 48
text = "NAME GOES HERE"
horizontal_alignment = 1
[node name="VBoxContainer" type="VBoxContainer" parent="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 = -39.0
offset_top = 281.0
offset_right = 245.0
offset_bottom = 394.0
grow_horizontal = 2
grow_vertical = 0
[node name="Panel" type="PanelContainer" parent="Control/VBoxContainer"]
layout_mode = 2
[node name="TrapContainer" type="HBoxContainer" parent="Control/VBoxContainer/Panel"]
unique_name_in_owner = true
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Control/VBoxContainer/Panel/TrapContainer"]
custom_minimum_size = Vector2(92, 64)
layout_mode = 2
expand_mode = 1
script = ExtResource("3_ph4cm")
[node name="Label" type="Label" parent="Control/VBoxContainer/Panel/TrapContainer/TextureRect"]
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 = -23.0
grow_horizontal = 0
grow_vertical = 0
text = "##"
horizontal_alignment = 2
[node name="TextureRect2" type="TextureRect" parent="Control/VBoxContainer/Panel/TrapContainer"]
custom_minimum_size = Vector2(92, 64)
layout_mode = 2
expand_mode = 1
script = ExtResource("3_ph4cm")
[node name="Label" type="Label" parent="Control/VBoxContainer/Panel/TrapContainer/TextureRect2"]
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 = -23.0
grow_horizontal = 0
grow_vertical = 0
text = "##"
horizontal_alignment = 2
[node name="TextureRect3" type="TextureRect" parent="Control/VBoxContainer/Panel/TrapContainer"]
custom_minimum_size = Vector2(92, 64)
layout_mode = 2
expand_mode = 1
script = ExtResource("3_ph4cm")
[node name="Label" type="Label" parent="Control/VBoxContainer/Panel/TrapContainer/TextureRect3"]
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 = -23.0
grow_horizontal = 0
grow_vertical = 0
text = "##"
horizontal_alignment = 2