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

Add rules briefing section #91

Merged
merged 7 commits into from
Apr 4, 2024
Merged
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
1 change: 1 addition & 0 deletions addons/briefing/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\afsk\addons\briefing
15 changes: 15 additions & 0 deletions addons/briefing/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
1 change: 1 addition & 0 deletions addons/briefing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PREP(createRules);
10 changes: 10 additions & 0 deletions addons/briefing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "script_component.hpp"

// Killswitch
if (!EGVAR(common,enabled)) exitWith {};

if (hasInterface) then {
if (GVAR(rulesEnabled)) then {
call FUNC(createRules);
};
};
10 changes: 10 additions & 0 deletions addons/briefing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "script_component.hpp"
ADDON = false;
#include "XEH_PREP.hpp"

#include "initSettings.inc.sqf"

// Killswitch
if (!EGVAR(common,enabled)) exitWith {};

ADDON = true;
2 changes: 2 additions & 0 deletions addons/briefing/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"
18 changes: 18 additions & 0 deletions addons/briefing/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"afsk_common"
};
author = "ArmaForces";
VERSION_CONFIG;
};
};


#include "CfgEventHandlers.hpp"
36 changes: 36 additions & 0 deletions addons/briefing/functions/fnc_createRules.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "script_component.hpp"
/*
* Author: 3Mydlo3
*
* Creates rules briefing.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/

#define DIARY_NAME "skDiary"

params [["_unit", player]];

_unit createDiarySubject [DIARY_NAME, LELSTRING(main,Category)];

private _listSeparator = "<br/>- ";
private _generalRulesList = [
LLSTRING(Rules_1),
LLSTRING(Rules_2),
LLSTRING(Rules_3),
LLSTRING(Rules_4),
LLSTRING(Rules_5),
LLSTRING(Rules_6),
LLSTRING(Rules_7),
LLSTRING(Rules_8)
] joinString _listSeparator;

private _generalRulesText = format ["%1%2%3", LLSTRING(Rules), _listSeparator, _generalRulesList];

_unit createDiaryRecord [DIARY_NAME, [LLSTRING(Rules), _generalRulesText]];
1 change: 1 addition & 0 deletions addons/briefing/functions/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "\z\afsk\addons\briefing\script_component.hpp"
10 changes: 10 additions & 0 deletions addons/briefing/initSettings.inc.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
QGVAR(rulesEnabled),
"CHECKBOX",
[LSTRING(RulesEnabled), LSTRING(RulesEnabled_Description)],
[LSTRING(DisplayName)],
true,
true,
{},
true
] call CBA_fnc_addSetting;
14 changes: 14 additions & 0 deletions addons/briefing/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#define COMPONENT briefing
#include "\z\afsk\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE

#ifdef DEBUG_ENABLED_BRIEFING
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_BRIEFING
#define DEBUG_SETTINGS DEBUG_SETTINGS_BRIEFING
#endif

#include "\z\afsk\addons\main\script_macros.hpp"
53 changes: 53 additions & 0 deletions addons/briefing/stringtable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="AFSK">
<Package name="Briefing">
<Key ID="STR_AFSK_Briefing_DisplayName">
<English>SerialKillers - Briefing</English>
<Polish>SerialKillers - Odprawa</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_RulesEnabled">
<English>Enable rules</English>
<Polish>Włącz zasady</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_RulesEnabled_Description">
<English>If enabled, suggested rules will be visible on the map in "SerialKillers" briefing section.</English>
<Polish>Jeżeli włączone, proponowane zasady będą widoczne na odprawnie na mapie w zakładce "SerialKillers".</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules">
<English>Rules</English>
<Polish>Zasady</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_1">
<English>Cops are not allowed to use terrorist stashes/weapons. They may only use radios they find after neutralizing a terrorist.</English>
<Polish>Policjanci nie mogą używać broni terrorystów ani skrytek z bronią. Mogą używać jedynie radia, które znajdą przy zneutralizowanym terroryście.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_2">
<English>Cops are not allowed to kill, hurt or harm civilians in any other way without certainty that this is a terrorist. They may not use civilian vehicles either.</English>
<Polish>Policjanci nie mogą zabijać ani krzywdzić cywili w żaden sposób bez pewności, że to terrorysta. Nie mogą również używać cywilnych pojazdów.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_3">
<English>Cops are not allowed to sit in jail nor obstruct it in any way. They may only check if a prisoner is there, without moving him, they must leave immediately afterwards.</English>
<Polish>Policjanci nie mogą siedzieć w więzieniu ani blokować wejścia do niego. Mogą jedynie sprawdzić czy więzień tam jest, bez przemieszczania go i muszą opuścić więzienie natychmiast po sprawdzeniu.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_4">
<English>Only 1 police helicopter is allowed, with the same dedicated crew.</English>
<Polish>Tylko 1 policyjny helikopter jest dozwolony, z tą samą dedykowaną załogą.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_5">
<English>Terrorists should not use any cops-dedicated functionalities within police stations.</English>
<Polish>Terroryści nie powinni używać funkcjonalności przeznaczonych dla policjantów w obrębie komisariatów.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_6">
<English>Terrorists are responsible for everyone's fun. Make it so the police doesn't die of boredom.</English>
<Polish>Terroryści są odpowiedzialni za zabawę wszystkich grających. Grajcie tak, żeby policja nie umarła z nudów.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_7">
<English>Driving off-road is allowed only when having off-road vehicle. Despite that, do not hide in forests/remote areas on purpose, as it's not fun.</English>
<Polish>Jeżdżenie poza drogami (off-road) jest dozwolone tylko w pojazdach terenowych. Nie ukrywaj się po lasach i odległych miejscach, to nie jest fajna zabawa.</Polish>
</Key>
<Key ID="STR_AFSK_Briefing_Rules_8">
<English>Using vehicles as kamikaze kinetic projectiles is strictly forbidden due to how arma works, and it's not fun anyway.</English>
<Polish>Używanie pojazdów jako pocisków kinetycznych do kamikadze jest zabronione ze względu na to jak działa arma, do tego nie jest to fajna zabawa.</Polish>
</Key>
</Package>
</Project>