summaryrefslogtreecommitdiff
path: root/src/event.h
AgeCommit message (Collapse)AuthorFilesLines
2025-07-02Added Quests windowThorbjørn Lindeijer1-2/+4
This window gives an overview over completed and currently active quests. A persistent checkbox toggles whether completed quests are shown. Item links are supported in quest texts. New window icon by meway. Completed quest icon for Mana theme copied from ManaPlus. The Quests window has no shortcut for now.
2025-05-12Fixed handling of "close2" script commandThorbjørn Lindeijer1-1/+0
When adding support for SMSG_NPC_COMMAND in d5ebad4e74da011777f9ba1a13f, I mistakenly assumed the "close dialog" (5) command should just close the NPC dialog. However, the client is expected to send CMSG_NPC_CLOSE as well. Closes #91 Closes #107 Closes #108
2025-03-07Removed the functionality to split item stacksThorbjørn Lindeijer1-1/+0
No longer supported by manaserv and not supported by tmwAthena.
2025-02-25Added support for option, opt1, opt2, opt3 status effect fieldsThorbjørn Lindeijer1-1/+0
Supporting these fields is necessary to correctly identify status effects sent by tmwAthena. This is a manual port of ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4, 542d2ba78d84e0fa051e0620ccab5fb3a0c711e3 and 8800940bb4b94f6dab7dcf80bf0abc3e3b09e35f from M+.
2025-01-21Replaced include guards with #pragma onceThorbjørn Lindeijer1-4/+1
Thanks to https://github.com/cgmb/guardonce and a follow-up replace to remove duplicated newlines at end of file: find src -type f -name '*.h' -exec \ sed --in-place -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \; Source: https://unix.stackexchange.com/questions/81685/how-to-remove-multiple-newlines-at-eof Fixes compile on macOS, which appears to have been due to the EVENT_H include guard.
2025-01-21Fixed ConfigOptionChanged eventsThorbjørn Lindeijer1-3/+37
With the statically typed config we no longer get an event for each changed config value. Where relevant, this is now done through `setConfigValue`. The `Event` now uses a `std::any`, which for `ConfigOptionChanged` events is set to the changed `Config` member. This allows for a type-safe check on which config value was changed.
2025-01-20Made client config statically typedThorbjørn Lindeijer1-1/+1
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-10-23Changed SERVER_NOTICE macro to inline functionThorbjørn Lindeijer1-4/+6
Seems to be no point in using a macro here.
2024-08-04Removed a bunch of unused NPC related eventsThorbjørn Lindeijer1-7/+0
Nobody cared for the events that were emitted when NPC related network messages had been sent.
2024-03-12General code cleanupsThorbjørn Lindeijer1-35/+2
* Use default member initializers * Use range-based for loops * Avoid needless pointer references for ShopItem::mDuplicates * Removed type aliases that are only used once or twice * Removed more unused includes * Removed some unused functions * Removed superfluous .c_str() * Rely on default copy and assignment operators for Vector class * Use std::unique_ptr in some places * Removed duplicated mPlayerMoney updating in SellDialog * Removed duplicated Game::handleInput call * Removed unused SDLInput::mMouseInWindow * Removed remnant of manual widget positioning in HelpWindow * Removed superfluous initialization of static pointers
2024-03-04Added support for handling SMSG_NPC_COMMANDThorbjørn Lindeijer1-0/+2
This only adds support for the NPC_CLOSE_DIALOG and NPC_CLEAR_DIALOG sub-commands. Closes #47
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-3/+3
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2024-01-24Fixed compilation issues and use of deprecated C++ featuresThorbjørn Lindeijer1-12/+12
* 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
2012-01-28Moved mTrading into the TradeHandlerThorbjørn Lindeijer1-2/+0
Really only the trade handler is concerned about whether the player is currently in a trade or not. Reviewed-by: Erik Schilling
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-26Removed 'inline' keyword where it's not of any valueThorbjørn Lindeijer1-10/+10
Members that are implemented inline are already inline, there is no need to mark them as such. Made two inline members of OpenGLGraphics private since because they are marked as inline, they can't be used from other classes. Reviewed-by: Erik Schilling
2011-04-09Renamed Listener to EventListenerThorbjørn Lindeijer1-6/+6
Makes it clear what kind of listener it is, since there are other listener classes as well. Acked-by: Jared Adams
2011-04-09Removed the Mana namespaceThorbjørn Lindeijer1-8/+3
It's just an annoyance when it's only applied to a few classes. Either we place everything in this namespace or nothing, and at the moment I don't see any rationale for placing everything in a Mana namespace. Acked-by: Jared Adams
2011-04-09Moved Channels to Mana::Event::ChannelThorbjørn Lindeijer1-24/+23
Acked-by: Jared Adams
2011-04-09Moved Events to Mana::Event::TypeThorbjørn Lindeijer1-69/+68
Acked-by: Jared Adams
2010-11-13Replace config listeners with the event systemChuck Miller1-0/+2
Reviewed-by: Jared Adams
2010-11-12Change NPC handling in the net codeChuck Miller1-7/+7
Instead of using events to invoke netcode, invoke netcode directly and have it send events Reviewed-by: Freeyorp
2010-11-11Replace Event names with enums instead of stringsChuck Miller1-6/+59
2010-11-11Have the event system channels use enums instead of stringsChuck Miller1-7/+22
Reviewed-by: Freeyorp
2010-08-16Move more to the event systemJared Adams1-1/+63
Most of Net::InventoryHandler is now done through events. The ActorSpriteManager was also replaced by events. A few odds and ends were taken care of too. Reviewed-by: Bertram
2010-08-12Simplify working with the event systemJared Adams1-0/+52
EventManager has been merged into Event, with some new convinience methods added. Reviewed-by: Chuck Miller
2010-08-12Fix some issues in the Event classJared Adams1-6/+6
Reviewed-by: Thorbjørn Lindeijer
2010-08-10Add some new methods to the Event classJared Adams1-7/+84
Adds get methods with default values, and has methods that return true if the variable exists. Reviewed-by: Chuck Miller
2010-08-01Remove isActive methods from buy/sell windowsJared Adams1-0/+4
Uses a state variable in PlayerInfo instead. Moves isTalking from Being to PlayerInfo. Also some small cleanups. Reviewed-by: Chuck Miller
2010-07-14Removed unnecessary semicolons after namespacesThorbjørn Lindeijer1-3/+4
Please don't, it causes warnings with my settings, which makes my build fail. ;)
2010-07-13Add the foundation for the event systemChuck Miller1-0/+73