Compare commits

..

1 Commits

Author SHA1 Message Date
AncTe
8883eca285
Merge 45c1d8c952 into 820dc5bf4c 2025-06-25 15:43:42 +00:00
3 changed files with 4 additions and 55 deletions

View File

@ -32,8 +32,6 @@ import {
} from './textboxTyper'; } from './textboxTyper';
import { SetupComponentOptions } from '@motajs/system-ui'; import { SetupComponentOptions } from '@motajs/system-ui';
//#region TextContent
export interface TextContentProps export interface TextContentProps
extends DefaultProps, extends DefaultProps,
Partial<ITextContentConfig> { Partial<ITextContentConfig> {
@ -227,8 +225,6 @@ export const TextContent = defineComponent<
}; };
}, textContentOptions); }, textContentOptions);
//#region Textbox
export interface TextboxProps extends TextContentProps, DefaultProps { export interface TextboxProps extends TextContentProps, DefaultProps {
/** 背景颜色 */ /** 背景颜色 */
backColor?: CanvasStyle; backColor?: CanvasStyle;
@ -381,7 +377,7 @@ export const Textbox = defineComponent<
}); });
}; };
//#region store // ----- store
/** 结束打字机 */ /** 结束打字机 */
const storeEmits: TextboxStoreEmits = { const storeEmits: TextboxStoreEmits = {

View File

@ -1,7 +1,7 @@
import { LayerShadowExtends } from '../legacy/shadow'; import { LayerShadowExtends } from '../legacy/shadow';
import { Props, Font, IActionEvent } from '@motajs/render'; import { Props, Font } from '@motajs/render';
import { WeatherController } from '../../weather'; import { WeatherController } from '../../weather';
import { defineComponent, onMounted, onUnmounted, reactive, ref } from 'vue'; import { defineComponent, onMounted, reactive, ref } from 'vue';
import { Textbox, Tip } from '../components'; import { Textbox, Tip } from '../components';
import { GameUI } from '@motajs/system-ui'; import { GameUI } from '@motajs/system-ui';
import { import {
@ -75,7 +75,6 @@ const MainScene = defineComponent(() => {
const map = ref<LayerGroup>(); const map = ref<LayerGroup>();
const hideStatus = ref(false); const hideStatus = ref(false);
const locked = ref(false);
const weather = new WeatherController('main'); const weather = new WeatherController('main');
onMounted(() => { onMounted(() => {
@ -164,50 +163,12 @@ const MainScene = defineComponent(() => {
} }
}; };
const updateDataFallback = () => {
// 更新 locked 状态
locked.value = core.status.lockControl;
};
/**
* registerAction fallback
*/
const clickData = (ev: IActionEvent) => {
const bx = Math.floor(ev.offsetX / 32);
const by = Math.floor(ev.offsetY / 32);
core.doRegisteredAction('onup', bx, by, ev.offsetX, ev.offsetY);
};
/**
* registerAction fallback
*/
const downData = (ev: IActionEvent) => {
const bx = Math.floor(ev.offsetX / 32);
const by = Math.floor(ev.offsetY / 32);
core.doRegisteredAction('ondown', bx, by, ev.offsetX, ev.offsetY);
};
/**
* registerAction fallback
*/
const moveData = (ev: IActionEvent) => {
const bx = Math.floor(ev.offsetX / 32);
const by = Math.floor(ev.offsetY / 32);
core.doRegisteredAction('onmove', bx, by, ev.offsetX, ev.offsetY);
};
const loaded = ref(true); const loaded = ref(true);
onLoaded(() => { onLoaded(() => {
loaded.value = true; loaded.value = true;
}); });
hook.on('statusBarUpdate', updateStatus); hook.on('statusBarUpdate', updateStatus);
hook.on('statusBarUpdate', updateDataFallback);
onUnmounted(() => {
hook.off('statusBarUpdate', updateStatus);
hook.off('statusBarUpdate', updateDataFallback);
});
return () => ( return () => (
<container id="main-scene" width={MAIN_WIDTH} height={MAIN_HEIGHT}> <container id="main-scene" width={MAIN_WIDTH} height={MAIN_HEIGHT}>
@ -237,15 +198,6 @@ const MainScene = defineComponent(() => {
pad={[12, 6]} pad={[12, 6]}
corner={16} corner={16}
/> />
<sprite
nocache
zIndex={170}
hidden={!locked.value}
loc={[0, 0, 480, 480]}
onClick={clickData}
onDown={downData}
onMove={moveData}
/>
</container> </container>
<g-line line={[180 + 480, 0, 180 + 480, 480]} lineWidth={1} /> <g-line line={[180 + 480, 0, 180 + 480, 480]} lineWidth={1} />
{loaded.value && ( {loaded.value && (

View File

@ -384,6 +384,7 @@ export const GameTitle = defineComponent<GameTitleProps>(props => {
const pos = maskPos.value; const pos = maskPos.value;
ctx.save(); ctx.save();
ctx.translate(pos, 0); ctx.translate(pos, 0);
ctx.fillStyle = 'transparent';
ctx.fillStyle = maskGradient!; ctx.fillStyle = maskGradient!;
ctx.fillRect(0, 0, MAIN_WIDTH + MAIN_HEIGHT + 200, MAIN_HEIGHT); ctx.fillRect(0, 0, MAIN_WIDTH + MAIN_HEIGHT + 200, MAIN_HEIGHT);
ctx.restore(); ctx.restore();