diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..e417650e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners +# +* @ArmaForces/sqf-devs diff --git a/.github/labels.json b/.github/labels.json new file mode 100644 index 00000000..67b11451 --- /dev/null +++ b/.github/labels.json @@ -0,0 +1,38 @@ +[ + { + "name": "bug", + "color": "#d73a4a", + "description": "Something isn't working" + }, + { + "name": "bugfix", + "color": "#52ed47", + "description": "Fixes something wasn't working" + }, + { + "name": "documentation", + "color": "#0075ca", + "description": "Improvements or additions to documentation" + }, + { + "name": "duplicate", + "color": "#cfd3d7", + "description": "This issue or pull request already exists" + }, + { + "name": "enhancement", + "color": "#a2eeef", + "description": "New feature or request" + }, + { + "name": "ignore changelog", + "color": "#fff", + "description": "Do not add to changelog" + }, + { + "name": "scenario", + "color": "#3BC4B8", + "description": "Improvements or additions to a scenario" + } +] + diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..87de2055 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,33 @@ +branches: + - master + +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' + +categories: + - title: '**ADDED:**' + labels: + - feature + - title: '**FIXED:**' + labels: + - bugfix + - title: '**CHANGED:**' + labels: + - cleanup + - enhancement + +exclude-labels: + - 'ignore changelog' + +change-template: '- $TITLE (#$NUMBER)' +template: | + _ArmaForces SerialKillers release._ + + ## Change Log Summary + + $CHANGES + +replacers: + # Category titles + - search: '/\#\# (\*\*(ADDED|FIXED|CHANGED):\*\*)/g' + replace: '$1' diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index fef1c598..224ab9f0 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -14,6 +14,8 @@ jobs: uses: actions/checkout@master - name: Validate SQF run: python3 tools/sqf_validator.py + - name: Validate Return Types + run: python3 tools/return_checker.py - name: Validate Config run: python3 tools/config_style_checker.py - name: Validate Stringtables @@ -21,26 +23,17 @@ jobs: - name: Check for BOM uses: arma-actions/bom-check@master - lint: + build-linux: runs-on: ubuntu-latest steps: - name: Checkout the source code - uses: actions/checkout@master - - name: Lint (sqflint) - uses: arma-actions/sqflint@master - continue-on-error: true # No failure due to many false-positives - -# build: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout the source code -# uses: actions/checkout@master -# - name: Build using HEMTT -# uses: arma-actions/hemtt@master -# with: -# command: build --release --ci -# https://github.com/actions/upload-artifact/issues/3#issuecomment-524442814 -# - uses: actions/upload-artifact@master -# with: -# name: armaforces_mods_VERSION -# path: releases/VERSION + uses: actions/checkout@v4 + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT build + run: hemtt build + - uses: actions/upload-artifact@v4 + with: + name: afsk_${{ github.sha }}-nobin + path: .hemttout/@* + include-hidden-files: true # Because .hemttout is a hidden directory diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..1afdfef0 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,16 @@ +name: Release Drafter + +on: + push: + branches: + - master + +jobs: + draft: + runs-on: ubuntu-latest + steps: + - name: Release Drafter + if: github.repository == 'ArmaForces/SerialKillers' + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..bdea6c93 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + release: + types: + - published + +jobs: + build_addon: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set VERSION env + run: echo VERSION=${GITHUB_REF:11} >> $GITHUB_ENV + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT release + run: hemtt release + # Upload to GitHub + - uses: softprops/action-gh-release@v1 + with: + files: 'releases/afsk-${{ env.VERSION }}-*.zip' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Upload to Steam Workshop + - uses: arma-actions/workshop-upload@v1 + with: + itemId: '1993094302' # Id of item to update + contentPath: '.hemttout/release' + changelog: 'https://github.com/ArmaForces/SerialKillers/releases/tag/v${{ env.VERSION }}' + env: + STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} + STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }} diff --git a/.hemtt/hooks/pre_build/set_version.rhai b/.hemtt/hooks/pre_build/set_version.rhai new file mode 100644 index 00000000..f26f229d --- /dev/null +++ b/.hemtt/hooks/pre_build/set_version.rhai @@ -0,0 +1,14 @@ + +let modCpp = HEMTT_VFS + .join("mod.cpp") + .open_file() + .read() +; + +modCpp.replace("0.0.0", HEMTT.project().version().to_string_short()); + +HEMTT_VFS + .join("mod.cpp") + .create_file() + .write(modCpp) +; diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml new file mode 100644 index 00000000..3fa1131f --- /dev/null +++ b/.hemtt/launch.toml @@ -0,0 +1,43 @@ +[default] +workshop = [ + "450814997", # CBA_A3 + "2369477168", # ADT +] +parameters = [ + "-name=dev_sk", +] + +[ace] +extends = "default" +workshop = [ + "463939057", # ACE +# "766491311", # KKA3 ACE Extension +] + +[cup] +extends = "default" +workshop = [ + "583496184", # CUP Terrains - Core + "583544987", # CUP Terrains - Maps + "497660133", # CUP Weapons + "497661914", # CUP Units + "541888371", # CUP Vehicles +] + +[vn] +extends = "default" +dlc = [ + "S.O.G. Prairie Fire", +] + +[ww2] +extends = "default" +dlc = [ + "Spearhead 1944", +] + +[gm] +extends = "default" +dlc = [ + "Global Mobilization", +] diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml new file mode 100644 index 00000000..025af8ce --- /dev/null +++ b/.hemtt/lints.toml @@ -0,0 +1,6 @@ +[sqf.command_case] +options.ignore = [ + "CIVILIAN", + "EAST", + "WEST", +] diff --git a/.hemtt/project.toml b/.hemtt/project.toml index f6f7a9be..ba34c73b 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -1,3 +1,4 @@ + name = "ArmaForces SerialKillers" mainprefix = "z" prefix = "afsk" @@ -16,33 +17,3 @@ author = "ArmaForces" [version] path = "addons/main/script_version.hpp" - -[asc] -exclude = [ - ".inc.sqf" -] - -[hemtt.launch] -workshop = [ - "450814997", # CBA_A3 - "2369477168", # ADT -] -parameters = [ - "-name=dev_sk", - "-window", -] - -[hemtt.launch.cup] -workshop = [ - "450814997", # CBA_A3 - "2369477168", # ADT - "583496184", # CUP Terrains - Core - "583544987", # CUP Terrains - Maps - "497660133", # CUP Weapons - "497661914", # CUP Units - "541888371", # CUP Vehicles -] -parameters = [ - "-name=dev_sk", - "-window", -] diff --git a/addons/briefing/stringtable.xml b/addons/briefing/stringtable.xml index fd229ee5..3e08f35d 100644 --- a/addons/briefing/stringtable.xml +++ b/addons/briefing/stringtable.xml @@ -5,6 +5,10 @@ SerialKillers - Briefing SerialKillers - Odprawa + + Rules + Zasady + Enable rules Włącz zasady @@ -13,10 +17,6 @@ If enabled, suggested rules will be visible on the map in "SerialKillers" briefing section. Jeżeli włączone, proponowane zasady będą widoczne na odprawnie na mapie w zakładce "SerialKillers". - - Rules - Zasady - Cops are not allowed to use terrorist stashes/weapons. They may only use radios they find after neutralizing a terrorist. Policjanci nie mogą używać broni terrorystów ani skrytek z bronią. Mogą używać jedynie radia, które znajdą przy zneutralizowanym terroryście. diff --git a/addons/civilian/functions/fnc_assignCityCivilian.sqf b/addons/civilian/functions/fnc_assignCityCivilian.sqf index 620cb895..3d69e2b6 100644 --- a/addons/civilian/functions/fnc_assignCityCivilian.sqf +++ b/addons/civilian/functions/fnc_assignCityCivilian.sqf @@ -18,7 +18,7 @@ params ["_civilian", "_cityNamespace"]; -// Get city civilians array and pushback new civilian. No need for setVariable as getVariable returns array pointer. +// Get city civilians array and pushBack new civilian. No need for setVariable as getVariable returns array pointer. _cityCivilians = _cityNamespace getVariable QGVAR(CiviliansList); _cityCivilians pushBack _civilian; _cityNamespace setVariable [QGVAR(CiviliansCount), count _cityCivilians]; diff --git a/addons/civilian/functions/fnc_civilianKilled.sqf b/addons/civilian/functions/fnc_civilianKilled.sqf index e78acade..8fd2cab1 100644 --- a/addons/civilian/functions/fnc_civilianKilled.sqf +++ b/addons/civilian/functions/fnc_civilianKilled.sqf @@ -31,7 +31,7 @@ if (count GVAR(civilians) isEqualTo 0) then { [QEGVAR(score,allCiviliansDead)] call CBA_fnc_serverEvent; }; -private _time = [daytime] call BIS_fnc_timeToString; +private _time = [dayTime] call BIS_fnc_timeToString; // Call function to create marker at killed unit's position. [_civilian, _time] call FUNC(civilianKilledMarker); // Show message for all cops that cop has been killed near some location with timestamp diff --git a/addons/civilian/functions/fnc_civilianKilledMarker.sqf b/addons/civilian/functions/fnc_civilianKilledMarker.sqf index ce47606b..eee5ffa5 100644 --- a/addons/civilian/functions/fnc_civilianKilledMarker.sqf +++ b/addons/civilian/functions/fnc_civilianKilledMarker.sqf @@ -18,7 +18,7 @@ params ["_unit", "_time"]; -private _markerName = format ["killed_civilian_%1_%2", _unit]; +private _markerName = format ["killed_civilian_%1", _unit]; private _markerText = format ["%1", _time]; private _marker = createMarkerLocal [_markerName, getPosATL _unit]; _marker setMarkerTypeLocal "mil_objective"; diff --git a/addons/civilian/functions/fnc_civilianKilledMsg.sqf b/addons/civilian/functions/fnc_civilianKilledMsg.sqf index fe1190ed..f4883feb 100644 --- a/addons/civilian/functions/fnc_civilianKilledMsg.sqf +++ b/addons/civilian/functions/fnc_civilianKilledMsg.sqf @@ -18,7 +18,7 @@ * Public: No */ -params ["_unit", ["_killer", objNull], ["_timeOfDeath", daytime], ["_nearestTown", locationNull]]; +params ["_unit", ["_killer", objNull], ["_timeOfDeath", dayTime], ["_nearestTown", locationNull]]; if (_timeOfDeath isEqualType 0) then { _timeOfDeath = [_timeOfDeath] call BIS_fnc_timeToString; diff --git a/addons/civilian/functions/fnc_createCivilian.sqf b/addons/civilian/functions/fnc_createCivilian.sqf index 0b279d02..a643c7c6 100644 --- a/addons/civilian/functions/fnc_createCivilian.sqf +++ b/addons/civilian/functions/fnc_createCivilian.sqf @@ -22,7 +22,7 @@ private _unit = selectRandom GVAR(units); private _civilian = _newGroup createUnit [_unit, _position, [], 0, "NONE"]; if (_civilian isEqualTo objNull) exitWith { - WARNING_2("Failed creating civilian %1 at %2", _unit, _position); + WARNING_2("Failed creating civilian %1 at %2",_unit,_position); }; -[_civilian] call FUNC(initCivilian); +[_civilian] call FUNC(initCivilian) diff --git a/addons/civilian/functions/fnc_getNearestCity.sqf b/addons/civilian/functions/fnc_getNearestCity.sqf index 05cc4fa7..26a60cd3 100644 --- a/addons/civilian/functions/fnc_getNearestCity.sqf +++ b/addons/civilian/functions/fnc_getNearestCity.sqf @@ -27,4 +27,5 @@ _nearestTown = [_position, _searchRadius] call EFUNC(common,getNearestCityLocati // Return city namespace or objNull if not found if (_nearestTown isEqualTo locationNull) exitWith {objNull}; -[_nearestTown] call FUNC(getCityByLocation); + +[_nearestTown] call FUNC(getCityByLocation) diff --git a/addons/civilian/functions/fnc_getNearestVehicle.sqf b/addons/civilian/functions/fnc_getNearestVehicle.sqf index 73753e1e..cb40333c 100644 --- a/addons/civilian/functions/fnc_getNearestVehicle.sqf +++ b/addons/civilian/functions/fnc_getNearestVehicle.sqf @@ -9,7 +9,7 @@ * 2: Filter function returning true for valid vehicles (Optional) * * Return Value: - * None + * Nearest vehicle or objNull if not found * * Example: * [player] call afsk_civilian_fnc_getNearestVehicle diff --git a/addons/civilian/functions/fnc_initCivilian.sqf b/addons/civilian/functions/fnc_initCivilian.sqf index 65c16a83..19675ff4 100644 --- a/addons/civilian/functions/fnc_initCivilian.sqf +++ b/addons/civilian/functions/fnc_initCivilian.sqf @@ -35,3 +35,5 @@ _civilian addEventHandler ["Killed", { [_civilian, _cityNamespace] call FUNC(assignCityCivilian); GVAR(civilians) pushBack _civilian; _civilian setVariable [QGVAR(initialized), true]; + +_civilian diff --git a/addons/civilian/stringtable.xml b/addons/civilian/stringtable.xml index 7a922de1..a38217be 100644 --- a/addons/civilian/stringtable.xml +++ b/addons/civilian/stringtable.xml @@ -1,74 +1,6 @@ - - SerialKillers - Civilian - SerialKillers - Cywile - - - Civilian vehicles limit - Limit pojazdów cywilnych - - - Controls how much civilian vehicles will be created on the whole map. - Ustala jak dużo pojazdów cywilnych będzie utworzonych na całej mapie. - - - Civilian was killed at %1 in %2! - Cywil został zabity o godzinie %1 w %2! - - - Civilian was killed at %1 near %2! - Cywil został zabity o godzinie %1 w pobliżu %2! - - - Civilian was killed by cop %3 at %1 in %2! - Cywil został zabity przez policjanta %3 o godzinie %1 w %2! - - - Civilian was killed by cop %3 at %1 near %2! - Cywil został zabity przez policjanta %3 o godzinie %1 w pobliżu %2! - - - Civilians count - Liczba cywili - - - Number of generated civilians on mission startup. Final number will be in +-10% range. Set 0 to randomize between 100-200. - Liczba generowanych cywili na starcie misji. Właściwa liczba będzie z przedziału +-10%. Losowana z przedziału 100-200 gdy ustawienie jest równe 0. - - - Guaranteed civilian in every location - Gwarantowany cywil w każdej lokacji - - - If checked, every village, city and capital will have at least 1 civilian on start (if limit allows). - Jeżeli zaznaczone, każda wioska, miasto i stolica będą miały przynajmniej 1 cywila na start (jeżeli pozwoli na to limit). - - - Location area - Obszar lokacji - - - Respect city area - Respektuj obszar miasta - - - Village civilians weight multiplier - Mnożnik cywili w wioskach - - - Weight multiplier for villages when civilians are spawned. The higher (relatively to other location types), the more civilians (on average) will be in villages on the same area. - Mnożnik wagi dla wiosek podczas spawnowania cywili. Im wyższy (w stosunku do innych typów lokacji), tym średnio więcej cywili będzie wygenerowanych w wioskach na tym samym obszarze. - - - City civilians weight multiplier - Mnożnik cywili w miastach - - - Weight multiplier for cities when civilians are spawned. The higher (relatively to other location types), the more civilians (on average) will be in cities on the same area. - Mnożnik wagi dla miast podczas spawnowania cywili. Im wyższy (w stosunku do innych typów lokacji), tym średnio więcej cywili będzie wygenerowanych w miastach o samym obszarze. - Capital civilians weight multiplier Mnożnik cywili w stolicy @@ -77,17 +9,13 @@ Weight multiplier for capital(s) when civilians are spawned. The higher (relatively to other location types), the more civilians (on average) will be in capital(s) on the same area. Mnożnik wagi dla stolic podczas spawnowania cywili. Im wyższy (w stosunku do innych typów lokacji), tym średnio więcej cywili będzie wygenerowanych w stolicach na tym samym obszarze. - - Civilians will be spawned in cities area as defined in map location configuration. Otherwise, values below will be used to define area for each location type. - Cywile będą spawnowani w miastach o obszarze zdefiniowanym w konfiguracji lokacji mapy. W przeciwnym razie wartości wyszczególnione poniżej zostaną użyte do zdefiniowania rozmiaru każdej lokacji. - - - Custom village area radius - Własny promień obszaru wioski + + City civilians weight multiplier + Mnożnik cywili w miastach - - When map locations are badly defined, this can be used to control how large villages are on a given map. This is used for spawning civilians, waypoints and some other things. - Gdy lokacje na mapie są słabo zdefiniowane, można ustawić ręcznie jak duże są wioski na danej mapie. Jest to używane do spawnownia cywili, waypointów i wielu innych rzeczy. + + Weight multiplier for cities when civilians are spawned. The higher (relatively to other location types), the more civilians (on average) will be in cities on the same area. + Mnożnik wagi dla miast podczas spawnowania cywili. Im wyższy (w stosunku do innych typów lokacji), tym średnio więcej cywili będzie wygenerowanych w miastach o samym obszarze. Custom city area radius @@ -105,6 +33,46 @@ When map locations are badly defined, this can be used to control how large capital(s) are on a given map. This is used for spawning civilians, waypoints and some other things. Gdy lokacje na mapie są słabo zdefiniowane, można ustawić ręcznie jak duże są stolice na danej mapie. Jest to używane do spawnownia cywili, waypointów i wielu innych rzeczy. + + Custom village area radius + Własny promień obszaru wioski + + + When map locations are badly defined, this can be used to control how large villages are on a given map. This is used for spawning civilians, waypoints and some other things. + Gdy lokacje na mapie są słabo zdefiniowane, można ustawić ręcznie jak duże są wioski na danej mapie. Jest to używane do spawnownia cywili, waypointów i wielu innych rzeczy. + + + SerialKillers - Civilian + SerialKillers - Cywile + + + Civilian vehicles limit + Limit pojazdów cywilnych + + + Controls how much civilian vehicles will be created on the whole map. + Ustala jak dużo pojazdów cywilnych będzie utworzonych na całej mapie. + + + Guaranteed civilian in every location + Gwarantowany cywil w każdej lokacji + + + If checked, every village, city and capital will have at least 1 civilian on start (if limit allows). + Jeżeli zaznaczone, każda wioska, miasto i stolica będą miały przynajmniej 1 cywila na start (jeżeli pozwoli na to limit). + + + High + Dużo + + + Civilians count + Liczba cywili + + + Number of generated civilians on mission startup. Final number will be in +-10% range. Set 0 to randomize between 100-200. + Liczba generowanych cywili na starcie misji. Właściwa liczba będzie z przedziału +-10%. Losowana z przedziału 100-200 gdy ustawienie jest równe 0. + Civilian was killed Cywil został zabity @@ -113,6 +81,26 @@ Civilian was killed by cop Cywil został zabity przez policjanta + + Civilian was killed by cop %3 at %1 in %2! + Cywil został zabity przez policjanta %3 o godzinie %1 w %2! + + + Civilian was killed by cop %3 at %1 near %2! + Cywil został zabity przez policjanta %3 o godzinie %1 w pobliżu %2! + + + Civilian was killed at %1 in %2! + Cywil został zabity o godzinie %1 w %2! + + + Civilian was killed at %1 near %2! + Cywil został zabity o godzinie %1 w pobliżu %2! + + + Location area + Obszar lokacji + Low Mało @@ -121,9 +109,21 @@ Mediun Średnio - - High - Dużo + + Respect city area + Respektuj obszar miasta + + + Civilians will be spawned in cities area as defined in map location configuration. Otherwise, values below will be used to define area for each location type. + Cywile będą spawnowani w miastach o obszarze zdefiniowanym w konfiguracji lokacji mapy. W przeciwnym razie wartości wyszczególnione poniżej zostaną użyte do zdefiniowania rozmiaru każdej lokacji. + + + Village civilians weight multiplier + Mnożnik cywili w wioskach + + + Weight multiplier for villages when civilians are spawned. The higher (relatively to other location types), the more civilians (on average) will be in villages on the same area. + Mnożnik wagi dla wiosek podczas spawnowania cywili. Im wyższy (w stosunku do innych typów lokacji), tym średnio więcej cywili będzie wygenerowanych w wioskach na tym samym obszarze. diff --git a/addons/civilian_statemachine/functions/fnc_getOut.sqf b/addons/civilian_statemachine/functions/fnc_getOut.sqf index 5382deb6..5a20e508 100644 --- a/addons/civilian_statemachine/functions/fnc_getOut.sqf +++ b/addons/civilian_statemachine/functions/fnc_getOut.sqf @@ -25,4 +25,4 @@ private _waypoint = _group addWaypoint [_vehicle, 0]; _waypoint waypointAttachVehicle _vehicle; _waypoint setWaypointType "GETOUT"; -TRACE_2("Group %1 getting out of a vehicle %2", _group, _vehicle); +TRACE_2("Group %1 getting out of a vehicle %2",_group,_vehicle); diff --git a/addons/civilian_statemachine/functions/fnc_moveToVehicle.sqf b/addons/civilian_statemachine/functions/fnc_moveToVehicle.sqf index 75cfeab9..1a4fb248 100644 --- a/addons/civilian_statemachine/functions/fnc_moveToVehicle.sqf +++ b/addons/civilian_statemachine/functions/fnc_moveToVehicle.sqf @@ -25,4 +25,4 @@ private _waypoint = _group addWaypoint [_vehicle, 0]; _waypoint waypointAttachVehicle _vehicle; _waypoint setWaypointType "GETIN"; -TRACE_2("Group %1 getting in a vehicle %2", _group, _vehicle); +TRACE_2("Group %1 getting in a vehicle %2",_group,_vehicle); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 0dbe45aa..255dd5d1 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -22,7 +22,7 @@ if (isServer) then { [QGVAR(showSideChatMsg), { params [["_side", sideEmpty], ["_msg", ""]]; if (_msg isEqualTo "") exitWith {}; - private _sideText = if (_side isEqualTo sideEmpty) then { "ALL" } else { _side }; + private _sideText = [_side, "ALL"] select (_side isEqualTo sideEmpty); INFO_2("(Side Chat) %1: %2",_sideText,_msg call BIS_fnc_localize); }] call CBA_fnc_addEventHandler; }; diff --git a/addons/common/functions/fnc_deleteAtRandom.sqf b/addons/common/functions/fnc_deleteAtRandom.sqf index fac9b37b..eacf4d78 100644 --- a/addons/common/functions/fnc_deleteAtRandom.sqf +++ b/addons/common/functions/fnc_deleteAtRandom.sqf @@ -17,4 +17,4 @@ params ["_array"]; -_array deleteAt (floor (random (count _array))); +_array deleteAt (floor (random (count _array))) diff --git a/addons/common/functions/fnc_getNearestCityLocation.sqf b/addons/common/functions/fnc_getNearestCityLocation.sqf index c7e0e876..00a20494 100644 --- a/addons/common/functions/fnc_getNearestCityLocation.sqf +++ b/addons/common/functions/fnc_getNearestCityLocation.sqf @@ -29,7 +29,7 @@ if (_pos isEqualType objNull) then { private _towns = nearestLocations [_pos, ["NameVillage", "NameCity", "NameCityCapital"], _searchRadius]; #define GET_NEAREST_LOCATION _towns param [0, locationNull] -TRACE_2("Nearest location for pos: %1 is location: %2", _pos, GET_NEAREST_LOCATION); +TRACE_2("Nearest location for pos: %1 is location: %2",_pos,GET_NEAREST_LOCATION); // Select nearest location from array. _towns param [0, locationNull] diff --git a/addons/common/functions/fnc_getNearestLocation.sqf b/addons/common/functions/fnc_getNearestLocation.sqf index d465cba5..a34c520d 100644 --- a/addons/common/functions/fnc_getNearestLocation.sqf +++ b/addons/common/functions/fnc_getNearestLocation.sqf @@ -30,7 +30,7 @@ private _locations = nearestLocations [_pos, GVAR(allLocationTypes), _searchRadi // Introduced so that there are no issues with ',' in TRACE macro. #define GET_NEAREST_LOCATION _locations param [0, locationNull] -TRACE_2("(getNearestLocation) Pos: %1 Location: %2", _pos, GET_NEAREST_LOCATION); +TRACE_2("(getNearestLocation) Pos: %1 Location: %2",_pos,GET_NEAREST_LOCATION); // Select nearest location from array. _locations param [0, locationNull] diff --git a/addons/common/functions/fnc_getNearestLocationName.sqf b/addons/common/functions/fnc_getNearestLocationName.sqf index d1db4611..b88731a3 100644 --- a/addons/common/functions/fnc_getNearestLocationName.sqf +++ b/addons/common/functions/fnc_getNearestLocationName.sqf @@ -30,4 +30,4 @@ if (_pos isEqualType objNull) then { private _nearestLocation = [_pos, _searchRadius] call FUNC(getNearestLocationWithAvailableName); if (_nearestLocation isEqualTo locationNull) exitWith {""}; -[_nearestLocation] call FUNC(getLocationName); +[_nearestLocation] call FUNC(getLocationName) diff --git a/addons/common/functions/fnc_getRandomPos.sqf b/addons/common/functions/fnc_getRandomPos.sqf index d362ebba..ed67f5fc 100644 --- a/addons/common/functions/fnc_getRandomPos.sqf +++ b/addons/common/functions/fnc_getRandomPos.sqf @@ -63,4 +63,4 @@ while {(_loopLimit >= 0) && {(_randomPos isEqualTo [])}} do { if (_loopLimit isEqualTo 0) exitWith {[]}; -_randomPos; +_randomPos diff --git a/addons/common/functions/fnc_getTextFromConfig.sqf b/addons/common/functions/fnc_getTextFromConfig.sqf index 122a8aec..a7badd74 100644 --- a/addons/common/functions/fnc_getTextFromConfig.sqf +++ b/addons/common/functions/fnc_getTextFromConfig.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * None + * Text read from config * * Example: * None diff --git a/addons/common/functions/fnc_isHouseNearby.sqf b/addons/common/functions/fnc_isHouseNearby.sqf index e68e6f8e..6a79ed28 100644 --- a/addons/common/functions/fnc_isHouseNearby.sqf +++ b/addons/common/functions/fnc_isHouseNearby.sqf @@ -18,8 +18,5 @@ params ["_position"]; private _houses = nearestTerrainObjects [_position, ["House"], 50, false]; -if (_houses isEqualTo []) then { - false -} else { - true -}; + +[true, false] select (_houses isEqualTo []) diff --git a/addons/common/functions/fnc_isRoadNearby.sqf b/addons/common/functions/fnc_isRoadNearby.sqf index 436b7f23..05f0ff01 100644 --- a/addons/common/functions/fnc_isRoadNearby.sqf +++ b/addons/common/functions/fnc_isRoadNearby.sqf @@ -18,8 +18,5 @@ params ["_position"]; private _roads = _position nearRoads 50; -if (_roads isEqualTo []) then { - false -} else { - true -}; + +[true, false] select (_roads isEqualTo []) diff --git a/addons/common/functions/fnc_showMessage.sqf b/addons/common/functions/fnc_showMessage.sqf index 24ee6aa5..8eb2126c 100644 --- a/addons/common/functions/fnc_showMessage.sqf +++ b/addons/common/functions/fnc_showMessage.sqf @@ -23,4 +23,6 @@ if (GVAR(ACE_Loaded)) then { [_msg, _size, _target, _width] call ACE_common_fnc_displayTextStructured; } else { hint _msg; -} +}; + +nil diff --git a/addons/equipment/CfgSerialKillers.hpp b/addons/equipment/CfgSerialKillers.hpp index b1065952..b73fd38b 100644 --- a/addons/equipment/CfgSerialKillers.hpp +++ b/addons/equipment/CfgSerialKillers.hpp @@ -255,7 +255,6 @@ class CfgSerialKillers class ACE_microDAGR {}; class ACE_DAGR {}; class ACE_CableTie {}; - class ACE_HandFlare_White {}; class ACE_Flashlight_XL50 {}; class ACE_Flashlight_KSF1 {}; class ACE_Flashlight_MX991 {}; @@ -394,7 +393,6 @@ class CfgSerialKillers availableInStash = 1; }; class rhsusf_acc_leupoldmk4_2 : rhs_weap_M107 {}; - class rhsusf_acc_eotech_552 : rhs_weap_M107 {}; /* Launchers */ class rhs_weap_panzerfaust60 @@ -731,7 +729,6 @@ class CfgSerialKillers class U_BG_Guerilla2_1 {}; class U_BG_Guerilla2_3 {}; class U_C_Journalist {}; - class U_Marshal {}; class U_C_IDAP_Man_casual_F {}; class U_C_IDAP_Man_Jeans_F {}; class U_C_IDAP_Man_Tee_F {}; diff --git a/addons/equipment/functions/fnc_getRequiredScoreForItem.sqf b/addons/equipment/functions/fnc_getRequiredScoreForItem.sqf index 65a1e72b..becda7ff 100644 --- a/addons/equipment/functions/fnc_getRequiredScoreForItem.sqf +++ b/addons/equipment/functions/fnc_getRequiredScoreForItem.sqf @@ -26,11 +26,7 @@ if (_item isEqualType objNull) then { if (_item isEqualTo "") exitWith {-1}; // Check if given item is a vehicle -private _namespace = if (isClass (configFile >> "CfgVehicles" >> _item)) then { - GVAR(policeVehiclesScores) -} else { - GVAR(policeEquipmentScores) -}; +private _namespace = [GVAR(policeEquipmentScores), GVAR(policeVehiclesScores)] select isClass (configFile >> "CfgVehicles" >> _item); // Lowercase search only _item = toLower _item; diff --git a/addons/equipment/functions/fnc_initPoliceEquipment.sqf b/addons/equipment/functions/fnc_initPoliceEquipment.sqf index bb129c30..bb85374a 100644 --- a/addons/equipment/functions/fnc_initPoliceEquipment.sqf +++ b/addons/equipment/functions/fnc_initPoliceEquipment.sqf @@ -61,7 +61,7 @@ _policeEquipmentList sort true; _itemNamespace = GVAR(commonEquipment) getVariable [_itemClassname, call CBA_fnc_createNamespace]; }; private _loadMagazines = _itemNamespace getVariable ["loadMagazines", true]; - if (_loadMagazines isEqualTo "false") exitwith {}; + if (_loadMagazines isEqualTo "false") exitWith {}; // Get compatible magazines and add them if not added yet private _magazines = [_itemClassName, true] call CBA_fnc_compatibleMagazines; { diff --git a/addons/equipment/stringtable.xml b/addons/equipment/stringtable.xml index d32c8885..c5cc32e0 100644 --- a/addons/equipment/stringtable.xml +++ b/addons/equipment/stringtable.xml @@ -5,6 +5,10 @@ SerialKillers - Equipment SerialKillers - Ekwipunek + + Predefined equipment preset + Predefiniowana konfiguracja ekwipunku + Custom equipment preset Własna konfiguracja ekwipunku @@ -13,17 +17,13 @@ Use "Custom" equipment preset from mission config. Overwrites predefined mod presets. Użyj konfiguracji "Custom" z pliku konfiguracyjnego w misji. Zastępuje predefiniowane konfiguracje z moda. - - Predefined equipment preset - Predefiniowana konfiguracja ekwipunku + + Automatic preset selection + Automatyczny wybór konfiguracji Use predefined equipment preset from mod config. Użyj predefiniowanej konfiguracji ekwipunku z moda. - - Automatic preset selection - Automatyczny wybór konfiguracji - diff --git a/addons/jail/functions/fnc_addReleaseAction.sqf b/addons/jail/functions/fnc_addReleaseAction.sqf index 0e7c671a..7539e12c 100644 --- a/addons/jail/functions/fnc_addReleaseAction.sqf +++ b/addons/jail/functions/fnc_addReleaseAction.sqf @@ -24,8 +24,8 @@ private _actionID = [ LLSTRING(Release_Prisoner), "", "", - QUOTE([ARR_2(_this, _target)] call FUNC(canRelease)), - QUOTE([ARR_2(_caller, _target)] call FUNC(canRelease)), + QUOTE([ARR_2(_this,_target)] call FUNC(canRelease)), + QUOTE([ARR_2(_caller,_target)] call FUNC(canRelease)), {}, {}, { params ["_target", "_caller", "_actionId", "_arguments"]; diff --git a/addons/jail/functions/fnc_canRelease.sqf b/addons/jail/functions/fnc_canRelease.sqf index d4a4802f..63949adb 100644 --- a/addons/jail/functions/fnc_canRelease.sqf +++ b/addons/jail/functions/fnc_canRelease.sqf @@ -8,7 +8,7 @@ * 1: Unit to release * * Return Value: - * None + * Whether target unit can be released * * Example: * [bob, ted] call afsk_jail_fnc_canBeReleased diff --git a/addons/jail/functions/fnc_getRandomJailPos.sqf b/addons/jail/functions/fnc_getRandomJailPos.sqf index 62ea2e45..33689ee7 100644 --- a/addons/jail/functions/fnc_getRandomJailPos.sqf +++ b/addons/jail/functions/fnc_getRandomJailPos.sqf @@ -15,4 +15,4 @@ * Public: No */ -[[[getPosATL GVAR(jail), GVAR(jail) getVariable "objectArea"]], ["water"]] call BIS_fnc_randomPos; +[[[getPosATL GVAR(jail), GVAR(jail) getVariable "objectArea"]], ["water"]] call BIS_fnc_randomPos diff --git a/addons/jail/functions/fnc_jailMarker.sqf b/addons/jail/functions/fnc_jailMarker.sqf index 13835a29..b675fb0f 100644 --- a/addons/jail/functions/fnc_jailMarker.sqf +++ b/addons/jail/functions/fnc_jailMarker.sqf @@ -17,8 +17,8 @@ private _markerText = format ["%1", LLSTRING(Jail)]; private _marker = createMarker ["jail", getPosATL GVAR(jail)]; -_marker setMarkerType "mil_end"; -_marker setMarkerColor "ColorEAST"; +_marker setMarkerTypeLocal "mil_end"; +_marker setMarkerColorLocal "ColorEAST"; _marker setMarkerText _markerText; _marker diff --git a/addons/jail/stringtable.xml b/addons/jail/stringtable.xml index caa7aa43..1fed62dd 100644 --- a/addons/jail/stringtable.xml +++ b/addons/jail/stringtable.xml @@ -9,13 +9,13 @@ Jail Więzienie - - Release prisoner - Uwolnij więźnia - Prisoners have been released from the prison! Więźniowie zostali uwolnieni z więzienia! + + Release prisoner + Uwolnij więźnia + diff --git a/addons/killers/functions/fnc_anyKillerFree.sqf b/addons/killers/functions/fnc_anyKillerFree.sqf index 8b467f5e..d6aac31d 100644 --- a/addons/killers/functions/fnc_anyKillerFree.sqf +++ b/addons/killers/functions/fnc_anyKillerFree.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * None + * True if any killer is still free * * Example: * call afsk_killers_fnc_anyKillerFree diff --git a/addons/killers/functions/fnc_createMarkersForNearbyVehicles.sqf b/addons/killers/functions/fnc_createMarkersForNearbyVehicles.sqf index 08127911..b3719cbf 100644 --- a/addons/killers/functions/fnc_createMarkersForNearbyVehicles.sqf +++ b/addons/killers/functions/fnc_createMarkersForNearbyVehicles.sqf @@ -36,10 +36,10 @@ private _emptyVehicles = _nearbyVehicles select { _marker setMarkerColorLocal "ColorCIVILIAN"; _marker setMarkerSizeLocal [0.5, 0.5]; _marker setMarkerAlphaLocal 1; // Force just in case marker already exists and should be fully-visible again - _marker setMarkerTextLocal getText (configFile >> "CfgVehicles" >> (typeof _vehicle) >> "displayName"); + _marker setMarkerTextLocal getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"); private _markerType = if (_vehicle isKindOf "Air") then { - if (_vehicle isKindOf "Plane") then { "loc_plane" } else { "loc_heli" } + ["loc_heli", "loc_plane"] select (_vehicle isKindOf "Plane") } else { "loc_car" }; _marker setMarkerTypeLocal _markerType; diff --git a/addons/killers/functions/fnc_createStartPositionMarker.sqf b/addons/killers/functions/fnc_createStartPositionMarker.sqf index debde5ff..97288f31 100644 --- a/addons/killers/functions/fnc_createStartPositionMarker.sqf +++ b/addons/killers/functions/fnc_createStartPositionMarker.sqf @@ -22,11 +22,11 @@ if (_name isEqualTo "") then { _name = [_pos] call EFUNC(common,getNearestLocationName); }; -private _marker = createMarkerlocal [_name, _pos]; -_marker setMarkerColorlocal "ColorEAST"; -_marker setMarkerSizelocal [0.5,0.5]; -_marker setMarkerTypelocal "mil_end"; +private _marker = createMarkerLocal [_name, _pos]; +_marker setMarkerColorLocal "ColorEAST"; +_marker setMarkerSizeLocal [0.5,0.5]; +_marker setMarkerTypeLocal "mil_end"; _marker setMarkerTextLocal _name; -GVAR(startPositionsMarkers) pushback _marker; +GVAR(startPositionsMarkers) pushBack _marker; _marker diff --git a/addons/killers/functions/fnc_createStashesMarkers.sqf b/addons/killers/functions/fnc_createStashesMarkers.sqf index ef9cdd3f..d17234aa 100644 --- a/addons/killers/functions/fnc_createStashesMarkers.sqf +++ b/addons/killers/functions/fnc_createStashesMarkers.sqf @@ -16,9 +16,9 @@ */ { - private _marker = createMarkerlocal [str _x, getPosATL _x]; - _marker setMarkerColorlocal "ColorEAST"; - _marker setMarkerSizelocal [0.5,0.5]; - _marker setMarkerTypelocal "mil_pickup"; + private _marker = createMarkerLocal [str _x, getPosATL _x]; + _marker setMarkerColorLocal "ColorEAST"; + _marker setMarkerSizeLocal [0.5,0.5]; + _marker setMarkerTypeLocal "mil_pickup"; _x setVariable [QGVAR(marker), _marker]; } forEach GVAR(stashes); diff --git a/addons/killers/functions/fnc_initKillersStashes.sqf b/addons/killers/functions/fnc_initKillersStashes.sqf index ab07898f..49cd544c 100644 --- a/addons/killers/functions/fnc_initKillersStashes.sqf +++ b/addons/killers/functions/fnc_initKillersStashes.sqf @@ -40,7 +40,7 @@ for "_y" from 0 to (_createStatshesCount - 1) step 1 do { _box setVariable [QGVAR(killersStash), _stash]; _stash setVariable [QGVAR(box), _box]; _box call FUNC(fillKillersStash); - GVAR(stashes) pushback _box; + GVAR(stashes) pushBack _box; }; publicVariable QGVAR(stashes); diff --git a/addons/main/ui/logo_sm_ca.paa b/addons/main/ui/logo_sm_ca.paa new file mode 100644 index 00000000..37d7faf8 Binary files /dev/null and b/addons/main/ui/logo_sm_ca.paa differ diff --git a/addons/markers/functions/fnc_loop.sqf b/addons/markers/functions/fnc_loop.sqf index a3e01783..49f226db 100644 --- a/addons/markers/functions/fnc_loop.sqf +++ b/addons/markers/functions/fnc_loop.sqf @@ -31,7 +31,7 @@ }; #endif }; -} foreach EGVAR(civilian,civilians); +} forEach EGVAR(civilian,civilians); // Move marker for every cop if (playerSide isEqualTo WEST) then { diff --git a/addons/missions/XEH_postInit.sqf b/addons/missions/XEH_postInit.sqf index b5205f77..be60e994 100644 --- a/addons/missions/XEH_postInit.sqf +++ b/addons/missions/XEH_postInit.sqf @@ -5,5 +5,5 @@ if (!EGVAR(common,enabled)) exitWith {}; [{alive player}, { private _welcomeText = format [LLSTRING(Welcome_Message), QUOTE(VERSION_STR)]; - titletext [_welcomeText, "plain"]; + titleText [_welcomeText, "plain"]; }] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/modules/functions/fnc_initKillersStarts.sqf b/addons/modules/functions/fnc_initKillersStarts.sqf index 29990f1d..8a6b3947 100644 --- a/addons/modules/functions/fnc_initKillersStarts.sqf +++ b/addons/modules/functions/fnc_initKillersStarts.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * None + * List of killers start modules > * * Example: * None diff --git a/addons/modules/functions/fnc_initKillersStashes.sqf b/addons/modules/functions/fnc_initKillersStashes.sqf index 8aec1857..90b9d979 100644 --- a/addons/modules/functions/fnc_initKillersStashes.sqf +++ b/addons/modules/functions/fnc_initKillersStashes.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * None + * List of killers stash modules > * * Example: * None diff --git a/addons/modules/functions/fnc_initPoliceStations.sqf b/addons/modules/functions/fnc_initPoliceStations.sqf index 3c56e4ea..963040d2 100644 --- a/addons/modules/functions/fnc_initPoliceStations.sqf +++ b/addons/modules/functions/fnc_initPoliceStations.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * None + * List of police station modules > * * Example: * None diff --git a/addons/modules/stringtable.xml b/addons/modules/stringtable.xml index c2b530ce..2ca2c5f8 100644 --- a/addons/modules/stringtable.xml +++ b/addons/modules/stringtable.xml @@ -25,13 +25,13 @@ Location Name. If empty will use nearest map location name according to player language. If not empty, the same name will be used for all languages (unless it's stringtable empty starting with $). Nazwa lokacji. Jeżeli puste to użyta zostanie nazwa najbliższej lokacji na mapie zgodnie z językiem gracza. Jeżeli nie będzie puste, ta sama nazwa pokaże się we wszystkich językach (chyba że będzie zawierać wpis lokalizowalny rozpoczynający się od $). - - Police Station - Posterunek Policji - Has helipad Posiada lądowisko dla helikoptera + + Police Station + Posterunek Policji + diff --git a/addons/police/XEH_postInit.sqf b/addons/police/XEH_postInit.sqf index 19125f0e..823c1e4c 100644 --- a/addons/police/XEH_postInit.sqf +++ b/addons/police/XEH_postInit.sqf @@ -58,7 +58,7 @@ if (isServer) then { [QEGVAR(score,scoreChanged), { params ["_side", "_change", ["_reason", ""]]; - if (_side isEqualTo EAST) exitwith {}; + if (_side isEqualTo EAST) exitWith {}; call FUNC(equipmentScoreCheck); }] call CBA_fnc_addEventHandler; diff --git a/addons/police/functions/fnc_copKilled.sqf b/addons/police/functions/fnc_copKilled.sqf index 612c0463..1c2ae26b 100644 --- a/addons/police/functions/fnc_copKilled.sqf +++ b/addons/police/functions/fnc_copKilled.sqf @@ -20,7 +20,7 @@ params ["_unit", "_killer"]; if !(isServer) exitWith {}; -private _time = [daytime] call BIS_fnc_timeToString; +private _time = [dayTime] call BIS_fnc_timeToString; private _isPlayerOrAi = ["AI", "PLAYER"] select isPlayer _killer; LOG_4("Cop %1 was killed by %2 %3 at %4",name _unit,_isPlayerOrAi,name _killer,_time); diff --git a/addons/police/functions/fnc_copKilledMsg.sqf b/addons/police/functions/fnc_copKilledMsg.sqf index 181c0528..e0f24731 100644 --- a/addons/police/functions/fnc_copKilledMsg.sqf +++ b/addons/police/functions/fnc_copKilledMsg.sqf @@ -17,7 +17,7 @@ * Public: No */ -params ["_unit", "_killer", ["_timeOfDeath", daytime], ["_nearestTown", locationNull]]; +params ["_unit", "_killer", ["_timeOfDeath", dayTime], ["_nearestTown", locationNull]]; if (_timeOfDeath isEqualType 0) then { _timeOfDeath = [_timeOfDeath] call BIS_fnc_timeToString; diff --git a/addons/police/functions/fnc_equipmentScoreCheck.sqf b/addons/police/functions/fnc_equipmentScoreCheck.sqf index ea34bd16..c656cd6a 100644 --- a/addons/police/functions/fnc_equipmentScoreCheck.sqf +++ b/addons/police/functions/fnc_equipmentScoreCheck.sqf @@ -17,19 +17,19 @@ private _step = if ((EGVAR(score,policeScore) - GVAR(lastEquipmentUpdateScore)) > 0) then {1} else {-1}; -TRACE_3("(equipmentScoreCheck) Performing check from %1 to %2 step %3", GVAR(lastEquipmentUpdateScore), EGVAR(score,policeScore), _step); +TRACE_3("(equipmentScoreCheck) Performing check from %1 to %2 step %3",GVAR(lastEquipmentUpdateScore),EGVAR(score,policeScore),_step); while {GVAR(lastEquipmentUpdateScore) != EGVAR(score,policeScore)} do { if (_step > 0) then { GVAR(lastEquipmentUpdateScore) = GVAR(lastEquipmentUpdateScore) + _step; }; - TRACE_1("(equipmentScoreCheck) Checking %1", GVAR(lastEquipmentUpdateScore)); + TRACE_1("(equipmentScoreCheck) Checking %1",GVAR(lastEquipmentUpdateScore)); private _scoreItems = EGVAR(equipment,policeEquipmentScores) getVariable [str GVAR(lastEquipmentUpdateScore), []]; private _scoreVehicles = EGVAR(equipment,policeVehiclesScores) getVariable [str GVAR(lastEquipmentUpdateScore), []]; - TRACE_2("(equipmentScoreCheck) Found %1 equipment and %2 vehicles", _scoreItems, _scoreVehicles); + TRACE_2("(equipmentScoreCheck) Found %1 equipment and %2 vehicles",_scoreItems,_scoreVehicles); { if (_step > 0) then { diff --git a/addons/police/stringtable.xml b/addons/police/stringtable.xml index 509a8474..d7788397 100644 --- a/addons/police/stringtable.xml +++ b/addons/police/stringtable.xml @@ -1,14 +1,6 @@ - - SerialKillers - Police - SerialKillers - Policja - - - Police - Policja - Someone is in %1 police station! Ktoś majstruje coś w bazie policji w %1! @@ -17,13 +9,21 @@ It was a bad idea... To był zły pomysł... - - Cop was killed at %1 in %2! - Policjant został zabity o godzinie %1 w %2! + + SerialKillers - Police + SerialKillers - Policja - - Cop was killed at %1 near %2! - Policjant został zabity o godzinie %1 w pobliżu %2! + + Cannot create %1 at %2. + Nie można utworzyć %1 w %2. + + + Cop was killed + Policjant został zabity + + + Cop was killed by cop + Policjant został zabity przez policjanta Cop was killed by cop %3 at %1 in %2! @@ -33,17 +33,17 @@ Cop was killed by cop %3 at %1 near %2! Policjant został zabity przez policjanta %3 o godzinie %1 w pobliżu %2! - - Cop was killed - Policjant został zabity + + Cop was killed at %1 in %2! + Policjant został zabity o godzinie %1 w %2! - - Cop was killed by cop - Policjant został zabity przez policjanta + + Cop was killed at %1 near %2! + Policjant został zabity o godzinie %1 w pobliżu %2! - - Cannot create %1 at %2. - Nie można utworzyć %1 w %2. + + Police + Policja Save equipment for respawn diff --git a/addons/score/functions/fnc_addKillersScore.sqf b/addons/score/functions/fnc_addKillersScore.sqf index 2dda71f2..3986e0d2 100644 --- a/addons/score/functions/fnc_addKillersScore.sqf +++ b/addons/score/functions/fnc_addKillersScore.sqf @@ -18,7 +18,7 @@ params ["_scoreChange", ["_reason", ""]]; -private _time = [daytime] call BIS_fnc_timeToString; +private _time = [dayTime] call BIS_fnc_timeToString; // Change killers score GVAR(killersScore) = GVAR(killersScore) + _scoreChange; diff --git a/addons/score/functions/fnc_addPoliceScore.sqf b/addons/score/functions/fnc_addPoliceScore.sqf index 4f5ad516..8d8151aa 100644 --- a/addons/score/functions/fnc_addPoliceScore.sqf +++ b/addons/score/functions/fnc_addPoliceScore.sqf @@ -18,7 +18,7 @@ params ["_scoreChange", ["_reason", ""]]; -private _time = [daytime] call BIS_fnc_timeToString; +private _time = [dayTime] call BIS_fnc_timeToString; // Change police score GVAR(policeScore) = GVAR(policeScore) + _scoreChange; @@ -39,3 +39,5 @@ GVAR(policeScoreLastChangeTime) = CBA_missionTime; publicVariable QGVAR(policeScoreChange); }; }, [GVAR(policeScoreChange)], 5] call CBA_fnc_waitAndExecute; + +GVAR(policeScore) diff --git a/addons/score/functions/fnc_endMissionClient.sqf b/addons/score/functions/fnc_endMissionClient.sqf index 41d0d9d6..b36ccbb7 100644 --- a/addons/score/functions/fnc_endMissionClient.sqf +++ b/addons/score/functions/fnc_endMissionClient.sqf @@ -24,27 +24,27 @@ GVAR(missionEnd) = _endType; switch (_endType) do { // 0 case KILLERS_SCORE_REACHED: { - private _win = if (playerSide isEqualTo EAST) then {true} else {false}; + private _win = [false, true] select (playerSide isEqualTo EAST); [QGVAR(killersScoreReached), _win, nil, false] call BIS_fnc_endMission; }; // 1 case KILLERS_DEAD: { - private _win = if (playerSide isEqualTo WEST) then {true} else {false}; + private _win = [false, true] select (playerSide isEqualTo WEST); [QGVAR(killersDead), _win, nil, false] call BIS_fnc_endMission; }; // 2 case MAXIMUM_TIMEOUT_REACHED: { - private _win = if (playerSide isEqualTo WEST) then {true} else {false}; + private _win = [false, true] select (playerSide isEqualTo WEST); [QGVAR(timeoutLimit), _win, nil, false] call BIS_fnc_endMission; }; // 3 case TIME_LIMIT_REACHED: { - private _win = if (playerSide isEqualTo WEST) then {true} else {false}; + private _win = [false, true] select (playerSide isEqualTo WEST); [QGVAR(timeLimit), _win, nil, false] call BIS_fnc_endMission; }; // 4 case ALL_CIVILIANS_DEAD: { - private _win = if (playerSide isEqualTo EAST) then {true} else {false}; + private _win = [false, true] select (playerSide isEqualTo EAST); [QGVAR(civiliansDead), _win, nil, false] call BIS_fnc_endMission; }; default { diff --git a/addons/score/functions/fnc_showScore.sqf b/addons/score/functions/fnc_showScore.sqf index 74c362c9..52131c81 100644 --- a/addons/score/functions/fnc_showScore.sqf +++ b/addons/score/functions/fnc_showScore.sqf @@ -30,7 +30,7 @@ private _fnc_determineSign = { private _separator = parseText "
---------------------------
"; _separator setAttributes ["align", "center"]; -private _msgHour = text format ["%1", [daytime] call BIS_fnc_timeToString]; +private _msgHour = text format ["%1", [dayTime] call BIS_fnc_timeToString]; _msgHour setAttributes ["align", "center"]; private _msgKillers = text format ["%1", LELSTRING(killers,Killers)]; diff --git a/addons/score/stringtable.xml b/addons/score/stringtable.xml index a0cb28db..5d9916fe 100644 --- a/addons/score/stringtable.xml +++ b/addons/score/stringtable.xml @@ -1,17 +1,134 @@ + + All civilians are dead + Wszyscy cywile nie żyją + + + Killers score when cop is killed + Wynik zabójców gdy policjant zostanie zabity + + + When cop is killed by police killers get this many points. + Zabójcy dostają tyle punktów gdy policjant zginie z rąk policji. + + + Police score for kiling cop + Wynik policji za zabicie policjanta + + + Police get this many points when they kill cop. + Policja dostaje tyle punktów gdy zabije policjanta. + SerialKillers - Score SerialKillers - Wynik - - Killers score target - Maksymalny wynik zabójców + + + Extra time + Dogrywka - - When killers reach given score, they win. - Zabójcy wygrywają, gdy osiągną wskazany wynik. + + Maximum extra time duration + Maksymalna długość dogrywki + + + After this additional time mission instantly ends with police victory. Set to -1 to disable. + Po tym dodatkowym czasie misja kończy się Natychmiastowym zwycięstwem policji. Ustaw na -1 by wyłączyć. + + + Killers score change during extra time + Zmiana wyniku zabójców po przekroczeniu limitu czasu w dogrywce + + + Killers get this many points on timeout during extra time. + Po upłynięciu maksymalnego czasu pomiędzy zabójstwami podczas dogrywki policja dostanie tyle punktów. + + + Police score change during extra time + Zmiana wyniku policji po przekroczeniu limitu czasu w dogrywce + + + Police gets this many points on timeout during extra time. + Po upłynięciu maksymalnego czasu pomiędzy zabójstwami podczas dogrywki policja dostanie tyle punktów. + + + Maximum timeout is adjusted to this value. + Maksymalny odstęp czasu między zabójstwami zostaje zmieniony do tej wartości. + + + Maximum number of timeouts is adjusted to this value. + Maksymalna liczba przekroczeń limitu czasu zostaje zmieniona do tej wartości. + + + Extra time has started + Rozpoczęła się dogrywka + + + + Timeout between kills + Odstęp czasu pomiędzy zabójstwami + + + Allowed idle time: %1 s + Dozwolony czas bezczynności: %1 s + + + Killers score change + Zmiana wyniku zabójców po przekroczeniu limitu czasu + + + Killers get this many points on timeout. + Po upłynięciu maksymalnego czasu pomiędzy zabójstwami policja dostanie tyle punktów. + + + Maximum time between kills (s) + Maksymalny odstęp czasu pomiędzy zabójstwami + + + Maximum idle times: %1 + Maksymalnie %1 razy bezczynności + + + When this time elapses police and killers can have their points adjusted. (-1 to disable) + Po upłynięciu tego czasu policja i zabójcy mogą mieć dodane/odjęte punkty. (-1 by wyłączyć) + + + Police score change + Zmiana wyniku policji po przekroczeniu limitu czasu + + + Police gets this many points on timeout. + Po upłynięciu maksymalnego czasu pomiędzy zabójstwami policja dostanie tyle punktów. + + + Score changes on idle time + Zmiany wyniku po bezczynności + + + + From now on killers must keep killing within %1 minutes since last kill or they will face penalty. + Od tego momentu zabójcy muszą zabić w ciągu %1 minut od ostatniego zabójstwa albo otrzymają karę. + + + Maximum idle time reached %1/%2 + Maksymalny odstęp czasu pomiędzy zabójstwami przekroczony %1/%2 + + + Maximum number of timeouts + Maksymalna liczba przekroczeń limitu czasu + + + Killers lose if then exceed maximum idle time this many times. (-1 to disable) + Zabójcy przegrywają jeśli tyle razy przekroczą limit czasu pomiędzy zabójstwami. (-1 by wyłączyć) @@ -67,64 +168,21 @@ When cop is killed by killers police get this many points. Policja dostaje tyle punktów gdy policjant zginie z rąk zabójców. - - Killers score when cop is killed - Wynik zabójców gdy policjant zostanie zabity - - - When cop is killed by police killers get this many points. - Zabójcy dostają tyle punktów gdy policjant zginie z rąk policji. - - - Police score for kiling cop - Wynik policji za zabicie policjanta - - - Police get this many points when they kill cop. - Policja dostaje tyle punktów gdy zabije policjanta. - - - Score - Wynik - - - - Timeout between kills - Odstęp czasu pomiędzy zabójstwami - - - Maximum number of timeouts - Maksymalna liczba przekroczeń limitu czasu - - - Killers lose if then exceed maximum idle time this many times. (-1 to disable) - Zabójcy przegrywają jeśli tyle razy przekroczą limit czasu pomiędzy zabójstwami. (-1 by wyłączyć) - - - Maximum time between kills (s) - Maksymalny odstęp czasu pomiędzy zabójstwami - - - When this time elapses police and killers can have their points adjusted. (-1 to disable) - Po upłynięciu tego czasu policja i zabójcy mogą mieć dodane/odjęte punkty. (-1 by wyłączyć) - - - Police score change - Zmiana wyniku policji po przekroczeniu limitu czasu + + Killers score target + Maksymalny wynik zabójców - - Police gets this many points on timeout. - Po upłynięciu maksymalnego czasu pomiędzy zabójstwami policja dostanie tyle punktów. + + When killers reach given score, they win. + Zabójcy wygrywają, gdy osiągną wskazany wynik. - - Killers score change - Zmiana wyniku zabójców po przekroczeniu limitu czasu + + All killers are either dead or in custody. + Wszyscy zabójcy są martwi albo w więzieniu. - - Killers get this many points on timeout. - Po upłynięciu maksymalnego czasu pomiędzy zabójstwami policja dostanie tyle punktów. + + Score limit reached + Osiągnięty limit wyniku - - Extra time - Dogrywka - - - Maximum extra time duration - Maksymalna długość dogrywki - - - After this additional time mission instantly ends with police victory. Set to -1 to disable. - Po tym dodatkowym czasie misja kończy się Natychmiastowym zwycięstwem policji. Ustaw na -1 by wyłączyć. - - - Maximum timeout is adjusted to this value. - Maksymalny odstęp czasu między zabójstwami zostaje zmieniony do tej wartości. - - - Maximum number of timeouts is adjusted to this value. - Maksymalna liczba przekroczeń limitu czasu zostaje zmieniona do tej wartości. - - - Police score change during extra time - Zmiana wyniku policji po przekroczeniu limitu czasu w dogrywce - - - Police gets this many points on timeout during extra time. - Po upłynięciu maksymalnego czasu pomiędzy zabójstwami podczas dogrywki policja dostanie tyle punktów. - - - Killers score change during extra time - Zmiana wyniku zabójców po przekroczeniu limitu czasu w dogrywce - - - Killers get this many points on timeout during extra time. - Po upłynięciu maksymalnego czasu pomiędzy zabójstwami podczas dogrywki policja dostanie tyle punktów. - - - - From now on killers must keep killing within %1 minutes since last kill or they will face penalty. - Od tego momentu zabójcy muszą zabić w ciągu %1 minut od ostatniego zabójstwa albo otrzymają karę. - - - Maximum idle time reached %1/%2 - Maksymalny odstęp czasu pomiędzy zabójstwami przekroczony %1/%2 - - - Extra time has started - Rozpoczęła się dogrywka + + Mission time limit reached + Osiągnięty limit czasu misji Remaining time left: %1 min Pozostały czas: %1 min - - Allowed idle time: %1 s - Dozwolony czas bezczynności: %1 s - - - Maximum idle times: %1 - Maksymalnie %1 razy bezczynności - - - Score changes on idle time - Zmiany wyniku po bezczynności + + Timeouts limit reached + Osiągnięty limit przekroczeń limitu czasu diff --git a/addons/vehicles/CfgVehicles.hpp b/addons/vehicles/CfgVehicles.hpp index ddf7fd88..0764da21 100644 --- a/addons/vehicles/CfgVehicles.hpp +++ b/addons/vehicles/CfgVehicles.hpp @@ -4,8 +4,6 @@ class CfgVehicles { class Car_F; - class Hatchback_01_base_F; - class Hatchback_01_sport_base_F; class C_Hatchback_01_F; class C_Hatchback_01_sport_F; diff --git a/addons/vehicles/functions/fnc_carAlarmNotification.sqf b/addons/vehicles/functions/fnc_carAlarmNotification.sqf index 3a2e06ad..f9c93bdf 100644 --- a/addons/vehicles/functions/fnc_carAlarmNotification.sqf +++ b/addons/vehicles/functions/fnc_carAlarmNotification.sqf @@ -31,7 +31,7 @@ private _notify = if (GVAR(alarmCopsNotification) isEqualTo 1) then { private _anyNearbyUnrestrainedCivilians = _nearbyUnits findIf {alive _x && {side _x isEqualTo CIVILIAN && {!([_x] call EFUNC(jail,isHandcuffed))}}} != -1; - if (_anyNearbyUnrestrainedCivilians) then { true } else { false }; + [false, true] select (_anyNearbyUnrestrainedCivilians) }; if (_notify) exitWith { diff --git a/addons/vehicles/functions/fnc_createVehicle.sqf b/addons/vehicles/functions/fnc_createVehicle.sqf index 7b0c94dd..edb6b70c 100644 --- a/addons/vehicles/functions/fnc_createVehicle.sqf +++ b/addons/vehicles/functions/fnc_createVehicle.sqf @@ -28,7 +28,7 @@ if (_position isEqualType objNull) then { _position = getPosATL _position; }; -private _mode = if (_forcePosition) then {"CAN_COLLIDE"} else {"NONE"}; +private _mode = ["NONE", "CAN_COLLIDE"] select (_forcePosition); private _vehicle = createVehicle [_vehicleClassname, _position, [], 0, _mode]; _vehicle setDir _dir; // Disable randomization and use own function to set texture on vehicle globally (so everyone can see the same color!) diff --git a/addons/vehicles/functions/fnc_vehicleStolenMsg.sqf b/addons/vehicles/functions/fnc_vehicleStolenMsg.sqf index 221b5fba..6599db3a 100644 --- a/addons/vehicles/functions/fnc_vehicleStolenMsg.sqf +++ b/addons/vehicles/functions/fnc_vehicleStolenMsg.sqf @@ -17,7 +17,7 @@ * Public: No */ -params ["_stolenVehicle", ["_timeOfTheft", daytime], ["_nearestTown", locationNull]]; +params ["_stolenVehicle", ["_timeOfTheft", dayTime], ["_nearestTown", locationNull]]; if (_timeOfTheft isEqualType 0) then { _timeOfTheft = [_timeOfTheft] call BIS_fnc_timeToString; diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index 92bfe611..32e177d4 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -1,18 +1,6 @@ - - SerialKillers - Vehicles - SerialKillers - Pojazdy - - - Alarm enabled - Alarmy włączone - - - Add car alarms to civilian vehicles. - Dodaj alarmy do pojazdów cywilnych. - Alarm always armed Alarm zawsze uzbrojony @@ -29,14 +17,18 @@ Control exact distance (in meters) at which an alarm can be heard. Increasing the distance makes it easier for cops to spot a stolen vehicle. Kontroluje dokładną odległość (w metrach), z której alarm będzie słyszalny. Zwiększenie tej odległości ułatwia policji zlokalizowanie skradzionego pojazdu. + + Alarm Average Chance + Średnia szansa na alarm + + + Controls the chance of an alarm going off in a car that has the alarm armed. Normal distribution of [min, mid, max]. + Ustala szansę na uruchomienie alarmu w pojeździe posiadającym alarm. Rozkład normalny [minimum, średnia, maksimum]. + Notify cops of alarm Powiadomienie dla policji o alarmie - - When should the cops be notified that an alarm went off? - Kiedy policja powinna być informowana o włączonym alarmie? - Cops notification delay Opóźnienie powiadomienia dla policji @@ -45,6 +37,10 @@ Delay between an alarm going off and possible notification for cops. Opóźnienie pomiędzy włączeniem alarmu a możliwym powiadomieniem dla Policji. + + When should the cops be notified that an alarm went off? + Kiedy policja powinna być informowana o włączonym alarmie? + Alarm disarm if didn't go off Rozbrój alarm jeżeli się nie włączył @@ -53,9 +49,21 @@ Disarm alarm if it didn't go off when a player entered vehicle. Effective only if 'Alarm always armed' is disabled and 'Alarm Minimum Chance' is set to less than 1. Rozbrój alarm jeżeli się nie włączył gdy gracz wszedł do pojazdu. Działa tylko jeżeli ustawienie 'Alarm zawsze uzbrojony' jest wyłączone oraz 'Minimalna szansa na alarm' jest ustawiona na mniej niż 1. - - Alarm Average Chance - Średnia szansa na alarm + + Alarm Duration + Długość alarmu + + + Controls how long will the alarm sound be heard. + Ustala jak długo będzie wył alarm. + + + Alarm enabled + Alarmy włączone + + + Add car alarms to civilian vehicles. + Dodaj alarmy do pojazdów cywilnych. Alarm Maximum Chance @@ -65,22 +73,18 @@ Alarm Minimum Chance Minimalna szansa na alarm - - Controls the chance of an alarm going off in a car that has the alarm armed. Normal distribution of [min, mid, max]. - Ustala szansę na uruchomienie alarmu w pojeździe posiadającym alarm. Rozkład normalny [minimum, średnia, maksimum]. - - - Alarm Duration - Długość alarmu - - - Controls how long will the alarm sound be heard. - Ustala jak długo będzie wył alarm. + + Always + Zawsze Car alarm Alarm samochodowy + + SerialKillers - Vehicles + SerialKillers - Pojazdy + Civilian vehicles limit Limit pojazdów cywilnych @@ -89,13 +93,13 @@ Controls how much civilian vehicles will be created on the whole map. Ustala jak dużo pojazdów cywilnych będzie utworzonych na całej mapie. - - Vehicle was stolen at %1 in %2! - Pojazd został skradziony o godzinie %1 w %2! + + High + Dużo - - Vehicle was stolen at %1 near %2! - Pojazd został skradziony o godzinie %1 w pobliżu %2! + + If civilians nearby + Jeżeli są cywile w pobliżu Low @@ -105,21 +109,17 @@ Mediun Średnio - - High - Dużo - - - Always - Zawsze - Never Nigdy - - If civilians nearby - Jeżeli są cywile w pobliżu + + Vehicle was stolen at %1 in %2! + Pojazd został skradziony o godzinie %1 w %2! + + + Vehicle was stolen at %1 near %2! + Pojazd został skradziony o godzinie %1 w pobliżu %2! diff --git a/mod.cpp b/mod.cpp index 4328e322..9e86dd3d 100644 --- a/mod.cpp +++ b/mod.cpp @@ -4,5 +4,8 @@ author = "ArmaForces"; url = "https://github.com/armaforces/serialkillers/"; action = "https://armaforces.com/"; actionName = "Website"; +logo = "\z\afwg\addons\main\ui\logo_sm_ca.paa"; +logoOver = "\z\afwg\addons\main\ui\logo_sm_ca.paa"; +overviewPicture = "\z\afwg\addons\main\ui\logo_sm_ca.paa"; tooltip = "ArmaForces SerialKillers"; description = "ArmaForces SerialKillers gamemode developed by 3Mydlo3."; diff --git a/tools/Publish.ps1 b/tools/Publish.ps1 deleted file mode 100644 index 97fbeace..00000000 --- a/tools/Publish.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -param ( - [string] $version, - [string] $workshopId, - [string] $addonDir -) - -$choice = Read-Host -Prompt "Do you want to publish '$version' on Steam Workshop? (y/N)" -if ('y' -ne $choice.ToLower()) { - Write-Host "Skipping Steam Workshop upload" - Exit -} - -try { - $publisherPath = (Get-ItemProperty -Path Registry::"HKEY_CURRENT_USER\Software\Bohemia Interactive\publisher" -ErrorAction Stop).path -} catch { - Throw "Can't find Publisher path in registry" -} - -$modPath = $PSScriptRoot + "/../releases/$version/$addonDir" | Resolve-Path - -$publisherArguments = @( - "update", - "/id:$workshopId", - "/changeNote:""Automatic mod upload""", - "/path:""$modPath""" -) - -Start-Process -FilePath "$publisherPath\PublisherCmd.exe" -NoNewWindow -Wait -ArgumentList $publisherArguments diff --git a/tools/Set-Version.ps1 b/tools/Set-Version.ps1 deleted file mode 100644 index 6c71fcca..00000000 --- a/tools/Set-Version.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -param ( - [string] $version, - [string] $addonDir -) - -$modCppPath = $PSScriptRoot + "/../releases/$version/$addonDir/mod.cpp" - -$replaced = (Get-Content $modCppPath) -replace "0.0.0", "$version" - -$replaced | Out-File $modCppPath diff --git a/tools/return_checker.py b/tools/return_checker.py new file mode 100644 index 00000000..54a42cbf --- /dev/null +++ b/tools/return_checker.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import re +import sys + + +def get_files(): + # Allow running from root directory and tools directory + root_dir = ".." + if os.path.exists("addons"): + root_dir = "." + + sqf_files = [] + + for root, _, files in os.walk(root_dir): + for file in fnmatch.filter(files, "fnc_*.sqf"): + sqf_files.append(os.path.join(root, file)) + + sqf_files.sort() + + return sqf_files + + +def filter_files(filepaths): + filtered_files = [] + + # Return only files that have a docblock + for filepath in filepaths: + with open(filepath, 'r') as file_contents: + for line in file_contents: + contents = line.strip() + + # A possible docblock starts + if contents.startswith('/*'): + print(f" INFO: Found docblock in file {filepath}") + # Find the `* Return Value:` comment + lines = list(map( + # Remove \n from all the lines + (lambda s: s.strip()), file_contents.readlines() + )) + + return_value_comment_index = lines.index('* Return Value:') + return_value_index = return_value_comment_index + 1 + + # Drop the first two characters (e.g. `* `) so it returns the return type + return_value = lines[return_value_index][2:] + + filtered_files.append([filepath, return_value]) + + break + + return filtered_files + + +def get_last_line(filepath): + with open(filepath, 'r') as file_contents: + lines = file_contents.readlines() + last_line = lines[-1].strip() + + # Handle multiple blank lines at the end of the file + if last_line == "": + i = -2 + + while lines[i].strip() == "": + i -= 1 + + return lines[i].strip() + return last_line + + +def check_last_character(filepath, return_value): + last_line = get_last_line(filepath) + last_line_character = last_line[-1] + + # If return type is None and the last line has a semicolon OR the last thing is just the nil keyword OR last thing is a closing bracket + if return_value == 'None' and (last_line_character == ';' or last_line == 'nil' or last_line == '};'): + return True + elif return_value != 'None' and (last_line_character != ';' or last_line == '};'): + return True + else: + return False + + +def get_expected_last_line(last_line, return_value): + last_line_character = last_line[-1] + + if return_value == 'None': + # If last character is a letter or a number + if re.search(r'[A-Za-z0-9]', last_line_character): + return '{};'.format(last_line) + else: + return 'nil' + else: + if last_line_character == ';': + return last_line[:-1] + + return 'Unknown' + + +def main(): + print('Validating Return Types') + print('-----------------------') + + bad_files = [] + + files = get_files() + filtered_files = filter_files(files) + + for file_details in filtered_files: + filepath, return_value = file_details + + status = check_last_character(filepath, return_value) + + if not status: + bad_files.append( + [filepath, return_value, get_last_line(filepath)]) + + error_count = len(bad_files) + print('Found {} error(s)'.format(error_count)) + + for bad_file in bad_files: + filepath, return_value, last_line = bad_file + + expected_last_line = get_expected_last_line(last_line, return_value) + + print('\nERROR: In file {}'.format(filepath)) + print('Incorrect return type, expected `{}`'.format(return_value)) + print('Found line `{}`'.format(last_line)) + print('Expected line `{}`'.format(expected_last_line)) + + if error_count: + print('\nReturn Validation FAILED') + else: + print('\nReturn Validation PASSED') + + return error_count + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/search_unused_privates.py b/tools/search_unused_privates.py index d62db28e..6550178a 100644 --- a/tools/search_unused_privates.py +++ b/tools/search_unused_privates.py @@ -67,10 +67,10 @@ def popClosing(): if '_forEachIndex' in priv_declared: priv_declared.remove('_forEachIndex') if '_forEachIndex' in priv_use: priv_use.remove('_forEachIndex') - if '_foreachIndex' in priv_declared: priv_declared.remove('_foreachIndex') - if '_foreachIndex' in priv_use: priv_use.remove('_foreachIndex') - if '_foreachindex' in priv_declared: priv_declared.remove('_foreachindex') - if '_foreachindex' in priv_use: priv_use.remove('_foreachindex') + if '_forEachIndex' in priv_declared: priv_declared.remove('_forEachIndex') + if '_forEachIndex' in priv_use: priv_use.remove('_forEachIndex') + if '_forEachindex' in priv_declared: priv_declared.remove('_forEachindex') + if '_forEachindex' in priv_use: priv_use.remove('_forEachindex') unused = [] for s in priv_declared: diff --git a/tools/stringtable_validator.py b/tools/stringtable_validator.py index 55484730..01e79971 100644 --- a/tools/stringtable_validator.py +++ b/tools/stringtable_validator.py @@ -53,9 +53,16 @@ def check_stringtable(filepath): print(" ERROR: Package name attribute '{}' is all lowercase, should be in titlecase.".format(package_name)) errors += 1 - if package_name.lower() != os.path.basename(os.path.dirname(filepath)): - print(" ERROR: Package name attribute '{}' does not match the component folder name.".format(package_name)) - errors += 1 + component_folder_name = os.path.basename(os.path.dirname(filepath)) + + if package_name.lower() != component_folder_name: + parent_component_folder_name = os.path.basename(os.path.dirname(os.path.dirname(filepath))) + subcomponent_name = f"{parent_component_folder_name}_{component_folder_name}" + if package_name.lower() != subcomponent_name: + print(" ERROR: Package name attribute '{}' does not match any of component folder name '{}' and subcomponent '{}'.".format(package_name, component_folder_name, subcomponent_name)) + errors += 1 + else: + print(f" INFO: Detected subaddon '{subcomponent_name}' used in Package name attribute.") # Get all keys contained in the stringtable keys = package.findall("Key")