-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
(#642) update kiska
- Loading branch information
Showing
56 changed files
with
1,651 additions
and
2,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBAP_fnc_addPerFrameHandler | ||
Description: | ||
A cheap imitation of CBAP_fnc_addPerFrameHandler that uses scheduled environment. | ||
The actual code to run (_function) will be executed in an unscheduled environment. | ||
Avoid using this. | ||
Parameters: | ||
0: _function <CODE> - The function you wish to execute. | ||
1: _delay <NUMBER> - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) | ||
2: _args <ANY> - Parameters passed to the function executing. This will be the same array every execution. (optional) | ||
Returns: | ||
_handle - A number representing the handle of the function. Use this to remove the handler. <NUMBER> | ||
Example: | ||
(begin example) | ||
_handle = [ | ||
{player sideChat format ["every frame! _this: %1", _this];}, | ||
0, | ||
["some","params",1,2,3] | ||
] call CBAP_fnc_addPerFrameHandler; | ||
(end) | ||
Author(s): | ||
Ansible2 | ||
---------------------------------------------------------------------------- */ | ||
if (["cba_common"] call KISKA_fnc_isPatchLoaded) exitWith { | ||
_this call CBA_fnc_addPerFrameHandler; | ||
}; | ||
|
||
params [ | ||
["_function", {}, [{}]], | ||
["_delay", 0, [0]], | ||
["_args", []] | ||
]; | ||
|
||
if (_function isEqualTo {}) exitWith {-1}; | ||
|
||
private _id = localNamespace getVariable ['CBAP_perFrameHandlerIdCount',0]; | ||
localNamespace setVariable ['CBAP_perFrameHandlerIdCount',_id + 1]; | ||
localNamespace setVariable ['CBAP_runPerFrameHandler_' + (str _id),true]; | ||
|
||
[_function,_delay,_args,_id] spawn { | ||
private _runVar = 'CBAP_runPerFrameHandler_' + (str _id); | ||
waitUntil { | ||
[ | ||
_function, | ||
_args | ||
] call CBAP_fnc_directCall; | ||
|
||
if (_delay > 0) then { | ||
sleep _delay; | ||
}; | ||
|
||
localNamespace getVariable [_runVar,false] | ||
}; | ||
}; | ||
|
||
|
||
_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBAP_fnc_removePerFrameHandler | ||
Description: | ||
A cheap imitation of CBAP_fnc_removePerFrameHandler that uses scheduled environment. | ||
Remove a handler that you have added using CBAP_fnc_addPerFrameHandler. | ||
Parameters: | ||
_handle - The function handle you wish to remove. <NUMBER> | ||
Returns: | ||
true if removed successful, false otherwise <BOOLEAN> | ||
Examples: | ||
(begin example) | ||
_handle = [{player sideChat format["every frame! _this: %1", _this];}, 0, ["some","params",1,2,3]] call CBA_fnc_addPerFrameHandler; | ||
sleep 10; | ||
[_handle] call CBA_fnc_removePerFrameHandler; | ||
(end) | ||
Author: | ||
Nou & Jaynus, donated from ACRE project code for use by the community; commy2 | ||
---------------------------------------------------------------------------- */ | ||
params [ | ||
["_handle", -1, [0]] | ||
]; | ||
|
||
[ | ||
{ | ||
params ["_handle"]; | ||
|
||
private _runningVar = 'CBAP_runPerFrameHandler_' + (str _handle); | ||
private _isRunning = localNamespace getVariable [_runningVar,false]; | ||
if (!_isRunning) exitWith { false }; | ||
|
||
localNamespace setVariable [_runningVar,nil]; | ||
true | ||
}, | ||
_handle | ||
] call CBAP_fnc_directCall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "KISKA GUI Colors.hpp" | ||
#include "KISKA GUI Grid.hpp" | ||
|
||
class KISKA_RscCloseButton : RscButtonMenu | ||
{ | ||
idc = -1; | ||
text = ""; | ||
x = KISKA_POS_X(7.5); | ||
y = KISKA_POS_Y(-10); | ||
w = KISKA_POS_W(1); | ||
h = KISKA_POS_H(1); | ||
colorText[] = KISKA_GREY_COLOR(0,1); | ||
colorActive[] = KISKA_GREY_COLOR(0,1); | ||
textureNoShortcut = "\A3\3den\Data\Displays\Display3DEN\search_END_ca.paa"; | ||
class ShortcutPos | ||
{ | ||
left = 0; | ||
top = 0; | ||
w = KISKA_POS_W(1); | ||
h = KISKA_POS_H(1); | ||
}; | ||
animTextureNormal = "#(argb,8,8,3)color(1,0,0,0.57)"; | ||
animTextureDisabled = ""; | ||
animTextureOver = "#(argb,8,8,3)color(1,0,0,0.57)"; | ||
animTextureFocused = ""; | ||
animTexturePressed = "#(argb,8,8,3)color(1,0,0,0.57)"; | ||
animTextureDefault = ""; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef KISKA_COLORS | ||
|
||
#define KISKA_COLORS 1 | ||
|
||
#define KISKA_PROFILE_BACKGROUND_COLOR(ALPHA)\ | ||
{\ | ||
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",\ | ||
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",\ | ||
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",\ | ||
ALPHA\ | ||
} | ||
|
||
#define KISKA_GREY_COLOR(PERCENT,ALPHA) {PERCENT,PERCENT,PERCENT,ALPHA} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef KISKA_GUI_GRID | ||
|
||
#define KISKA_GUI_GRID 1 | ||
|
||
#define KISKA_UI_GRID_X (0.5) | ||
#define KISKA_UI_GRID_Y (0.5) | ||
#define KISKA_UI_GRID_W (2.5 * pixelW * pixelGrid) | ||
#define KISKA_UI_GRID_H (2.5 * pixelH * pixelGrid) | ||
|
||
#define KISKA_POS_X(N) N * KISKA_UI_GRID_W + KISKA_UI_GRID_X | ||
#define KISKA_POS_Y(N) N * KISKA_UI_GRID_H + KISKA_UI_GRID_Y | ||
#define KISKA_POS_W(N) N * KISKA_UI_GRID_W | ||
#define KISKA_POS_H(N) N * KISKA_UI_GRID_H | ||
|
||
#define KISKA_GUI_TEXT_SIZE(MULTIPLIER) (pixelH * pixelGrid) * MULTIPLIER | ||
|
||
#endif |
Oops, something went wrong.