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 29a96b0..cd20ddb 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -118,6 +118,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", @@ -222,20 +223,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; } @@ -282,6 +286,8 @@ void dWMShop_c::LoadShopForWorld(int world) { if (!isHidden) { return; } + wasOff = true; + // Handle showing it MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_IN, 1); isHidden = false; @@ -328,6 +334,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(); |