summaryrefslogtreecommitdiff
path: root/src/gui
AgeCommit message (Collapse)AuthorFilesLines
2024-02-22General code cleanupsThorbjørn Lindeijer28-60/+48
* 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-15Fix handling of non-consecutive emote IDsThorbjørn Lindeijer5-97/+82
Previous code was assuming there would be no gaps in the emote IDs. Also cleaned up some confusion where the "emote ID" being passed around in the code was often offset by 1. Now it is only offset in communication with tmwAthena and when saving the shortcuts.
2024-02-13Removed no longer supported admin messagesThorbjørn Lindeijer1-5/+3
* Removed /announce command * Changed "Kick player" in player pop-up to kick by name Other messages, like CMSG_ADMIN_HIDE, CMSG_ADMIN_MUTE and CMSG_ADMIN_LOCAL_ANNOUNCE were already not used by the client. Also, none of this was implemented for Manaserv.
2024-02-13General code cleanupsThorbjørn Lindeijer64-293/+175
* Removing unused includes * Use member initialization * Use range-based for loops * Use nullptr * Removed no longer used aliases * Use override * Don't use else after return * Use '= delete' to remove implicit members * Use std::string::empty instead of comparing to ""
2024-02-09Optimized BrowserBoxThorbjørn Lindeijer9-351/+327
* Introduced a LayoutContext that conveniently allows for relayouting all rows, or just a single one when it is added. BrowserBox::addRow no longer relayouts all the rows. * BrowserLink and LinePart are now merged into a new TextRow struct, so they can be conveniently dropped when the row limit has been reached. * Removed "opaque" option, which was enabled by default but disabled for all BrowserBox instances. * Removed "always update" option, and instead start delaying relayouting automatically when there are a lot of rows (> 100 currently). * Update window now also has text wrapping enabled. Closes #50
2024-02-09Some cleanups in UpdaterWindow and BrowserBoxThorbjørn Lindeijer4-170/+79
Doing some cleanups before working towards optimizing this code. Removed needless additional wrapping code in BrowserBox::addRow, since the text will be relayouted anyway. Simplified layouting code a little. For example, there's no need to keep track of the number of wrapped lines. Use more optimal data structures, like an std::deque for the text rows and a plain std::vector for the line parts. Both have less fragmentation than an std::list.
2024-02-09C++11: Use default member initializersThorbjørn Lindeijer38-190/+113
This patch is not exhaustive.
2024-02-05Updated C++ standard to C++17Thorbjørn Lindeijer1-7/+1
C++17 should be universal enough by now. This raises the minimum CMake to 3.8, which should also pose no problem since Ubuntu 18.04 already shipped with CMake 3.10. C++17's 'if' initialization statement is now used in an efficient implementation of 'join' for vector<string>, found on StackOverflow.
2024-01-30Apply readability-delete-null-pointer fixitsThorbjørn Lindeijer2-8/+5
These checks are unnecessary as deleting a null pointer has no effect.
2024-01-29Removed unused SpecialEntry::mLevelLabelThorbjørn Lindeijer1-2/+0
2024-01-29Removed unused includes in various filesThorbjørn Lindeijer8-13/+0
2024-01-29Removed remnants of alpha cache in ResourceManagerThorbjørn Lindeijer1-3/+0
Continuation of 2c51c98625b225cecfb9628c30d62d4e30f7e3e1, which had already removed most of the alpha cache in Image.
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer31-197/+145
modernize-loop-convert modernize-deprecated-headers
2024-01-29Fixed another crash due to incomplete SDL2 upgradeThorbjørn Lindeijer1-1/+1
SDL_GetKeyboardState array needs to be indexed by scan codes.
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer172-801/+801
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2024-01-26Added support for the "persistentIp" server info settingThorbjørn Lindeijer1-2/+11
This option was added in ManaPlus and support for it is required to connect to The Mana World as it is currently set up, since the server sends 127.0.0.1 for the character server and map server IP. Can't play yet, because of an unknown packet 0x226 being received once connecting to the map server.
2024-01-25Fixed parent for OkDialog in social windowThorbjørn Lindeijer1-1/+1
2024-01-25Minor includes cleanupThorbjørn Lindeijer3-7/+0
2024-01-25Ported to SDL2Thorbjørn Lindeijer14-129/+156
2024-01-24Fixed compilation issues and use of deprecated C++ featuresThorbjørn Lindeijer9-12/+14
* Fixed compiler errors due to dynamic exception specifications * Replace std::auto_ptr with std::unique_ptr * Replace std::mem_fun with std::mem_fn * Prefix for_each with std:: (apparently not needed before) * Just use lambda instead of std::bind2nd * Removed usages of std::unary_function
2013-05-09Changed default serverlist.xml URL to avoid redirectThorbjørn Lindeijer1-1/+1
Previously the redirect was from www.manasource.org to manasource.org.
2013-04-30Hide attribute sliders on character creation when appropriateThorbjørn Lindeijer2-53/+69
When the minimum and maximum values of the attributes are equal, then there is nothing for the player to customize and the sliders are not shown. At the same time the dialog has been fixed to resize properly to any number of modifiable attributes.
2013-04-29Single xml solution - compatibility with skill-set and special-setPrzemysław Grzywacz1-1/+2
Mana-mantis: #506.
2013-04-27Added support for charcreation.xml settingsThorbjørn Lindeijer1-0/+7
This file was introduced by ManaPlus as a way of configuring the character creation process. It defines the number of hair styles and colors, how stat points should be divided and what the starting equipment of the player is. The minimum and maximum hair color/style IDs are not supported at the moment. This is mostly a backport of ManaPlus commits 10cf52b5 and dcc18eba, with some style changes. Mantis-issue: 501 Reviewed-by: Ablu
2013-04-13Removed unused IntMap typedefThorbjørn Lindeijer1-2/+0
2012-08-14Can now build using cmake on OSXSocapex1-4/+0
Tested-by: Frost.
2012-08-12Fixed coding style in specialswindowErik Schilling1-16/+18
Reviewed-by: Thorbjørn Lindeijer.
2012-08-12Improved the layout of the specials windowThorbjørn Lindeijer2-25/+8
And removed the unused TabbedArea. Reviewed-by: Erik Schilling
2012-08-12Removed ImageLoader and ProxyImage classesThorbjørn Lindeijer1-5/+0
They allowed using gcn::Image, which in turns allows using gcn::Icon and gcn::ImageFont, but none of this is actually used anymore. Reviewed-by: Erik Schilling
2012-08-08Changed to using delete_all instead of a loopTom Leese1-8/+2
Reviewed-by: Erik Schilling.
2012-08-07Fixed issue where previous special entries were drawn underneathTom Leese1-0/+7
Reviewed-by: Erik Schilling.
2012-08-05Removed all the hardcoded sizes of the various setup tabsThorbjørn Lindeijer19-81/+66
Instead, support for dynamically adjusting layout was added to the Container class. Various other places were also adapted to use the new layout support in Container. Reviewed-by: Erik Schilling
2012-08-02Removing constructor of DebugSwitches.Stefan Beller1-15/+0
The class DebugSwitches is a derived class from Container, 'which automatically deletes its child widgets, so there is no need for such fragile cleanup code.' acked-by: bjorn
2012-08-02Add a checkbox to the debugging window to show being ids.Stefan Beller2-1/+42
Reviewed-by: Ablu
2012-05-25Fixed skill display for manaservErik Schilling1-4/+9
- shows manaserv skills at all - shows the progress bar for manaserv skills again - shows the level for this skills (server side patch needed) TODO: URGENT: Fix attributes and skills getting stored in same list. Reviewed-by: Bertram.
2012-05-21Merge branch '0.6'Erik Schilling1-1/+1
2012-05-10Corrected coordinates of window menujurkan1-1/+1
The window menu (the row of buttons at the top right in game) was displayed 3 pixels left of where it should be, which makes the setup button jump 3 pixels left when logging in. Reviewed-by: Ablu
2012-05-07Merge branch '0.6'Thorbjørn Lindeijer1-9/+9
2012-05-07Fixed wrong offset values for tab widget drawingjurkan1-9/+9
Mantis-Issue: 423 Reviewed-by: Thorbjørn Lindeijer
2012-05-05Merge branch '0.6'Thorbjørn Lindeijer2-1/+3
2012-05-05Removed the shared base classes of MessageIn and MessageOutThorbjørn Lindeijer2-2/+0
There wasn't a whole lot gained by sharing a common base class, and it makes extending the manaserv Message{In,Out} classes with a debugging mode unnecessarily complicated. Reviewed-by: Yohann Ferreira
2012-05-05Fixed compilation errors and warnings with GCC 4.7Thorbjørn Lindeijer2-1/+3
Also, since GCC 4.7 there is a binary compatibility issue when linking with a Guichan that was not compiled in C++11 mode. This commit also allows compiling with GCC 4.7 with C++11 mode turned off. Reviewed-by: Erik Schilling
2012-04-19Client side fix for manaserv guild systemErik Schilling1-2/+3
- kick code untested because no kick button exists yet Reviewed-by: bjorn.
2012-04-04Synced specials to latest manaserv changesErik Schilling1-21/+20
Reviewed-by: bjorn.
2012-04-02Merge branch '0.6'Thorbjørn Lindeijer2-4/+3
2012-04-02Fixed problems with using the last emotev0.6.1Thorbjørn Lindeijer1-3/+2
The tmwa/BeingHandler was adjusting the effect id rather than the emote id, causing it to not find the last emote (and the rest of the emotes only worked correctly because the effect ids were consecutive in the same order as the emote ids). Furthermore, the EmoteShortcutContainer refused to draw the icon for the last emote due to an off-by-one error in dealing with the 1-adjusted emote ids used by the EmoteShortcut class. Also cleaned up some old remains of a player ignore strategy that used to use the two balloon emotes (this had been their original purpose). Reviewed-by: Erik Schilling
2012-04-01Made changes to compile on Mac OSX 10.6 and laterDavid Athay1-1/+1
Also added Xcode project for others to compile for Mac OSX. Reviewed-by: Thorbjørn Lindeijer
2012-03-24Merge branch '0.6'Thorbjørn Lindeijer3-27/+41
2012-03-24Introduced compile-time option to disable use of C++0xThorbjørn Lindeijer2-3/+3
This is in order to still support older compilers, in particular GCC 4.2.1, so that Mana may be compiled for Maemo 5. Reviewed-by: Yohann Ferreira
2012-03-21Added default ports when connecting to a custom server.jurkan2-19/+8
When creating a custom server entry, the default port is used if no other port is specified. Reviewed-by: Thorbjørn Lindeijer Mantis-issue: 464