Skip to content

Commit

Permalink
Add translations, warning for no dead players
Browse files Browse the repository at this point in the history
  • Loading branch information
veteran29 committed Oct 25, 2024
1 parent aa7184b commit 3982a16
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 27 deletions.
21 changes: 10 additions & 11 deletions .hemtt/missions/test.Stratis/mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class EditorData
};
class Camera
{
pos[]={2115.6221,61.299213,5696.2256};
dir[]={-0.35770744,-0.57448208,-0.73621982};
up[]={-0.25105935,0.81851542,-0.51672125};
aside[]={-0.89945447,1.6298145e-09,0.43701831};
pos[]={2103.7285,49.199692,5677.5742};
dir[]={-0.24344152,-0.74140024,-0.6253494};
up[]={-0.26895773,0.67106307,-0.69089508};
aside[]={-0.93187869,-1.4901161e-08,0.36276996};
};
};
binarizationWanted=0;
Expand Down Expand Up @@ -124,18 +124,18 @@ class Mission
dataType="Object";
class PositionInfo
{
position[]={2095.22,6.6758265,5649.3877};
position[]={2093.6479,6.6836753,5649.085};
angles[]={0,3.8437212,0};
};
side="West";
flags=7;
class Attributes
{
name="zeus";
isPlayer=1;
};
id=75;
type="B_Soldier_SL_F";
atlOffset=4.7683716e-07;
class CustomAttributes
{
class Attribute0
Expand Down Expand Up @@ -173,7 +173,6 @@ class Mission
name="respawn_group";
};
id=74;
atlOffset=4.7683716e-07;
};
class Item1
{
Expand Down Expand Up @@ -345,11 +344,11 @@ class Mission
dataType="Logic";
class PositionInfo
{
position[]={2030.7878,6.2922206,5623.8281};
position[]={2030.788,6.292222,5623.8281};
};
id=83;
type="ModuleCurator_F";
atlOffset=-4.7683716e-07;
atlOffset=4.7683716e-07;
class CustomAttributes
{
class Attribute0
Expand All @@ -361,7 +360,7 @@ class Mission
class data
{
singleType="STRING";
value="";
value="zeus";
};
};
};
Expand Down Expand Up @@ -400,7 +399,7 @@ class Mission
class data
{
singleType="SCALAR";
value=2;
value=3;
};
};
};
Expand Down
12 changes: 6 additions & 6 deletions addons/respawn/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CfgVehicles {
class GVAR(moduleRespawn): Module_F {
scope = 2;

displayName = "$$$ RESPAWN $$$";
displayName = CSTRING(ModuleRespawn_DisplayName);
category = QUOTE(PREFIX);
icon = "\a3\Modules_f\data\iconRespawn_ca.paa";
portrait = "\a3\Modules_f\data\portraitRespawn_ca.paa";
Expand All @@ -29,7 +29,7 @@ class CfgVehicles {
class Attributes: AttributesBase {

class GVAR(applyTo): Combo {
displayName = "Apply to";
displayName = CSTRING(ModuleRespawn_Attribute_ApplyTo_DisplayName);

property = QGVAR(applyTo);
typeName = "NUMBER";
Expand All @@ -52,8 +52,8 @@ class CfgVehicles {
};

class GVAR(filter): EGVAR(common,codeSmall) {
displayName = "Filter units code";
tooltip = "\nparams [""_unit""]";
displayName = CSTRING(ModuleRespawn_Attribute_Filter_DisplayName);
tooltip = "params [""_unit""]";

property = QGVAR(filter);
defaultValue = "'true'";
Expand All @@ -64,8 +64,8 @@ class CfgVehicles {

class ModuleDescription: ModuleDescription {
description[] = {
"Synchronize the module with a trigger to respawn players of the selected side once it's activated.",
"List of the players can be filtered with optional condition code."
CSTRING(ModuleRespawn_Description_0),
CSTRING(ModuleRespawn_Description_1),
};
sync[] = {"EmptyDetector"};

Expand Down
27 changes: 17 additions & 10 deletions addons/respawn/functions/fnc_addZeusModules.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ if (isNil "zen_custom_modules_fnc_register" || !isMultiplayer) exitWith {};

LOG("Adding ZEN modules");

[ELSTRING(Main,Category), "Respawn side", {
private _iconRespawn = getText (configFile >> "CfgVehicles" >> QGVAR(moduleRespawn) >> "portrait");

[ELSTRING(Main,Category), LSTRING(ModuleRespawn_ZEN_Sides_DisplayName), {
[
"Respawn side",
LSTRING(ModuleRespawn_ZEN_Sides_DisplayName),
[
[
"SIDES",
"Sides to respawn",
LSTRING(ModuleRespawn_ZEN_Sides_AttributeSides_DisplayName),
[],
false
]
Expand All @@ -28,21 +30,26 @@ LOG("Adding ZEN modules");

private _players = allPlayers select {side group _x in _sides && !alive _x};

format ["Respawning %1 players", count _players] call CBA_fnc_notify;
format [LLSTRING(ModuleRespawn_Notification_RespawningMany), count _players] call CBA_fnc_notify;
[QGVAR(force), nil, _players] call CBA_fnc_targetEvent;
}
] call zen_dialog_fnc_create;
}, getText (configFile >> "CfgVehicles" >> QGVAR(moduleRespawn) >> "portrait")] call zen_custom_modules_fnc_register;
}, _iconRespawn] call zen_custom_modules_fnc_register;

[ELSTRING(Main,Category), "Respawn player", {
[ELSTRING(Main,Category), LSTRING(ModuleRespawn_ZEN_Player_DisplayName), {
private _deadPlayers = allPlayers select {!alive _x};
private _deadPlayersNames = _deadPlayers apply {format ["%1 (%2)", name _x, side group _x]};

if (_deadPlayers isEqualTo []) exitWith {
[objNull, LLSTRING(ModuleRespawn_Notification_NoDead)] call BIS_fnc_showCuratorFeedbackMessage;
};

[
"Respawn player",
LSTRING(ModuleRespawn_ZEN_Player_DisplayName),
[
[
"LIST",
"Dead players:",
LSTRING(ModuleRespawn_ZEN_Player_AttributeDead_DisplayName),
[
_deadPlayers,
_deadPlayersNames,
Expand All @@ -57,11 +64,11 @@ LOG("Adding ZEN modules");
_dialogValues params ["_selected"];
TRACE_1("",_dialogValues);

format ["Respawning %1", name _selected] call CBA_fnc_notify;
format [LLSTRING(ModuleRespawn_Notification_RespawningSingle), name _selected] call CBA_fnc_notify;

[QGVAR(force), nil, _selected] call CBA_fnc_targetEvent;
},
{},
_deadPlayers
] call zen_dialog_fnc_create;
}, getText (configFile >> "CfgVehicles" >> QGVAR(moduleRespawn) >> "portrait")] call zen_custom_modules_fnc_register;
}, _iconRespawn] call zen_custom_modules_fnc_register;
53 changes: 53 additions & 0 deletions addons/respawn/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,58 @@
<English>How much time must pass before player will respawn (if respawn is enabled).</English>
<Polish>Jak dużo czasu musi upłynąć by gracz mógł się odrodzić (jeśli odrodzenie jest włączone).</Polish>
</Key>
<Container name="Modules">
<Key ID="STR_AFM_Respawn_ModuleRespawn_DisplayName">
<English>Force respawn</English>
<Polish>Wymuś odrodzenie</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_Attribute_ApplyTo_DisplayName">
<English>Apply to</English>
<Polish>Zastosuj do</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_Attribute_Filter_DisplayName">
<English>Filter units code</English>
<Polish>Kod filtru jednostek</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_Description_0">
<English>Synchronize the module with a trigger to respawn players of the selected side once it's activated.</English>
<Polish>Zsynchronizuj moduł z triggerem aby odrodzić graczy po jego aktywacji.</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_Description_1">
<English>List of the players can be filtered with filter code.</English>
<Polish>Lista graczy może zostać odfiltrowana za pomocą kodu filtru.</Polish>
</Key>
<!---->
<Key ID="STR_AFM_Respawn_ModuleRespawn_ZEN_Sides_DisplayName">
<English>Respawn sides</English>
<Polish>Odródź strony</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_ZEN_Sides_AttributeSides_DisplayName">
<English>Sides to respawn</English>
<Polish>Strony do odrodzenia</Polish>
</Key>
<!-- -->
<Key ID="STR_AFM_Respawn_ModuleRespawn_ZEN_Player_DisplayName">
<English>Respawn player</English>
<Polish>Odródź gracza</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_ZEN_Player_AttributeDead_DisplayName">
<English>Dead players:</English>
<Polish>Martwi gracze:</Polish>
</Key>
<!-- -->
<Key ID="STR_AFM_Respawn_ModuleRespawn_Notification_RespawningSingle">
<English>Respawning %1</English>
<Polish>Odradzanie %1</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_Notification_RespawningMany">
<English>Respawning %1 players</English>
<Polish>Odradzanie %1 graczy</Polish>
</Key>
<Key ID="STR_AFM_Respawn_ModuleRespawn_Notification_NoDead">
<English>No dead players</English>
<Polish>Brak martwych graczy</Polish>
</Key>
</Container>
</Package>
</Project>

0 comments on commit 3982a16

Please sign in to comment.