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

Advanced Equipment v0.5.2 final #329

Merged
merged 19 commits into from
Feb 10, 2023
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 AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Wasserstoff
# CONTRIBUTORS
Bilibagga (Russian translation)
PowerBOXx (Simplified Chinese Translation)
alexisdu7589 (French translation)
4 changes: 2 additions & 2 deletions addons/armaos/CfgGames.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class CfgGames
class snake : OsFunction
{
path = "/games/snake";
description = "Retro Snake Game";
man = "Retro Snake Game - use option --big for doubled block size";
description = "$STR_AE3_ArmaOS_Config_CommandSnakeDescr";
man = "$STR_AE3_ArmaOS_Config_CommandSnakeMan";
code = "_this call AE3_armaos_fnc_games_snake";
};
};
12 changes: 6 additions & 6 deletions addons/armaos/functions/fnc_games_snake.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_size", "", "big", "bool", false, false, "increases the pixel size"]
["_size", "", "big", "bool", false, false, localize "STR_AE3_ArmaOS_CommandHelp_Snake_size"]
];
private _commandSyntax =
[
Expand Down Expand Up @@ -155,11 +155,11 @@ while { _dialog getVariable "AE3_Retro_Snake_Running" } do
_head params ["_x", "_y"];

// if snake is out of canvas bounds then game over
if ((_x < 0) || (_y < 0) || (_x == _width) || (_y == _height)) then { _dialog setVariable ["AE3_Retro_Snake_Running", false]; [_computer, "Fallen. Game over!"] call AE3_armaos_fnc_shell_stdout; break; };
if ((_x < 0) || (_y < 0) || (_x == _width) || (_y == _height)) then { _dialog setVariable ["AE3_Retro_Snake_Running", false]; [_computer, localize "STR_AE3_ArmaOS_Result_Fallen"] call AE3_armaos_fnc_shell_stdout; break; };

// if snake collides with itself then game over
private _findResult = _snake find _head;
if (_findResult != ((count _snake) - 1)) then { _dialog setVariable ["AE3_Retro_Snake_Running", false]; [_computer, "Bitten. Game over!"] call AE3_armaos_fnc_shell_stdout; break; };
if (_findResult != ((count _snake) - 1)) then { _dialog setVariable ["AE3_Retro_Snake_Running", false]; [_computer, localize "STR_AE3_ArmaOS_Result_Bitten"] call AE3_armaos_fnc_shell_stdout; break; };

// draw pixel at new head pos
[_dialog, _x, _y, [1,1,1,1]] call AE3_armaos_fnc_retro_setPixelColor;
Expand Down Expand Up @@ -213,6 +213,6 @@ private _stopTime = time;

private _duration = _stopTime - _startTime;

[_computer, format ["snake length: %1", (count _snake)]] call AE3_armaos_fnc_shell_stdout;
[_computer, format ["speed level: %1", _speed]] call AE3_armaos_fnc_shell_stdout;
[_computer, format ["duration: %1 s", _duration]] call AE3_armaos_fnc_shell_stdout;
[_computer, format [localize "STR_AE3_ArmaOS_Result_SnakeLength", (count _snake)]] call AE3_armaos_fnc_shell_stdout;
[_computer, format [localize "STR_AE3_ArmaOS_Result_SnakeSpeedlevel", _speed]] call AE3_armaos_fnc_shell_stdout;
[_computer, format [localize "STR_AE3_ArmaOS_Result_SnakeDuration", _duration]] call AE3_armaos_fnc_shell_stdout;
2 changes: 1 addition & 1 deletion addons/armaos/functions/fnc_os_cat.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_numbered", "n", "number", "bool", false, false, "prints numbered output lines"]
["_numbered", "n", "number", "bool", false, false, localize "STR_AE3_ArmaOS_CommandHelp_Cat_numbered"]
];
private _commandSyntax =
[
Expand Down
2 changes: 1 addition & 1 deletion addons/armaos/functions/fnc_os_chown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
params ["_computer", "_options", "_commandName"];

private _commandOpts = [
["_recursive", "r", "recursive", "bool", false, false, "recursively changes owner"]
["_recursive", "r", "recursive", "bool", false, false, localize "STR_AE3_ArmaOS_CommandHelp_Chown_recursive"]
];
private _commandSyntax =
[
Expand Down
4 changes: 2 additions & 2 deletions addons/armaos/functions/fnc_os_crack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_mode", "m", "mode", "stringSelect", "", true, "sets the mode", ["bruteforce", "statistics"]],
["_algorithm", "a", "algorithm", "stringSelect", "caesar", false, "sets the algorithm", ["caesar"]]
["_mode", "m", "mode", "stringSelect", "", true, localize "STR_AE3_ArmaOS_CommandHelp_Crack_mode", ["bruteforce", "statistics"]],
["_algorithm", "a", "algorithm", "stringSelect", "caesar", false, localize "STR_AE3_ArmaOS_CommandHelp_Crack_algorithm", ["caesar"]]
];
private _commandSyntax =
[
Expand Down
6 changes: 3 additions & 3 deletions addons/armaos/functions/fnc_os_crypto.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_mode", "m", "mode", "stringSelect", "", true, "sets the mode", ["encrypt", "decrypt"]],
["_algorithm", "a", "algorithm", "stringSelect", "caesar", false, "sets the algorithm", ["caesar"]],
["_key", "k", "key", "string", "", true, "sets the key/password/pin"]
["_mode", "m", "mode", "stringSelect", "", true, localize "STR_AE3_ArmaOS_CommandHelp_Crypto_mode", ["encrypt", "decrypt"]],
["_algorithm", "a", "algorithm", "stringSelect", "caesar", false, localize "STR_AE3_ArmaOS_CommandHelp_Crypto_algorithm", ["caesar"]],
["_key", "k", "key", "string", "", true, localize "STR_AE3_ArmaOS_CommandHelp_Crypto_key"]
];
private _commandSyntax =
[
Expand Down
4 changes: 2 additions & 2 deletions addons/armaos/functions/fnc_os_echo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_backslashInterpretion", "e", "", "bool", false, false, "enables interpretation of backslash escapes"]
["_backslashInterpretion", "e", "", "bool", false, false, localize "STR_AE3_ArmaOS_CommandHelp_Echo_backslash"]
];
private _commandSyntax =
[
Expand All @@ -34,7 +34,7 @@ private _text = _ae3OptsThings joinString " ";

if (_backslashInterpretion) then
{
_text = _text splitString "\n";
_text = [_text, "\n", true] call BIS_fnc_splitString;
};

[_computer, _text] call AE3_armaos_fnc_shell_stdout;
8 changes: 4 additions & 4 deletions addons/armaos/functions/fnc_os_history.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_clear", "c", "", "bool", false, false, "clears the history list"],
["_deleteAtOffset", "d", "", "number", -1, false, "deletes a history entry at the given position offset"]
["_clear", "c", "", "bool", false, false, localize "STR_AE3_ArmaOS_CommandHelp_History_clear"],
["_deleteAtOffset", "d", "", "number", -1, false, localize "STR_AE3_ArmaOS_CommandHelp_History_deleteAtOffset"]
];
private _commandSyntax =
[
Expand Down Expand Up @@ -44,7 +44,7 @@ if (_clear) exitWith
_terminalCommandHistory set [_username, _terminalCommandHistoryUser];
_terminal set ["AE3_terminalCommandHistory", _terminalCommandHistory];

[_computer, "history cleared"] call AE3_armaos_fnc_shell_stdout;
[_computer, localize "STR_AE3_ArmaOS_Result_HistoryCleared"] call AE3_armaos_fnc_shell_stdout;
};

if ((_deleteAtOffset != -1) && (_deleteAtOffset != 0) && !(_deleteAtOffset > (count _terminalCommandHistoryUser))) exitWith
Expand All @@ -53,7 +53,7 @@ if ((_deleteAtOffset != -1) && (_deleteAtOffset != 0) && !(_deleteAtOffset > (co
_terminalCommandHistory set [_username, _terminalCommandHistoryUser];
_terminal set ["AE3_terminalCommandHistory", _terminalCommandHistory];

[_computer, format ["history element at index %1 deleted", _deleteAtOffset]] call AE3_armaos_fnc_shell_stdout;
[_computer, format [localize "STR_AE3_ArmaOS_Result_HistoryElementDeleted", _deleteAtOffset]] call AE3_armaos_fnc_shell_stdout;
};

private _numberedHistory = [];
Expand Down
2 changes: 1 addition & 1 deletion addons/armaos/functions/fnc_os_ls.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ params ["_computer", "_options", "_commandName"];

private _commandOpts =
[
["_long", "l", "long", "bool", false, false, "prints folder content in long form"]
["_long", "l", "long", "bool", false, false, localize "STR_AE3_ArmaOS_CommandHelp_Ls_long"]
];
private _commandSyntax =
[
Expand Down
6 changes: 3 additions & 3 deletions addons/armaos/functions/fnc_shell_getOpts.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ _resultOpts set ["_ae3OptsSuccess", true];

private _missingOptions =
[
format ["Command option '%1' missing!", _y select 0],
format ["Help: %1", _y select 1]
format [localize "STR_AE3_ArmaOS_Result_GetOpts_MissingOpt", _y select 0],
format [localize "STR_AE3_ArmaOS_Result_GetOpts_Help", _y select 1]
];

[_computer, _missingOptions] call AE3_armaos_fnc_shell_stdout;
Expand All @@ -105,7 +105,7 @@ private _syntaxMatch = [_commandSyntax, _resultThings] call AE3_armaos_fnc_shell
if (!_syntaxMatch) then
{
_resultOpts set ["_ae3OptsSuccess", false];
[_computer, format ["Syntax mismatch! See output of '%1 -h' for allowed syntax.", _commandName]] call AE3_armaos_fnc_shell_stdout;
[_computer, format [localize "STR_AE3_ArmaOS_Result_GetOpts_SyntaxMismatch", _commandName]] call AE3_armaos_fnc_shell_stdout;
};

_result = _resultOpts toArray false; // Convert HashMap to Array
Expand Down
6 changes: 3 additions & 3 deletions addons/armaos/functions/fnc_shell_getOptsPrintHelp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private _commandOpts = _commandSettings select 1;
private _commandSyntax = _commandSettings select 2;

// print command syntax to stdout
[_computer, ["COMMAND SYNTAX", ""]] call AE3_armaos_fnc_shell_stdout;
[_computer, [localize "STR_AE3_ArmaOS_Result_GetOpts_CommandSyntax", ""]] call AE3_armaos_fnc_shell_stdout;
{
private _commandSyntaxString = "";
private _commandSyntaxVariant = _x;
Expand All @@ -44,7 +44,7 @@ private _commandSyntax = _commandSettings select 2;
[_computer, ""] call AE3_armaos_fnc_shell_stdout;

// print command options to stdout
[_computer, ["COMMAND OPTIONS", ""]] call AE3_armaos_fnc_shell_stdout;
[_computer, [localize "STR_AE3_ArmaOS_Result_GetOpts_CommandOptionen", ""]] call AE3_armaos_fnc_shell_stdout;
{
private _shortOpt = _x select 1;
private _longOpt = _x select 2;
Expand All @@ -65,5 +65,5 @@ private _commandSyntax = _commandSettings select 2;
} forEach _commandOpts;

// also add the help option to every command help output
private _result = format ["%1 : %2", "-h/--help", "display this help and exit"];
private _result = format ["%1 : %2", "-h/--help", localize "STR_AE3_ArmaOS_CommandHelp_GetOpts_help"];
[_computer, _result] call AE3_armaos_fnc_shell_stdout;
2 changes: 1 addition & 1 deletion addons/armaos/functions/fnc_terminal_getAllowedKeysFR.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private _allowedKeys = createHashMapFromArray
[format ["%1-%2-%3-%4", DIK_NUMPADSLASH, false, false, false], "/"],
[format ["%1-%2-%3-%4", DIK_ADD, false, false, false], "+"],
[format ["%1-%2-%3-%4", DIK_SUBTRACT, false, false, false], "-"],
[format ["%1-%2-%3-%4", DIK_DECIMAL, false, false, false], ","]
[format ["%1-%2-%3-%4", DIK_DECIMAL, false, false, false], "."]
];

_allowedKeys
2 changes: 1 addition & 1 deletion addons/armaos/functions/fnc_terminal_getAllowedKeysUS.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private _allowedKeys = createHashMapFromArray
[format ["%1-%2-%3-%4", DIK_NUMPADSLASH, false, false, false], "/"],
[format ["%1-%2-%3-%4", DIK_ADD, false, false, false], "+"],
[format ["%1-%2-%3-%4", DIK_SUBTRACT, false, false, false], "-"],
[format ["%1-%2-%3-%4", DIK_DECIMAL, false, false, false], ","]
[format ["%1-%2-%3-%4", DIK_DECIMAL, false, false, false], "."]
];

_allowedKeys
Loading