-
Notifications
You must be signed in to change notification settings - Fork 0
/
behavior.js
51 lines (40 loc) · 1.82 KB
/
behavior.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"use strict";
{
const SDK = self.SDK;
////////////////////////////////////////////
// The behavior ID is how Construct identifies different kinds of behaviors.
// *** NEVER CHANGE THE BEHAVIOR ID! ***
// If you change the behavior ID after releasing the behavior, Construct will think it is an entirely different
// behavior and assume it is incompatible with the old one, and YOU WILL BREAK ALL EXISTING PROJECTS USING THE BEHAVIOR.
// Only the behavior name is displayed in the editor, so to rename your behavior change the name but NOT the ID.
// If you want to completely replace a behavior, make it deprecated (it will be hidden but old projects keep working),
// and create an entirely new behavior with a different behavior ID.
const BEHAVIOR_ID = "maurovanetti_TwoDotFiveD";
////////////////////////////////////////////
const BEHAVIOR_VERSION = "1.0.0.0";
const BEHAVIOR_CATEGORY = "general";
const BEHAVIOR_CLASS = SDK.Behaviors.maurovanetti_TwoDotFiveD = class MyCustomBehavior extends SDK.IBehaviorBase
{
constructor()
{
super(BEHAVIOR_ID);
SDK.Lang.PushContext("behaviors." + BEHAVIOR_ID.toLowerCase());
this._info.SetName(self.lang(".name"));
this._info.SetDescription(self.lang(".description"));
this._info.SetVersion(BEHAVIOR_VERSION);
this._info.SetCategory(BEHAVIOR_CATEGORY);
this._info.SetAuthor("Mauro Vanetti");
this._info.SetHelpUrl(self.lang(".help-url"));
this._info.SetIsOnlyOneAllowed(true);
SDK.Lang.PushContext(".properties");
this._info.SetProperties([
new SDK.PluginProperty("check", "locked", false),
new SDK.PluginProperty("text", "image-point", "0"),
new SDK.PluginProperty("float", "delta-z", 50.0)
]);
SDK.Lang.PopContext(); // .properties
SDK.Lang.PopContext();
}
};
BEHAVIOR_CLASS.Register(BEHAVIOR_ID, BEHAVIOR_CLASS);
}