diff options
author | Treeki <treeki@gmail.com> | 2013-02-07 03:45:53 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-02-07 03:45:53 +0100 |
commit | 64cd97926e2a45f5220a23626721e60d0ceacfae (patch) | |
tree | 42cdc7ba48dd59703e4e441026cd69ce1bd2c952 /src/koopatlas/shop.cpp | |
parent | e7dd81b3099f6e3e592f51b923a9e9c3b82ff2ef (diff) | |
download | kamek-64cd97926e2a45f5220a23626721e60d0ceacfae.tar.gz kamek-64cd97926e2a45f5220a23626721e60d0ceacfae.zip |
various fixes to Layout code
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/shop.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp index e3cade7..27f6077 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -141,7 +141,7 @@ int dWMShop_c::onCreate() { layout.clipY = 52; layout.clipWidth = 640; layout.clipHeight = 352; - layout.layout.rootPane->scale.x = 0.7711f; + layout.layout.rootPane->scale.x = 0.731f; layout.layout.rootPane->scale.y = 0.7711f; } @@ -200,6 +200,10 @@ int dWMShop_c::onCreate() { Buttons[i] = layout.findPaneByName(name); } + Btn1Base = layout.findPaneByName("Btn1_Base"); + Btn2Base = layout.findPaneByName("Btn2_Base"); + OSReport("Found btn 1,2: %p, %p\n", Btn1Base, Btn2Base); + leftCol.setTexMap(BtnLeft[0]->material->texMaps); midCol.setTexMap(BtnMid[0]->material->texMaps); rightCol.setTexMap(BtnRight[0]->material->texMaps); @@ -210,8 +214,6 @@ int dWMShop_c::onCreate() { rightCol.applyAlso(BtnRight[i]->material->texMaps); } - Buttons[5]->size.x = 252.0f; // don't feel like editing rlyt - layoutLoaded = true; } @@ -363,7 +365,11 @@ void dWMShop_c::executeState_Wait() { layout.enableNonLoopAnim(DEACTIVATE_BUTTON+selected); layout.enableNonLoopAnim(ACTIVATE_BUTTON+newSelection); - UpdateSelectCursor(Buttons[newSelection], 0, false); + switch (newSelection) { + case 4: UpdateSelectCursor(Btn1Base, 0, false); break; + case 5: UpdateSelectCursor(Btn2Base, 0, false); break; + default: UpdateSelectCursor(Buttons[newSelection], 0, false); + } selected = newSelection; if (newSelection <= 3) @@ -472,6 +478,12 @@ void dWMShop_c::loadModels() { lakituModel->setupLakitu(shopKind); lakituModel->x = 240.0f; lakituModel->y = 220.0f; + if (!IsWideScreen()) { + lakituModel->x = (0.731f * (lakituModel->x + 416.0f)) - 292.0f; + lakituModel->y *= 0.7711f; + lakituModel->y += 52.0f; + lakituModel->scaleFactor = 0.77f; + } static const float itemPos[ITEM_COUNT][2] = { {357.0f, 276.0f}, @@ -491,8 +503,17 @@ void dWMShop_c::loadModels() { }; itemModels = new ShopModel_c[ITEM_COUNT]; - for (int i = 0; i < ITEM_COUNT; i++) - itemModels[i].setupItem(itemPos[i][0], itemPos[i][1], Inventory[shopKind][i]); + for (int i = 0; i < ITEM_COUNT; i++) { + float effectiveX = itemPos[i][0]; + float effectiveY = itemPos[i][1]; + if (!IsWideScreen()) { + effectiveX = (0.731f * (effectiveX + 416.0f)) - 296.0f; + effectiveY *= 0.7711f; + effectiveY += 50.0f; + itemModels[i].scaleFactor = 1.6f; + } + itemModels[i].setupItem(effectiveX, effectiveY, Inventory[shopKind][i]); + } } void dWMShop_c::deleteModels() { if (lakituModel) |