summaryrefslogtreecommitdiff
path: root/src/gui/minimap.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-04-25GUI: Allow customizing the SkinType used by a WindowThorbjørn Lindeijer1-1/+1
Now different windows can use different skin types. This also introduces a new ToolWindow skin type, which is generally a window without title bar nor close button. Customized windows are: * Chat -> Popup skin * MiniMap -> Popup skin * ShortcutWindow (items and emotes) -> ToolWindow skin Even though the MiniMap now appears as a Popup, it does have a title, so appropriate attributes have been added to this skin type.
2025-03-31GUI: Apply clipping only where necessaryThorbjørn Lindeijer1-27/+24
Clipping has been disabled globally by taking it out of Graphics::pushClipArea. Now its name is a little confusing, but it can't just be changed since it is part of Guichan. Widgets that do need to clip their children use the new Graphics::pushClipRect, which pushes a clipping rectangle without affecting the local coordinates. These are: * ScrollArea * TextField * TabbedArea (scrolling tabs) * MiniMap While it might count as a small optimization, I'm actually disabling clipping because it is not always desired. For example it gets in the way of rendering the complete ResizeGrip in the Jewelry theme because that's a child widget.
2025-03-24Define the GUI theme in XMLThorbjørn Lindeijer1-2/+1
Now all images used by the various UI widgets are defined in a `theme.xml`, removing hardcoded requirements on the size of images, borders and sub-images and their locations. The `colors.xml` file was merged into this new file as well. The `<img>` element defines either a plain image, or a 9-scale that is automatically rendered at the size of the widget when any of the `left`, `right`, `top` or `bottom` attributes are given. The `x`, `y`, `width` and `height` attributes determine the sub-rectangle within the image referenced by `src`. `x` and `y` default to 0 and `width` and `height` default to the imge size. The `<state>` element defines in which state its images are used by setting its `selected`, `disabled`, `hovered` or `focused` attributes to either `true` or `false`. Only the first matching state is rendered. The `Text` and `SpeechBubble` classes now use the same skin to draw the bubble, as well as using a newly introduced `BUBBLE_TEXT` color from the theme palette.
2025-02-26Use ResourceRef for all resource typesThorbjørn Lindeijer1-1/+1
All ResourceManager functions that load resources now return respective ResourceRef values, which helps to make sure resources are properly cleaned up. The Sound class was cleaned up and now also allows SoundEffect resources to be unloaded. The Animation class now keeps its ImageSet loaded only as long as necessary. Previously, SimpleAnimation and ParticleEmitter would keep the ImageSet loaded indefinitely by never decreasing its reference count. Reduced duplicated animation loading code between SimpleAnimation and ParticleEmitter.
2025-02-17Wrapped PhysFS usage in a convenience APIThorbjørn Lindeijer1-1/+2
* Most direct PhysFS calls now contained within a single header file. * File class that automatically closes. * Files class allows iterating files with range-based for. * Use std::optional to force error handling where applicable.
2025-01-20Made client config statically typedThorbjørn Lindeijer1-10/+4
This makes accessing the config values much faster, since it no longer needs to do a lookup nor string conversion, which means we could remove some needless copying of the values. Overall it makes it easier to find out where settings are used and it puts the defaults along with the declaration. Options with default values are no longer saved to the config file. This does not include unrecognized options, which are kept around to provide some compatibility with older clients. While most basic options have kept the same name, more complicated settings like window geometry, shortcuts, outfits, etc. now have their own XML elements. Older clients will ignore these and erase them when saving the configuration.
2024-04-08Use ResourceRef<Image> in more placesThorbjørn Lindeijer1-11/+3
Automatic reference counting of images is now used by Item, Icon, AnimatedSprite, ImageSprite, ParticleEmitter, Minimap, Desktop and Emote. Since ResourceManager::get automatically adds a reference, it needs to be explicitly subtracted when the resource is managed by ResourceRef. This is taken care of by the new ResourceManager::getImageRef. Also removed the apprently unused and duplicate "mDrawImage" from Item (which also didn't get decRef called on it). Fixes cleanup of emote ImageSet and ImageSprite instances, as well as particle images.
2024-02-22General code cleanupsThorbjørn Lindeijer1-1/+1
* Use default member initializers * Use range-based loops * Don't use 'else' after 'return' * Removed some unused includes * Construct empty strings with std::string() instead of "" * Clear strings with .clear() instead of assigning "" * Check whether strings are empty with .empty() instead of comparing to "" * Removed redundant initializations
2024-02-09C++11: Use default member initializersThorbjørn Lindeijer1-5/+1
This patch is not exhaustive.
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer1-6/+3
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-4/+4
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-15Remove dead beings from the minimapStefan Dombrowski1-0/+4
Reviewed-by: Bertram
2012-01-10player_node -> local_playerYohann Ferreira1-2/+2
Reviewed-by: Ablu
2012-01-07Fixed minimap showing the right colors for npcs and monstersErik Schilling1-2/+2
Actually Bertram explained the fix in the bugtracker and I only did what he said there. Resolves: Mana-mantis #444. Reviewed-by: Bertram.
2011-06-17First pass on removing tile hard coded values.Yohann Ferreira1-7/+17
Every files has been checked against the hard coded 32 values except the map.cpp file. I also added convenience functions in the Game class, centralized the default item icon size, and removed two unused defines in being.cpp.
2010-09-25Merge branch '1.0'Thorbjørn Lindeijer1-1/+2
Conflicts: src/actorspritemanager.h src/beingmanager.cpp src/game.cpp src/gui/beingpopup.cpp src/gui/chat.cpp src/gui/chat.h src/gui/inventorywindow.h src/gui/itempopup.cpp src/gui/socialwindow.cpp src/gui/statuswindow.cpp src/gui/widgets/chattab.cpp src/gui/widgets/chattab.h src/net/tmwa/inventoryhandler.cpp src/net/tmwa/partyhandler.cpp src/party.cpp src/sound.cpp src/utils/stringutils.cpp src/utils/stringutils.h
2010-09-13Avoid loading non-existing music and minimapsStefan Dombrowski1-1/+2
Reviewed-by: Thorbjorn
2010-08-03Move Theme and UserPalette to the resources folderJared Adams1-1/+1
Reviewed-by: Yohann Ferreira
2010-06-13Merge remote branch '1.0/1.0'Jared Adams1-3/+1
Conflicts: data/graphics/CMakeLists.txt data/graphics/Makefile.am src/client.cpp
2010-06-10Merge BeingManager and FloorItemManager as ActorSpriteManagerJared Adams1-5/+8
No need for two different classes to manage ActorSprites. Reviewed-by: Chuck Miller
2010-06-05Fix memory leak in minimapAndrei Karas1-3/+1
Reviewed-by: Thorbjørn Lindeijer
2010-05-17Remove Monster, Player, and NPC classesJared Adams1-33/+23
Instead of having these three subclasses with minor differences, this commit merges them back into Being. In the future, we can make Beings that are talkable to some, attackable by others, etc. This also puts back support for monster equipment. Also changes remaining references to Being::Type and the constants to refer to ActorSprite::Type. Reviewed-by: Freeyorp
2010-03-12Split Palette into Theme and UserPaletteJared Adams1-8/+8
Themes can now control the colors they use. Colors in the Viewport (being names, particles, etc) can still be changed by the user. Also make ProgressBars more easily colored. DyePalette was made more flexible in the process. Also fixes comparing strings of different lengths insensitively. Reviewed-by: Thorbjørn Lindeijer
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-15Revert "Attempt to fix Minimap caption again..."Chuck Miller1-1/+4
This reverts commit 20d2a17c8c0fa9220c257d61641a6459e154de26. Going to try to remove this fix, people have still been reporting crashes with minimap caption. Maybe if more people report it, we can get more information.
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-02-01Attempt to fix Minimap caption again...Jared Adams1-4/+1
2010-01-23Chaning the method name Map::getMapId() to map::getFilename()Blue Sans Douze1-3/+5
2010-01-23Autoload a minimap is no minimap info is givenBlue Sans Douze1-1/+10
Looks for "graphics/minimap/MAPID.png"
2010-01-05Fix a crash when maps don't have namesJared Adams1-1/+1
2009-07-26Gettext fixesKess Vargavind1-1/+1
And a Swedish translation of the desktop file.
2009-07-23Clear some more support ifdefsJared Adams1-0/+2
2009-05-25Handle map not found gracefullyBjørn Lindeijer1-7/+12
Instead of shutting down, the client will now draw a gray background. This allows the player to still contact a GM in order to be helped out of the situation. It also helps me warp out of the non-existing map I accidentally warped myself onto. ;)
2009-05-12Some small cleanups and fixed compile with tmwserv supportBjørn Lindeijer1-1/+1
2009-05-12Handle in party status in a much saner wayJared Adams1-5/+7
2009-05-11Fix a few states on minimap that I missed. mShow now replaces the visibility ↵peavey1-8/+7
setting since this is only saved on manually setting visibility. go back to saving visibility and use sticky bit to decide if minimap should be turned off or not.
2009-05-10nuke a tab indent I put in by mistakepeavey1-1/+1
2009-05-10Fix visibility and stickyness so its saved correctlypeavey1-5/+10
2009-05-10Color party members differently in the minimapJared Adams1-0/+5
2009-05-03Moved mIsGM from Being to Player and made isGM() constBjørn Lindeijer1-2/+2
2009-05-03De-hardcoded the color values for the minimap, and set them to theirTametomo1-10/+20
equivalent Palette color type. Signed-off-by: Tametomo <irarice@gmail.com> Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
2009-04-28Made map non-resizable. Stopped emote spamming.David Athay1-3/+6
2009-04-26Moved minimap title setting into the Minimap classBjørn Lindeijer1-15/+21
Also cleaned up some debug log statements, fixed initialization order, removed an unused member variable and added some documentation.
2009-04-26Minimap ratio adaptBlue1-9/+28
Now the minimap can adapt every image ratio, not only 0.5 (even images with differents width and height)
2009-04-20Fix up window visibility saving/restoringJared Adams1-0/+2
2009-04-13Some cleanup of the Configuration interfaceBjørn Lindeijer1-9/+9
Mainly avoid all the convertions from integer to float and then to string and also back from string to float and then to integer.
2009-04-09Made BeingManager methods const where appropriateBjørn Lindeijer1-2/+2
2009-03-28Add a sticky button to the Window classJared Adams1-2/+4
The Minimap window uses this so you can froce it to always be open. The Minimap toggle button can be used to show or hide it temporarily, as warping will reset it's visibility based on the sticky state and weather the 'new' map has a minimap.