Skip to content

Commit

Permalink
Use STRING macros (#6576)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wakbub authored and jonpas committed Dec 7, 2019
1 parent 30b4f3e commit 79e3de6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
20 changes: 10 additions & 10 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,14 @@ GVAR(deviceKeyHandlingArray) = [];
GVAR(deviceKeyCurrentIndex) = -1;

// Register localizations for the Keybinding categories
["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call CBA_fnc_registerKeybindModPrettyName;

["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"), {
["ACE3 Equipment", LLSTRING(ACEKeybindCategoryEquipment)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Common", LLSTRING(ACEKeybindCategoryCommon)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Weapons", LLSTRING(ACEKeybindCategoryWeapons)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Movement", LLSTRING(ACEKeybindCategoryMovement)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Scope Adjustment", LLSTRING(ACEKeybindCategoryScopeAdjustment)] call CBA_fnc_registerKeybindModPrettyName;
["ACE3 Vehicles", LLSTRING(ACEKeybindCategoryVehicles)] call CBA_fnc_registerKeybindModPrettyName;

["ACE3 Equipment", QGVAR(openDevice), LLSTRING(toggleHandheldDevice), {
[] call FUNC(deviceKeyFindValidIndex);
if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false};
[] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 3);
Expand All @@ -475,7 +475,7 @@ GVAR(deviceKeyCurrentIndex) = -1;
{false},
[0xC7, [false, false, false]], false] call CBA_fnc_addKeybind; //Home Key

["ACE3 Equipment", QGVAR(closeDevice), (localize "STR_ACE_Common_closeHandheldDevice"), {
["ACE3 Equipment", QGVAR(closeDevice), LLSTRING(closeHandheldDevice), {
[] call FUNC(deviceKeyFindValidIndex);
if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false};
[] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 4);
Expand All @@ -484,7 +484,7 @@ GVAR(deviceKeyCurrentIndex) = -1;
{false},
[0xC7, [false, true, false]], false] call CBA_fnc_addKeybind; //CTRL + Home Key

["ACE3 Equipment", QGVAR(cycleDevice), (localize "STR_ACE_Common_cycleHandheldDevices"), {
["ACE3 Equipment", QGVAR(cycleDevice), LLSTRING(cycleHandheldDevices), {
[1] call FUNC(deviceKeyFindValidIndex);
if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false};
private _displayName = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 0);
Expand Down
2 changes: 1 addition & 1 deletion addons/concertina_wire/functions/fnc_deploy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ GVAR(deployPFH) = [{
} count WIRE_FAST;
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler;

[localize LSTRING(RollWire), "", ""] call EFUNC(interaction,showMouseHint);
[LLSTRING(RollWire), "", ""] call EFUNC(interaction,showMouseHint);

[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);

Expand Down
2 changes: 1 addition & 1 deletion addons/concertina_wire/functions/fnc_dismount.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private _delay = [45, 30] select ([_unit] call EFUNC(common,isEngineer) || {[_un
[_wire],
{(_this select 0) call FUNC(dismountSuccess)},
{},
localize LSTRING(UnrollWire),
LLSTRING(UnrollWire),
{true},
["isnotinside"]
] call EFUNC(common,progressBar);
8 changes: 4 additions & 4 deletions addons/rangecard/initKeybinds.sqf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
["ACE3 Equipment", QGVAR(RangeCardDialogKey), localize "STR_ACE_RangeCard_RangeCardDialogKey",
["ACE3 Equipment", QGVAR(RangeCardDialogKey), LLSTRING(RangeCardDialogKey),
{
// Conditions: canInteract, canShow
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
if (GVAR(RangeCardOpened)) exitWith {
closeDialog 0;
false
};
};
if !(call FUNC(canShow)) exitWith {false};
// Statement
false call FUNC(openRangeCard);
Expand All @@ -14,7 +14,7 @@
{false},
[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key)

["ACE3 Equipment", QGVAR(RangeCardCopyDialogKey), localize "STR_ACE_RangeCard_RangeCardCopyDialogKey",
["ACE3 Equipment", QGVAR(RangeCardCopyDialogKey), LLSTRING(RangeCardCopyDialogKey),
{
// Conditions: canInteract, canShowCopy
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
Expand All @@ -28,4 +28,4 @@
true
},
{false},
[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key)
[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key)
2 changes: 1 addition & 1 deletion addons/tripod/functions/fnc_adjust.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GVAR(adjustPFH) = [{

[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// add mouse button action and hint
[localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint);
[LLSTRING(Done), "", LLSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint);

_unit setVariable [QGVAR(Adjust), [
_unit, "DefaultAction",
Expand Down
2 changes: 1 addition & 1 deletion addons/yardage450/initKeybinds.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

["ACE3 Equipment", QGVAR(DistanceKey), localize "STR_ACE_Yardage450_PowerButtonKey",
["ACE3 Equipment", QGVAR(DistanceKey), LLSTRING(PowerButtonKey),
{
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
Expand Down
8 changes: 5 additions & 3 deletions docs/wiki/development/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ These macros are allowed but are not enforced.
Note that you need the strings in module `stringtable.xml` in the correct format:
`STR_ACE_<module>_<string>`
Example: `STR_Balls_Banana`
Example: `STR_ACE_Balls_Banana`
Script strings (still require `localize` to localize the string):
Script strings:
| Macro | Expands to |
| -------|---------|
|`LSTRING(banana)` | `"STR_ACE_balls_banana"` |
|`LLSTRING(banana)` | `localize "STR_ACE_balls_banana"` |
|`ELSTRING(leg,banana)` | `"STR_ACE_leg_banana"` |
|`LELSTRING(leg,banana)` | `localize "STR_ACE_leg_banana"` |
Config Strings (require `$` as first character):
Expand Down Expand Up @@ -299,7 +301,7 @@ call {
call {
if (/* condition */) then {
/* code */
};
};
};
};
```
Expand Down

0 comments on commit 79e3de6

Please sign in to comment.