Skip to content

Commit 157046b

Browse files
committed
Fixed a few issues with editor side, added new plugin prop enum, start of behavior support
1 parent 93f7a1e commit 157046b

File tree

12 files changed

+114
-92
lines changed

12 files changed

+114
-92
lines changed

build/generateAddonJSON.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ function addonFromConfig() {
4545
description: config.description,
4646
"editor-scripts": ["editor.js"],
4747
"file-list": [
48-
"c3runtime/plugin.js",
49-
"c3runtime/type.js",
50-
"c3runtime/instance.js",
51-
"c3runtime/expressions.js",
52-
"c3runtime/conditions.js",
53-
"c3runtime/actions.js",
48+
"c3runtime/main.js",
5449
"lang/en-US.json",
5550
"aces.json",
5651
"addon.json",

build/generateEmptyFiles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fromConsole from "./fromConsole.js";
33
import * as chalkUtils from "./chalkUtils.js";
44

55
export default function generateEmptyFiles() {
6+
return false;
67
// C3 needs these files to exist for some reason, so make empty ones
78
const emptyFiles = [
89
"actions.js",

build/schemas.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ const propertySchema = Joi.object({
195195
});
196196

197197
const configSchema = Joi.object({
198-
addonType: Joi.string().valid("plugin", "behavior", "effect").required(),
198+
addonType: Joi.string()
199+
.valid("plugin", "behavior" /* , "effect" */)
200+
.required(),
199201
type: Joi.string().valid("world", "object", "dom").required(),
200202
id: Joi.string().token().required(),
201203
name: Joi.string().required(),
@@ -268,6 +270,7 @@ const configSchema = Joi.object({
268270
CanBeBundled: Joi.boolean().default(true),
269271
IsDeprecated: Joi.boolean().default(false),
270272
GooglePlayServicesEnabled: Joi.boolean().default(false),
273+
IsOnlyOneAllowed: Joi.boolean().default(false),
271274
}).required(),
272275
AddCommonACEs: Joi.object({
273276
Position: Joi.boolean().default(false),

build/vite_domside_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
rollupOptions: {
77
preserveEntrySignatures: "strict",
88
input: {
9-
domside: "../src/domside/index.js",
9+
domside: "../template/domside.js",
1010
},
1111
output: {
1212
entryFileNames: "[name].js",

build/vite_export_config2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
rollupOptions: {
77
preserveEntrySignatures: "strict",
88
input: {
9-
"c3runtime/plugin": "../template/main.js",
9+
"c3runtime/main": "../template/main.js",
1010
},
1111
output: {
1212
entryFileNames: "[name].js",

config.caw.js

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { ADDON_CATEGORY, ADDON_TYPE, PLUGIN_TYPE } from "./template/enums.js";
1+
import {
2+
ADDON_CATEGORY,
3+
ADDON_TYPE,
4+
PLUGIN_TYPE,
5+
PROPERTY_TYPE,
6+
} from "./template/enums.js";
27
export const addonType = ADDON_TYPE.PLUGIN;
38
export const type = PLUGIN_TYPE.OBJECT;
49
export const id = "sample_addon";
@@ -8,24 +13,31 @@ export const author = "skymen";
813
export const website = "https://www.construct.net";
914
export const documentation = "https://www.construct.net";
1015
export const description = "Description";
11-
export const category = ADDON_CATEGORY.GENERAL; // "3d", "data-and-storage", "form-controls", "input", "media", "monetisation", "platform-specific", "web", "other"
16+
export const category = ADDON_CATEGORY.GENERAL;
1217

18+
export const hasDomside = false;
1319
export const files = {
1420
extensionScript: {},
1521
fileDependencies: [],
1622
};
1723

18-
export const hasDomside = false;
19-
2024
// categories that are not filled will use the folder name
2125
export const aceCategories = {};
2226

2327
export const info = {
2428
// icon: "icon.svg",
25-
// world only
29+
// PLUGIN world only
2630
// defaultImageUrl: "default-image.png",
2731
Set: {
28-
// world only
32+
// COMMON to all
33+
CanBeBundled: true,
34+
IsDeprecated: false,
35+
GooglePlayServicesEnabled: false,
36+
37+
// BEHAVIOR only
38+
IsOnlyOneAllowed: false,
39+
40+
// PLUGIN world only
2941
IsResizable: false,
3042
IsRotatable: false,
3143
Is3D: false,
@@ -36,16 +48,11 @@ export const info = {
3648
SupportsEffects: false,
3749
MustPreDraw: false,
3850

39-
// object only
51+
// PLUGIN object only
4052
IsSingleGlobal: true,
41-
42-
// world and object
43-
CanBeBundled: true,
44-
IsDeprecated: false,
45-
GooglePlayServicesEnabled: false,
4653
},
54+
// PLUGIN only
4755
AddCommonACEs: {
48-
// world only
4956
Position: false,
5057
SceneGraph: false,
5158
Size: false,
@@ -58,21 +65,7 @@ export const info = {
5865
export const properties = [
5966
/*
6067
{
61-
type:
62-
"integer"
63-
"float"
64-
"percent"
65-
"text"
66-
"longtext"
67-
"check"
68-
"font"
69-
"combo"
70-
"color"
71-
"object"
72-
"group"
73-
"link"
74-
"info"
75-
68+
type: PROPERTY_TYPE.INTEGER,
7669
id: "property_id",
7770
options: {
7871
initialValue: 0,
@@ -93,14 +86,14 @@ export const properties = [
9386
// allowedPluginIds: ["Sprite", "<world>"],
9487
9588
// for type link only
96-
// linkCallback: `function(instOrObj) {}`,
89+
// linkCallback: function(instOrObj) {},
9790
// linkText: "Link Text",
9891
// callbackType:
9992
// "for-each-instance"
10093
// "once-for-type"
10194
10295
// for type info only
103-
// infoCallback: `function(inst) {}`,
96+
// infoCallback: function(inst) {},
10497
},
10598
name: "Property Name",
10699
desc: "Property Description",

src/aces.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ action(
1818
name: "Param1",
1919
desc: "This is a sample param",
2020
type: "string",
21-
initialValue: "Hello World",
21+
initialValue: '"Hello World"',
2222
},
2323
],
2424
},

src/aces/Aces_Files_In_Category_Folder/a.Action.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const config = {
1111
name: "Param1",
1212
desc: "This is a sample param",
1313
type: "string",
14-
initialValue: "Hello World",
14+
initialValue: '"Hello World"',
1515
},
1616
],
1717
};

src/aces/Aces_Files_In_Category_Folder/c.Condition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const config = {
1010
name: "Param1",
1111
desc: "This is a sample param",
1212
type: "string",
13-
initialValue: "Hello World",
13+
initialValue: '"Hello World"',
1414
},
1515
],
1616
};

template/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"languageTag": "en-US",
33
"fileDescription": "Strings for sample_addon.",
44
"text": {
5-
"plugins": {
5+
"behaviors": {
66
"sample_addon": {
77
"name": "Sample Addon",
88
"description": "Description",

0 commit comments

Comments
 (0)