summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-29Fixed storing of player relationsHEADmasterThorbjørn Lindeijer3-27/+15
There were two issues here. First, the loading of the relations was triggering a storing of the settings before they were loaded. In effect, all the related settings were reset on every startup. And since storing of the relations wasn't enabled by default, they were always cleared. Second problem was in `PlayerConfSerialiser::readConfigItem`, which was never setting any relation because of an inverted condition introduced in 9a702e64449ba54fab28706c5b9c5ff9f2a41f8a.
2024-10-29Turned the PlayerRelation struct into an enum classThorbjørn Lindeijer10-106/+82
Less code to achieve the same thing (strong type and namespaced values). The permissions related values have been moved to a PlayerPermissions struct, which is also a bit less confusing.
2024-10-29Optimise PlayerRelationsManager::clearThorbjørn Lindeijer6-51/+34
Previous implementation was O(n^2), doing lots of work (saving file and updating UI) for each removed player.
2024-10-29Avoid some needless pointer indirectionThorbjørn Lindeijer3-82/+49
* Don't use `PlayerRelation*` in `mRelations`, but just store the value. * Pass `std::vector<PlayerIgnoreStrategy *>` by reference instead of pointer. * Return player list in `PlayerRelationsManager::getPlayers` by value instead of pointer. Overall these changes simplify the code, making it less prone to errors.
2024-10-26Fixed FPS limit being enabled by defaultThorbjørn Lindeijer8-38/+21
There were some inconsistencies between the values set up in `Client::initConfiguration` and those in `getConfigDefaults`. These duplicates have now been removed. For some of these settings the code getting the values had to be adjusted to use getBoolValue, to actually rely on the provided default instead of one provided as a parameter.
2024-10-23Updated translation filesThorbjørn Lindeijer38-54728/+60398
This is not a string freeze yet!
2024-10-23Removed old Transifex configThorbjørn Lindeijer1-8/+0
We're going to use Weblate instead.
2024-10-23Changed SERVER_NOTICE macro to inline functionThorbjørn Lindeijer21-159/+152
Seems to be no point in using a macro here.
2024-10-23.gitignore clangd cacheThorbjørn Lindeijer1-0/+3
2024-10-23Various small fixes to translatable stringsThorbjørn Lindeijer13-36/+26
Mostly adjustments based on feedback from the Finnish translator.
2024-10-23Removed ChangeLog fileThorbjørn Lindeijer1-6267/+0
This reverts acc55f47f1b4090e599d2af12b60419e6ece8d40 and f2f00d9e33b1df0fa356bac54eef0f17a6281bdb. The ChangeLog file is no longer necessary since we stopped using autoconf in 48241af5432ee8248151c41bdc5321ba508f1d11. The contents will remain available in Git history and can be retrieved for example with: git show v0.0.29.1:ChangeLog
2024-10-23Translated using Weblate (Spanish)gallegonovato1-4/+4
Currently translated at 98.2% (860 of 875 strings) Translation: Mana/Mana Client Translate-URL: https://hosted.weblate.org/projects/mana/mana/es/
2024-10-23Translated using Weblate (Norwegian Bokmål)Allan Nordhøy1-54/+60
Currently translated at 19.6% (172 of 875 strings) Translation: Mana/Mana Client Translate-URL: https://hosted.weblate.org/projects/mana/mana/nb_NO/
2024-10-23Translations: Replaced some "..." with "…" and removed double spacesAllan Nordhøy28-187/+188
2024-10-18Added small grabbable margin to Shortcuts windowThorbjørn Lindeijer5-81/+32
The Shortcuts window could no longer be moved since adding support for resizing windows at the top edge. Now there is again a bit of space where the window can be grabbed. Included some related cleanups.
2024-10-18Avoid accessing static members through instancesThorbjørn Lindeijer5-40/+40
Fixed with clang-tidy `readability-static-accessed-through-instance` check.
2024-10-18Some code cleanups in ResourceManagerThorbjørn Lindeijer1-10/+4
* Use 'time' instead of 'gettimeofday', since we only use the timestamp anyway. * Use the iterator returned by std::map::erase.
2024-10-18General code cleanupsThorbjørn Lindeijer9-38/+19
2024-10-18Take only const pointers to images in GraphicsThorbjørn Lindeijer6-43/+43
Helps making sure we're not modifying the images in the rendering code. Re-applies 4eea727b7649726670d8963d11ab4fd429624b3e (and reverts 363f71157a8107190b3bd2ba656faf0a0e63ab36).
2024-10-15Fixed crash when taking screenshot with scaled graphicsThorbjørn Lindeijer2-15/+28
Because the allocated surface was based on the unscaled size, writing the actual pixels was overwriting random memory.
2024-10-12Added support for hit/miss sounds on equipment for all playersThorbjørn Lindeijer5-30/+32
Previously only the local player's weapon "strike" sound would play, regardless of hit or miss. Now the sound is played in response to the SMSG_BEING_ACTION message, so it can be played for all players. Also added alias "miss", which is used by TMW in some places. Finally, when no weapon is equipped, it falls back to the sounds defined on the racesprite item (fixes punch sound on TMW). Closes #68
2024-10-08CI: Added Ubuntu 24.04 compile testThorbjørn Lindeijer1-0/+1
2024-10-08Small cleanup in OutfitWindow::loadThorbjørn Lindeijer2-19/+7
Based on MV commit db452921bafb2dd322b52c1e5d03e5e713849dd0.
2024-10-08Simplified "drawnWhenBehind" logicThorbjørn Lindeijer8-37/+8
* Removed `Actor::getNumberOfLayers`, since we really only cared about whether they should be visible when behind other stuff. * Removed `CompoundSprite::drawnWhenBehind`, since this property was only relevant for actors.
2024-10-08Restore the screen shake effectThorbjørn Lindeijer2-30/+32
Now the experience mightes better with what it was before the logic update change (59a7d5c58f8b3af21b3e19d4e78f5653bf011bfb). The per-frame effect is reduced and less constant, based on a sine wave. The effect is no longer applied directly to the mPixelViewX/Y values, but is rather only taken into account when rendering the view.
2024-10-08Use Timer for duration of blinking nameThorbjørn Lindeijer3-23/+18
This fixes the duration on 1500 ms, whereas before it was dependent on the framerate, blinking for 200 frames.
2024-10-08Updated NEWS fileThorbjørn Lindeijer1-0/+4
2024-10-08Smoother keyboard movementThorbjørn Lindeijer4-26/+39
This change addresses the slight stutter and broken animation playback when walking with the keyboard. Once the end of the path has been reached but a movement key is still held, the LocalPlayer now immediately calculates a new path rather than waiting on the next logic update.
2024-10-08Smoother being movementThorbjørn Lindeijer7-67/+71
There was a slight stutter in being movement, since each time a being reached the next position along its path, it would only continue to the following position with the next logic tick. Now the logic has been adjusted to keep moving until all the time for the current frame was used up, or the path was exhausted. A slight stutter remains for keyboard movement, as well as broken walk animation playback, since it will only set a new path once the current one is finished (see e554d9b2be1ec2fcb15065ae70151302adeef602). Also simplified some logic in Viewport::draw and removed some obsolete code in LocalPlayer::startWalking.
2024-10-08Do a single logic update each frameThorbjørn Lindeijer26-113/+92
The logic update now uses Time::deltaTimeMs() where needed to make it framerate-independent. This means there will no longer be multiple logic calls per frame (as was usually the case with logic ticking at 100 fps whereas the game would generally run at 60 fps). At the same time, the game can be more precise at higher framerates and should now run smoother at 144 Hz, for example. Previously the game would sometimes skip logic ticks at that rate. This change affects: * Updating of animations * Being movement speed * More moving of manual time variables to Timer Notoriously, the particle system still does 100 ticks/second.
2024-10-08Added convenient and efficient Timer classThorbjørn Lindeijer26-293/+388
The Timer is efficient because it does not depend on incrementing a counter to keep track of time, nor does it call SDL_GetTicks every time its state is checked (this happens once per frame instead). Along with global functions Time::absoluteTimeMs() and Time::deltaTimeMs(), this replaces previous globals tick_time, cur_time and get_elapsed_time(). For now, there is still a fixed 100 times per second logic call rate, but the new Time::deltaTimeMs() function should allow getting rid of this.
2024-10-04Removed useless LocalPlayer::mUpdateNameThorbjørn Lindeijer6-39/+3
Maybe it once had a use, but a change in the "Show own name" setting is already handled by LocalPlayer::event.
2024-10-02Fixed potential crash in character selectionThorbjørn Lindeijer1-0/+2
When items with particle effects are equipped.
2024-10-02Removed getter/setter cruft from BeingInfoThorbjørn Lindeijer6-143/+86
Made the class and the code in general more readable by removing all the needless getters and setters. Also used "enum class" for SoundEvent.
2024-09-30Reduce number of rand() calls in Particle::updateAndrei Karas1-3/+4
(cherry picked from M+ commit cc6b5ebf94ad24180a4db69aa87cae07e3c876d2)
2024-09-30Added support for particle effects on equipmentThorbjørn Lindeijer6-37/+104
The effect is also there when the equipment is dropped, because it uses the same field as the floor item. Removed unused ItemInfo::particle. Based roughly on M+ commit 44e5d8bcb7fea443ca9ed3844454b11ac6e4dbed. Closes #85
2024-09-28Replaced all "xmlChildrenNode" with "children"Thorbjørn Lindeijer8-17/+16
Because "xmlChildrenNode" is a macro defined for compatibility with libxml1, which we don't support.
2024-09-28Removed getter/setter cruft from ItemInfoThorbjørn Lindeijer20-365/+213
Made the class and the code in general more readable by removing all the needless getters and setters.
2024-09-27Replaced for_each_xml_child_node macro with helper classThorbjørn Lindeijer24-57/+79
The new XML::Children class enables using a C++11 range-based for loop to iterate over the children of an xmlNodePtr.
2024-09-23snap: Workaround automated review issueThorbjørn Lindeijer1-3/+0
Snapcraft automatically adds 'assumes: command-chain' when it detects a command chain is used, without checking whether it is already there. This causes the 'lint-snap-v2:snap_schema' to fail due to the duplicated entry. See https://github.com/canonical/snapcraft/issues/4931
2024-09-02Added a hand mouse cursor, used when hovering linksThorbjørn Lindeijer5-14/+24
InputEvent::mIsConsumed is used to tell the Window it should not change the mouse cursor as well. This change also adds a closed hand mouse cursor, though this is unused for now (might be useful when dragging stuff around). The new cursors are by meway.
2024-08-31Apply a margin to the text in the help windowThorbjørn Lindeijer7-230/+233
And removed the manual space character at the start of each line...
2024-08-31Display "Mana" as part of the version in Setup windowThorbjørn Lindeijer4-5/+5
This was already done in the log, when responding to the --version parameter and for the label on the Desktop widget, but not in the Setup window. Now it is consistently part of the FULL_VERSION define.
2024-08-31BrowserBox: Make sure to start each line with the default colorThorbjørn Lindeijer1-1/+4
This was already the case for each newly added line, but when the entire layout was redone previous selected colors would spill over to the next line.
2024-08-31CMake: Make the data files show up in the IDEThorbjørn Lindeijer1-0/+18
Using a custom target which should otherwise not affect the build.
2024-08-31Some margin and indentation tweaks in news and NPC dialogsThorbjørn Lindeijer6-40/+41
* Apply indentation after wrapping only in NPC dialogs and chat window, since we don't want this in the updater window / news. * Added some margin around the text in the updater window and NPC dialogs, using gcn::Widget::setFrameSize. * Cosmetic changes to BrowserBox implementation.
2024-08-28Fixed handling of consecutive text formatting markersThorbjørn Lindeijer2-11/+8
If a text contained for example "##3##B", expected behavior was to switch to blue color and bold font. Instead, due to there being no actual text in between the markers, the layouting code was aborting prematurely here: if (mMode == AUTO_WRAP && partWidth == 0) break; As far as I could judge, this check is actually not necessary anyway, but I've kept it for now since the wrapping code looks so problematic. Instead, a while loop now makes sure we process all consecutive formatting markers. Closes #75
2024-08-28Fixed choosing default world when using -D command-line parametercuoco2-6/+2
- Updated STATE_WORLD_SELECT case to automatically select the first world and proceed to update state when mOptions.chooseDefault is true. - This change ensures that the world selection window is bypassed for a smoother user experience when the default selection option is enabled. - Improved logic to handle cases with only one available world and directly proceed without showing the dialog.
2024-08-26Limit shop's Max button to available carry weightFedja Beader2-1/+14
(cherry picked from M+ commit 13b9ff5baf1f6d31cc6bfa5bd30bacd45b80539c)
2024-08-25Fixed initialization of equipment backendThorbjørn Lindeijer10-144/+110
For new characters (and in general, when logging in with a character that had nothing equipped), the equipment backend wasn't being initialized. This resulted in the equipment not being visible in the Equipment window. Fixes #83