Skip to content

Commit 8253cc4

Browse files
committed
initial
0 parents  commit 8253cc4

21 files changed

Lines changed: 1712 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
package:
13+
name: Package mod
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out repository
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Validate release version
23+
shell: bash
24+
run: |
25+
set -euo pipefail
26+
27+
VERSION="$(jq -r '.version' mod.txt)"
28+
29+
if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" != "v${VERSION}" ]]; then
30+
echo "::error::tag (${GITHUB_REF_NAME}) does not match mod version (v${VERSION})"
31+
exit 1
32+
fi
33+
34+
echo "version=$VERSION" >> "$GITHUB_ENV"
35+
36+
- name: Generate update metadata
37+
shell: bash
38+
run: |
39+
set -euo pipefail
40+
41+
ident="$(jq -r '.updates[0].identifier // empty' mod.txt)"
42+
version="$(jq -r '.version' mod.txt)"
43+
repo="$GITHUB_REPOSITORY"
44+
45+
if [[ -z "$ident" ]]; then
46+
echo "has_update_metadata=false" >> "$GITHUB_ENV"
47+
echo "No mod.txt updates[0].identifier configured; skipping update metadata."
48+
exit 0
49+
fi
50+
51+
mkdir -p generated
52+
jq -n \
53+
--arg ident "$ident" \
54+
--arg version "$version" \
55+
--arg download_url "https://github.com/$repo/releases/download/v$version/LowViolenceMode.zip" \
56+
--arg patchnotes_url "https://github.com/$repo/releases/tag/v$version" \
57+
'[{
58+
ident: $ident,
59+
version: $version,
60+
download_url: $download_url,
61+
patchnotes_url: $patchnotes_url
62+
}]' > generated/update_meta.json
63+
64+
echo "has_update_metadata=true" >> "$GITHUB_ENV"
65+
66+
- name: Build SuperBLT zip
67+
shell: bash
68+
run: |
69+
set -euo pipefail
70+
71+
rm -rf package LowViolenceMode.zip
72+
mkdir -p package/LowViolenceMode
73+
cp -R loc mod.txt modules package/LowViolenceMode/
74+
75+
if [[ "${has_update_metadata}" == "true" ]]; then
76+
cp generated/update_meta.json package/LowViolenceMode/update_meta.json
77+
fi
78+
79+
cd package
80+
zip -r ../LowViolenceMode.zip LowViolenceMode
81+
82+
- name: Get previous tag
83+
id: previous-tag
84+
shell: bash
85+
run: |
86+
set -euo pipefail
87+
88+
git fetch --tags --force
89+
previous_tag="$(git --no-pager tag --sort=creatordate --merged "${GITHUB_REF_NAME}" | grep -v "^${GITHUB_REF_NAME}$" | tail -1 || true)"
90+
echo "previous_tag=$previous_tag" >> "$GITHUB_OUTPUT"
91+
92+
- name: Generate changelog
93+
id: changelog
94+
if: ${{ steps.previous-tag.outputs.previous_tag != '' }}
95+
uses: requarks/changelog-action@v1
96+
with:
97+
token: ${{ github.token }}
98+
fromTag: ${{ github.ref_name }}
99+
toTag: ${{ steps.previous-tag.outputs.previous_tag }}
100+
writeToFile: false
101+
restrictToTypes: feat,fix,perf
102+
useGitmojis: false
103+
includeInvalidCommits: false
104+
105+
- name: Write release notes
106+
env:
107+
CHANGELOG: ${{ steps.changelog.outputs.changes }}
108+
PREVIOUS_TAG: ${{ steps.previous-tag.outputs.previous_tag }}
109+
shell: bash
110+
run: |
111+
set -euo pipefail
112+
113+
printf 'Low Violence Mode %s\n' "$version" > release-notes.md
114+
115+
if [[ -n "$CHANGELOG" ]]; then
116+
printf '\n%s\n' "$CHANGELOG" >> release-notes.md
117+
elif [[ -z "$PREVIOUS_TAG" ]]; then
118+
printf '\nInitial release.\n' >> release-notes.md
119+
else
120+
printf '\nMaintenance release.\n' >> release-notes.md
121+
fi
122+
123+
- name: Upload release asset
124+
env:
125+
GITHUB_TOKEN: ${{ github.token }}
126+
TAG: ${{ github.ref_name }}
127+
shell: bash
128+
run: |
129+
set -euo pipefail
130+
131+
assets=(LowViolenceMode.zip)
132+
if [[ "${has_update_metadata}" == "true" ]]; then
133+
assets+=(generated/update_meta.json)
134+
fi
135+
136+
if gh release view "$TAG" >/dev/null 2>&1; then
137+
gh release edit "$TAG" --notes-file release-notes.md
138+
gh release upload "$TAG" "${assets[@]}" --clobber
139+
else
140+
gh release create "$TAG" "${assets[@]}" \
141+
--title "$TAG" \
142+
--notes-file release-notes.md
143+
fi
144+
145+
- name: Publish update metadata
146+
if: ${{ env.has_update_metadata == 'true' }}
147+
env:
148+
TAG: ${{ github.ref_name }}
149+
shell: bash
150+
run: |
151+
set -euo pipefail
152+
153+
cp generated/update_meta.json update_meta.json
154+
155+
if git diff --quiet -- update_meta.json; then
156+
echo "update_meta.json already matches $TAG"
157+
exit 0
158+
fi
159+
160+
git config user.name "github-actions[bot]"
161+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
162+
git add update_meta.json
163+
git commit -m "chore: update release metadata for $TAG"
164+
git push origin HEAD:main

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Perry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Low Violence Mode
2+
3+
PAYDAY 2 mod that reduces combat visual clutter.
4+
5+
## Requirements
6+
7+
- SuperBLT
8+
9+
## Settings
10+
11+
- `Block Corpses`: off, after ragdoll, or timer
12+
- `Corpse Timer`: `0.00` to `5.00` seconds
13+
- `Block Bullet Effects`: off, decals, hit effects, or all
14+
- `Block Blood Effects`: off, decals, splatter, or all
15+
- `Block Magazines`, `Block Shields`, `Block Helmets`, and `Block Dozer Fallen Plates`
16+
- `Reduce Crew Shotgun Spam`

loc/en.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"low_violence_mode_options": "Low Violence Mode",
3+
"low_violence_mode_options_title": "Low Violence Mode",
4+
"low_violence_mode_options_desc": "Configure low-violence and performance options.",
5+
6+
"low_violence_mode_choice_off": "Off",
7+
"low_violence_mode_choice_after_ragdoll": "After Ragdoll",
8+
"low_violence_mode_choice_timer": "Timer",
9+
"low_violence_mode_choice_decals": "Decals",
10+
"low_violence_mode_choice_hit_effects": "Hit Effects",
11+
"low_violence_mode_choice_splatter": "Splatter",
12+
"low_violence_mode_choice_both": "All",
13+
14+
"low_violence_mode_corpses_mode_title": "Block Corpses",
15+
"low_violence_mode_corpses_mode_desc": "Choose how corpses are blocked.",
16+
"low_violence_mode_corpse_timer_title": "Corpse Timer",
17+
"low_violence_mode_corpse_timer_desc": "Seconds before timer-mode corpses are removed. Set to 0 for immediate removal.",
18+
19+
"low_violence_mode_bullet_effects_mode_title": "Block Bullet Effects",
20+
"low_violence_mode_bullet_effects_mode_desc": "Choose which bullet impact visuals to block.",
21+
22+
"low_violence_mode_blood_effects_mode_title": "Block Blood Effects",
23+
"low_violence_mode_blood_effects_mode_desc": "Choose which blood impact visuals to block.",
24+
25+
"low_violence_mode_block_magazines_title": "Block Magazines",
26+
"low_violence_mode_block_magazines_desc": "Prevent dropped magazine objects from spawning.",
27+
28+
"low_violence_mode_block_shields_title": "Block Shields",
29+
"low_violence_mode_block_shields_desc": "Set enemy shield limit and shield disposal lifetime to 0.",
30+
31+
"low_violence_mode_block_helmets_title": "Block Helmets",
32+
"low_violence_mode_block_helmets_desc": "Prevent headshot and explosion head-gadget spawns.",
33+
34+
"low_violence_mode_block_dozer_fallen_plates_title": "Block Dozer Fallen Plates",
35+
"low_violence_mode_block_dozer_fallen_plates_desc": "Prevent dozer armor plate debris from spawning.",
36+
37+
"low_violence_mode_reduce_shotgun_spam_title": "Reduce Crew Shotgun Spam",
38+
"low_violence_mode_reduce_shotgun_spam_desc": "Reduce crew shotgun ray count to 1."
39+
}

mod.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name" : "LowViolenceMode",
3+
"description" : "Reduces combat visual clutter",
4+
"author" : "Perry",
5+
"version" : "1.0.0",
6+
"blt_version" : 2,
7+
"updates" : [
8+
{
9+
"identifier" : "perry519.low_violence_mode",
10+
"host" : {
11+
"meta" : "https://raw.githubusercontent.com/perry519/LowViolenceMode/main/update_meta.json"
12+
}
13+
}
14+
],
15+
"hooks" : [
16+
{
17+
"hook_id" : "lib/managers/localizationmanager",
18+
"script_path" : "modules/localization/localizationmanager.lua"
19+
},
20+
{
21+
"hook_id" : "lib/managers/enemymanager",
22+
"script_path" : "modules/features/enemies/enemymanager.lua"
23+
},
24+
{
25+
"hook_id" : "lib/managers/gameplaycentralmanager",
26+
"script_path" : "modules/features/decals/gameplaycentralmanager.lua"
27+
},
28+
{
29+
"hook_id" : "lib/units/enemies/cop/copdamage",
30+
"script_path" : "modules/features/enemies/copdamage.lua"
31+
},
32+
{
33+
"hook_id" : "core/lib/managers/coresequencemanager",
34+
"script_path" : "modules/features/enemies/dozerfallenplates.lua"
35+
},
36+
{
37+
"hook_id" : "lib/units/enemies/cop/copmovement",
38+
"script_path" : "modules/features/magazines/copmovement.lua"
39+
},
40+
{
41+
"hook_id" : "lib/units/beings/player/huskplayermovement",
42+
"script_path" : "modules/features/magazines/huskplayermovement.lua"
43+
},
44+
{
45+
"hook_id" : "lib/units/weapons/cosmeticsweaponbase",
46+
"script_path" : "modules/features/magazines/cosmeticsweaponbase.lua"
47+
},
48+
{
49+
"hook_id" : "lib/tweak_data/weapontweakdata",
50+
"script_path" : "modules/features/weapons/weapontweakdata.lua"
51+
},
52+
{
53+
"hook_id" : "lib/managers/menumanager",
54+
"script_path" : "modules/menu/menumanager.lua"
55+
}
56+
]
57+
}

0 commit comments

Comments
 (0)