Skip to content

Commit

Permalink
Merge pull request #260 from CBATeam/createNamespace
Browse files Browse the repository at this point in the history
add CBA_fnc_createNamespace and CBA_fnc_deleteNamespace
  • Loading branch information
Killswitch00 committed Feb 13, 2016
2 parents ed9ce99 + ba97fbd commit f5ac24b
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
12 changes: 12 additions & 0 deletions addons/common/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class CfgFunctions
description = "Creates a marker all at once.";
file = "\x\cba\addons\common\fnc_createMarker.sqf";
};
// CBA_fnc_createNamespace
class createNamespace
{
description = "Creates a namespace. Used to store and read variables via setVariable and getVariable.";
file = "\x\cba\addons\common\fnc_createNamespace.sqf";
};
// CBA_fnc_createTrigger
class createTrigger
{
Expand All @@ -105,6 +111,12 @@ class CfgFunctions
description = "A function used to delete entities";
file = "\x\cba\addons\common\fnc_deleteEntity.sqf";
};
// CBA_fnc_deleteNamespace
class deleteNamespace
{
description = "Deletes a namespace created with CBA_fnc_createNamespace.";
file = "\x\cba\addons\common\fnc_deleteNamespace.sqf";
};
// CBA_fnc_determineMuzzles
class determineMuzzles
{
Expand Down
13 changes: 13 additions & 0 deletions addons/common/CfgLocationTypes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

class CfgLocationTypes {
class CBA_NamespaceDummy {
name = "";
drawStyle = "name";
texture = "";
color[] = {0,0,0,0};
size = 0;
textSize = 0;
shadow = 0;
font = "PuristaMedium";
};
};
1 change: 1 addition & 0 deletions addons/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CfgPatches {
#include "CfgFunctions.hpp"
#include "CfgPerFrame.hpp"
#include "CfgRemoteExec.hpp"
#include "CfgLocationTypes.hpp"

class CBA_DirectCall {
class dummy;
Expand Down
25 changes: 25 additions & 0 deletions addons/common/fnc_createNamespace.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* ----------------------------------------------------------------------------
Function: CBA_fnc_createNamespace
Description:
Creates a namespace. Used to store and read variables via setVariable and getVariable.
The Namespace is destroyed after the mission ends. getVariable ARRAY is not supported.
Parameters:
None
Returns:
_namespace - a namespace <LOCATION>
Examples:
(begin example)
_namespace = call CBA_fnc_createNamespace;
(end)
Author:
commy2
---------------------------------------------------------------------------- */
#include "script_component.hpp"
SCRIPT(createNamespace);

createLocation ["CBA_NamespaceDummy", [-1000, -1000, 0], 0, 0]
26 changes: 26 additions & 0 deletions addons/common/fnc_deleteNamespace.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* ----------------------------------------------------------------------------
Function: CBA_fnc_deleteNamespace
Description:
Deletes a namespace created with CBA_fnc_createNamespace.
Parameters:
_namespace - a namespace <LOCATION>
Returns:
None
Examples:
(begin example)
_namespace call CBA_fnc_deleteNamespace;
(end)
Author:
commy2
---------------------------------------------------------------------------- */
#include "script_component.hpp"
SCRIPT(deleteNamespace);

params [["_namespace", locationNull, [locationNull]]];

deleteLocation _namespace;

0 comments on commit f5ac24b

Please sign in to comment.