Commit d0b8b3a1 authored by Jan Speichert's avatar Jan Speichert
Browse files

Old Clearchat Version

parent ca9f1ddc
/clearhud.sublime-workspace
/clearhud.sublime-project
This diff is collapsed.
This diff is collapsed.
#include "script_component.hpp"
class CfgPatches
{
class ADDON
{
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"clearchat_main"};
version = VERSION;
author[] = {"Soldia"};
authorUrl = URL;
};
};
PRELOAD_ADDONS;
#include "\userconfig\sol_clearchat\usersettings.hpp"
#include "cfg_action.hpp"
\ No newline at end of file
#define COMPONENT gui
#include "\sol\clearchat\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#include "\sol\clearchat\addons\main\script_macros.hpp"
\ No newline at end of file
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"CBA_main"};
VERSION_CONFIG;
};
};
\ No newline at end of file
#define COMPONENT main
#include "\sol\clearchat\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_MAIN
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_MAIN
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
#endif
#include "script_macros.hpp"
#include "\x\cba\addons\main\script_macros_common.hpp"
#ifndef PRELOAD_ADDONS
#define PRELOAD_ADDONS class CfgAddons \
{ \
class PreloadAddons \
{ \
class ADDON \
{ \
list[]={ QUOTE(ADDON) }; \
}; \
}; \
};
#endif
// local event handler naming macro
#define NO_DEDICATED if(isDedicated) exitWith { }
#define NO_CLIENT if(!isServer) exitWith { }
#define RGB_GREEN 0, 0.5, 0, 1
#define RGB_BLUE 0, 0, 1, 1
#define RGB_ORANGE 0.5, 0.5, 0, 1
#define RGB_RED 1, 0, 0, 1
#define RGB_YELLOW 1, 1, 0, 1
#define RGB_WHITE 1, 1, 1, 1
#define RGB_GRAY 0.5, 0.5, 0.5, 1
#define RGB_BLACK 0, 0, 0, 1
#define RGB_MAROON 0.5, 0, 0, 1
#define RGB_OLIVE 0.5, 0.5, 0, 1
#define RGB_NAVY 0, 0, 0.5, 1
#define RGB_PURPLE 0.5, 0, 0.5, 1
#define RGB_FUCHSIA 1, 0, 1, 1
#define RGB_AQUA 0, 1, 1, 1
#define RGB_TEAL 0, 0.5, 0.5, 1
#define RGB_LIME 0, 1, 0, 1
#define RGB_SILVER 0.75, 0.75, 0.75, 1
#define CALLSTACK(functionName) functionName
#define CALLSTACK_NORETURN(functionName) functionName
#define DUMPSTACK
// #define CALLSTACK(functionName) {private ["_ret"]; ACRE_STACK_TRACE set [ACRE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACRE_CURRENT_FUNCTION, #functionName, _this]]; ACRE_STACK_DEPTH = ACRE_STACK_DEPTH + 1; ACRE_CURRENT_FUNCTION = #functionName; _ret = _this call functionName; ACRE_STACK_DEPTH = ACRE_STACK_DEPTH - 1; _ret;}
// #define CALLSTACK_NORETURN(functionName) {ACRE_STACK_TRACE set [ACRE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACRE_CURRENT_FUNCTION, #functionName, _this]]; ACRE_STACK_DEPTH = ACRE_STACK_DEPTH + 1; ACRE_CURRENT_FUNCTION = #functionName; _this call functionName; ACRE_STACK_DEPTH = ACRE_STACK_DEPTH - 1; true;}
// #define DUMPSTACK ([__FILE__, __LINE__] call ACRE_DUMPSTACK_FNC)
// COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp
#define MAINPREFIX sol
#define PREFIX clearchat
//--BUILDPREFIX
#include "\sol\clearchat\addons\main\script_version.hpp"
//--ENDBUILDPREFIX
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
#define VERSION_PLUGIN MAJOR.MINOR.PATCHLVL.BUILD
// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 1.01
\ No newline at end of file
#define MAJOR 1
#define MINOR 0
#define PATCHLVL 0
#define BUILD 300
#define BUILDDATE Mon, 31 Oct 2014 11:03:12 +0100
\ No newline at end of file
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_post_init));
};
};
\ No newline at end of file
#include "script_component.hpp"
#include "\userconfig\sol_clearchat\usersettings.hpp"
//For each client, register the keybind
[] call CALLSTACK(FUNC(registerKeybind));
//deactivate the chat by default in MP and assign it to a handle
if (isMultiplayer) then {
if(sol_clearchat_chatison) then{
GVAR(handle) = [{clearRadio;}, 0, []] call CBA_fnc_addPerFrameHandler;
GVAR(activated) = true;
hint parseText "Chat <t color='#ff0000'>disabled</t>";
};
};
\ No newline at end of file
#include "script_component.hpp"
ADDON = false;
//Prepare all functions
PREP(registerKeybind);
PREP(suppressChat);
//Dedicated Servers shall not pass!
NO_DEDICATED;
//Define a global variable, chat deactivated by default
if(isNil QGVAR(activated)) then {
GVAR(activated) = false;
};
ADDON = true;
\ No newline at end of file
#include "script_component.hpp"
class CfgPatches
{
class ADDON
{
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"clearchat_main"};
version = VERSION;
author[] = {"Soldia"};
authorUrl = URL;
};
};
PRELOAD_ADDONS;
#include "CfgEventHandlers.hpp"
\ No newline at end of file
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_addon", "_description", "_key", "_modifier", "_keybind"];
//define all parameters for the cba keybinding
_addon = "Soldias Chat Disabler";
_actionname = "Disable / Enable Chat";
_key = DIK_COMMA;
_modifier = [true, false, false];
//initiate the cba keybind, will return the current keybind
_keybind = [_addon, _actionname, {_this call clearchat_suppress_fnc_suppressChat}, [_key, _modifier]] call CBA_fnc_registerKeybind;
true
\ No newline at end of file
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_status", "_handle", "_key", "_keybind", "_activated"];
PARAMS_5(_display,_dikCode,_shift,_ctrl,_alt);
//read the current status of chat deactivation (true = deactivated)
_status = GVAR(activated);
//local copy of the DIK Code to String Table and transform it to a hash
_diktable = uiNamespace getVariable QUOTE(CBA_keybinding_dikDecToStringTable);
_hash = [_diktable,0] call CBA_fnc_hashCreate;
_key = [_hash, format ["%1", _dikCode]] call CBA_fnc_hashGet;
//create several strings for the current variables
if (_status) then {
_activated = parseText "<t color='#00ff00'>enabled</t>";
[GVAR(handle)] call CBA_fnc_removePerFrameHandler;
_status = false;
} else {
_activated = parseText "<t color='#ff0000'>disabled</t>";
GVAR(handle) = [{clearRadio;}, 0, []] call CBA_fnc_addPerFrameHandler;
_status = true;
};
if (_shift) then {
_shift = "SHIFT + ";
} else {
_shift = "";
};
if (_ctrl) then {
_ctrl = "CTRL + ";
} else {
_ctrl = "";
};
if (_alt) then {
_alt = "ALT + ";
} else {
_alt = "";
};
_keybind = parseText format ["<t color='#FFA54F'>%1%2%3%4</t>",_shift,_ctrl,_alt,_key];
hint formatText ["The Chat is now %1.%2This can be changed by pressing %3",_activated,parseText "<br/>",_keybind];
GVAR(activated) = _status;
true
\ No newline at end of file
#define COMPONENT suppress
#include "\sol\clearchat\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#include "\sol\clearchat\addons\main\script_macros.hpp"
\ No newline at end of file
/*//////////////////////////////////////////////
// Save in UTF 8 / without BOM Π //
///////////////////////////////////////////////*/
/*//////////////////////////////////////////////
Settings for Soldias Chat Disabler
----------
//////////////////////////////////////////////*/
//The chat is initially suppressed. To change this behaviour add "//" in front of the next line
sol_clearchat_nochat = true;
//////////////////////////////////////////////*/
//All crosshair icons are disabled by default. To change this behaviour add "//" in front of the next line
#define CLEARCHAT_NOICONS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment