fix: 统计数据

This commit is contained in:
AncTe committed 2025-05-27 20:54:36 +08:00
1 parent 12c289d06a
commit 5ddeed6d19
5 files changed
+43 -13

No files matched your search

@@ -73,18 +73,36 @@ export const List = defineComponent<ListProps, ListEmits, keyof ListEmits>(
props.loc[2] ?? 200,
lineHeight.value
];
const selectionLoc: ElementLocator = [
0,
0,
(props.loc[2] ?? 200) - 10,
lineHeight.value
];
const textLoc: ElementLocator = [
10,
lineHeight.value / 2,
void 0,
void 0,
0,
0.5
];
return (
<container onClick={() => select(key)}>
<container loc={loc} onClick={() => select(key)}>
{selected.value === key && (
<Selection
loc={loc}
loc={selectionLoc}
color={props.color}
border={props.border}
winskin={props.winskin}
alphaRange={props.alphaRange}
/>
)}
<text text={value} font={props.font} />
<text
loc={textLoc}
text={value}
font={props.font}
/>
</container>
);
})}
@@ -171,7 +189,7 @@ export const ListPage = defineComponent<
};
return () => (
<container>
<container loc={props.loc}>
<List
{...props}
loc={listLoc.value}
@@ -1,7 +1,7 @@
import { LayerShadowExtends } from '@motajs/legacy-ui';
import { Props, Font } from '@motajs/render';
import { WeatherController } from '../../weather';
import { defineComponent, onMounted, reactive, ref } from 'vue';
import { defineComponent, onMounted, reactive, ref, watch } from 'vue';
import { Textbox, Tip } from '../components';
import { GameUI } from '@motajs/system-ui';
import {
@@ -209,7 +209,8 @@ const MainScene = defineComponent(() => {
)}
<container
loc={[0, 0, MAIN_WIDTH, MAIN_HEIGHT]}
hidden={mainUIController.showBack.value}
hidden={!mainUIController.showBack.value}
zIndex={200}
>
{mainUIController.render()}
</container>
@@ -30,7 +30,7 @@ export interface StatisticsProps extends UIComponentProps, DefaultProps {
}
const statisticsProps = {
props: ['data']
props: ['data', 'controller', 'instance']
} satisfies SetupComponentOptions<StatisticsProps>;
export const Statistics = defineComponent<StatisticsProps>(props => {
@@ -52,6 +52,7 @@ export const Statistics = defineComponent<StatisticsProps>(props => {
loc={[180, 0, 480, 480]}
close
onClose={close}
lineHeight={24}
>
{{
total: () => <TotalStatistics data={props.data} />,
@@ -67,21 +68,29 @@ interface StatisticsPanelProps extends DefaultProps {
data: StatisticsData;
}
const statisticsPanelProps = {
props: ['data']
} satisfies SetupComponentOptions<StatisticsPanelProps>;
const TotalStatistics = defineComponent<StatisticsPanelProps>(props => {
return () => <container></container>;
}, statisticsProps);
return () => (
<container>
<text text="测试"></text>
</container>
);
}, statisticsPanelProps);
const FloorStatistics = defineComponent<StatisticsPanelProps>(props => {
return () => <container></container>;
}, statisticsProps);
}, statisticsPanelProps);
const EnemyStatistics = defineComponent<StatisticsPanelProps>(props => {
return () => <container></container>;
}, statisticsProps);
}, statisticsPanelProps);
const PotionStatistics = defineComponent<StatisticsPanelProps>(props => {
return () => <container></container>;
}, statisticsProps);
}, statisticsPanelProps);
function calculateStatistics(): StatisticsData {
core.setFlag('__statistics__', true);