mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 05:44:06 +00:00
[Client] Make it possible to get ContainerWindow from elsewhere in code
This commit is contained in:
parent
bbdc30628b
commit
bb15ee9215
3 changed files with 57 additions and 4 deletions
|
@ -145,6 +145,17 @@ namespace MWBase
|
||||||
virtual MWGui::ConfirmationDialog* getConfirmationDialog() = 0;
|
virtual MWGui::ConfirmationDialog* getConfirmationDialog() = 0;
|
||||||
virtual MWGui::TradeWindow* getTradeWindow() = 0;
|
virtual MWGui::TradeWindow* getTradeWindow() = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Make it possible to get the ContainerWindow from elsewhere
|
||||||
|
in the code
|
||||||
|
*/
|
||||||
|
virtual MWGui::ContainerWindow* getContainerWindow() = 0;
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
/// Make the player use an item, while updating GUI state accordingly
|
/// Make the player use an item, while updating GUI state accordingly
|
||||||
virtual void useItem(const MWWorld::Ptr& item) = 0;
|
virtual void useItem(const MWWorld::Ptr& item) = 0;
|
||||||
|
|
||||||
|
|
|
@ -384,10 +384,19 @@ namespace MWGui
|
||||||
mGuiModeStates[GM_Dialogue] = GuiModeState(mDialogueWindow);
|
mGuiModeStates[GM_Dialogue] = GuiModeState(mDialogueWindow);
|
||||||
mTradeWindow->eventTradeDone += MyGUI::newDelegate(mDialogueWindow, &DialogueWindow::onTradeComplete);
|
mTradeWindow->eventTradeDone += MyGUI::newDelegate(mDialogueWindow, &DialogueWindow::onTradeComplete);
|
||||||
|
|
||||||
ContainerWindow* containerWindow = new ContainerWindow(mDragAndDrop);
|
/*
|
||||||
mWindows.push_back(containerWindow);
|
Start of tes3mp change (major)
|
||||||
trackWindow(containerWindow, "container");
|
|
||||||
mGuiModeStates[GM_Container] = GuiModeState({containerWindow, mInventoryWindow});
|
Use a member variable (mContainerWIndow) instead of a local one so
|
||||||
|
we can access it from elsewhere
|
||||||
|
*/
|
||||||
|
mContainerWindow = new ContainerWindow(mDragAndDrop);
|
||||||
|
mWindows.push_back(mContainerWindow);
|
||||||
|
trackWindow(mContainerWindow, "container");
|
||||||
|
mGuiModeStates[GM_Container] = GuiModeState({mContainerWindow, mInventoryWindow});
|
||||||
|
/*
|
||||||
|
End of tes3mp change (major)
|
||||||
|
*/
|
||||||
|
|
||||||
mHud = new HUD(mCustomMarkers, mDragAndDrop, mLocalMapRender);
|
mHud = new HUD(mCustomMarkers, mDragAndDrop, mLocalMapRender);
|
||||||
mWindows.push_back(mHud);
|
mWindows.push_back(mHud);
|
||||||
|
@ -1399,6 +1408,17 @@ namespace MWGui
|
||||||
MWGui::ConfirmationDialog* WindowManager::getConfirmationDialog() { return mConfirmationDialog; }
|
MWGui::ConfirmationDialog* WindowManager::getConfirmationDialog() { return mConfirmationDialog; }
|
||||||
MWGui::TradeWindow* WindowManager::getTradeWindow() { return mTradeWindow; }
|
MWGui::TradeWindow* WindowManager::getTradeWindow() { return mTradeWindow; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Make it possible to get the ContainerWindow from elsewhere
|
||||||
|
in the code
|
||||||
|
*/
|
||||||
|
MWGui::ContainerWindow* WindowManager::getContainerWindow() { return mContainerWindow; }
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
void WindowManager::useItem(const MWWorld::Ptr &item)
|
void WindowManager::useItem(const MWWorld::Ptr &item)
|
||||||
{
|
{
|
||||||
if (mInventoryWindow)
|
if (mInventoryWindow)
|
||||||
|
|
|
@ -184,6 +184,17 @@ namespace MWGui
|
||||||
virtual MWGui::ConfirmationDialog* getConfirmationDialog();
|
virtual MWGui::ConfirmationDialog* getConfirmationDialog();
|
||||||
virtual MWGui::TradeWindow* getTradeWindow();
|
virtual MWGui::TradeWindow* getTradeWindow();
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Make it possible to get the ContainerWindow from elsewhere
|
||||||
|
in the code
|
||||||
|
*/
|
||||||
|
virtual MWGui::ContainerWindow* getContainerWindow();
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
/// Make the player use an item, while updating GUI state accordingly
|
/// Make the player use an item, while updating GUI state accordingly
|
||||||
virtual void useItem(const MWWorld::Ptr& item);
|
virtual void useItem(const MWWorld::Ptr& item);
|
||||||
|
|
||||||
|
@ -510,6 +521,17 @@ namespace MWGui
|
||||||
DebugWindow* mDebugWindow;
|
DebugWindow* mDebugWindow;
|
||||||
JailScreen* mJailScreen;
|
JailScreen* mJailScreen;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Keep a pointer to the container window because of its usefulness
|
||||||
|
in multiplayer for container sync
|
||||||
|
*/
|
||||||
|
ContainerWindow* mContainerWindow;
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
std::vector<WindowBase*> mWindows;
|
std::vector<WindowBase*> mWindows;
|
||||||
|
|
||||||
Translation::Storage& mTranslationDataStorage;
|
Translation::Storage& mTranslationDataStorage;
|
||||||
|
|
Loading…
Reference in a new issue