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

add CBA_fnc_createNamespace and CBA_fnc_deleteNamespace #260

Merged
merged 2 commits into from
Feb 13, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 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
24 changes: 24 additions & 0 deletions addons/common/fnc_createNamespace.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* ----------------------------------------------------------------------------
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"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCRIPT(createNamespace);

createLocation ["CBA_NamespaceDummy", [-1000, -1000, 0], 0, 0]
25 changes: 25 additions & 0 deletions addons/common/fnc_deleteNamespace.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* ----------------------------------------------------------------------------
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"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCRIPT(deleteNamespace);

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

deleteLocation _namespace;