mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-07 12:31:16 +00:00
Shrouds
This commit is contained in:
parent
5011de651f
commit
bf0fbb68b1
10 changed files with 1688 additions and 1182 deletions
|
|
@ -0,0 +1,31 @@
|
|||
[gd_resource type="Resource" script_class="FuncGodotFGDSolidClass" load_steps=5 format=3 uid="uid://xh2rr0g6ey1a"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://bfjnt8q3l2p65" path="res://3D/TrenchBroom/EntityDefinitions/base/func_base.tres" id="1_ug7xt"]
|
||||
[ext_resource type="Resource" uid="uid://c1utxplehq2jl" path="res://3D/TrenchBroom/EntityDefinitions/base/targetname_base.tres" id="2_euhoe"]
|
||||
[ext_resource type="Script" uid="uid://msq50x6rk4po" path="res://addons/func_godot/src/fgd/func_godot_fgd_solid_class.gd" id="3_wgfj6"]
|
||||
[ext_resource type="Script" uid="uid://dgbkp4hgm0oxl" path="res://3D/TrenchBroom/EntityScripts/Solid/FuncShroud.cs" id="4_ug7xt"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_wgfj6")
|
||||
origin_type = 3
|
||||
use_in_baked_light = false
|
||||
shadow_casting_setting = 0
|
||||
build_occlusion = true
|
||||
collision_shape_type = 0
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
script_class = ExtResource("4_ug7xt")
|
||||
classname = "func_shroud"
|
||||
description = "Geometry that can be made disappear"
|
||||
base_classes = Array[Resource]([ExtResource("1_ug7xt"), ExtResource("2_euhoe")])
|
||||
class_properties = {
|
||||
"one_time": true
|
||||
}
|
||||
class_property_descriptions = {
|
||||
"one_time": "Trigger only one time?"
|
||||
}
|
||||
meta_properties = {
|
||||
"color": Color(0.9647059, 0.87211144, 0, 1)
|
||||
}
|
||||
node_class = "StaticBody3D"
|
||||
metadata/_custom_type_script = "uid://msq50x6rk4po"
|
||||
92
3D/TrenchBroom/EntityScripts/Solid/FuncShroud.cs
Normal file
92
3D/TrenchBroom/EntityScripts/Solid/FuncShroud.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Utils;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno._3D.TrenchBroom.EntityScripts.Solid;
|
||||
|
||||
[Tool]
|
||||
public partial class FuncShroud : StaticBody3D, IActivable
|
||||
{
|
||||
[Export] public string TargetName { get; private set; }
|
||||
[Export] public bool OneTime { get; private set; }
|
||||
|
||||
private bool _enabled = true;
|
||||
private bool _activable = true;
|
||||
|
||||
public void _func_godot_apply_properties(Dictionary<string, Variant> props)
|
||||
{
|
||||
TargetName = props["targetname"].AsString();
|
||||
OneTime = props["one_time"].AsBool();
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(TargetName))
|
||||
{
|
||||
this.AddToGroup(TargetName);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
if (!_activable) return false;
|
||||
switch (activationType)
|
||||
{
|
||||
case ActivationType.Toggle:
|
||||
case ActivationType.Use:
|
||||
Toggle();
|
||||
break;
|
||||
case ActivationType.Enable:
|
||||
case ActivationType.Close:
|
||||
ShowShroud();
|
||||
break;
|
||||
case ActivationType.Disable:
|
||||
case ActivationType.Open:
|
||||
HideShroud();
|
||||
break;
|
||||
|
||||
case ActivationType.Destroy:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(activationType), activationType, null);
|
||||
}
|
||||
|
||||
if (OneTime)
|
||||
{
|
||||
_activable = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Toggle()
|
||||
{
|
||||
if (!_activable) return;
|
||||
if (_enabled)
|
||||
{
|
||||
HideShroud();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowShroud();
|
||||
}
|
||||
}
|
||||
|
||||
private void HideShroud()
|
||||
{
|
||||
if (!_activable) return;
|
||||
_enabled = false;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void ShowShroud()
|
||||
{
|
||||
if (!_activable) return;
|
||||
_enabled = true;
|
||||
this.Show();
|
||||
}
|
||||
}
|
||||
1
3D/TrenchBroom/EntityScripts/Solid/FuncShroud.cs.uid
Normal file
1
3D/TrenchBroom/EntityScripts/Solid/FuncShroud.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dgbkp4hgm0oxl
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="TrenchBroomGameConfig" load_steps=10 format=3 uid="uid://epxfscc84ib6"]
|
||||
[gd_resource type="Resource" script_class="TrenchBroomGameConfig" load_steps=11 format=3 uid="uid://epxfscc84ib6"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://8a2w537d05la" path="res://3D/TrenchBroom/Tags/trigger_tag.tres" id="1_2qv8g"]
|
||||
[ext_resource type="Resource" uid="uid://b4xhdj0e16lop" path="res://addons/func_godot/game_config/trenchbroom/tb_face_tag_clip.tres" id="1_vu564"]
|
||||
|
|
@ -9,10 +9,11 @@
|
|||
[ext_resource type="Resource" uid="uid://bdmexobfdwk12" path="res://3D/TrenchBroom/Tags/glass_tag.tres" id="5_lswco"]
|
||||
[ext_resource type="Script" uid="uid://cfpnvyygr4pb5" path="res://addons/func_godot/src/trenchbroom/trenchbroom_game_config.gd" id="6_478qb"]
|
||||
[ext_resource type="Resource" uid="uid://chysqo5rdd5p" path="res://3D/TrenchBroom/Tags/test_glass_tag.tres" id="6_lswco"]
|
||||
[ext_resource type="Resource" uid="uid://b8kujhnu10hyc" path="res://3D/TrenchBroom/Tags/func_shroud_tag.tres" id="7_jsm6j"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("6_478qb")
|
||||
fgd_file = ExtResource("4_fiwv4")
|
||||
entity_scale = "16"
|
||||
brush_tags = Array[Resource]([ExtResource("1_2qv8g")])
|
||||
brush_tags = Array[Resource]([ExtResource("1_2qv8g"), ExtResource("7_jsm6j")])
|
||||
brushface_tags = Array[Resource]([ExtResource("1_vu564"), ExtResource("2_xq8pd"), ExtResource("3_sgien"), ExtResource("5_lswco"), ExtResource("6_lswco")])
|
||||
|
|
|
|||
10
3D/TrenchBroom/Tags/func_shroud_tag.tres
Normal file
10
3D/TrenchBroom/Tags/func_shroud_tag.tres
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[gd_resource type="Resource" script_class="TrenchBroomTag" load_steps=2 format=3 uid="uid://b8kujhnu10hyc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvwfhwn3pgig1" path="res://addons/func_godot/src/trenchbroom/trenchbroom_tag.gd" id="1_vq4m7"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_vq4m7")
|
||||
tag_name = "Shroud"
|
||||
tag_match_type = 1
|
||||
tag_pattern = "func_shroud"
|
||||
metadata/_custom_type_script = "uid://cvwfhwn3pgig1"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="FuncGodotFGDFile" load_steps=10 format=3 uid="uid://dgkdkac8ppgnq"]
|
||||
[gd_resource type="Resource" script_class="FuncGodotFGDFile" load_steps=11 format=3 uid="uid://dgkdkac8ppgnq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cknmd0lgmorx2" path="res://addons/func_godot/src/fgd/func_godot_fgd_file.gd" id="1_jws5j"]
|
||||
[ext_resource type="Resource" uid="uid://cxy7jnh6d7msn" path="res://addons/func_godot/fgd/func_detail.tres" id="1_rbohd"]
|
||||
|
|
@ -9,12 +9,9 @@
|
|||
[ext_resource type="Resource" uid="uid://c2x5nns4yv5y1" path="res://3D/TrenchBroom/EntityDefinitions/solid/Brush/acid_area.tres" id="6_ire2f"]
|
||||
[ext_resource type="Resource" uid="uid://jnnorlsenrwb" path="res://3D/TrenchBroom/EntityDefinitions/solid/funcs/func_move.tres" id="7_h7bc3"]
|
||||
[ext_resource type="Resource" uid="uid://bl3lxmse670pv" path="res://3D/TrenchBroom/EntityDefinitions/solid/Brush/worldspawn_shadow.tres" id="8_jyjj4"]
|
||||
[ext_resource type="Resource" uid="uid://xh2rr0g6ey1a" path="res://3D/TrenchBroom/EntityDefinitions/solid/funcs/func_shroud.tres" id="9_ujqfn"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_jws5j")
|
||||
export_file = false
|
||||
target_map_editor = 1
|
||||
fgd_name = "FuncGodot"
|
||||
base_fgd_files = Array[Resource]([])
|
||||
entity_definitions = Array[Resource]([ExtResource("1_rbohd"), ExtResource("2_1pqwq"), ExtResource("3_ire2f"), ExtResource("4_h7bc3"), ExtResource("5_1pqwq"), ExtResource("6_ire2f"), ExtResource("7_h7bc3"), ExtResource("8_jyjj4")])
|
||||
entity_definitions = Array[Resource]([ExtResource("1_rbohd"), ExtResource("2_1pqwq"), ExtResource("3_ire2f"), ExtResource("4_h7bc3"), ExtResource("5_1pqwq"), ExtResource("6_ire2f"), ExtResource("7_h7bc3"), ExtResource("8_jyjj4"), ExtResource("9_ujqfn")])
|
||||
metadata/_custom_type_script = "uid://cknmd0lgmorx2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue