forked from clusterio/gridworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
125 lines (117 loc) · 3.84 KB
/
index.ts
File metadata and controls
125 lines (117 loc) · 3.84 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import * as lib from "@clusterio/lib";
import * as messages from "./messages";
lib.definePermission({
name: "gridworld.view",
title: "View gridworld",
description: "View gridworld tiles and status",
grantByDefault: true,
});
lib.definePermission({
name: "gridworld.manage",
title: "Manage gridworld",
description: "Create or delete gridworld tiles",
});
declare module "@clusterio/lib" {
export interface ControllerConfigFields {
"gridworld.map_exchange_string": string;
"gridworld.tile_size": number;
"gridworld.surface_name": string;
"gridworld.initial_tile_x": number;
"gridworld.initial_tile_y": number;
"gridworld.auto_start_instances": boolean;
"gridworld.save_name_prefix": string;
}
export interface InstanceConfigFields {
"gridworld.tile_x": number;
"gridworld.tile_y": number;
"gridworld.tile_size": number;
"gridworld.surface_name": string;
}
}
export const plugin: lib.PluginDeclaration = {
name: "gridworld",
title: "Gridworld",
description: "Creates an infinite tiled world backed by Universal Edges.",
controllerEntrypoint: "./dist/node/controller",
controllerConfigFields: {
"gridworld.map_exchange_string": {
title: "Map Exchange String",
description: "Map exchange string used to generate tiles.",
type: "string",
initialValue: ">>>eNpjYmBg8GRgZGDgYUnOT8wB8uwZGA44gDBXcn5BQWqRbn5RKrIwZ3JRaUqqbn4mquLUvNTcSt2kxGKg4gaocIM9R2ZRfh66CTx5iaVlmcXxyTmZaWkQ1RDMWpSfnF2MLCJWXJJYVJKZlx6fWJSaGJ+bn1lcUlqUiqKpuCQ/D8V81pKi1FQUY7hLixLzMktzIS5psIOrLE8sSS1CVsnAqBBSYtHQIscAwv/rGRT+/wdhIOsB0A4QZmBsgKhmBArCACvUMwwKjkDshDCOkbFaZJ37w6op9owQlXoOUMYHqMiBJJiIJ4zh54BTSgXGMEEyxxgMPiMxIJaWAK2AquJwQDAgki0gSUbG3rdbF3w/dsGO8c/Kj5d8kxLsGQ1dRd59MFpnB5RmB3mXCU7MmgkCO2FeYYCZ+cAeKnXTnvHsGRB4Y8/ICtIhAiIcLIDEAW9mBkYBPiBrQQ+QUJBhgDnNDmaMiANjGhh8g/nkMYxx2R7dH8CAsAEZLgciToAIsIVwlzFCmA79DowO8jBZSYQSoH4jBmQ3pCB8eBJm7WEk+9EcghkRyP5AE1FxwBINXCALU+DEC2a4a4DheYEdxnOY78DIDGKAVH0BikF4IBmYURBawAEc3MzwRPnBHjWlgRggQwplrp4BAHC3vz8=<<<",
},
"gridworld.tile_size": {
title: "Tile Size",
description: "Tile size in map units (tiles).",
type: "number",
initialValue: 1024,
},
"gridworld.surface_name": {
title: "Surface Name",
description: "Surface name to use for edge endpoints.",
type: "string",
initialValue: "nauvis",
},
"gridworld.initial_tile_x": {
title: "Initial Tile X",
description: "X coordinate of the initial tile.",
type: "number",
initialValue: 0,
},
"gridworld.initial_tile_y": {
title: "Initial Tile Y",
description: "Y coordinate of the initial tile.",
type: "number",
initialValue: 0,
},
"gridworld.auto_start_instances": {
title: "Auto Start Instances",
description: "Legacy setting (ignored). Instances now start as players explore.",
type: "boolean",
initialValue: false,
},
"gridworld.save_name_prefix": {
title: "Save Name Prefix",
description: "Prefix to use for tile save names.",
type: "string",
initialValue: "gridworld",
},
},
instanceEntrypoint: "./dist/node/instance",
instanceConfigFields: {
"gridworld.tile_x": {
title: "Tile X",
description: "Tile X coordinate (managed by gridworld).",
type: "number",
initialValue: 0,
},
"gridworld.tile_y": {
title: "Tile Y",
description: "Tile Y coordinate (managed by gridworld).",
type: "number",
initialValue: 0,
},
"gridworld.tile_size": {
title: "Tile Size",
description: "Tile size in map units (managed by gridworld).",
type: "number",
initialValue: 1024,
},
"gridworld.surface_name": {
title: "Surface Name",
description: "Surface name to use for gridworld boundaries (managed by gridworld).",
type: "string",
initialValue: "nauvis",
},
},
messages: [
messages.GridworldStateUpdate,
messages.GridworldStateRequest,
messages.GridworldCreateRequest,
messages.GridworldDeleteRequest,
],
webEntrypoint: "./web",
routes: [
"/gridworld",
],
};