Files
Clarksons_Logi_Framework/eventHandlers/fn_registerClientEvents.sqf
T

102 lines
2.0 KiB
Plaintext
Raw Normal View History

/*
// Handler for reacting to a supply vehicle creation, thus creating the required interactable actions on that vehicle
[
"CLF_SupplyVehicleCreated",
{
params ["_vehicle"];
[_vehicle] call CLF_fnc_initSupplyVehicleInteractions;
}
] call CBA_fnc_addEventHandler;
// Handler for reacting to a supply depot creation, thus creating the required interactable actions on that depot
[
"CLF_SupplyDepotCreated",
{
params ["_depot"];
[_depot] call CLF_fnc_initSupplyDepotInteractions;
}
] call CBA_fnc_addEventHandler;
*/
// Handler for confirming construction of a vehicle at a factory for the client
[
"CLF_ConfirmFactoryVehicleClient",
{
params ["_hq", "_vehicle", "_cost", "_buildTime", "_player"];
[_hq, _vehicle, _cost, _buildTime, _player] call CLF_fnc_factoryBuildConfirmClient;
}
] call CBA_fnc_addEventHandler;
// Handler for displaying a message local to one player. Message can be SUCCESS (0), WARNING (1), ALERT (2), or INFO (3) with different appearances based on message type
[
"CLF_ShowMessage",
{
params ["_type", "_size", "_message"];
private _fontsize = "";
private _ypos = "";
private _prefix = "";
private _color = "";
switch (_size) do {
case 0: {
_fontsize = 1;
_ypos = 0.3
};
case 1: {
_fontsize = 0.8;
_ypos = 0.65
};
default {
_fontsize = 0.8;
_ypos = 0.65
};
};
switch (_type) do {
case 0: {
_prefix = "SUCCESS";
_color = "#00FF00";
};
case 1: {
_prefix = "WARNING";
_color = "#FFFF00";
};
case 2: {
_prefix = "ALERT";
_color = "#FF0000";
};
case 3: {
_prefix = "INFO";
_color = "#5979FF";
};
default {
_prefix = "INFO";
_color = "#5979FF";
};
};
[
format [
"<t size='%1', align='center'><t color='%2'>%3</t>: %4</t>",
_fontsize,
_color,
_prefix,
_message
],
0, // X position (centre)
_ypos, // Y position
4, // duration
0.3 // fade time
] spawn BIS_fnc_dynamicText;
}
] call CBA_fnc_addEventHandler;