Skip to content

Commit 7a9aeba

Browse files
committed
Refactor marker colors, fix startup issue
1 parent 44be08b commit 7a9aeba

File tree

11 files changed

+35
-20
lines changed

11 files changed

+35
-20
lines changed

js/animations/animation_controllers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { openMolangEditor } from './molang_editor';
33
import { clipboard, currentwindow, dialog, fs, ipcRenderer } from '../native_apis';
44
import { Filesystem } from '../file_system';
55
import { Easings } from '../lib/easing';
6+
import { markerColors } from '../marker_colors';
67

78
export class AnimationControllerState {
89
constructor(controller, data = 0) {

js/animations/keyframe.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { markerColors } from "../marker_colors";
12
import { clipboard } from "../native_apis";
23
import { invertMolang } from "../util/molang";
34
import { openMolangEditor } from "./molang_editor";

js/animations/timeline.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { markerColors } from "../marker_colors";
12
import { dragHelper } from "../util/drag_helper";
23

34
export class TimelineMarker {

js/interface/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Blockbench } from "../api";
33
import { Dialog } from "./dialog";
44
import { FormInputType } from "./form";
55
import { ipcRenderer } from "../native_apis";
6+
import { markerColors } from "../marker_colors";
67

78
export const settings: Record<string, Setting> = {};
89
export type settings_type = typeof settings;

js/interface/settings_window.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Blockbench } from "../api";
2+
import { markerColors } from "../marker_colors";
23
import { ipcRenderer } from "../native_apis";
34
import { Plugins } from "../plugin_loader";
45
import { compileJSON } from "../util/json";

js/marker_colors.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export type MarkerColor = {
2+
id: string
3+
name?: string
4+
pastel: string
5+
standard: string
6+
}
7+
export const markerColors: MarkerColor[] = [
8+
{pastel: "#A2EBFF", standard: "#58C0FF", id: 'light_blue'},
9+
{pastel: "#FFF899", standard: "#F4D714", id: 'yellow'},
10+
{pastel: "#F1BB75", standard: "#EC9218", id: 'orange'},
11+
{pastel: "#FF9B97", standard: "#FA565D", id: 'red'},
12+
{pastel: "#C5A6E8", standard: "#B55AF8", id: 'purple'},
13+
{pastel: "#A6C8FF", standard: "#4D89FF", id: 'blue'},
14+
{pastel: "#7BFFA3", standard: "#00CE71", id: 'green'},
15+
{pastel: "#BDFFA6", standard: "#AFFF62", id: 'lime'},
16+
{pastel: "#FFA5D5", standard: "#F96BC5", id: 'pink'},
17+
{pastel: "#E0E9FB", standard: "#C7D5F6", id: 'silver'}
18+
]
19+
const global = {markerColors};
20+
declare global {
21+
//const markerColors: typeof global.markerColors
22+
}
23+
Object.assign(window, global);

js/modeling/mesh/add_mesh.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { markerColors } from "../../marker_colors";
2+
13
BARS.defineActions(function() {
24
let add_mesh_dialog = new Dialog({
35
id: 'add_primitive',

js/outliner/outliner.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { OutlinerNode } from "./abstract/outliner_node"
44
import { OutlinerElement } from "./abstract/outliner_element"
55
import { radToDeg } from "three/src/math/MathUtils"
66
import { PointerTarget } from "../interface/pointer_target"
7+
import { markerColors } from "../marker_colors"
78

89
export const Outliner = {
910
ROOT: 'root',
@@ -213,19 +214,6 @@ Object.defineProperty(window, 'selected', {
213214
console.warn('You cannot modify this')
214215
}
215216
});
216-
//Colors
217-
export const markerColors = [
218-
{pastel: "#A2EBFF", standard: "#58C0FF", id: 'light_blue'},
219-
{pastel: "#FFF899", standard: "#F4D714", id: 'yellow'},
220-
{pastel: "#F1BB75", standard: "#EC9218", id: 'orange'},
221-
{pastel: "#FF9B97", standard: "#FA565D", id: 'red'},
222-
{pastel: "#C5A6E8", standard: "#B55AF8", id: 'purple'},
223-
{pastel: "#A6C8FF", standard: "#4D89FF", id: 'blue'},
224-
{pastel: "#7BFFA3", standard: "#00CE71", id: 'green'},
225-
{pastel: "#BDFFA6", standard: "#AFFF62", id: 'lime'},
226-
{pastel: "#FFA5D5", standard: "#F96BC5", id: 'pink'},
227-
{pastel: "#E0E9FB", standard: "#C7D5F6", id: 'silver'}
228-
]
229217

230218

231219
export class NodePreviewController extends EventSystem {
@@ -1675,7 +1663,6 @@ Interface.definePanels(function() {
16751663

16761664
Object.assign(window, {
16771665
Outliner,
1678-
markerColors,
16791666
OutlinerNode,
16801667
OutlinerElement,
16811668
NodePreviewController,

js/outliner/types/armature_bone.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Armature } from "./armature";
66
import { Vue } from '../../lib/libs'
77
import { OutlinerElement } from "../abstract/outliner_element";
88
import { OutlinerNode } from "../abstract/outliner_node";
9+
import { markerColors } from "../../marker_colors";
910

1011
interface ArmatureBoneOptions {
1112
name?: string

js/plugin_loader.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Filesystem } from "./file_system";
1010
import { app, fs, getPluginPermissions, getPluginScopedRequire, https, revokePluginPermissions } from "./native_apis";
1111
import { Panels } from "./interface/panels";
1212
import VersionUtil from './util/version_util'
13+
import { markerColors } from "./marker_colors";
1314

1415

1516
export const Plugins = {
@@ -1208,6 +1209,7 @@ BARS.defineActions(function() {
12081209
settings: settings,
12091210
isMobile: Blockbench.isMobile,
12101211
isApp,
1212+
markerColors,
12111213
online: navigator.onLine
12121214
},
12131215
computed: {

0 commit comments

Comments
 (0)