41#include <guichan/font.hpp>
84 std::string tempname =
88 std::string minimapName = map->
getProperty(
"minimap");
90 if (minimapName.empty() &&
FS::exists(tempname))
91 minimapName = tempname;
93 if (!minimapName.empty())
99 const int offsetX = 2 * getPadding();
100 const int offsetY = getTitleBarHeight() + getPadding();
101 const int titleWidth = getFont()->getWidth(getCaption()) + 15;
107 setMinWidth(mapWidth > titleWidth ? mapWidth : titleWidth);
144 const gcn::Rectangle a = getChildrenArea();
164 mapOriginX = std::clamp(mapOriginX, minOriginX, 0);
169 mapOriginY = std::clamp(mapOriginY, minOriginY, 0);
172 g->drawImage(
mMapImage, mapOriginX, mapOriginY);
180 const Being *being =
static_cast<Being*
>(actor);
194 else if (being->
isGM())
222 gcn::Rectangle((
int) (pos.
x *
mWidthProportion) / tileWidth + mapOriginX - offsetWidth,
ActorSpriteManager * actorSpriteManager
const ActorSprites & getAll() const
Returns the whole list of beings.
const Vector & getPosition() const
Returns the pixel position of this actor.
Type getType() const final
Returns the type of the ActorSprite.
bool isGM() const
Whether or not this player is a GM.
bool isAlive() const
Returns whether this being is still alive.
A central point of control for graphics.
void setColor(const gcn::Color &color) override
int getHeight() const
Returns the height of the image.
int getWidth() const
Returns the width of the image.
int getHeight() const
Returns the height of this map in tiles.
int getTileHeight() const
Returns the tile height used by this map.
std::string getName() const
std::string getFilename() const
Gives the map id based on filepath (ex: 009-1)
int getWidth() const
Returns the width of this map in tiles.
int getTileWidth() const
Returns the tile width of this map.
void draw(gcn::Graphics *graphics) override
Draws the minimap.
void toggle()
Toggles the displaying of the minimap.
ResourceRef< Image > mMapImage
void setMap(Map *map)
Sets the map image that should be displayed.
const gcn::Color & getColor(int type) const
Gets the color associated with the type.
std::string getProperty(const std::string &name, const std::string &def=std::string()) const
Get a map property.
A class for loading and managing resources.
static ResourceManager * getInstance()
Returns an instance of the class, creating one if it does not already exist.
ResourceRef< Image > getImage(const std::string &idPath)
Loads the Image resource found at the given identifier path.
void registerWindowForReset(Window *window)
Enables the Reset Windows button.
void draw(gcn::Graphics *graphics) override
Draws the window contents.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
void setDefaultVisible(bool save)
Sets whether the window is visible by default.
void setMinHeight(int height)
Sets the minimum height of the window.
void setStickyButton(bool flag)
Sets whether or not the window has a sticky button.
void setWindowName(const std::string &name)
Sets the name of the window.
bool isSticky() const
Returns whether the window is sticky.
virtual void resetToDefaultSize()
Reset the win pos and size to default.
void setSticky(bool sticky)
Sets whether the window is sticky.
void setResizable(bool resize)
Sets whether or not the window can be resized.
void setSaveVisible(bool save)
Sets whether the window will save it's visibility.
void setDefaultSize()
Set the default win pos and size to the current ones.
void loadWindowState()
Reads the position (and the size for resizable windows) in the configuration based on the given strin...
void setMaxHeight(int height)
Sets the minimum height of the window.
void setMinWidth(int width)
Sets the minimum width of the window.
void setMaxWidth(int width)
Sets the maximum width of the window.
Config config
Global settings (config.xml)
UserPalette * userPalette
LocalPlayer * local_player
bool exists(const std::string &path)
Checks whether the given file or directory exists in the search path.