mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 04:33:47 +00:00
typed Open trigger
This commit is contained in:
parent
1907a38575
commit
4abf28066a
23 changed files with 2018 additions and 1440 deletions
|
|
@ -0,0 +1,30 @@
|
|||
[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=2 format=3 uid="uid://bd4h6ha84s74b"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://6o4wbl0iau0v" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_giwth"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_giwth")
|
||||
classname = "ActivationType"
|
||||
description = "Activation Type"
|
||||
func_godot_internal = false
|
||||
base_classes = Array[Resource]([])
|
||||
class_properties = {
|
||||
"activationtype": {
|
||||
"Close": "Close",
|
||||
"Disable": "Disable",
|
||||
"Enable": "Enable",
|
||||
"Open": "Open",
|
||||
"Toggle": "Toggle"
|
||||
}
|
||||
}
|
||||
class_property_descriptions = {
|
||||
"activationtype": "Type of activation"
|
||||
}
|
||||
auto_apply_to_matching_node_properties = false
|
||||
meta_properties = {
|
||||
"color": Color(0.8, 0.8, 0.8, 1),
|
||||
"size": AABB(-8, -8, -8, 8, 8, 8)
|
||||
}
|
||||
node_class = ""
|
||||
name_property = ""
|
||||
metadata/_custom_type_script = "uid://6o4wbl0iau0v"
|
||||
|
|
@ -1,16 +1,17 @@
|
|||
[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=5 format=3 uid="uid://ermxog0n4mvn"]
|
||||
[gd_resource type="Resource" script_class="FuncGodotFGDBaseClass" load_steps=6 format=3 uid="uid://ermxog0n4mvn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://6o4wbl0iau0v" path="res://addons/func_godot/src/fgd/func_godot_fgd_base_class.gd" id="1_0kba8"]
|
||||
[ext_resource type="Resource" uid="uid://kerywjgft7vh" path="res://3D/TrenchBroom/EntityDefinitions/base/target_base.tres" id="1_73jh0"]
|
||||
[ext_resource type="Resource" uid="uid://c1utxplehq2jl" path="res://3D/TrenchBroom/EntityDefinitions/base/targetname_base.tres" id="2_f4xyy"]
|
||||
[ext_resource type="Resource" uid="uid://x4g06004i574" path="res://3D/TrenchBroom/EntityDefinitions/base/globalname_base.tres" id="3_mslp0"]
|
||||
[ext_resource type="Resource" uid="uid://bd4h6ha84s74b" path="res://3D/TrenchBroom/EntityDefinitions/base/activation_type_base.tres" id="4_mslp0"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_0kba8")
|
||||
classname = "Trigger"
|
||||
description = ""
|
||||
description = "Base Trigger"
|
||||
func_godot_internal = false
|
||||
base_classes = Array[Resource]([ExtResource("1_73jh0"), ExtResource("2_f4xyy"), ExtResource("3_mslp0")])
|
||||
base_classes = Array[Resource]([ExtResource("1_73jh0"), ExtResource("2_f4xyy"), ExtResource("3_mslp0"), ExtResource("4_mslp0")])
|
||||
class_properties = {}
|
||||
class_property_descriptions = {}
|
||||
auto_apply_to_matching_node_properties = false
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class_property_descriptions = {}
|
|||
auto_apply_to_matching_node_properties = false
|
||||
meta_properties = {
|
||||
"size": AABB(-4, -4, -4, 4, 4, 4),
|
||||
"studio": "\"3D/MapModels/actor_controlpad.glb\""
|
||||
"studio": "\"3D\\MapModels/actor_controlpad.glb\""
|
||||
}
|
||||
node_class = ""
|
||||
name_property = ""
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ public partial class TriggerArea : Area3D
|
|||
[Export] public string TargetFunc { get; private set; }
|
||||
[Export] public string TargetName { get; private set; }
|
||||
|
||||
[Export] public ActivationType ActivationType { get; private set; } = ActivationType.Toggle;
|
||||
|
||||
public enum TriggerStates
|
||||
{
|
||||
READY,
|
||||
|
|
@ -27,6 +29,16 @@ public partial class TriggerArea : Area3D
|
|||
Target = props["target"];
|
||||
TargetFunc = props["targetfunc"];
|
||||
TargetName = props["targetname"];
|
||||
if (props.TryGetValue("activationtype", out var type))
|
||||
{
|
||||
var t = Enum.TryParse(type, true, out ActivationType activationType);
|
||||
if (t)
|
||||
{
|
||||
ActivationType = activationType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void _on_ent_entered(Node ent)
|
||||
|
|
@ -72,7 +84,7 @@ public partial class TriggerArea : Area3D
|
|||
if (t is IActivable activable)
|
||||
{
|
||||
GD.Print($"Activating {t.Name}");
|
||||
activable.Toggle();
|
||||
activable.Activate(ActivationType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="FuncGodotFGDFile" load_steps=11 format=3 uid="uid://onsfttdpojex"]
|
||||
[gd_resource type="Resource" script_class="FuncGodotFGDFile" load_steps=12 format=3 uid="uid://onsfttdpojex"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://kerywjgft7vh" path="res://3D/TrenchBroom/EntityDefinitions/base/target_base.tres" id="1_abw2p"]
|
||||
[ext_resource type="Script" uid="uid://cknmd0lgmorx2" path="res://addons/func_godot/src/fgd/func_godot_fgd_file.gd" id="1_p3xok"]
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
[ext_resource type="Resource" uid="uid://ermxog0n4mvn" path="res://3D/TrenchBroom/EntityDefinitions/base/trigger_base.tres" id="7_2isdf"]
|
||||
[ext_resource type="Resource" uid="uid://di5wnbv5icxtq" path="res://3D/TrenchBroom/EntityDefinitions/base/dialogue_base.tres" id="8_2isdf"]
|
||||
[ext_resource type="Resource" uid="uid://dwc3j47cgj78j" path="res://3D/TrenchBroom/EntityDefinitions/base/requirement_key_base.tres" id="9_htav4"]
|
||||
[ext_resource type="Resource" uid="uid://bd4h6ha84s74b" path="res://3D/TrenchBroom/EntityDefinitions/base/activation_type_base.tres" id="10_vqlk3"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_p3xok")
|
||||
|
|
@ -17,5 +18,5 @@ export_file = false
|
|||
target_map_editor = 1
|
||||
fgd_name = "FuncGodot"
|
||||
base_fgd_files = Array[Resource]([])
|
||||
entity_definitions = Array[Resource]([ExtResource("1_abw2p"), ExtResource("2_entxp"), ExtResource("1_wfoxw"), ExtResource("5_mkw5g"), ExtResource("2_abw2p"), ExtResource("6_1xsdl"), ExtResource("7_2isdf"), ExtResource("8_2isdf"), ExtResource("9_htav4")])
|
||||
entity_definitions = Array[Resource]([ExtResource("1_abw2p"), ExtResource("2_entxp"), ExtResource("1_wfoxw"), ExtResource("5_mkw5g"), ExtResource("2_abw2p"), ExtResource("6_1xsdl"), ExtResource("7_2isdf"), ExtResource("8_2isdf"), ExtResource("9_htav4"), ExtResource("10_vqlk3")])
|
||||
metadata/_custom_type_script = "uid://cknmd0lgmorx2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue