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

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

@ -20,6 +20,17 @@
#include <SDL_keyboard.h> #include <SDL_keyboard.h>
#include <SDL_clipboard.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/sdlutil/sdlcursormanager.hpp>
#include <components/esm/esmreader.hpp> #include <components/esm/esmreader.hpp>
@ -48,9 +59,6 @@
#include <components/misc/resourcehelpers.hpp> #include <components/misc/resourcehelpers.hpp>
#include "../mwmp/Main.hpp"
#include "../mwmp/GUIController.hpp"
#include "../mwbase/inputmanager.hpp" #include "../mwbase/inputmanager.hpp"
#include "../mwbase/statemanager.hpp" #include "../mwbase/statemanager.hpp"
#include "../mwbase/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"

Loading…
Cancel
Save