|
|
|
@ -47,6 +47,12 @@ void MessageBoxManager::onFrame (float frameDuration)
|
|
|
|
|
it++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(mInterMessageBoxe != NULL && mInterMessageBoxe->mMarkedToDelete) {
|
|
|
|
|
delete mInterMessageBoxe;
|
|
|
|
|
mInterMessageBoxe = NULL;
|
|
|
|
|
mWindowManager->setNextMode(GM_Game);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MessageBoxManager::createMessageBox (const std::string& message)
|
|
|
|
@ -124,6 +130,16 @@ void MessageBoxManager::setMessageBoxSpeed (int speed)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int MessageBoxManager::readPressedButton ()
|
|
|
|
|
{
|
|
|
|
|
if(mInterMessageBoxe != NULL)
|
|
|
|
|
{
|
|
|
|
|
return mInterMessageBoxe->readPressedButton();
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message)
|
|
|
|
@ -186,6 +202,7 @@ int MessageBox::getHeight ()
|
|
|
|
|
InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons)
|
|
|
|
|
: Layout("openmw_interactive_messagebox_layout.xml")
|
|
|
|
|
, mMessageBoxManager(parMessageBoxManager)
|
|
|
|
|
, mButtonPressed(-1)
|
|
|
|
|
{
|
|
|
|
|
int fixedWidth = 500;
|
|
|
|
|
int textPadding = 10; // padding between text-widget and main-widget
|
|
|
|
@ -195,6 +212,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|
|
|
|
int buttonPadding = 5; // padding between button label and button itself
|
|
|
|
|
int buttonMainPadding = 10; // padding between buttons and bottom of the main widget
|
|
|
|
|
|
|
|
|
|
mMarkedToDelete = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getWidget(mMessageWidget, "message");
|
|
|
|
|
getWidget(mButtonsWidget, "buttons");
|
|
|
|
@ -222,6 +241,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|
|
|
|
MyGUI::Align::Default);
|
|
|
|
|
button->setCaption(*it);
|
|
|
|
|
|
|
|
|
|
button->eventMouseButtonClick = MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed);
|
|
|
|
|
|
|
|
|
|
mButtons.push_back(button);
|
|
|
|
|
|
|
|
|
|
buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding;
|
|
|
|
@ -343,6 +364,30 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void InteractiveMessageBox::mousePressed (MyGUI::Widget* pressed)
|
|
|
|
|
{
|
|
|
|
|
mMarkedToDelete = true;
|
|
|
|
|
int index = 0;
|
|
|
|
|
std::vector<MyGUI::ButtonPtr>::const_iterator button;
|
|
|
|
|
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
|
|
|
|
{
|
|
|
|
|
if(*button == pressed)
|
|
|
|
|
{
|
|
|
|
|
mButtonPressed = index;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
std::cout << "Cant be possible :/" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int InteractiveMessageBox::readPressedButton ()
|
|
|
|
|
{
|
|
|
|
|
int pressed = mButtonPressed;
|
|
|
|
|
mButtonPressed = -1;
|
|
|
|
|
return pressed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|