Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: comp_visual_preset #288

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9e699b5
temp - import improvements
ozxybox Oct 1, 2024
c348b73
Allow for exporting postcompiler changes to base classes via @ExtendC…
ozxybox Oct 5, 2024
9f83e10
Strata specific changes
ozxybox Nov 7, 2024
0394ea0
Add FGD asset builder script
ozxybox Oct 7, 2024
9193422
mark a number of comp_ ents with autovis
ozxybox Nov 7, 2024
64c40f0
fix: Add missing appliesto(srctools) to ControlEnables
ozxybox Nov 7, 2024
9631200
feat: CI workflow
ozxybox Nov 7, 2024
d128a90
Temp: include the FGD patch until we can build it automatically later
ozxybox Nov 7, 2024
ef46323
feat: Package assets in CI
ozxybox Nov 7, 2024
5440181
fix: Include toolspropcombine assets in build
ozxybox Nov 11, 2024
2289200
feat: Target srctools package at our fork
ozxybox Dec 21, 2024
71128dc
fix: Make sure we're copying in the vactube models
ozxybox Dec 25, 2024
d1f43e5
FGD entries for comp_visual_preset
TheEnderek0 Dec 28, 2024
18f27f6
add: comp_visual_preset.py
TheEnderek0 Dec 28, 2024
6387f01
comp_visual_preset editor materials
TheEnderek0 Dec 28, 2024
4ecc57c
Merge pull request #1 from TeamSpen210/dev
TheEnderek0 Jan 2, 2025
a147e13
comp_visual_preset editor materials
TheEnderek0 Dec 28, 2024
222c3ff
add: comp_visual_preset.py
TheEnderek0 Dec 28, 2024
58280c5
FGD entries for comp_visual_preset
TheEnderek0 Dec 28, 2024
b6915df
Use comp_visual_preset sprite
TheEnderek0 Jan 2, 2025
115764f
Improve comp_visual_preset FGD
TheEnderek0 Jan 9, 2025
3685670
Improve comp_visual_preset.py
TheEnderek0 Jan 9, 2025
fd75e66
Merge branch 'psc-dev' into dev
TheEnderek0 Jan 15, 2025
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
84 changes: 38 additions & 46 deletions .github/workflows/build-postcompiler.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,29 @@
name: Build Postcompiler
on:
schedule:
- cron: '14 9 * * TUE' # Run at 9:14 (7:14pm local) on Tuesday
create:
ref_type: 'tag'
workflow_dispatch:
# Allow triggering manually whenever it's useful.
inputs:
ref:
description: 'Branch/tag/commit to use'
version:
description: 'Release version'
required: true
type: string
default: 'dev'

permissions:
contents: read
pull-requests: read

jobs:
freeze:
strategy:
fail-fast: false
matrix:
include:
# We want 3.8 because it works on Windows 7.
- artifact-name: 'win32'
python-version: '3.8.10'
arch: 'x86'
os: 'windows-latest'
- artifact-name: 'win64'
python-version: '3.11'
arch: 'x64'
os: 'windows-latest'
- artifact-name: 'linux64'
python-version: '3.11'
arch: 'x64'
os: 'ubuntu-latest'
# - artifact-name: 'linux64'
# python-version: '3.11'
# arch: 'x64'
# os: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
name: Build postcompiler-${{ matrix.artifact-name }}
steps:
# Build dev on schedule, since it's actually changing.
- name: Checkout Dev
uses: actions/checkout@v4
if: github.event_name == 'schedule'
with:
ref: dev
# Always build the exact tag that's pushed.
- name: Checkout Tag
uses: actions/checkout@v4
if: github.event_name == 'create'
with:
ref: ${{ github.event.ref }}
- name: Checkout Ref
uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
ref: ${{ inputs.ref }}

- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}-${{ matrix.arch }}
uses: actions/setup-python@v5
with:
Expand All @@ -68,20 +35,45 @@ jobs:
run: |
python -m pip install -U setuptools pip wheel
python -m pip install -r requirements.txt
- name: Build assets
run: |
mkdir build
mkdir build/bin
mkdir build/bin/win64
mkdir build/hammer
robocopy hammer/scripts build/hammer/scripts /S /PURGE
robocopy hammer/materials/tools build/hammer/materials/tools /S /PURGE
robocopy hammer/models/editor/vactubes build/hammer/models/editor/vactubes /S /PURGE
python src/hammeraddons/build_fgd_assets.py -i patch_postcompiler.fgd -o build/hammer -a hammer

- name: Freeze application
run: python -m PyInstaller --distpath ../build/ -y ../postcompiler.spec
run: python -m PyInstaller --distpath ../build/bin/win64 -y ../postcompiler.spec
working-directory: ./src/
- name: Zip hammeraddons_${{ matrix.artifact-name }}
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./build/
filename: 'hammeraddons_${{ matrix.artifact-name }}.zip'
- name: Artifact upload (tag)
uses: actions/upload-artifact@v4
if: github.event_name == 'create'
with:
name: hammeraddons_${{ github.event.ref }}_${{ matrix.artifact-name }}
path: ./build/
name: hammeraddons_${{ github.event.inputs.version }}_${{ matrix.artifact-name }}
path: ./build/hammeraddons_${{ matrix.artifact-name }}.zip
if-no-files-found: error
- name: Artifact upload (hash)
uses: actions/upload-artifact@v4
if: github.event_name != 'create'
with:
name: hammeraddons_${{ github.sha }}_${{ matrix.artifact-name }}
path: ./build/
name: hammeraddons_${{ github.event.inputs.version }}_${{ matrix.artifact-name }}
path: ./build/hammeraddons_${{ matrix.artifact-name }}.zip
if-no-files-found: error

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
files: |
./build/hammeraddons_${{ matrix.artifact-name }}.zip
fail_on_unmatched_files: true
4 changes: 3 additions & 1 deletion fgd/bases/ControlEnables.fgd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@BaseClass = ControlEnables: "A pair of keyvalues for specifying if a comp_ entity is enabled."
@BaseClass
appliesto(srctools)
= ControlEnables: "A pair of keyvalues for specifying if a comp_ entity is enabled."
[
ctrl_type[engine](boolean) : "Invert Value?" : 0
ctrl_type(choices) : "Control Type" : 0 : "Controls how the Control Value is interpreted" =
Expand Down
2 changes: 1 addition & 1 deletion fgd/bases/SRCModel.fgd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@BaseClass appliesto(+P2, +srctools)
@BaseClass appliesto(+P2, +srctools, -STRATA) // We already have this in P2CE
= SRCModel: "Adds keyvalues to set a custom model."
[
comp_custom_model_type[srctools, -engine](boolean) : "[HA] Override Model" : 0 : "If enabled, automatically pack a VScript to override the entity's model on spawn."+
Expand Down
1 change: 1 addition & 0 deletions fgd/point/comp/comp_prop_cable.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
iconsprite("editor/comp_prop_cable")
line(128 128 128, targetname, bunting)
appliesto(srctools)
autovis(Auto, Postcompiler, Prop Ropes)
= comp_prop_cable: "Generates cables using a static prop. comp_prop_rope is an alternate name, they can be interchanged."
[
group(target_source): "Group" : : "If set, all cables with the same group will be compiled to one model."
Expand Down
1 change: 1 addition & 0 deletions fgd/point/comp/comp_prop_cable_dynamic.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sphere(fademaxdist)
studio("models/editor/comp_prop_cable_dynamic.mdl")
appliesto(srctools)
autovis(Auto, Postcompiler, Prop Ropes)
= comp_prop_cable_dynamic: "Allows using comp_prop_rope/comp_prop_cable as a dynamic prop."
[
spawnflags(flags) =
Expand Down
1 change: 1 addition & 0 deletions fgd/point/comp/comp_prop_rope.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
iconsprite("editor/comp_prop_rope")
line(128 128 128, targetname, bunting)
appliesto(srctools)
autovis(Auto, Postcompiler, Prop Ropes)
= comp_prop_rope: "Generates ropes using a static prop. comp_prop_cable is an alternate name, they can be interchanged."
[
group(target_source): "Group" : : "If set, all ropes with the same group will be compiled to one model."
Expand Down
1 change: 1 addition & 0 deletions fgd/point/comp/comp_prop_rope_bunting.fgd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@MoveClass base(StaticTargetname)
iconsprite("editor/comp_prop_rope_bunting")
appliesto(srctools)
autovis(Auto, Postcompiler, Prop Ropes)
= comp_prop_rope_bunting: "Specifies small props which will be placed at regular intervals across the compiled rope."
[
weight(integer) : "Weight" : 1 : "If multiple are defined with the same weighting, this specifies the relative probabilities." +
Expand Down
1 change: 1 addition & 0 deletions fgd/point/comp/comp_prop_rope_dynamic.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sphere(fademaxdist)
studio("models/editor/comp_prop_rope_dynamic.mdl")
appliesto(srctools)
autovis(Auto, Postcompiler, Prop Ropes)
= comp_prop_rope_dynamic: "Allows using comp_prop_rope/comp_prop_cable as a prop_dynamic."
[
spawnflags(flags) =
Expand Down
1 change: 1 addition & 0 deletions fgd/point/comp/comp_vactube_spline.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
animator() keyframe()
iconsprite("editor/comp_prop_rope")
appliesto(srctools)
autovis(Vactubes, Vac Paths)
= comp_vactube_spline: "Constructs a custom vactube model, using a set of path points."
[
nextkey(target_destination) : "Next Rope" : : "Name of the next spline node."
Expand Down
48 changes: 48 additions & 0 deletions fgd/point/comp/comp_visual_preset.fgd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@PointClass
iconsprite("editor/comp_visual_preset")
appliesto(srctools)
autovis(Postcompiler, Visual Preset)
= comp_visual_preset : "Handles visual presets." +
"These can be fog settings, tonemapper presets and custom color correction. All handled by one entity."
[

targetname(target_source) : "Name" : : "The name that other entities refer to this entity by."

linedivider_tgname[!engine](string) readonly : "----------------------------------------------------------------------------------------------------------" : ""


tonemapper(target_destination) : "env_tonemap_controller" : "@Tonemapper" : "Tonemapper entity used. Needs to be set to use tonemap presets."

tm_autoexposuremax(float) : "Auto Exposure Max" : 2.0 : "Set the auto exposure maximum."
tm_autoexposuremin(float) : "Auto Exposure Min" : 0.5 : "Set the auto exposure minimum."
tm_bloomscale(float) : "Bloom Scale" : 0.2 : "Set the bloom scale."
tm_bloomexponent(float) : "Bloom Exponent" : 2.2 : "Set the bloom exponent."

linedivider_tm[!engine](string) readonly : "----------------------------------------------------------------------------------------------------------" : ""

fog_controller(target_destination) : "env_fog_controller" : "@FogController" : "Env_fog_controller entity used to set tonemap presets. Should have master flag checked."

fog_primary_color(color255) : "Primary Fog Color" : "255 255 255" : "Primary fog color to use."
fog_start(float) : "Fog Start" : -1.0
fog_end(float) : "Fog End" : 2000.0
fog_max_density(float) : "Fog Max Density" : 1.0
use_lerp(boolean) : "Use Lerp" : 1 : "Use lerping instead of instant changing of fog values. Requires lerp time on the fog controller entity to be set."

linedivider_fg[!engine](string) readonly : "----------------------------------------------------------------------------------------------------------" : ""


cc_filename(string) : "CC Filename" : : "The filename used by color correction for this preset (if set), e.g. 'cc_RECYCLED_TEST'."
cc_fadein(float) : "CC FadeIn Time" : 1.0
cc_fadeout(float) : "CC FadeOut Time" : 1.0


input Apply(void) : "Applies the preset, disables all other ones."

// We need to provide "some" outputs to allow you to add some.
// These exist on everything, at least.
output OnUser1(void) : "Fired in response to FireUser1 input."
output OnUser2(void) : "Fired in response to FireUser2 input."
output OnUser3(void) : "Fired in response to FireUser3 input."
output OnUser4(void) : "Fired in response to FireUser4 input."
output OnKilled[L4D](void) : "Fired when the entity is killed and removed from the game."
]
5 changes: 4 additions & 1 deletion fgd/point/logic/PlayerInputs.fgd
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@BaseClass base(BaseEntityInputs) = PlayerInputs: "The inputs that can be fired on the player, for entities that pass through those."
@BaseClass
base(BaseEntityInputs)
appliesto(-STRATA) // Strata HACK: Does not exist in mainline repo yet, so disabling this
= PlayerInputs: "The inputs that can be fired on the player, for entities that pass through those."
[
input IgnoreFallDamage[HL2, P1](float) : "Prevent the player from taking fall damage for [n] seconds, but reset back to taking fall damage after the first impact (so players will be hurt if they bounce off what they hit)."
input IgnoreFallDamageWithoutReset[HL2, P1](float) : "Absolutely prevent the player from taking fall damage for [n] seconds. "
Expand Down
8 changes: 8 additions & 0 deletions hammer/materials/editor/comp_visual_preset.vmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Sprite
{
$baseTexture "editor/comp_visual_preset"
$spriteorientation "vp_parallel"
$spriteorigin "[ 0.50 0.50 ]"
$spriterendermode 2
$no_fullbright 1
}
Binary file added hammer/materials/editor/comp_visual_preset.vtf
Binary file not shown.
Loading
Loading