38 #include "gui/viewport.h"
50 #include "resources/map/map.h"
68 mWidthProportion(0.5),
69 mHeightProportion(0.5),
73 mCustomMapImage(false),
74 mAutoResize(
config.getBoolValue(
"autoresizeminimaps"))
142 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000);
143 if (surface ==
nullptr)
152 SDL_LockSurface(surface);
153 int*
data =
static_cast<int*
>(surface->pixels);
161 const int size = surface->h * surface->w;
167 for (
int ptr = 0; ptr <
size; ptr ++)
173 SDL_UnlockSurface(surface);
185 std::string minimapName = map->
getProperty(
"minimap",
189 minimapName = tempname;
191 if (minimapName.empty())
193 tempname =
pathJoin(
"graphics/minimaps",
199 if (!minimapName.empty())
207 if ((
mMapImage !=
nullptr) && (map !=
nullptr))
212 const int mapWidth =
mMapImage->mBounds.w < 100 ? width : 100;
213 const int mapHeight =
mMapImage->mBounds.h < 100 ? height : 100;
214 const int minWidth = mapWidth > 310 ? 310 : mapWidth;
215 const int minHeight = mapHeight > 220 ? 220 : mapHeight;
295 const SDL_Rect &rect =
mMapImage->mBounds;
296 const int w = rect.w;
297 const int h = rect.h;
306 const int minOriginX = a.
width - w;
307 const int minOriginY = a.
height - h;
328 const Being *
const being =
static_cast<const Being *
>(*it);
329 if (being ==
nullptr)
340 else if (being->
isGM())
392 const int offsetHeight =
CAST_S32(
static_cast<float>(
394 const int offsetWidth =
CAST_S32(
static_cast<float>(
406 if (
party !=
nullptr)
413 const std::string curMap = m->
getMap();
414 Party::MemberList::const_iterator it = members->begin();
415 const Party::MemberList::const_iterator
416 it_end = members->end();
420 if ((member !=
nullptr) && member->
getMap() == curMap
447 const int gw = graphics->
getWidth();
456 const int w =
CAST_S32(
static_cast<float>(
458 const int h =
CAST_S32(
static_cast<float>(
463 if (
x < 0 && (w != 0))
470 if (
y < 0 && (h != 0))
498 int x =
event.getX();
499 int y =
event.getY();
506 int x =
event.getX();
507 int y =
event.getY();
519 const int x =
event.getX();
520 const int y =
event.getY();
540 if (name ==
"autoresizeminimaps")
ActorManager * actorManager
std::set< ActorSprite * > ActorSprites
ActorSprites::const_iterator ActorSpritesConstIterator
#define fromBool(val, name)
const ActorSprites & getAll() const A_CONST
std::string getMap() const
const Guild * getGuild(const std::string &guildName) const
const std::string & getName() const
const std::string & getGuildName() const
ActorTypeT getType() const
bool getValueBool(const std::string &key, const bool deflt) const
bool getBoolValue(const std::string &key) const
std::string getStringValue(const std::string &key) const
void addListener(const std::string &key, ConfigListener *const listener)
void setValue(const std::string &key, const std::string &value)
void removeListeners(ConfigListener *const listener)
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
virtual void popClipArea()
virtual void fillRectangle(const Rect &rectangle)=0
virtual void setColor(const Color &color)
virtual void drawRectangle(const Rect &rectangle)=0
virtual void pushClipArea(const Rect &area)
virtual Image * loadSurface(SDL_Surface *const)
bool navigateTo(const int x, const int y)
const std::string getFilename() const
MetaTile *const mMetaTiles
const std::string getName() const
void setMap(const Map *const map)
void optionChanged(const std::string &name)
void mouseReleased(MouseEvent &event)
void mousePressed(MouseEvent &event)
void mouseMoved(MouseEvent &event)
void screenToMap(int &x, int &y)
void draw2(Graphics *const graphics)
void safeDraw(Graphics *const graphics)
void mouseExited(MouseEvent &event)
void draw(Graphics *const graphics)
MouseButtonT getButton() const
std::vector< PartyMember * > MemberList
const std::string getProperty(const std::string &name, const std::string &def) const
void registerWindowForReset(Window *const window)
const Color & getColor(UserColorIdT type, const unsigned int alpha)
int getCameraRelativeY() const
int getCameraRelativeX() const
void safeDraw(Graphics *const graphics)
void mouseReleased(MouseEvent &event)
void setSaveVisible(const bool save)
void setResizable(const bool resize)
void setMaxWidth(const int width)
virtual void setVisible(Visible visible)
bool isWindowVisible() const
void setWindowName(const std::string &name)
unsigned int getTitleBarHeight() const
void mouseExited(MouseEvent &event)
virtual void resetToDefaultSize()
void setSticky(const bool sticky)
void setCaption(const std::string &caption)
void setMinHeight(const int height)
void mouseMoved(MouseEvent &event)
void setMaxHeight(const int height)
void setMinWidth(const int width)
void mousePressed(MouseEvent &event)
void enableVisibleSound(bool b)
void draw(Graphics *const graphics)
const std::string & getWindowName() const
void setDefaultVisible(const bool save)
void setStickyButton(const bool flag)
#define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a)
#define MSDL_FreeSurface(surface)
#define FOR_EACH(type, iter, array)
ImageHelper * imageHelper
LocalPlayer * localPlayer
Image * getImage(const std::string &idPath)
bool exists(std::string name)
#define BLOCK_START(name)
SetupWindow * setupWindow
std::string pathJoin(std::string str1, const std::string &str2)
UserColorId ::T UserColorIdT
UserPalette * userPalette