@@ -12,6 +12,8 @@ import { getActions, getActionSnapshotPath } from "./asset-lib/unit-action/Main"
1212import { reducePromise } from "meta3d-structure-utils/src/ArrayUtils"
1313import { imageSrcToBase64 } from "meta3d-file-ts-utils/src/ImageUtils"
1414import { action , countFactor , emitSpeed , emitterSpeed , excitement } from "meta3d-action-mod-unit-publish-to-game-protocol/src/UnitType"
15+ import { getAllPropData , getPropSnapshotPath } from "./asset-lib/prop/Main"
16+ import { gem } from "meta3d-action-mod-unit-publish-to-game-protocol/src/Type"
1517
1618// let _buildAllDefaultCareerFeatures = (api: api) => {
1719// // let modAPI = _buildFakeModAPI()
@@ -123,13 +125,33 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
123125 } ,
124126 api . immutable . createMap ( )
125127 ) . then ( newAllActionData => {
126- meta3dState = api . action . setActionState ( meta3dState , actionName , {
127- ...api . nullable . getExn ( api . action . getActionState < state > ( meta3dState , actionName ) ) ,
128- allModelData : newAllModelData ,
129- allActionData : newAllActionData ,
130- } )
128+ return reducePromise (
129+ getAllPropData ( ) ,
130+ ( result , data ) => {
131+ return new Promise ( ( resolve , reject ) => {
132+ imageSrcToBase64 (
133+ resolve ,
134+ reject ,
135+ getPropSnapshotPath ( _getPathPrefix ( "prop" ) , data . name )
136+ )
137+ } ) . then ( ( imageBase64 ) => {
138+ return result . push ( {
139+ ...data ,
140+ snapshotImageBase64 : imageBase64 ,
141+ } )
142+ } )
143+ } ,
144+ api . immutable . createList ( )
145+ ) . then ( newProps => {
146+ meta3dState = api . action . setActionState ( meta3dState , actionName , {
147+ ...api . nullable . getExn ( api . action . getActionState < state > ( meta3dState , actionName ) ) ,
148+ allModelData : newAllModelData ,
149+ allActionData : newAllActionData ,
150+ allPropData : newProps ,
151+ } )
131152
132- return meta3dState
153+ return meta3dState
154+ } )
133155 } )
134156 } )
135157 } )
@@ -161,10 +183,12 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
161183 // allModelData: api.immutable.createMapOfData(getAllModelData()),
162184 allModelData : api . immutable . createMap ( ) ,
163185 allActionData : api . immutable . createMap ( ) ,
186+ allPropData : api . immutable . createList ( ) ,
164187
165188 selectedModelIndex : api . nullable . getEmpty ( ) ,
166189 selectedSmallSkillObjectActionIndex : api . nullable . getEmpty ( ) ,
167190 selectedBigSkillObjectActionIndex : api . nullable . getEmpty ( ) ,
191+ // selectedPropIndex: api.nullable.getEmpty(),
168192
169193 // isShowModelWindow: false,
170194 // isShowSkillWindow: false,
@@ -175,6 +199,7 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
175199 isShowActionModal : false ,
176200 isShowSmallSkillObjectActionValueModal : false ,
177201 isShowBigSkillObjectActionValueModal : false ,
202+ isShowPropModal : false ,
178203
179204 excitement : excitement . Level5 ,
180205
@@ -205,6 +230,9 @@ export let getContribute: getContributeMeta3D<actionContribute<uiData, state>> =
205230
206231 bo_sceneData_rate : 0 ,
207232 bo_sceneData_countFactor : countFactor . Level5 ,
233+
234+
235+ prop : [ ] ,
208236 }
209237 }
210238 }
0 commit comments