diff options
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/shop.cpp | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp index eed0222..211ab49 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -138,6 +138,7 @@ int dWMShop_c::onCreate() { return false; currentItem = 0; + wasOff = false; static const char *brlanNames[5] = {"shop_hitButton.brlan", "shop_offButton.brlan", "shop_onButton.brlan", "shop_inWindow.brlan", "shop_outWindow.brlan"}; static const char *groupNames[20] = {"B00_Button", "B01_Button", "B02_Button", "B03_Button", "B05_Button", "B08_Button", @@ -242,20 +243,23 @@ int dWMShop_c::onDraw() { } void dWMShop_c::specialDraw1() { - if (!isHidden) { - // Vec pos = {250.0f, 170.0f, -1000.0f}; - // S16Vec rot = {0,0,0}; - // Vec scale = {1.0f, 1.0f, 1.0f}; - // matrix.translation(pos.x, pos.y, pos.z); - // matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z); - - // shopkeep.setDrawMatrix(matrix); - // shopkeep.setScale(&scale); - // shopkeep.calcWorld(false); - // shopkeep.scheduleForDrawing(); - - // if(this->ska.isAnimationDone()) - // this->ska.setCurrentFrame(0.0); + if (!isHidden && !layout.isAnimOn(18) && !layout.isAnimOn(19)) { + + Vec pos = {250.0f, 170.0f, 1000.0f}; + S16Vec rot = {0,0,0}; + Vec scale = {1.0f, 1.0f, 1.0f}; + matrix.translation(pos.x, pos.y, pos.z); + matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z); + + shopkeep.setDrawMatrix(matrix); + shopkeep.setScale(&scale); + shopkeep.calcWorld(false); + shopkeep.scheduleForDrawing(); + + if (wasOff) { effect.spawn("Wm_ob_greencoinkira", 0, &pos, &rot, &scale); wasOff = false; } + + if(this->ska.isAnimationDone()) + this->ska.setCurrentFrame(0.0); } return; } @@ -302,6 +306,8 @@ void dWMShop_c::LoadShopForWorld(int world) { if (!isHidden) { return; } + wasOff = true; + // Handle showing it MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_IN, 1); isHidden = false; @@ -348,6 +354,8 @@ void dWMShop_c::CloseUpShop() { changeItem(currentItem, 0); currentItem = 0; + effect.spawn("Wm_ob_greencoinkira", 0, &pos, &rot, &scale); + // itemA->Delete(); // itemB->Delete(); // itemC->Delete(); |