Skip to content
Open
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
3 changes: 2 additions & 1 deletion fgd/bases/BasePortButton.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
0 : "Solid"
1 : "Non-Solid"
]
filtername(filterclass) : "Filter Name" : : "A filter entity that restricts which things can press the button. If set, the builtin filtering is disabled."
filtername(filterclass) : "Filter Name" : : "A filter entity that restricts which things can press the button. " +
"If set, the builtin filtering is disabled. A filter_cube_type is especially suitable here, since it can replicate all the existing filter behavior."

// Inputs
input PressIn(void) : "Activate the button as if it was pressed, sending it to the bottom position."
Expand Down
86 changes: 86 additions & 0 deletions fgd/point/filter/filter_cube_type.fgd
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@FilterClass base(filter_base)
appliesto(P2CE)
iconsprite("editor/filter_cube_type.vmt")
line(0 255 0, targetname, twinfilter)
= filter_cube_type : "A filter that filters based on cube properties. When testing cubes, irrelevant conditions are always ignored, if that cube type is enabled.\n" +
"Tip: This works well with a filter_multi, if you want to match different cube configurations or check for specific models.\n" +
"Additionally, keep in mind filters are only checked when items are actively moving inside a trigger or other events occur, you'll need repeated checks to handle events."
[
allowedbehaviors(flags): "Allowed Behaviors" : : "Which cube behaviors are allowed." =
[
1: "Frankenturret (prop_monster_box)" : 1
2: "Regular" : 1
4: "Reflection": 1
8: "Schrodinger": 1
]
allowedshapes(flags) : "Allowed Shapes" : : "Which cube shapes are allowed, matching how buttons check. 'Custom' types must be set manually in the cube keyvalues. Up to 64 types can be filtered." =
[
// Shape 0 is 'auto', shape 1 is bit 1, shape 2 is bit 2 etc.
1 : "1: Cubic": 1
2 : "2: Spherical": 1
4 : "3: Custom": 0
8 : "4: Custom": 0
16: "5: Custom": 0
32: "6: Custom": 0
64: "7: Custom": 0
128 : "8: Custom": 0
256 : "9: Custom": 0
512 : "10: Custom": 0
1024 : "11: Custom": 0
2048 : "12: Custom": 0
4096 : "13: Custom": 0
8192 : "14: Custom": 0
16384: "15: Custom": 0
32768: "16: Custom": 0
// ETC up to 64.
]

boxmode[engine](integer) : "Frankenturret Pose" : 0
activated[engine](integer) : "Button Activation" : 0
powered[engine](integer) : "Laser State" : 0
laserfilter[engine](integer) : "Laser Filter" : 0
lasermodifier[engine](integer) : "Laser Modifier" : 0

allowplayer(boolean) : "Allow Players" : 0 : "As a convenience for things like floor buttons, if enabled this filter will succeed for any player entities in addition to cubes. This saves needing a filter_multi."

boxmode(choices) : "Frankenturret Pose" : 0 : "If a frankenturret, require it to be in this pose." =
[
0: "Don't care"
1: "Extended"
2: "Retracted (box)"
]
activated(choices) : "Button Activation" : 0 : "For non-frankenturrets, check whether the cube is currently 'active' from pressing a button." =
[
0: "Don't care"
1: "Inactive"
2: "Active"
]

powered(choices) : "Laser State" : 0 : "If a Reflection or Schrödinger's cube, check whether it is emitting a laser." =
[
0: "Don't care"
1: "Not emitting"
2: "Emitting laser"
]

laserfilter(choices) : "Laser Filter" : 0 : "If a Reflection or Schrödinger's cube, check which laser filter is defined." =
[
0: "Don't care"
1: "No filter"
2: "Specific filter color"
3: "Any filter set"
]
laserfiltercolor(color255) : "Laser Filter Color" : "255 255 255 255" : "If 'Laser Filter' is set to 'specific color', this is the color to check. It must match exactly."
lasermodifier(choices) : "Laser Modifier" : 0 : "If a Reflection or Schrödinger's cube, check which laser modifier is defined." =
[
0: "Don't care"
1: "No modifier"
2: "Specific modifier colour"
3: "Any modifier set"
]
lasermodifiercolor(color255) : "Laser Modifier Color" : "255 255 255 255" : "If 'Laser Modifier' is set to 'specific color', this is the color to check. It must match exactly."

twinfilter(filterclass) : "Schrodinger Twin Filter" : : "If a Schrödinger's cube and this is set, test this other filter against the partner cube."

@resources []
]
7 changes: 7 additions & 0 deletions hammer/materials/editor/filter_cube_type.vmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"Sprite"
{
"$spriteorientation" "vp_parallel"
"$spriteorigin" "[ 0.50 0.50 ]"
"$baseTexture" "editor/filter_cube_type"
"$no_fullbright" 1
}
Binary file added hammer/materials/editor/filter_cube_type.vtf
Binary file not shown.
Binary file added materialsrc/editor/filter_cube_type.pdn
Binary file not shown.
Loading