Skip to content

Commit

Permalink
Merge pull request #518 from CBATeam/use-new-logn-macros
Browse files Browse the repository at this point in the history
use FORMAT log_N macros where possible
  • Loading branch information
Killswitch00 authored Oct 3, 2016
2 parents 98020cc + 7c73294 commit d402055
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions addons/keybinding/fnc_addKeybind.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ if (_tooltip isEqualTo "") then {
};

if (count _defaultKeybind == 4) then {
_msg = format ["%1: %2 - Wrong format for the default keybind parameter. Use [DIK, [shift, ctrl, alt]]", _modName, _actionId];
WARNING(_msg);
WARNING_2("%1: %2 - Wrong format for the default keybind parameter. Use [DIK, [shift, ctrl, alt]]",_modName,_actionId);
_modifiers=[_defaultKeybind select 1, _defaultKeybind select 2, _defaultKeybind select 3];
_defaultKeybind = [_defaultKeybind select 0, _modifiers];
};
Expand Down
6 changes: 2 additions & 4 deletions addons/settings/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ if (isServer) then {
params ["_setting", "_value", ["_forced", false, [false]]];

if ([_setting, "mission"] call FUNC(isForced)) exitWith {
private _message = format ["Setting %1 already forced, ignoring setSettingMission.", str _setting];
LOG(_message);
LOG_1("Setting %1 already forced, ignoring setSettingMission.",str _setting);
};
if (!([_setting, _value] call FUNC(check))) exitWith {
private _message = format ["Value %1 is invalid for setting %2.", _value, str _setting];
WARNING(_message);
WARNING_2("Value %1 is invalid for setting %2.",_value,str _setting);
};

GVAR(missionSettings) setVariable [_setting, [_value, _forced]];
Expand Down
3 changes: 1 addition & 2 deletions addons/settings/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ if (!isNil "_settingInfo") then {
if !([_setting, _value] call FUNC(check)) then {
_value = [_setting, "default"] call FUNC(get);
[_setting, _value, _forced, "client"] call FUNC(set);
private _message = format ["Invalid value for setting %1. Fall back to default value.", str _setting];
WARNING(_message);
WARNING_1("Invalid value for setting %1. Fall back to default value.",str _setting);
};

GVAR(clientSettings) setVariable [_setting, [_value, _forced]];
Expand Down
6 changes: 2 additions & 4 deletions addons/settings/fnc_parse.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ private _result = [];
private _currentValue = [_setting, "default"] call FUNC(get);

if (isNil "_currentValue") then {
private _message = format ["Error parsing settings file. Setting %1 does not exist.", str _setting];
ERROR(_message);
ERROR_1("Error parsing settings file. Setting %1 does not exist.",str _setting);
} else {
if ([_setting, _value] call FUNC(check)) then {
_result pushBack [_setting, _value, _force];
} else {
private _message = format ["Error parsing settings file. Value %1 is invalid for setting %2.", _value, str _setting];
ERROR(_message);
ERROR_2("Error parsing settings file. Value %1 is invalid for setting %2.",_value,str _setting);
};
};
};
Expand Down
3 changes: 1 addition & 2 deletions addons/settings/fnc_set.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Author:
params [["_setting", "", [""]], "_value", ["_forced", nil, [false]], ["_source", "client", [""]]];

if (!isNil "_value" && {!([_setting, _value] call FUNC(check))}) exitWith {
private _message = format ["Value %1 is invalid for setting %2.", _value, str _setting];
WARNING(_message);
WARNING_2("Value %1 is invalid for setting %2.",_value,str _setting);
1
};

Expand Down

0 comments on commit d402055

Please sign in to comment.