diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index babde8ff2f..e2c1ef5c96 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -2,6 +2,8 @@ set(GAME main.cpp engine.cpp + + ${CMAKE_SOURCE_DIR}/files/openmw/openmw.rc ) if (ANDROID) diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index 32aaa6e711..272a9b27bf 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -26,6 +26,7 @@ namespace MWGui getWidget(mLevelText, "LevelText"); getWidget(mLevelDescription, "LevelDescription"); getWidget(mCoinBox, "Coins"); + getWidget(mAssignWidget, "AssignWidget"); mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onOkButtonClicked); @@ -83,13 +84,19 @@ namespace MWGui { const int coinSpacing = 10; int curX = mCoinBox->getWidth()/2 - (coinSpacing*(mCoinCount - 1) + 16*mCoinCount)/2; - for (unsigned int i=0; idetachFromWidget(); image->attachToWidget(mCoinBox); - image->setCoord(MyGUI::IntCoord(curX,0,16,16)); - curX += 16+coinSpacing; + if (i < mCoinCount) + { + mCoins[i]->setVisible(true); + image->setCoord(MyGUI::IntCoord(curX,0,16,16)); + curX += 16+coinSpacing; + } + else + mCoins[i]->setVisible(false); } } @@ -100,13 +107,13 @@ namespace MWGui { MyGUI::ImageBox* image = mCoins[i]; image->detachFromWidget(); - image->attachToWidget(mMainWidget); + image->attachToWidget(mAssignWidget); int attribute = mSpentAttributes[i]; int xdiff = mAttributeMultipliers[attribute]->getCaption() == "" ? 0 : 20; - MyGUI::IntPoint pos = mAttributes[attribute]->getAbsolutePosition() - mMainWidget->getAbsolutePosition() - MyGUI::IntPoint(22+xdiff,0); + MyGUI::IntPoint pos = mAttributes[attribute]->getAbsolutePosition() - mAssignWidget->getAbsolutePosition() - MyGUI::IntPoint(22+xdiff,0); pos.top += (mAttributes[attribute]->getHeight() - image->getHeight())/2; image->setPosition(pos); } @@ -178,14 +185,6 @@ namespace MWGui mCoinCount = std::min(sMaxCoins, availableAttributes); - for (unsigned int i = 0; i < sMaxCoins; i++) - { - if (i < mCoinCount) - mCoins[i]->attachToWidget(mCoinBox); - else - mCoins[i]->detachFromWidget(); - } - mSpentAttributes.clear(); resetCoins(); diff --git a/apps/openmw/mwgui/levelupdialog.hpp b/apps/openmw/mwgui/levelupdialog.hpp index 5ca9c8c758..e5edbd53c8 100644 --- a/apps/openmw/mwgui/levelupdialog.hpp +++ b/apps/openmw/mwgui/levelupdialog.hpp @@ -20,6 +20,7 @@ namespace MWGui MyGUI::EditBox* mLevelDescription; MyGUI::Widget* mCoinBox; + MyGUI::Widget* mAssignWidget; std::vector mAttributes; std::vector mAttributeValues; diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index 853b90b0f7..1264185a29 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -559,6 +559,8 @@ namespace MWGui Box * b = dynamic_cast(parent); if (b) b->notifyChildrenSizeChanged(); + else + break; parent = parent->getParent(); } } diff --git a/files/mygui/openmw_enchanting_dialog.layout b/files/mygui/openmw_enchanting_dialog.layout index 188c538e46..811a214e3e 100644 --- a/files/mygui/openmw_enchanting_dialog.layout +++ b/files/mygui/openmw_enchanting_dialog.layout @@ -92,7 +92,6 @@ - diff --git a/files/mygui/openmw_levelup_dialog.layout b/files/mygui/openmw_levelup_dialog.layout index 07e1e560b5..190f16e5d9 100644 --- a/files/mygui/openmw_levelup_dialog.layout +++ b/files/mygui/openmw_levelup_dialog.layout @@ -16,7 +16,7 @@ - + @@ -27,20 +27,20 @@ - + - - - - - - - - + + + + + + + + - + @@ -54,7 +54,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -139,7 +139,7 @@ - + diff --git a/files/openmw/openmw.rc b/files/openmw/openmw.rc new file mode 100644 index 0000000000..325c182c36 --- /dev/null +++ b/files/openmw/openmw.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "../launcher/images/openmw.ico"