diff options
-rw-r--r-- | src/koopatlas/shop.cpp | 31 | ||||
-rw-r--r-- | src/koopatlas/shop.h | 4 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp index 514bd43..4852d81 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -53,6 +53,7 @@ void dWMShop_c::ShopModel_c::setupLakitu(int id) { }; scaleFactor = 1.0f; + scaleEase = 0.0f; allocator.link(-1, GameHeaps[0], 0, 0x20); @@ -85,7 +86,9 @@ void dWMShop_c::ShopModel_c::draw() { mtx.translation(x, y, 1000.0f); model.setDrawMatrix(mtx); - Vec scale = {scaleFactor, scaleFactor, scaleFactor}; + float s = scaleFactor * scaleEase; + + Vec scale = {s, s, s}; model.setScale(&scale); model.calcWorld(false); @@ -233,15 +236,19 @@ int dWMShop_c::onDraw() { void dWMShop_c::specialDraw1() { if (visible) { + lakituModel->scaleEase = scaleEase; lakituModel->draw(); - for (int i = 0; i < 12; i++) + for (int i = 0; i < 12; i++) { + itemModels[i].scaleEase = scaleEase; itemModels[i].draw(); + } + } + // if (wasOff) { effect.spawn("Wm_ob_greencoinkira", 0, &pos, &rot, &scale); wasOff = false; } // if(this->ska.isAnimationDone()) // this->ska.setCurrentFrame(0.0); - } } @@ -263,6 +270,7 @@ void dWMShop_c::beginState_ShowWait() { layout.disableAllAnimations(); layout.enableNonLoopAnim(SHOW_ALL); visible = true; + scaleEase = 0.0; loadInfo(); loadModels(); @@ -282,11 +290,16 @@ void dWMShop_c::executeState_ButtonActivateWait() { if (!layout.isAnyAnimOn()) state.setState(&StateID_Wait); } -void dWMShop_c::endState_ButtonActivateWait() { } +void dWMShop_c::endState_ButtonActivateWait() { OSReport("Wait"); } // Wait -void dWMShop_c::beginState_Wait() { } +void dWMShop_c::beginState_Wait() { timer = 0; MapSoundPlayer(SoundRelatedClass, SE_OBJ_CLOUD_BLOCK_TO_JUGEM, 1); } void dWMShop_c::executeState_Wait() { + if (timer < 90) + scaleEase = -((cos(timer * 3.14 /20)-0.9)/timer*10)+1; + timer++; + OSReport("Scale Ease @ %f, timer %d", scaleEase, timer); + int nowPressed = Remocon_GetPressed(GetActiveRemocon()); int newSelection = -1; @@ -341,8 +354,16 @@ void dWMShop_c::beginState_HideWait() { MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_OUT_AUTO, 1); layout.enableNonLoopAnim(HIDE_ALL); layout.enableNonLoopAnim(DEACTIVATE_BUTTON+selected); + + timer = 25; + MapSoundPlayer(SoundRelatedClass, SE_OBJ_CS_KINOHOUSE_DISAPP, 1); } void dWMShop_c::executeState_HideWait() { + if (timer > 0) + scaleEase = -((cos(timer * 3.14 /13.5)-0.9)/timer*10)+1; + OSReport("Scale Ease @ %f, timer %d", scaleEase, timer); + timer--; + if (!layout.isAnimOn(HIDE_ALL)) state.setState(&StateID_Hidden); } diff --git a/src/koopatlas/shop.h b/src/koopatlas/shop.h index 304154a..2381b29 100644 --- a/src/koopatlas/shop.h +++ b/src/koopatlas/shop.h @@ -21,6 +21,8 @@ class dWMShop_c : public dActor_c { m2d::EmbedLayout_c layout; bool visible; + float scaleEase; + int timer; int selected, lastTopRowChoice; int shopKind; @@ -70,7 +72,7 @@ class dWMShop_c : public dActor_c { m3d::mdl_c model; m3d::anmChr_c animation; - float x, y, scaleFactor; + float x, y, scaleFactor, scaleEase; void setupItem(float x, float y, ItemTypes type); void setupLakitu(int id); |