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

tweak ERROR(), 'CBA_fnc_error' #480

Merged
merged 1 commit into from
Aug 22, 2016
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
12 changes: 10 additions & 2 deletions addons/diagnostic/fnc_error.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Internal Function: CBA_fnc_error
Description:
Logs an error message to the RPT log.

Should not be used directly, but rather via macros (<ERROR_WITH_TITLE()>
Should not be used directly, but rather via macros (<ERROR()>, <ERROR_WITH_TITLE()>
or the <Assertions>).

Parameters:
Expand Down Expand Up @@ -49,7 +49,15 @@ disableSerialization;
QGVAR(Error) cutRsc [QGVAR(Error), "PLAIN"];
private _control = uiNamespace getVariable QGVAR(Error);

private _compose = [lineBreak, parseText format ["<t align='center' size='1.65'>[%1] (%2) %3<\t>", _prefix, _component, _title], lineBreak];
if (_message isEqualTo "") then {
_lines = [_title];
_title = "ERROR";
};

private _compose = [lineBreak, parseText format [
"<img align='center' size='1.65' image='\a3\3DEN\Data\Displays\Display3DEN\EntityMenu\functions_ca.paa' /><t align='center' size='1.65'>[%1] (%2) %3<\t>",
_prefix, _component, _title
], lineBreak];

{
_compose append [lineBreak, format [" %1", _x]];
Expand Down
2 changes: 0 additions & 2 deletions addons/diagnostic/fnc_log.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Description:
Logs a message to the RPT log.

Should not be used directly, but rather via macro (<LOG()>).
This function is unaffected by the debug level (<DEBUG_MODE_x>).

Parameters:
_message - Message <STRING>
Expand All @@ -16,7 +15,6 @@ Returns:
Author:
Spooner, Rommel, commy2
-----------------------------------------------------------------------------*/
#define DEBUG_MODE_NORMAL
#include "script_component.hpp"
SCRIPT(log);

Expand Down
6 changes: 3 additions & 3 deletions addons/diagnostic/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RscStructuredText;
class RscTitles {
class GVAR(Error) {
idd = -1;
duration = 5;
duration = 10;
fadeIn = 0;
fadeOut = 0.5;
movingEnable = 0;
Expand All @@ -16,10 +16,10 @@ class RscTitles {
font = "RobotoCondensedBold";
sizeEx = 0.55 * GUI_GRID_CENTER_H;
x = 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X;
y = 0 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y;
y = 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y;
w = 40 * GUI_GRID_CENTER_W;
h = 10 * GUI_GRID_CENTER_H;
colorBackground[] = {1,0.4,0,0.8};
colorBackground[] = {1,0.2,0,0.8};
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/main/script_macros_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Macro: ERROR()
Author:
Spooner
------------------------------------------- */
#define ERROR(MESSAGE) LOG_SYS_FILELINENUMBERS('ERROR',MESSAGE)
#define ERROR(MESSAGE) ['PREFIX', 'COMPONENT', MESSAGE, nil, __FILE__, __LINE__ + 1] call CBA_fnc_error

/* -------------------------------------------
Macro: ERROR_WITH_TITLE()
Expand Down