-
-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathguiInterface.ts
More file actions
69 lines (61 loc) · 1.88 KB
/
guiInterface.ts
File metadata and controls
69 lines (61 loc) · 1.88 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
/**
* 当前Menu页面显示的Tag
*/
export enum MenuPanelTag {
Save, // “保存”选项卡
Load, // “读取”选项卡
Option, // “设置”选项卡
}
/**
* @interface IGuiState GUI状态接口
*/
export interface IGuiState {
fontOptions: FontOption[];
showStarter: boolean; // 是否显示初始界面(用于使得bgm可以播放)
showTitle: boolean; // 是否显示标题界面
showMenuPanel: boolean; // 是否显示Menu界面
showTextBox: boolean;
showControls: boolean;
controlsVisibility: boolean;
currentMenuTag: MenuPanelTag; // 当前Menu界面的选项卡
showBacklog: boolean;
titleBgm: string; // 标题背景音乐
titleBg: string; // 标题背景图片
logoImage: string[];
showExtra: boolean;
showGlobalDialog: boolean;
showPanicOverlay: boolean;
isEnterGame: boolean;
isShowLogo: boolean;
enableAppreciationMode: boolean; // Pc102
fontOptimization: boolean; // 字体优化
waitNoBreak: boolean; // 处于不可中断的等待
}
export type componentsVisibility = Pick<
IGuiState,
Exclude<keyof IGuiState, 'currentMenuTag' | 'titleBg' | 'titleBgm' | 'logoImage' | 'theme' | 'fontOptions'>
>;
// 标题资源
export type GuiAsset = Pick<IGuiState, 'titleBgm' | 'titleBg'>;
export interface IGuiStore {
GuiState: IGuiState;
setGuiAsset: <K extends keyof GuiAsset>(key: K, value: string) => void;
setVisibility: <K extends keyof componentsVisibility>(key: K, value: boolean) => void;
setMenuPanelTag: (value: MenuPanelTag) => void;
}
export interface setVisibilityPayload {
component: keyof componentsVisibility;
visibility: boolean;
}
export interface setAssetPayload {
asset: keyof GuiAsset;
value: string;
}
export type GuiStore = IGuiStore;
export type FontOptionSource = 'default' | 'template';
export interface FontOption {
family: string;
source: FontOptionSource;
labelKey?: string;
label?: string;
}