Otclient 1.0  14/8/2020
MapView Class Reference

#include <mapview.h>

Inheritance diagram for MapView:
Collaboration diagram for MapView:

Public Types

enum  ViewMode { NEAR_VIEW, MID_VIEW, FAR_VIEW, HUGE_VIEW }
 

Public Member Functions

 MapView ()
 
 ~MapView ()
 
void draw (const Rect &rect)
 
int getLockedFirstVisibleFloor ()
 
void lockFirstVisibleFloor (int firstVisibleFloor)
 
void unlockFirstVisibleFloor ()
 
bool isMultifloor ()
 
void setMultifloor (bool enable)
 
Point getVisibleCenterOffset ()
 
Size getVisibleDimension ()
 
void setVisibleDimension (const Size &visibleDimension)
 
int getTileSize ()
 
int getCachedFirstVisibleFloor ()
 
int getCachedLastVisibleFloor ()
 
ViewMode getViewMode ()
 
void setViewMode (ViewMode viewMode)
 
void optimizeForSize (const Size &visibleSize)
 
void setAutoViewMode (bool enable)
 
bool isAutoViewModeEnabled ()
 
CreaturePtr getFollowingCreature ()
 
void followCreature (const CreaturePtr &creature)
 
bool isFollowingCreature ()
 
Position getCameraPosition ()
 
void setCameraPosition (const Position &pos)
 
void setMinimumAmbientLight (float intensity)
 
float getMinimumAmbientLight ()
 
void setDrawTexts (bool enable)
 
bool isDrawingTexts ()
 
void setDrawNames (bool enable)
 
bool isDrawingNames ()
 
void setDrawHealthBars (bool enable)
 
bool isDrawingHealthBars ()
 
void setDrawLights (bool enable)
 
bool isDrawingLights ()
 
void setDrawManaBar (bool enable)
 
bool isDrawingManaBar ()
 
void move (int x, int y)
 
void setAddLightMethod (bool add)
 
void setShader (const PainterShaderProgramPtr &shader, float fadein, float fadeout)
 
PainterShaderProgramPtr getShader ()
 
Position getPosition (const Point &point, const Size &mapSize)
 
MapViewPtr asMapView ()
 
void requestDrawing (const Position &pos, const Otc::RequestDrawFlags reDrawFlags, const bool force=false, const bool isLocalPlayer=false)
 
void resetLastCamera ()
 
std::vector< CreaturePtrgetVisibleCreatures ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

void onTileUpdate (const Position &pos, const ThingPtr &thing, const Otc::Operation operation)
 
void onMapCenterChange (const Position &pos)
 

Friends

class Map
 

Detailed Description

Definition at line 39 of file mapview.h.

Member Enumeration Documentation

◆ ViewMode

Enumerator
NEAR_VIEW 
MID_VIEW 
FAR_VIEW 
HUGE_VIEW 

Definition at line 42 of file mapview.h.

Constructor & Destructor Documentation

◆ MapView()

MapView::MapView ( )

Definition at line 53 of file mapview.cpp.

Here is the call graph for this function:

◆ ~MapView()

MapView::~MapView ( )

Definition at line 79 of file mapview.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ asMapView()

MapViewPtr MapView::asMapView ( )
inline

Definition at line 125 of file mapview.h.

◆ draw()

void MapView::draw ( const Rect rect)

Definition at line 86 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ followCreature()

void MapView::followCreature ( const CreaturePtr creature)

Definition at line 536 of file mapview.cpp.

Here is the caller graph for this function:

◆ getCachedFirstVisibleFloor()

int MapView::getCachedFirstVisibleFloor ( )
inline

Definition at line 78 of file mapview.h.

Here is the caller graph for this function:

◆ getCachedLastVisibleFloor()

int MapView::getCachedLastVisibleFloor ( )
inline

Definition at line 79 of file mapview.h.

◆ getCameraPosition()

Position MapView::getCameraPosition ( )

Definition at line 705 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFollowingCreature()

CreaturePtr MapView::getFollowingCreature ( )
inline

Definition at line 90 of file mapview.h.

Here is the caller graph for this function:

◆ getLockedFirstVisibleFloor()

int MapView::getLockedFirstVisibleFloor ( )
inline

Definition at line 66 of file mapview.h.

◆ getMinimumAmbientLight()

float MapView::getMinimumAmbientLight ( )
inline

Definition at line 98 of file mapview.h.

Here is the caller graph for this function:

◆ getPosition()

Position MapView::getPosition ( const Point point,
const Size mapSize 
)

Definition at line 550 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getShader()

PainterShaderProgramPtr MapView::getShader ( )
inline

Definition at line 121 of file mapview.h.

Here is the caller graph for this function:

◆ getTileSize()

int MapView::getTileSize ( )
inline

Definition at line 77 of file mapview.h.

◆ getViewMode()

ViewMode MapView::getViewMode ( )
inline

Definition at line 82 of file mapview.h.

Here is the caller graph for this function:

◆ getVisibleCenterOffset()

Point MapView::getVisibleCenterOffset ( )
inline

Definition at line 74 of file mapview.h.

Here is the caller graph for this function:

◆ getVisibleCreatures()

std::vector<CreaturePtr> MapView::getVisibleCreatures ( )
inline

Definition at line 130 of file mapview.h.

Here is the caller graph for this function:

◆ getVisibleDimension()

Size MapView::getVisibleDimension ( )
inline

Definition at line 75 of file mapview.h.

Here is the caller graph for this function:

◆ isAutoViewModeEnabled()

bool MapView::isAutoViewModeEnabled ( )
inline

Definition at line 87 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingHealthBars()

bool MapView::isDrawingHealthBars ( )
inline

Definition at line 108 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingLights()

bool MapView::isDrawingLights ( )
inline

Definition at line 111 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingManaBar()

bool MapView::isDrawingManaBar ( )
inline

Definition at line 114 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingNames()

bool MapView::isDrawingNames ( )
inline

Definition at line 105 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingTexts()

bool MapView::isDrawingTexts ( )
inline

Definition at line 102 of file mapview.h.

Here is the caller graph for this function:

◆ isFollowingCreature()

bool MapView::isFollowingCreature ( )
inline

Definition at line 92 of file mapview.h.

Here is the caller graph for this function:

◆ isMultifloor()

bool MapView::isMultifloor ( )
inline

Definition at line 70 of file mapview.h.

Here is the caller graph for this function:

◆ lockFirstVisibleFloor()

void MapView::lockFirstVisibleFloor ( int  firstVisibleFloor)

Definition at line 488 of file mapview.cpp.

Here is the caller graph for this function:

◆ move()

void MapView::move ( int  x,
int  y 
)

Definition at line 577 of file mapview.cpp.

Here is the caller graph for this function:

◆ onMapCenterChange()

void MapView::onMapCenterChange ( const Position pos)
protected

Definition at line 483 of file mapview.cpp.

◆ onTileUpdate()

void MapView::onTileUpdate ( const Position pos,
const ThingPtr thing,
const Otc::Operation  operation 
)
protected

Definition at line 463 of file mapview.cpp.

Here is the call graph for this function:

◆ optimizeForSize()

void MapView::optimizeForSize ( const Size visibleSize)

Definition at line 531 of file mapview.cpp.

◆ requestDrawing()

void MapView::requestDrawing ( const Position pos,
const Otc::RequestDrawFlags  reDrawFlags,
const bool  force = false,
const bool  isLocalPlayer = false 
)

Definition at line 806 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetLastCamera()

void MapView::resetLastCamera ( )
inline

Definition at line 128 of file mapview.h.

◆ setAddLightMethod()

void MapView::setAddLightMethod ( bool  add)
inline

Definition at line 118 of file mapview.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAutoViewMode()

void MapView::setAutoViewMode ( bool  enable)

Definition at line 524 of file mapview.cpp.

Here is the caller graph for this function:

◆ setCameraPosition()

void MapView::setCameraPosition ( const Position pos)

Definition at line 543 of file mapview.cpp.

Here is the caller graph for this function:

◆ setDrawHealthBars()

void MapView::setDrawHealthBars ( bool  enable)
inline

Definition at line 107 of file mapview.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDrawLights()

void MapView::setDrawLights ( bool  enable)

Definition at line 731 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDrawManaBar()

void MapView::setDrawManaBar ( bool  enable)
inline

Definition at line 113 of file mapview.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDrawNames()

void MapView::setDrawNames ( bool  enable)
inline

Definition at line 104 of file mapview.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDrawTexts()

void MapView::setDrawTexts ( bool  enable)
inline

Definition at line 101 of file mapview.h.

Here is the caller graph for this function:

◆ setMinimumAmbientLight()

void MapView::setMinimumAmbientLight ( float  intensity)
inline

Definition at line 97 of file mapview.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMultifloor()

void MapView::setMultifloor ( bool  enable)
inline

Definition at line 71 of file mapview.h.

Here is the caller graph for this function:

◆ setShader()

void MapView::setShader ( const PainterShaderProgramPtr shader,
float  fadein,
float  fadeout 
)

Definition at line 713 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setViewMode()

void MapView::setViewMode ( ViewMode  viewMode)

Definition at line 518 of file mapview.cpp.

Here is the caller graph for this function:

◆ setVisibleDimension()

void MapView::setVisibleDimension ( const Size visibleDimension)

Definition at line 500 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unlockFirstVisibleFloor()

void MapView::unlockFirstVisibleFloor ( )

Definition at line 494 of file mapview.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Map

friend class Map
friend

Definition at line 62 of file mapview.h.


The documentation for this class was generated from the following files: