mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-07-16 01:27:58 +08:00
fix: 工具栏打开设置 & 工具栏数字键盘的字体
This commit is contained in:
parent
fe7e765e95
commit
09f02a6989
@ -19,7 +19,7 @@ import { useKey } from '../use';
|
|||||||
import { MAP_WIDTH } from '../shared';
|
import { MAP_WIDTH } from '../shared';
|
||||||
import { getSave, SaveData } from '../utils';
|
import { getSave, SaveData } from '../utils';
|
||||||
import { Thumbnail } from '../components/thumbnail';
|
import { Thumbnail } from '../components/thumbnail';
|
||||||
import { adjustGrid, IGridLayoutData } from '../utils/layout';
|
import { adjustGrid, IGridLayoutData } from '../utils';
|
||||||
|
|
||||||
export const enum SaveMode {
|
export const enum SaveMode {
|
||||||
Save,
|
Save,
|
||||||
|
@ -24,6 +24,7 @@ import { SetupComponentOptions } from '@motajs/system-ui';
|
|||||||
import { saveSave, saveLoad } from './save';
|
import { saveSave, saveLoad } from './save';
|
||||||
import { mainUIController } from './controller';
|
import { mainUIController } from './controller';
|
||||||
import { MAIN_WIDTH, MAIN_HEIGHT } from '../shared';
|
import { MAIN_WIDTH, MAIN_HEIGHT } from '../shared';
|
||||||
|
import { openSettings } from './settings';
|
||||||
|
|
||||||
interface ToolbarProps extends DefaultProps {
|
interface ToolbarProps extends DefaultProps {
|
||||||
loc?: ElementLocator;
|
loc?: ElementLocator;
|
||||||
@ -115,7 +116,9 @@ export const PlayingToolbar = defineComponent<
|
|||||||
};
|
};
|
||||||
const danmaku = () => requestAnimationFrame(openDanmakuPoster);
|
const danmaku = () => requestAnimationFrame(openDanmakuPoster);
|
||||||
const replay = () => core.ui._drawReplay();
|
const replay = () => core.ui._drawReplay();
|
||||||
const settings = () => core.openSettings(true);
|
const settings = () => {
|
||||||
|
openSettings(mainUIController, [420, 240, 240, 400, 0.5, 0.5]);
|
||||||
|
};
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<container loc={props.loc} cursor="pointer">
|
<container loc={props.loc} cursor="pointer">
|
||||||
@ -241,6 +244,7 @@ export const NumpadToolbar = defineComponent<
|
|||||||
>((props, { emit }) => {
|
>((props, { emit }) => {
|
||||||
const numpad = () => emit('numpad');
|
const numpad = () => emit('numpad');
|
||||||
const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
||||||
|
const font = new Font('Verdana', 14);
|
||||||
|
|
||||||
const ctrlEnabled = ref(false);
|
const ctrlEnabled = ref(false);
|
||||||
const shiftEnabled = ref(false);
|
const shiftEnabled = ref(false);
|
||||||
@ -314,6 +318,7 @@ export const NumpadToolbar = defineComponent<
|
|||||||
<text
|
<text
|
||||||
text={v.toString()}
|
text={v.toString()}
|
||||||
loc={middle(col, row)}
|
loc={middle(col, row)}
|
||||||
|
font={font}
|
||||||
noevent
|
noevent
|
||||||
/>
|
/>
|
||||||
];
|
];
|
||||||
@ -332,6 +337,7 @@ export const NumpadToolbar = defineComponent<
|
|||||||
text="Ctrl"
|
text="Ctrl"
|
||||||
loc={[59, 93, void 0, void 0, 0.5, 0.5]}
|
loc={[59, 93, void 0, void 0, 0.5, 0.5]}
|
||||||
fillStyle={ctrlTextColor.value}
|
fillStyle={ctrlTextColor.value}
|
||||||
|
font={font}
|
||||||
noevent
|
noevent
|
||||||
/>
|
/>
|
||||||
<g-rectr
|
<g-rectr
|
||||||
@ -346,6 +352,7 @@ export const NumpadToolbar = defineComponent<
|
|||||||
text="Shift"
|
text="Shift"
|
||||||
loc={[108, 93, void 0, void 0, 0.5, 0.5]}
|
loc={[108, 93, void 0, void 0, 0.5, 0.5]}
|
||||||
fillStyle={shiftTextColor.value}
|
fillStyle={shiftTextColor.value}
|
||||||
|
font={font}
|
||||||
noevent
|
noevent
|
||||||
/>
|
/>
|
||||||
<g-rectr
|
<g-rectr
|
||||||
@ -360,6 +367,7 @@ export const NumpadToolbar = defineComponent<
|
|||||||
text="Alt"
|
text="Alt"
|
||||||
loc={[154, 93, void 0, void 0, 0.5, 0.5]}
|
loc={[154, 93, void 0, void 0, 0.5, 0.5]}
|
||||||
fillStyle={altTextColor.value}
|
fillStyle={altTextColor.value}
|
||||||
|
font={font}
|
||||||
noevent
|
noevent
|
||||||
/>
|
/>
|
||||||
<NumpadIcon loc={ic(0, 2)} strokeStyle="gold" onClick={numpad} />
|
<NumpadIcon loc={ic(0, 2)} strokeStyle="gold" onClick={numpad} />
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
export * from './layout';
|
||||||
export * from './saves';
|
export * from './saves';
|
||||||
export * from './use';
|
export * from './use';
|
||||||
|
@ -3406,10 +3406,7 @@ events.prototype.load = function (fromUserAction) {
|
|||||||
|
|
||||||
////// 点击设置按钮时的操作 //////
|
////// 点击设置按钮时的操作 //////
|
||||||
events.prototype.openSettings = function (fromUserAction) {
|
events.prototype.openSettings = function (fromUserAction) {
|
||||||
if (core.isReplaying()) return;
|
// deprecated.
|
||||||
if (!this._checkStatus('settings', fromUserAction)) return;
|
|
||||||
core.playSound('打开界面');
|
|
||||||
core.ui._drawSettings();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------ 一些事件的具体执行过程 ------ //
|
// ------ 一些事件的具体执行过程 ------ //
|
||||||
|
Loading…
Reference in New Issue
Block a user