[Client] Add comments for GUI additions made by tes3mp

pull/249/merge
David Cernat 8 years ago
parent b1fb9ba23e
commit ad4b1d05bb

@ -11,14 +11,22 @@
#include <MyGUI_RotatingSkin.h>
#include <MyGUI_FactoryManager.h>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/GUIController.hpp"
/*
End of tes3mp addition
*/
#include <components/esm/globalmap.hpp>
#include <components/esm/esmwriter.hpp>
#include <components/settings/settings.hpp>
#include <components/myguiplatform/myguitexture.hpp>
#include "../mwmp/Main.hpp"
#include "../mwmp/GUIController.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
@ -179,13 +187,31 @@ namespace MWGui
, mNeedDoorMarkersUpdate(false)
{
mCustomMarkers.eventMarkersChanged += MyGUI::newDelegate(this, &LocalMapBase::updateCustomMarkers);
/*
Start of tes3mp addition
Add a MyGUI delegate for updating player markers
*/
mwmp::Main::get().getGUIController()->mPlayerMarkers.eventMarkersChanged += MyGUI::newDelegate(this, &LocalMapBase::updatePlayerMarkers);
/*
End of tes3mp addition
*/
}
LocalMapBase::~LocalMapBase()
{
mCustomMarkers.eventMarkersChanged -= MyGUI::newDelegate(this, &LocalMapBase::updateCustomMarkers);
/*
Start of tes3mp addition
Remove a MyGUI delegate for updating player markers
*/
mwmp::Main::get().getGUIController()->mPlayerMarkers.eventMarkersChanged -= MyGUI::newDelegate(this, &LocalMapBase::updatePlayerMarkers);
/*
End of tes3mp addition
*/
}
void LocalMapBase::init(MyGUI::ScrollView* widget, MyGUI::ImageBox* compass, int mapWidgetSize, int cellDistance)
@ -361,17 +387,33 @@ namespace MWGui
redraw();
}
/*
Start of tes3mp addition
Send the LocalMapBase to our GUIController when updating player markers
*/
void LocalMapBase::updatePlayerMarkers()
{
mwmp::Main::get().getGUIController()->updatePlayersMarkers(this);
}
/*
End of tes3mp addition
*/
/*
Start of tes3mp addition
Send the MapWindow to our GUIController when updating player markers
*/
void MapWindow::updatePlayerMarkers()
{
LocalMapBase::updatePlayerMarkers();
mwmp::Main::get().getGUIController()->updateGlobalMapMarkerTooltips(this);
}
/*
End of tes3mp addition
*/
void LocalMapBase::setActiveCell(const int x, const int y, bool interior)
{

@ -9,10 +9,18 @@
#include <components/esm/custommarkerstate.hpp>
/*
Start of tes3mp addition
Declare GUIController here so we can use it for delegates
*/
namespace mwmp
{
class GUIController;
}
/*
End of tes3mp addition
*/
namespace MWRender
{
@ -73,7 +81,15 @@ namespace MWGui
class LocalMapBase
{
/*
Start of tes3mp addition
Allow the use of GUIController by declaring it as a friend class
*/
friend class mwmp::GUIController;
/*
End of tes3mp addition
*/
public:
LocalMapBase(CustomMarkerCollection& markers, MWRender::LocalMap* localMapRender, bool fogOfWarEnabled = true);
virtual ~LocalMapBase();
@ -142,10 +158,28 @@ namespace MWGui
std::vector<MyGUI::Widget*> mDoorMarkerWidgets;
std::vector<MyGUI::Widget*> mMagicMarkerWidgets;
std::vector<MyGUI::Widget*> mCustomMarkerWidgets;
/*
Start of tes3mp addition
Add a new group of Widgets for player markers
*/
std::vector<MyGUI::Widget*> mPlayerMarkerWidgets;
/*
End of tes3mp addition
*/
virtual void updateCustomMarkers();
/*
Start of tes3mp addition
Send the LocalMapBase to our GUIController when updating player markers
*/
virtual void updatePlayerMarkers();
/*
End of tes3mp addition
*/
void applyFogOfWar();
@ -203,7 +237,15 @@ namespace MWGui
class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase, public NoDrop
{
/*
Start of tes3mp addition
Allow the use of GUIController by declaring it as a friend class
*/
friend class mwmp::GUIController;
/*
End of tes3mp addition
*/
public:
MapWindow(CustomMarkerCollection& customMarkers, DragAndDrop* drag, MWRender::LocalMap* localMapRender, SceneUtil::WorkQueue* workQueue);
virtual ~MapWindow();
@ -232,7 +274,16 @@ namespace MWGui
void onFrame(float dt);
virtual void updateCustomMarkers();
/*
Start of tes3mp addition
Send the MapWindow to our GUIController when updating player markers
*/
virtual void updatePlayerMarkers();
/*
End of tes3mp addition
*/
/// Clear all savegame-specific data
void clear();

@ -20,6 +20,17 @@
#include <SDL_keyboard.h>
#include <SDL_clipboard.h>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/GUIController.hpp"
/*
End of tes3mp addition
*/
#include <components/sdlutil/sdlcursormanager.hpp>
#include <components/esm/esmreader.hpp>
@ -48,9 +59,6 @@
#include <components/misc/resourcehelpers.hpp>
#include "../mwmp/Main.hpp"
#include "../mwmp/GUIController.hpp"
#include "../mwbase/inputmanager.hpp"
#include "../mwbase/statemanager.hpp"
#include "../mwbase/soundmanager.hpp"

Loading…
Cancel
Save