mirror of
https://github.com/motajs/template.git
synced 2026-11-30 02:34:30 +08:00
refactor: 组件中的 ITextureManager 和 IMapRenderer 从 inject 中获取默认值
This commit is contained in:
1 parent
65b6b24b1f
commit
ba90ce6dac
16 files changed
+153
-83
No files matched your search
@@ -23,6 +23,7 @@ import {
|
||||
MAP_HEIGHT,
|
||||
MAP_WIDTH
|
||||
} from './uiConstant';
|
||||
import { createRendererScene } from './ui/scene';
|
||||
|
||||
/**
|
||||
* 创建渲染端配置对象
|
||||
@@ -44,6 +45,7 @@ export function createClientCoreConfig(
|
||||
mapBlockHeight: MAP_BLOCK_HEIGHT,
|
||||
expandMapRendererWidth: MAP_WIDTH,
|
||||
expandMapRendererHeight: MAP_HEIGHT,
|
||||
createInitialComponent: createRendererScene,
|
||||
clientPlugins: [new MainClientPlugin(), ...clientPlugins],
|
||||
|
||||
...createCoreStateConfig(starter)
|
||||
|
||||
@@ -276,7 +276,7 @@ export const Shop = defineComponent<IShopProps>(props => {
|
||||
/>
|
||||
<Icon
|
||||
icon={item.num}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={[10, 6, ROW_ICON_SIZE, ROW_ICON_SIZE]}
|
||||
/>
|
||||
<text
|
||||
|
||||
@@ -276,7 +276,7 @@ export const EnemyOne = defineComponent<IEnemyOneProps>(props => {
|
||||
/>
|
||||
<Icon
|
||||
icon={enemy.value?.code ?? 0}
|
||||
manager={props.materials}
|
||||
materials={props.materials}
|
||||
loc={[ICON_CENTER, height.value / 2, ICON_SIZE, ICON_SIZE]}
|
||||
anc={[0.5, 0.5]}
|
||||
noevent
|
||||
|
||||
@@ -474,7 +474,7 @@ export const EquipBox = defineComponent<EquipBoxProps>(props => {
|
||||
// 拖动起手仍只在图标上,整格只负责悬停判定
|
||||
<Icon
|
||||
icon={slotEquip ? slotEquip.item.num : 0}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={slotIconLoc}
|
||||
cursor="pointer"
|
||||
onEnter={getSlotEnter(i)}
|
||||
@@ -533,7 +533,7 @@ export const EquipBox = defineComponent<EquipBoxProps>(props => {
|
||||
/>,
|
||||
<Icon
|
||||
icon={item.item.num}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={ownedIconLoc}
|
||||
noevent
|
||||
/>,
|
||||
@@ -563,7 +563,7 @@ export const EquipBox = defineComponent<EquipBoxProps>(props => {
|
||||
{/* 拖拽浮层 */}
|
||||
<Icon
|
||||
icon={dragNum.value > 0 ? dragNum.value : 0}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={dragLoc}
|
||||
noevent
|
||||
zIndex={100}
|
||||
|
||||
@@ -254,7 +254,7 @@ export const ToolBox = defineComponent<ToolBoxProps>(props => {
|
||||
/>,
|
||||
<Icon
|
||||
icon={item.num}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={[10, y + 7, ROW_ICON_SIZE, ROW_ICON_SIZE]}
|
||||
noevent
|
||||
/>,
|
||||
@@ -307,7 +307,7 @@ export const ToolBox = defineComponent<ToolBoxProps>(props => {
|
||||
/>,
|
||||
<Icon
|
||||
icon={item.num}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={[10, y + 7, ROW_ICON_SIZE, ROW_ICON_SIZE]}
|
||||
noevent
|
||||
/>,
|
||||
@@ -333,7 +333,7 @@ export const ToolBox = defineComponent<ToolBoxProps>(props => {
|
||||
{/* 详情图标、名称与类型 */}
|
||||
<Icon
|
||||
icon={current ? current.num : 0}
|
||||
manager={props.state.materials}
|
||||
materials={props.state.materials}
|
||||
loc={[INFO_LEFT + 8, 8, DETAIL_ICON_SIZE, DETAIL_ICON_SIZE]}
|
||||
noevent
|
||||
hidden={!current}
|
||||
|
||||
Reference in new issue
Block a user