mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 10:45:32 +00:00
Merge pull request #312 from TES3MP/master
Add master commits up to 10 Oct 2017
This commit is contained in:
commit
fe9a3088bd
7 changed files with 28 additions and 12 deletions
|
@ -538,6 +538,7 @@ if(WIN32)
|
|||
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org")
|
||||
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.openmw.org")
|
||||
SET(CPACK_NSIS_INSTALLED_ICON_NAME "openmw-launcher.exe")
|
||||
SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "openmw-launcher.exe")
|
||||
SET(CPACK_NSIS_MUI_ICON "${OpenMW_SOURCE_DIR}/files/tes3mp/tes3mp.ico")
|
||||
SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/tes3mp/tes3mp.ico")
|
||||
SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp")
|
||||
|
|
|
@ -30,8 +30,17 @@ Cell::Iterator Cell::end() const
|
|||
|
||||
void Cell::addPlayer(Player *player)
|
||||
{
|
||||
auto it = find(player->cells.begin(), player->cells.end(), this);
|
||||
if (it == player->cells.end())
|
||||
// Ensure the player hasn't already been added
|
||||
auto it = find(begin(), end(), player);
|
||||
|
||||
if (it != end())
|
||||
{
|
||||
LOG_APPEND(Log::LOG_INFO, "- Attempt to add %s to Cell %s again was ignored", player->npc.mName.c_str(), getDescription().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
auto it2 = find(player->cells.begin(), player->cells.end(), this);
|
||||
if (it2 == player->cells.end())
|
||||
{
|
||||
LOG_APPEND(Log::LOG_INFO, "- Adding %s to Player %s", getDescription().c_str(), player->npc.mName.c_str());
|
||||
|
||||
|
|
|
@ -142,6 +142,9 @@ void ContainerItemModel::update()
|
|||
|
||||
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
||||
{
|
||||
if (!(*it).getClass().showsInInventory(*it))
|
||||
continue;
|
||||
|
||||
std::vector<ItemStack>::iterator itemStack = mItems.begin();
|
||||
for (; itemStack != mItems.end(); ++itemStack)
|
||||
{
|
||||
|
|
|
@ -203,4 +203,10 @@ namespace MWGui
|
|||
checkReferenceAvailable();
|
||||
mTimeAdvancer.onFrame(dt);
|
||||
}
|
||||
|
||||
bool TrainingWindow::exit()
|
||||
{
|
||||
return !mTimeAdvancer.isRunning();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace MWGui
|
|||
|
||||
virtual void onOpen();
|
||||
|
||||
bool exit() { return false; }
|
||||
bool exit();
|
||||
|
||||
void setPtr(const MWWorld::Ptr& actor);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ mwmp::GUIController::GUIController(): mInputBox(0), mListBox(0)
|
|||
mChat = nullptr;
|
||||
keySay = SDL_SCANCODE_Y;
|
||||
keyChatMode = SDL_SCANCODE_F2;
|
||||
calledMessageBox = false;
|
||||
calledInteractiveMessage = false;
|
||||
}
|
||||
|
||||
mwmp::GUIController::~GUIController()
|
||||
|
@ -118,10 +118,7 @@ void mwmp::GUIController::showDialogList(const mwmp::BasePlayer::GUIMessageBox &
|
|||
void mwmp::GUIController::showMessageBox(const BasePlayer::GUIMessageBox &guiMessageBox)
|
||||
{
|
||||
MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager();
|
||||
std::vector<std::string> buttons;
|
||||
buttons.push_back("Ok");
|
||||
windowManager->interactiveMessageBox(guiMessageBox.label, buttons);
|
||||
calledMessageBox = true;
|
||||
windowManager->messageBox(guiMessageBox.label);
|
||||
}
|
||||
|
||||
std::vector<std::string> splitString(const std::string &str, char delim = ';')
|
||||
|
@ -139,7 +136,7 @@ void mwmp::GUIController::showCustomMessageBox(const BasePlayer::GUIMessageBox &
|
|||
MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager();
|
||||
std::vector<std::string> buttons = splitString(guiMessageBox.buttons);
|
||||
windowManager->interactiveMessageBox(guiMessageBox.label, buttons);
|
||||
calledMessageBox = true;
|
||||
calledInteractiveMessage = true;
|
||||
}
|
||||
|
||||
void mwmp::GUIController::showInputBox(const BasePlayer::GUIMessageBox &guiMessageBox)
|
||||
|
@ -207,10 +204,10 @@ void mwmp::GUIController::update(float dt)
|
|||
// checked somewhere else
|
||||
int pressedButton = MWBase::Environment::get().getWindowManager()->readPressedButton(false);
|
||||
|
||||
if (pressedButton != -1 && calledMessageBox)
|
||||
if (pressedButton != -1 && calledInteractiveMessage)
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Pressed: %d", pressedButton);
|
||||
calledMessageBox = false;
|
||||
calledInteractiveMessage = false;
|
||||
Main::get().getLocalPlayer()->guiMessageBox.data = MyGUI::utility::toString(pressedButton);
|
||||
Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->setPlayer(Main::get().getLocalPlayer());
|
||||
Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->Send();
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace mwmp
|
|||
int keyChatMode;
|
||||
|
||||
long id;
|
||||
bool calledMessageBox;
|
||||
bool calledInteractiveMessage;
|
||||
TextInputDialog *mInputBox;
|
||||
GUIDialogList *mListBox;
|
||||
void onInputBoxDone(MWGui::WindowBase* parWindow);
|
||||
|
|
Loading…
Reference in a new issue