@minecraft/server-editor 0.1.0-beta.1.21.0-preview.26 → 0.1.0-beta.1.21.10-preview.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +582 -9
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ```json
|
|
15
15
|
* {
|
|
16
16
|
* "module_name": "@minecraft/server-editor",
|
|
17
|
-
* "version": "0.1.0-beta.1.21.
|
|
17
|
+
* "version": "0.1.0-beta.1.21.10-preview.21"
|
|
18
18
|
* }
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
@@ -36,6 +36,14 @@ export enum BlockPaletteItemType {
|
|
|
36
36
|
Probability = 1,
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Predefined action bar items
|
|
41
|
+
*/
|
|
42
|
+
export declare enum CoreActionBarItemType {
|
|
43
|
+
Redo = 'editor:actionBarItem:redo',
|
|
44
|
+
Undo = 'editor:actionBarItem:undo',
|
|
45
|
+
}
|
|
46
|
+
|
|
39
47
|
/**
|
|
40
48
|
* Predefined top level menus for core editor
|
|
41
49
|
*/
|
|
@@ -122,6 +130,7 @@ export declare enum EDITOR_PANE_PROPERTY_ITEM_TYPE {
|
|
|
122
130
|
Action = 'editorUI:Action',
|
|
123
131
|
BlockPicker = 'editorUI:BlockPicker',
|
|
124
132
|
Boolean = 'editorUI:Boolean',
|
|
133
|
+
ColorPicker = 'editorUI:ColorPicker',
|
|
125
134
|
Divider = 'editorUI:Divider',
|
|
126
135
|
Dropdown = 'editorUI:Dropdown',
|
|
127
136
|
Image = 'editorUI:Image',
|
|
@@ -488,6 +497,7 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
|
|
|
488
497
|
readonly actionManager: ActionManager;
|
|
489
498
|
readonly inputManager: IGlobalInputManager;
|
|
490
499
|
readonly menuBar: IMenuContainer;
|
|
500
|
+
readonly actionBar: IActionBar;
|
|
491
501
|
readonly toolRail: IModalToolContainer;
|
|
492
502
|
readonly log: IPlayerLogger;
|
|
493
503
|
readonly extensionContext: ExtensionContext;
|
|
@@ -752,6 +762,28 @@ export class BrushShapeManager {
|
|
|
752
762
|
uiSettingValueChanged(elementName: string, newValue: boolean | number | string | minecraftserver.Vector3): boolean;
|
|
753
763
|
}
|
|
754
764
|
|
|
765
|
+
export class ClipboardChangeAfterEvent {
|
|
766
|
+
private constructor();
|
|
767
|
+
readonly isPrimary: boolean;
|
|
768
|
+
readonly itemId: string;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export class ClipboardChangeAfterEventSignal {
|
|
772
|
+
private constructor();
|
|
773
|
+
/**
|
|
774
|
+
* @remarks
|
|
775
|
+
* This function can't be called in read-only mode.
|
|
776
|
+
*
|
|
777
|
+
*/
|
|
778
|
+
subscribe(callback: (arg: ClipboardChangeAfterEvent) => void): (arg: ClipboardChangeAfterEvent) => void;
|
|
779
|
+
/**
|
|
780
|
+
* @remarks
|
|
781
|
+
* This function can't be called in read-only mode.
|
|
782
|
+
*
|
|
783
|
+
*/
|
|
784
|
+
unsubscribe(callback: (arg: ClipboardChangeAfterEvent) => void): void;
|
|
785
|
+
}
|
|
786
|
+
|
|
755
787
|
/**
|
|
756
788
|
* A ClipboardItem is a handle to an object which represents a
|
|
757
789
|
* set of blocks in a contained bounding area (most likely
|
|
@@ -966,6 +998,27 @@ export class Cursor {
|
|
|
966
998
|
* @throws This property can throw when used.
|
|
967
999
|
*/
|
|
968
1000
|
readonly isVisible: boolean;
|
|
1001
|
+
/**
|
|
1002
|
+
* @remarks
|
|
1003
|
+
* This function can't be called in read-only mode.
|
|
1004
|
+
*
|
|
1005
|
+
* @throws This function can throw errors.
|
|
1006
|
+
*/
|
|
1007
|
+
attachClipboardItem(item: ClipboardItem): void;
|
|
1008
|
+
/**
|
|
1009
|
+
* @remarks
|
|
1010
|
+
* This function can't be called in read-only mode.
|
|
1011
|
+
*
|
|
1012
|
+
* @throws This function can throw errors.
|
|
1013
|
+
*/
|
|
1014
|
+
clearAttachment(): void;
|
|
1015
|
+
/**
|
|
1016
|
+
* @remarks
|
|
1017
|
+
* This function can't be called in read-only mode.
|
|
1018
|
+
*
|
|
1019
|
+
* @throws This function can throw errors.
|
|
1020
|
+
*/
|
|
1021
|
+
getAttachmentProperties(): CursorAttachmentProperties;
|
|
969
1022
|
/**
|
|
970
1023
|
* @remarks
|
|
971
1024
|
* Get the world position of the 3D block cursor
|
|
@@ -1022,6 +1075,13 @@ export class Cursor {
|
|
|
1022
1075
|
* @throws This function can throw errors.
|
|
1023
1076
|
*/
|
|
1024
1077
|
resetToDefaultState(): void;
|
|
1078
|
+
/**
|
|
1079
|
+
* @remarks
|
|
1080
|
+
* This function can't be called in read-only mode.
|
|
1081
|
+
*
|
|
1082
|
+
* @throws This function can throw errors.
|
|
1083
|
+
*/
|
|
1084
|
+
setAttachmentProperties(properties: CursorAttachmentProperties): void;
|
|
1025
1085
|
/**
|
|
1026
1086
|
* @remarks
|
|
1027
1087
|
* Set the 3D block cursor properties to a given state
|
|
@@ -1045,6 +1105,29 @@ export class Cursor {
|
|
|
1045
1105
|
show(): void;
|
|
1046
1106
|
}
|
|
1047
1107
|
|
|
1108
|
+
export class CursorAttachmentPropertiesChangeAfterEvent {
|
|
1109
|
+
private constructor();
|
|
1110
|
+
readonly properties: CursorAttachmentProperties;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
export class CursorAttachmentPropertyChangeAfterEventSignal {
|
|
1114
|
+
private constructor();
|
|
1115
|
+
/**
|
|
1116
|
+
* @remarks
|
|
1117
|
+
* This function can't be called in read-only mode.
|
|
1118
|
+
*
|
|
1119
|
+
*/
|
|
1120
|
+
subscribe(
|
|
1121
|
+
callback: (arg: CursorAttachmentPropertiesChangeAfterEvent) => void,
|
|
1122
|
+
): (arg: CursorAttachmentPropertiesChangeAfterEvent) => void;
|
|
1123
|
+
/**
|
|
1124
|
+
* @remarks
|
|
1125
|
+
* This function can't be called in read-only mode.
|
|
1126
|
+
*
|
|
1127
|
+
*/
|
|
1128
|
+
unsubscribe(callback: (arg: CursorAttachmentPropertiesChangeAfterEvent) => void): void;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1048
1131
|
export class CursorPropertiesChangeAfterEvent {
|
|
1049
1132
|
private constructor();
|
|
1050
1133
|
readonly properties: CursorProperties;
|
|
@@ -1249,6 +1332,8 @@ export class ExtensionContext {
|
|
|
1249
1332
|
*/
|
|
1250
1333
|
export class ExtensionContextAfterEvents {
|
|
1251
1334
|
private constructor();
|
|
1335
|
+
readonly clipboardChange: ClipboardChangeAfterEventSignal;
|
|
1336
|
+
readonly cursorAttachmentPropertyChange: CursorAttachmentPropertyChangeAfterEventSignal;
|
|
1252
1337
|
readonly cursorPropertyChange: CursorPropertyChangeAfterEventSignal;
|
|
1253
1338
|
/**
|
|
1254
1339
|
* @remarks
|
|
@@ -1794,18 +1879,14 @@ export class SettingsManager {
|
|
|
1794
1879
|
|
|
1795
1880
|
export class SettingsUIElement {
|
|
1796
1881
|
readonly initialValue: boolean | number | string | minecraftserver.Vector3;
|
|
1797
|
-
readonly max?: number;
|
|
1798
|
-
readonly min?: number;
|
|
1799
1882
|
readonly name: string;
|
|
1800
|
-
readonly onChange: (arg: boolean | number | string | minecraftserver.Vector3) =>
|
|
1801
|
-
readonly options
|
|
1883
|
+
readonly onChange: (arg: boolean | number | string | minecraftserver.Vector3) => void;
|
|
1884
|
+
readonly options: SettingsUIElementOptions;
|
|
1802
1885
|
constructor(
|
|
1803
1886
|
name: string,
|
|
1804
1887
|
initialValue: boolean | number | string | minecraftserver.Vector3,
|
|
1805
|
-
onChange: (arg: boolean | number | string | minecraftserver.Vector3) =>
|
|
1806
|
-
|
|
1807
|
-
max?: number,
|
|
1808
|
-
options?: string[],
|
|
1888
|
+
onChange: (arg: boolean | number | string | minecraftserver.Vector3) => void,
|
|
1889
|
+
options?: SettingsUIElementOptions,
|
|
1809
1890
|
);
|
|
1810
1891
|
}
|
|
1811
1892
|
|
|
@@ -1821,9 +1902,37 @@ export class SimpleBlockPaletteItem extends IBlockPaletteItem {
|
|
|
1821
1902
|
* how to use this class and the wrapper framework
|
|
1822
1903
|
*/
|
|
1823
1904
|
export declare class SimpleToolWrapper implements IDisposable {
|
|
1905
|
+
/**
|
|
1906
|
+
* @remarks
|
|
1907
|
+
* The player UI session that the tool is running in Use this
|
|
1908
|
+
* to access the player UI session, or any of the session's
|
|
1909
|
+
* components
|
|
1910
|
+
*
|
|
1911
|
+
*/
|
|
1824
1912
|
get session(): IPlayerUISession;
|
|
1913
|
+
/**
|
|
1914
|
+
* @remarks
|
|
1915
|
+
* The simple tool instance that is created and managed by the
|
|
1916
|
+
* wrapper Use this to access any of the tools components, or
|
|
1917
|
+
* mess with the tools window visibility
|
|
1918
|
+
*
|
|
1919
|
+
*/
|
|
1825
1920
|
get simpleTool(): ISimpleTool;
|
|
1921
|
+
/**
|
|
1922
|
+
* @remarks
|
|
1923
|
+
* Setup the simple tool instance with the given options This
|
|
1924
|
+
* will create and initialize the simple tool instance
|
|
1925
|
+
*
|
|
1926
|
+
*/
|
|
1826
1927
|
setupSimpleTool(session: IPlayerUISession, options: ISimpleToolOptions): void;
|
|
1928
|
+
/**
|
|
1929
|
+
* @remarks
|
|
1930
|
+
* Teardown the simple tool instance This will call the
|
|
1931
|
+
* teardown function on the simple tool instance This function
|
|
1932
|
+
* is automatically invoked by the Editor Extension system when
|
|
1933
|
+
* the editor is shutting down
|
|
1934
|
+
*
|
|
1935
|
+
*/
|
|
1827
1936
|
teardown(): void;
|
|
1828
1937
|
}
|
|
1829
1938
|
|
|
@@ -2289,6 +2398,18 @@ export interface ClipboardWriteOptions {
|
|
|
2289
2398
|
rotation?: minecraftserver.StructureRotation;
|
|
2290
2399
|
}
|
|
2291
2400
|
|
|
2401
|
+
export interface CursorAttachmentProperties {
|
|
2402
|
+
boundsFillColor?: minecraftserver.RGBA;
|
|
2403
|
+
boundsVisible?: boolean;
|
|
2404
|
+
boundsWireframeColor?: minecraftserver.RGBA;
|
|
2405
|
+
contentsFillColor?: minecraftserver.RGBA;
|
|
2406
|
+
contentsWireframeColor?: minecraftserver.RGBA;
|
|
2407
|
+
mirror?: minecraftserver.StructureMirrorAxis;
|
|
2408
|
+
offset?: minecraftserver.Vector3;
|
|
2409
|
+
origin?: minecraftserver.Vector3;
|
|
2410
|
+
rotation?: minecraftserver.StructureRotation;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2292
2413
|
/**
|
|
2293
2414
|
* The CursorProperties interface is used to describe the
|
|
2294
2415
|
* properties of the Editor 3D block cursor construct.
|
|
@@ -2322,6 +2443,7 @@ export interface CursorProperties {
|
|
|
2322
2443
|
*
|
|
2323
2444
|
*/
|
|
2324
2445
|
controlMode?: CursorControlMode;
|
|
2446
|
+
fillColor?: minecraftserver.RGBA;
|
|
2325
2447
|
/**
|
|
2326
2448
|
* @remarks
|
|
2327
2449
|
* The fixed distance from the players feet at which the cursor
|
|
@@ -2454,6 +2576,13 @@ export interface ProjectExportOptions {
|
|
|
2454
2576
|
initialTimOfDay?: number;
|
|
2455
2577
|
}
|
|
2456
2578
|
|
|
2579
|
+
export interface SettingsUIElementOptions {
|
|
2580
|
+
dropdownItems?: string[];
|
|
2581
|
+
max?: number;
|
|
2582
|
+
min?: number;
|
|
2583
|
+
refreshOnChange?: boolean;
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2457
2586
|
export interface WidgetCreateOptions {
|
|
2458
2587
|
initialVisibility?: boolean;
|
|
2459
2588
|
isSelectable?: boolean;
|
|
@@ -2547,6 +2676,103 @@ export declare interface EventSink<T> {
|
|
|
2547
2676
|
subscribe(handler: EventHandler<T>): IEventToken;
|
|
2548
2677
|
}
|
|
2549
2678
|
|
|
2679
|
+
/**
|
|
2680
|
+
* Manager for IActionBarItem objects.
|
|
2681
|
+
*/
|
|
2682
|
+
export interface IActionBar {
|
|
2683
|
+
/**
|
|
2684
|
+
* @remarks
|
|
2685
|
+
* Add a new action bar item to the collection.
|
|
2686
|
+
*
|
|
2687
|
+
* @param id
|
|
2688
|
+
* Unique item identifier.
|
|
2689
|
+
* @param action
|
|
2690
|
+
* Action to be invoked.
|
|
2691
|
+
* @param props
|
|
2692
|
+
* Configuration for the item to create.
|
|
2693
|
+
*/
|
|
2694
|
+
registerItem(
|
|
2695
|
+
id: string,
|
|
2696
|
+
action: RegisteredAction<NoArgsAction>,
|
|
2697
|
+
props: IActionBarItemCreationParams,
|
|
2698
|
+
): IActionBarItem;
|
|
2699
|
+
/**
|
|
2700
|
+
* @remarks
|
|
2701
|
+
* Remove an action item from the collection.
|
|
2702
|
+
*
|
|
2703
|
+
* @param id
|
|
2704
|
+
* Unique item identifier.
|
|
2705
|
+
*/
|
|
2706
|
+
unregisterItem(id: string): void;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
/**
|
|
2710
|
+
* Registered item handle in the Action Bar collection.
|
|
2711
|
+
*/
|
|
2712
|
+
export interface IActionBarItem {
|
|
2713
|
+
/**
|
|
2714
|
+
* @remarks
|
|
2715
|
+
* Returns the current enabled state of the item.
|
|
2716
|
+
*
|
|
2717
|
+
*/
|
|
2718
|
+
getEnabled: () => boolean;
|
|
2719
|
+
/**
|
|
2720
|
+
* @remarks
|
|
2721
|
+
* Unique identifier of the item.
|
|
2722
|
+
*
|
|
2723
|
+
*/
|
|
2724
|
+
readonly id: string;
|
|
2725
|
+
/**
|
|
2726
|
+
* @remarks
|
|
2727
|
+
* Text label of the item.
|
|
2728
|
+
*
|
|
2729
|
+
*/
|
|
2730
|
+
readonly label: string;
|
|
2731
|
+
/**
|
|
2732
|
+
* @remarks
|
|
2733
|
+
* Modify enabled state of the item.
|
|
2734
|
+
*
|
|
2735
|
+
*/
|
|
2736
|
+
setEnabled: (enabled: boolean) => void;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
/**
|
|
2740
|
+
* Properties required to create an Action Bar item.
|
|
2741
|
+
*/
|
|
2742
|
+
export interface IActionBarItemCreationParams {
|
|
2743
|
+
/**
|
|
2744
|
+
* @remarks
|
|
2745
|
+
* Initial enabled state of the item. If not defined, default
|
|
2746
|
+
* is true.
|
|
2747
|
+
*
|
|
2748
|
+
*/
|
|
2749
|
+
enabled?: boolean;
|
|
2750
|
+
/**
|
|
2751
|
+
* @remarks
|
|
2752
|
+
* Icon resource for the item.
|
|
2753
|
+
*
|
|
2754
|
+
*/
|
|
2755
|
+
icon: string;
|
|
2756
|
+
/**
|
|
2757
|
+
* @remarks
|
|
2758
|
+
* Text label for item.
|
|
2759
|
+
*
|
|
2760
|
+
*/
|
|
2761
|
+
label: string;
|
|
2762
|
+
/**
|
|
2763
|
+
* @remarks
|
|
2764
|
+
* Tooltip description for the item.
|
|
2765
|
+
*
|
|
2766
|
+
*/
|
|
2767
|
+
tooltipDescription?: string;
|
|
2768
|
+
/**
|
|
2769
|
+
* @remarks
|
|
2770
|
+
* Tooltip title for the item.
|
|
2771
|
+
*
|
|
2772
|
+
*/
|
|
2773
|
+
tooltipTitle?: string;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2550
2776
|
/**
|
|
2551
2777
|
* Simple abstraction for disposable objects.
|
|
2552
2778
|
*/
|
|
@@ -2624,6 +2850,12 @@ export interface IMenu {
|
|
|
2624
2850
|
*
|
|
2625
2851
|
*/
|
|
2626
2852
|
checked?: boolean;
|
|
2853
|
+
/**
|
|
2854
|
+
* @remarks
|
|
2855
|
+
* The menu will be in either an enabled or disabled state
|
|
2856
|
+
*
|
|
2857
|
+
*/
|
|
2858
|
+
enabled: boolean;
|
|
2627
2859
|
/**
|
|
2628
2860
|
* @remarks
|
|
2629
2861
|
* Unique ID for the menu
|
|
@@ -2682,6 +2914,12 @@ export interface IMenuCreationParams {
|
|
|
2682
2914
|
*
|
|
2683
2915
|
*/
|
|
2684
2916
|
displayStringId?: string;
|
|
2917
|
+
/**
|
|
2918
|
+
* @remarks
|
|
2919
|
+
* Whether the menu should be enabled or disabled
|
|
2920
|
+
*
|
|
2921
|
+
*/
|
|
2922
|
+
enabled?: boolean;
|
|
2685
2923
|
/**
|
|
2686
2924
|
* @remarks
|
|
2687
2925
|
* The name of the menu
|
|
@@ -2885,6 +3123,11 @@ export interface IPropertyItemOptionsButton extends IPropertyItemOptions {
|
|
|
2885
3123
|
variant?: ButtonVariant;
|
|
2886
3124
|
}
|
|
2887
3125
|
|
|
3126
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
3127
|
+
export interface IPropertyItemOptionsColorPicker extends IPropertyItemOptions {
|
|
3128
|
+
showAlpha?: boolean;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
2888
3131
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2889
3132
|
export interface IPropertyItemOptionsDataPicker extends IPropertyItemOptions {
|
|
2890
3133
|
/**
|
|
@@ -3094,6 +3337,16 @@ export interface IPropertyPane {
|
|
|
3094
3337
|
},
|
|
3095
3338
|
'EMPTY'
|
|
3096
3339
|
>;
|
|
3340
|
+
/**
|
|
3341
|
+
* @remarks
|
|
3342
|
+
* Adds a color picker item to the pane.
|
|
3343
|
+
*
|
|
3344
|
+
*/
|
|
3345
|
+
addColorPicker<T extends PropertyBag, Prop extends keyof T & string>(
|
|
3346
|
+
obj: T,
|
|
3347
|
+
property: Prop,
|
|
3348
|
+
options?: IPropertyItemOptionsColorPicker,
|
|
3349
|
+
): IPropertyItem<T, Prop>;
|
|
3097
3350
|
/**
|
|
3098
3351
|
* @remarks
|
|
3099
3352
|
* Adds an divider item to the pane.
|
|
@@ -3303,46 +3556,127 @@ export interface IRegisterExtensionOptionalParameters {
|
|
|
3303
3556
|
* the editor evolves.
|
|
3304
3557
|
*/
|
|
3305
3558
|
export interface ISimpleTool {
|
|
3559
|
+
/**
|
|
3560
|
+
* @remarks
|
|
3561
|
+
* Get a reference to the menu component that was automatically
|
|
3562
|
+
* created for the tool This generally only happens if the tool
|
|
3563
|
+
* is a global tool (i.e. has a pane and does not have a tool
|
|
3564
|
+
* rail component) In this case a menu item is automatically
|
|
3565
|
+
* created and some visibility controls are inserted. If you
|
|
3566
|
+
* have additional menu options you want to add, this is the
|
|
3567
|
+
* ideal control to add children to
|
|
3568
|
+
*
|
|
3569
|
+
*/
|
|
3306
3570
|
get menu(): IMenu | undefined;
|
|
3571
|
+
/**
|
|
3572
|
+
* @remarks
|
|
3573
|
+
* Get the tool name
|
|
3574
|
+
*
|
|
3575
|
+
*/
|
|
3307
3576
|
get name(): string;
|
|
3577
|
+
/**
|
|
3578
|
+
* @remarks
|
|
3579
|
+
* Get a reference to the root (primary) property pane
|
|
3580
|
+
* component - if no component was requested, this function
|
|
3581
|
+
* will throw an error
|
|
3582
|
+
*
|
|
3583
|
+
*/
|
|
3308
3584
|
get pane(): ISimpleToolPaneComponent;
|
|
3585
|
+
/**
|
|
3586
|
+
* @remarks
|
|
3587
|
+
* Get a reference to the IPlayerUISession. This is the primary
|
|
3588
|
+
* interface to the editor UI and all of the editor extension
|
|
3589
|
+
* controls
|
|
3590
|
+
*
|
|
3591
|
+
*/
|
|
3309
3592
|
get session(): IPlayerUISession;
|
|
3593
|
+
/**
|
|
3594
|
+
* @remarks
|
|
3595
|
+
* Get a reference to the status bar component - if no
|
|
3596
|
+
* component was requested, this function will throw an error
|
|
3597
|
+
*
|
|
3598
|
+
*/
|
|
3310
3599
|
get statusBar(): ISimpleToolStatusBarComponent;
|
|
3600
|
+
/**
|
|
3601
|
+
* @remarks
|
|
3602
|
+
* Get a reference to the tool rail component - if no component
|
|
3603
|
+
* was requested, this function will throw an error
|
|
3604
|
+
*
|
|
3605
|
+
*/
|
|
3311
3606
|
get toolRail(): ISimpleToolRailComponent;
|
|
3312
3607
|
/**
|
|
3313
3608
|
* @remarks
|
|
3609
|
+
* Find a pane or subpane by it's unique ID.
|
|
3610
|
+
*
|
|
3314
3611
|
*/
|
|
3315
3612
|
findPane(idString: string): ISimpleToolPaneComponent | undefined;
|
|
3316
3613
|
/**
|
|
3317
3614
|
* @remarks
|
|
3615
|
+
* Hide a particular pane or subpane by it's unique ID. If no
|
|
3616
|
+
* ID is provided (or cannot be found) the function will throw
|
|
3617
|
+
* an error Although the parent pane is used to execute the
|
|
3618
|
+
* visibility request, the hidePane function will NOT affect
|
|
3619
|
+
* the visibility of any sibling panes -- so it is possible to
|
|
3620
|
+
* hide all of the child panes of a parent using this function
|
|
3621
|
+
*
|
|
3318
3622
|
*/
|
|
3319
3623
|
hidePane(idString?: string): void;
|
|
3320
3624
|
/**
|
|
3321
3625
|
* @remarks
|
|
3626
|
+
* Send a tagged Debug log message to the console. The tag will
|
|
3627
|
+
* contain the tool name
|
|
3628
|
+
*
|
|
3322
3629
|
*/
|
|
3323
3630
|
logDebug(message: string): void;
|
|
3324
3631
|
/**
|
|
3325
3632
|
* @remarks
|
|
3633
|
+
* Send a tagged Error log message to the console. The tag will
|
|
3634
|
+
* contain the tool name
|
|
3635
|
+
*
|
|
3326
3636
|
*/
|
|
3327
3637
|
logError(message: string): void;
|
|
3328
3638
|
/**
|
|
3329
3639
|
* @remarks
|
|
3640
|
+
* Send a tagged Informational log message to the console. The
|
|
3641
|
+
* tag will contain the tool name
|
|
3642
|
+
*
|
|
3330
3643
|
*/
|
|
3331
3644
|
logInfo(message: string): void;
|
|
3332
3645
|
/**
|
|
3333
3646
|
* @remarks
|
|
3647
|
+
* Send a tagged Warning log message to the console. The tag
|
|
3648
|
+
* will contain the tool name
|
|
3649
|
+
*
|
|
3334
3650
|
*/
|
|
3335
3651
|
logWarn(message: string): void;
|
|
3336
3652
|
/**
|
|
3337
3653
|
* @remarks
|
|
3654
|
+
* Show a particular pane or subpane by it's unique ID. If no
|
|
3655
|
+
* ID is provided (or cannot be found) the function will throw
|
|
3656
|
+
* an error Note that the showPane function (when used with a
|
|
3657
|
+
* child pane) will use the parent pane to execute the
|
|
3658
|
+
* visibility request. In this case, if the child panes are
|
|
3659
|
+
* marked as mututally exclusive, then the siblings of the
|
|
3660
|
+
* requested pane will be hidden
|
|
3661
|
+
*
|
|
3338
3662
|
*/
|
|
3339
3663
|
showPane(idString?: string): void;
|
|
3340
3664
|
/**
|
|
3341
3665
|
* @remarks
|
|
3666
|
+
* Much like the showPane function, but will hide all other
|
|
3667
|
+
* panes that are not the requested pane irrespective of the
|
|
3668
|
+
* exclusivity setting
|
|
3669
|
+
*
|
|
3342
3670
|
*/
|
|
3343
3671
|
showPaneExclusively(idString: string): void;
|
|
3344
3672
|
/**
|
|
3345
3673
|
* @remarks
|
|
3674
|
+
* A teardown function implemented by the ISimpleTool
|
|
3675
|
+
* implementation, and is called by the system during editor
|
|
3676
|
+
* extension shutdown. Don't override this function - instead,
|
|
3677
|
+
* implement the onTeardown event in the ISimpleToolOptions
|
|
3678
|
+
* structure
|
|
3679
|
+
*
|
|
3346
3680
|
*/
|
|
3347
3681
|
teardown(): void;
|
|
3348
3682
|
}
|
|
@@ -3361,12 +3695,61 @@ export interface ISimpleToolKeyPair {
|
|
|
3361
3695
|
* simple tool, and the optional components that are desired.
|
|
3362
3696
|
*/
|
|
3363
3697
|
export interface ISimpleToolOptions {
|
|
3698
|
+
/**
|
|
3699
|
+
* @remarks
|
|
3700
|
+
* A key binding that will activate the tool. Note that if the
|
|
3701
|
+
* tool is a modal tool, then the key binding will be tied to
|
|
3702
|
+
* the tool rail activation, and appear as a tooltip on the
|
|
3703
|
+
* tool rail button. If the tool is a global tool, then the key
|
|
3704
|
+
* binding will be tied to a menu item in the View menu, and
|
|
3705
|
+
* appear as a stateful menu item which will control the pane
|
|
3706
|
+
* visibility. If there's no pane required, then the key
|
|
3707
|
+
* binding is ignored
|
|
3708
|
+
*
|
|
3709
|
+
*/
|
|
3364
3710
|
activationKeyBinding?: ISimpleToolKeyPair;
|
|
3711
|
+
/**
|
|
3712
|
+
* @remarks
|
|
3713
|
+
* The name of the tool. This will be used to identify the tool
|
|
3714
|
+
* in the UI and logs and will be used in the View \> [Tool
|
|
3715
|
+
* Name] menu item (if it's a global tool)
|
|
3716
|
+
*
|
|
3717
|
+
*/
|
|
3365
3718
|
name: string;
|
|
3719
|
+
/**
|
|
3720
|
+
* @remarks
|
|
3721
|
+
* The finalize function is executed after each of the
|
|
3722
|
+
* components have been created and finalized during
|
|
3723
|
+
* construction
|
|
3724
|
+
*
|
|
3725
|
+
*/
|
|
3366
3726
|
onFinalize?: (tool: ISimpleTool) => void;
|
|
3727
|
+
/**
|
|
3728
|
+
* @remarks
|
|
3729
|
+
* The teardown function is executed when the tool is being
|
|
3730
|
+
* torn down and only after the individual components have
|
|
3731
|
+
* executed their own teardown functions
|
|
3732
|
+
*
|
|
3733
|
+
*/
|
|
3367
3734
|
onTeardown?: (tool: ISimpleTool) => void;
|
|
3735
|
+
/**
|
|
3736
|
+
* @remarks
|
|
3737
|
+
* The options structure for an optional property pane
|
|
3738
|
+
* component
|
|
3739
|
+
*
|
|
3740
|
+
*/
|
|
3368
3741
|
propertyPaneOptions?: ISimpleToolPaneOptions;
|
|
3742
|
+
/**
|
|
3743
|
+
* @remarks
|
|
3744
|
+
* The options structure for an optional status bar component
|
|
3745
|
+
*
|
|
3746
|
+
*/
|
|
3369
3747
|
statusBarOptions?: ISimpleToolStatusBarOptions;
|
|
3748
|
+
/**
|
|
3749
|
+
* @remarks
|
|
3750
|
+
* The options structure for an optional tool rail component
|
|
3751
|
+
*
|
|
3752
|
+
*/
|
|
3370
3753
|
toolRailOptions?: ISimpleToolRailOptions;
|
|
3371
3754
|
}
|
|
3372
3755
|
|
|
@@ -3385,26 +3768,83 @@ export interface ISimpleToolOptions {
|
|
|
3385
3768
|
* to the creator/user)
|
|
3386
3769
|
*/
|
|
3387
3770
|
export interface ISimpleToolPaneComponent {
|
|
3771
|
+
/**
|
|
3772
|
+
* @remarks
|
|
3773
|
+
* Get a list of the unique ID's of all of the child panes
|
|
3774
|
+
*
|
|
3775
|
+
*/
|
|
3388
3776
|
get childPaneList(): string[];
|
|
3777
|
+
/**
|
|
3778
|
+
* @remarks
|
|
3779
|
+
* Get the unique ID of the pane
|
|
3780
|
+
*
|
|
3781
|
+
*/
|
|
3389
3782
|
get id(): string;
|
|
3783
|
+
/**
|
|
3784
|
+
* @remarks
|
|
3785
|
+
* Check the visibility of the pane
|
|
3786
|
+
*
|
|
3787
|
+
*/
|
|
3390
3788
|
get isVisible(): boolean;
|
|
3789
|
+
/**
|
|
3790
|
+
* @remarks
|
|
3791
|
+
* Get a reference to actual property pane implementation that
|
|
3792
|
+
* was constructed by the tool. This reference is used to
|
|
3793
|
+
* construct the UI components that are displayed in the pane.
|
|
3794
|
+
*
|
|
3795
|
+
*/
|
|
3391
3796
|
get pane(): IPropertyPane;
|
|
3797
|
+
/**
|
|
3798
|
+
* @remarks
|
|
3799
|
+
* Get a reference to the IPlayerUISession. This is the primary
|
|
3800
|
+
* interface to the editor UI and all of the editor extension
|
|
3801
|
+
* controls
|
|
3802
|
+
*
|
|
3803
|
+
*/
|
|
3392
3804
|
get session(): IPlayerUISession;
|
|
3805
|
+
/**
|
|
3806
|
+
* @remarks
|
|
3807
|
+
* Get a reference to the parent tool.
|
|
3808
|
+
*
|
|
3809
|
+
*/
|
|
3393
3810
|
get simpleTool(): ISimpleTool;
|
|
3394
3811
|
/**
|
|
3395
3812
|
* @remarks
|
|
3813
|
+
* Find a pane reference by unique ID
|
|
3814
|
+
*
|
|
3396
3815
|
*/
|
|
3397
3816
|
findPane(idString: string): ISimpleToolPaneComponent | undefined;
|
|
3398
3817
|
/**
|
|
3399
3818
|
* @remarks
|
|
3819
|
+
* Hide the pane. Although the parent pane is used to execute
|
|
3820
|
+
* the visibility request, the hidePane function will NOT
|
|
3821
|
+
* affect the visibility of any sibling panes -- so it is
|
|
3822
|
+
* possible to hide all of the child panes of a parent using
|
|
3823
|
+
* this function
|
|
3824
|
+
*
|
|
3400
3825
|
*/
|
|
3401
3826
|
hidePane(): void;
|
|
3402
3827
|
/**
|
|
3403
3828
|
* @remarks
|
|
3829
|
+
* This causes the reconstruction of the pane (and the child
|
|
3830
|
+
* panes) as if the tool was being constructed for the first
|
|
3831
|
+
* time. This is unfortunately necessary until such time that
|
|
3832
|
+
* all of our UI components are able to communicate dynamically
|
|
3833
|
+
* with their client counterparts. Certain controls require a
|
|
3834
|
+
* full teardown and reconstruction to properly update their
|
|
3835
|
+
* state. This is undergoing code changes and should become
|
|
3836
|
+
* unnecessary in the future.
|
|
3837
|
+
*
|
|
3404
3838
|
*/
|
|
3405
3839
|
reconstructPane(): void;
|
|
3406
3840
|
/**
|
|
3407
3841
|
* @remarks
|
|
3842
|
+
* Show the pane. Note, if this is a sub-pane, then this
|
|
3843
|
+
* function will ask the parent for permission to show, and may
|
|
3844
|
+
* result in the visibility of any sibling panes to change as a
|
|
3845
|
+
* result (depending on the `mutually exclusive visibility`
|
|
3846
|
+
* flag)
|
|
3847
|
+
*
|
|
3408
3848
|
*/
|
|
3409
3849
|
showPane(): void;
|
|
3410
3850
|
}
|
|
@@ -3426,22 +3866,85 @@ export interface ISimpleToolPaneComponent {
|
|
|
3426
3866
|
* pane to finalize itself.
|
|
3427
3867
|
*/
|
|
3428
3868
|
export interface ISimpleToolPaneOptions {
|
|
3869
|
+
/**
|
|
3870
|
+
* @remarks
|
|
3871
|
+
* The id of the child pane that should be visible when the
|
|
3872
|
+
* parent pane is first shown, or the editor tool is
|
|
3873
|
+
* constructed and finalized
|
|
3874
|
+
*
|
|
3875
|
+
*/
|
|
3429
3876
|
childPaneInitiallyVisible?: string;
|
|
3877
|
+
/**
|
|
3878
|
+
* @remarks
|
|
3879
|
+
* An optional array of child panes. These panes are set up
|
|
3880
|
+
* exactly the same as the top level pane, but are displayed as
|
|
3881
|
+
* children inside the parent pane.
|
|
3882
|
+
*
|
|
3883
|
+
*/
|
|
3430
3884
|
childPanes?: ISimpleToolPaneOptions[];
|
|
3885
|
+
/**
|
|
3886
|
+
* @remarks
|
|
3887
|
+
* An optional flag to indicate whether the child panes are
|
|
3888
|
+
* mutually exclusive. If this is true, then only one child
|
|
3889
|
+
* pane can be visible at a time. If this is false, then
|
|
3890
|
+
* multiple child panes can be visible at the same time.
|
|
3891
|
+
* Visibility is controlled either through `showPane` or
|
|
3892
|
+
* `hidePane` functions of the `ISimpleToolPaneComponent` or
|
|
3893
|
+
* through the visibility methods in the top level tool
|
|
3894
|
+
* (`ISimpleTool`)
|
|
3895
|
+
*
|
|
3896
|
+
*/
|
|
3431
3897
|
childPanesMutuallyExclusive?: boolean;
|
|
3898
|
+
/**
|
|
3899
|
+
* @remarks
|
|
3900
|
+
* The unique identifier for this pane. This is used to
|
|
3901
|
+
* identify the pane in the tool's pane hierarchy.
|
|
3902
|
+
*
|
|
3903
|
+
*/
|
|
3432
3904
|
id: string;
|
|
3433
3905
|
onBeginFinalize?: (pane: ISimpleToolPaneComponent) => void;
|
|
3434
3906
|
onEndFinalize?: (pane: ISimpleToolPaneComponent) => void;
|
|
3435
3907
|
onHide?: (pane: ISimpleToolPaneComponent) => void;
|
|
3436
3908
|
onShow?: (pane: ISimpleToolPaneComponent) => void;
|
|
3437
3909
|
onTeardown?: (pane: ISimpleToolPaneComponent) => void;
|
|
3910
|
+
/**
|
|
3911
|
+
* @remarks
|
|
3912
|
+
* The title of the pane. This will be displayed in the title
|
|
3913
|
+
* bar of the pane.
|
|
3914
|
+
*
|
|
3915
|
+
*/
|
|
3438
3916
|
titleAltText: string;
|
|
3917
|
+
/**
|
|
3918
|
+
* @remarks
|
|
3919
|
+
* The string id of the title of the pane. This will be
|
|
3920
|
+
* displayed in the title bar of the pane if it exists in the
|
|
3921
|
+
* language file, otherwise the titleAltText will be used.
|
|
3922
|
+
*
|
|
3923
|
+
*/
|
|
3439
3924
|
titleStringId?: string;
|
|
3440
3925
|
}
|
|
3441
3926
|
|
|
3442
3927
|
export interface ISimpleToolRailComponent {
|
|
3928
|
+
/**
|
|
3929
|
+
* @remarks
|
|
3930
|
+
* Get a reference to the IPlayerUISession. This is the primary
|
|
3931
|
+
* interface to the editor UI and all of the editor extension
|
|
3932
|
+
* controls
|
|
3933
|
+
*
|
|
3934
|
+
*/
|
|
3443
3935
|
get session(): IPlayerUISession;
|
|
3936
|
+
/**
|
|
3937
|
+
* @remarks
|
|
3938
|
+
* Get a reference to the parent tool.
|
|
3939
|
+
*
|
|
3940
|
+
*/
|
|
3444
3941
|
get simpleTool(): ISimpleTool;
|
|
3942
|
+
/**
|
|
3943
|
+
* @remarks
|
|
3944
|
+
* Get the implementation interface of the underlying tool rail
|
|
3945
|
+
* component
|
|
3946
|
+
*
|
|
3947
|
+
*/
|
|
3445
3948
|
get toolRail(): IModalTool;
|
|
3446
3949
|
}
|
|
3447
3950
|
|
|
@@ -3459,14 +3962,47 @@ export interface ISimpleToolRailComponent {
|
|
|
3459
3962
|
* gameplay interaction
|
|
3460
3963
|
*/
|
|
3461
3964
|
export interface ISimpleToolRailOptions {
|
|
3965
|
+
/**
|
|
3966
|
+
* @remarks
|
|
3967
|
+
* The text for the tool description
|
|
3968
|
+
*
|
|
3969
|
+
*/
|
|
3462
3970
|
displayAltText: string;
|
|
3971
|
+
/**
|
|
3972
|
+
* @remarks
|
|
3973
|
+
* The string ID for the tool description if it is in the
|
|
3974
|
+
* localization language file.
|
|
3975
|
+
*
|
|
3976
|
+
*/
|
|
3463
3977
|
displayStringId?: string;
|
|
3978
|
+
/**
|
|
3979
|
+
* @remarks
|
|
3980
|
+
* The icon for the tool rail button. This is generally a URL
|
|
3981
|
+
* to an image file in the editor extension resource pack e.g.
|
|
3982
|
+
* `pack://textures/my-tool-icon.png`
|
|
3983
|
+
*
|
|
3984
|
+
*/
|
|
3464
3985
|
icon: string;
|
|
3465
3986
|
onActivate?: (component: ISimpleToolRailComponent) => void;
|
|
3466
3987
|
onDeactivate?: (component: ISimpleToolRailComponent) => void;
|
|
3467
3988
|
onFinalize?: (component: ISimpleToolRailComponent) => void;
|
|
3468
3989
|
onTeardown?: (component: ISimpleToolRailComponent) => void;
|
|
3990
|
+
/**
|
|
3991
|
+
* @remarks
|
|
3992
|
+
* The tooltip string for the tool rail button. Note: if an
|
|
3993
|
+
* activation key binding was added to `ISimpleToolOptions`,
|
|
3994
|
+
* then the key binding will be appended to the tooltip string.
|
|
3995
|
+
*
|
|
3996
|
+
*/
|
|
3469
3997
|
tooltipAltText: string;
|
|
3998
|
+
/**
|
|
3999
|
+
* @remarks
|
|
4000
|
+
* The string ID for the tooltip string if it is in the
|
|
4001
|
+
* localization language file. Note: if an activation key
|
|
4002
|
+
* binding was added to `ISimpleToolOptions`, then the key
|
|
4003
|
+
* binding will be appended to the tooltip string.
|
|
4004
|
+
*
|
|
4005
|
+
*/
|
|
3470
4006
|
tooltipStringId?: string;
|
|
3471
4007
|
}
|
|
3472
4008
|
|
|
@@ -3483,13 +4019,36 @@ export interface ISimpleToolStatusBarComponent {
|
|
|
3483
4019
|
* status bar item for a simple tool.
|
|
3484
4020
|
*/
|
|
3485
4021
|
export interface ISimpleToolStatusBarOptions {
|
|
4022
|
+
/**
|
|
4023
|
+
* @remarks
|
|
4024
|
+
* The alignment of the status bar item within the parent
|
|
4025
|
+
* status bar container
|
|
4026
|
+
*
|
|
4027
|
+
*/
|
|
3486
4028
|
alignment: EditorStatusBarAlignment;
|
|
4029
|
+
/**
|
|
4030
|
+
* @remarks
|
|
4031
|
+
* The text for the status bar item
|
|
4032
|
+
*
|
|
4033
|
+
*/
|
|
3487
4034
|
displayAltText: string;
|
|
3488
4035
|
onFinalize?: (statusBar: ISimpleToolStatusBarComponent) => void;
|
|
3489
4036
|
onHide?: (statusBar: ISimpleToolStatusBarComponent) => void;
|
|
3490
4037
|
onShow?: (statusBar: ISimpleToolStatusBarComponent) => void;
|
|
3491
4038
|
onTeardown?: (statusBar: ISimpleToolStatusBarComponent) => void;
|
|
4039
|
+
/**
|
|
4040
|
+
* @remarks
|
|
4041
|
+
* The size of the status bar item within the parent status bar
|
|
4042
|
+
* container
|
|
4043
|
+
*
|
|
4044
|
+
*/
|
|
3492
4045
|
size: number;
|
|
4046
|
+
/**
|
|
4047
|
+
* @remarks
|
|
4048
|
+
* Determine the status bar visibility based on the existence
|
|
4049
|
+
* and visibility of the tool's root property pane
|
|
4050
|
+
*
|
|
4051
|
+
*/
|
|
3493
4052
|
visibility?: SimpleToolStatusBarVisibility;
|
|
3494
4053
|
}
|
|
3495
4054
|
|
|
@@ -3576,6 +4135,20 @@ export declare function executeLargeOperation(
|
|
|
3576
4135
|
selection: Selection,
|
|
3577
4136
|
operation: (blockLocation: minecraftserver.Vector3) => void,
|
|
3578
4137
|
): Promise<void>;
|
|
4138
|
+
/**
|
|
4139
|
+
* @remarks
|
|
4140
|
+
* Executes an operation over a BlockLocationIterator via
|
|
4141
|
+
* chunks to allow splitting operation over multiple game ticks
|
|
4142
|
+
*
|
|
4143
|
+
* @param blockLocationIterator
|
|
4144
|
+
* the selection to iterator over
|
|
4145
|
+
* @param operation
|
|
4146
|
+
* the operation to apply over each block location
|
|
4147
|
+
*/
|
|
4148
|
+
export declare function executeLargeOperationFromIterator(
|
|
4149
|
+
blockLocationIterator: minecraftserver.BlockLocationIterator,
|
|
4150
|
+
operation: (blockLocation: minecraftserver.Vector3) => void,
|
|
4151
|
+
): Promise<void>;
|
|
3579
4152
|
/**
|
|
3580
4153
|
* @remarks
|
|
3581
4154
|
* Returns a string array of the default block types for the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-editor",
|
|
3
|
-
"version": "0.1.0-beta.1.21.
|
|
3
|
+
"version": "0.1.0-beta.1.21.10-preview.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@minecraft/common": "^1.0.0",
|
|
17
|
-
"@minecraft/server": "^1.
|
|
17
|
+
"@minecraft/server": "^1.13.0-beta.1.21.10-preview.21"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
20
|
}
|