Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
Made the class and the code in general more readable by removing all
the needless getters and setters.
|
|
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.
|
|
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.
|
|
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.
|
|
* 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.
|
|
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
|
|
|
|
|
|
Less code duplication.
|
|
The online list refreshes every 18 seconds, which matches ManaVerse
behavior. It's not ideal, but to improve this would mean diving into
TMWA.
The client version was bumped to 8 to get a SMSG_ONLINE_LIST reply.
Further changes needed related to the client version are tracked by #71.
This also changes the TabbedArea to take into account the frame size for
its tab widgets, to make sure those frames are not clipped by the
TabbedArea widget (as happened in the Social window).
The horizontal scroll bar is now disabled in all social tabs, with the
vertical one appearing only when necessary.
Closes #61
|
|
This reverts part of 087babc2525ddb89e5b31f240a08739d9a3029a9.
It's unclear to me why big words should be split (chat window
force-wraps when necessary anyway) and it's causing issues by adding
spaces in the middle of links, for example.
|
|
(cherry picked from commit 0192d44d46dcf948ab26371862753f4baf5aae4e)
|
|
##B switches font to bold, ##b switches font to normal. Each line starts
with the normal font.
This change is roughly based on ManaPlus commit
6c4c6ca877c336e17c0378131a0a139792012a99.
|
|
Previously, the top edge of windows could not be dragged. Now you can also
resize windows by their top edge, as well as the top-left and top-right
corners.
|
|
Shows outlines of visible widgets as well as highlighting modal focus,
modal mouse focus and regular focus.
Can currently only be toggled in the Debug window, so needs source code
modification to be used during login sequence for now.
|
|
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.
|
|
* Removed some unused includes
* Removed unused ListBox::mFont
* Removed wrong cast to SDL_Scancode
* Removed superfluous .c_str()
* Removed superfluous explicit std::string construction
* Removed unused variable
* Use more emplace_back
* Turned FindBeingFunctor into a lambda
* Avoid needless pointer references for ambient layers and use a vector
|
|
Most prominently, fixes the tooltips on the window buttons being clipped
due to their position being slightly outside of the clipping children
area. And fixes NPC tooltips from having a lot of empty space below the
NPC name.
Also reduced the space between texts in the item tooltip to match the
padding rather than being an entire empty line.
|
|
It did not distribute them when the value of the DropDown was changed by
key events or mouse wheel.
|
|
Ubuntu 20.04 had SDL 2.0.10, and it is still supported.
Also added error handling to the SDL_OpenURL call, just in case.
|
|
* 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
|
|
* Use ConfirmDialog to confirm the opening of the external link.
* ConfirmDialog now centers on its parent window when provided.
* Reset hovered link when mouse exits the BrowserBox.
|
|
Rewrote the tile animation loading code based on XML tags, replacing
the code that loaded tile animations from tile properties.
Also made a number of code simplifications and optimizations:
* Replaced a number of pointer members with value members.
* Pass around Animation and TileAnimation by value, using std::move to
avoid allocating copies.
* push -> emplace
* push_front -> emplace_front
* push_back -> emplace_back
* Use range-based for loops
* Use std::vector instead of std::list for storing affected tiles
(less fragmentation)
* Avoid string copies and allocations while parsing CSV layer data.
* Replaced xmlNodeGetContent with directly accessing 'content'.
|
|
The new cursor types are not used yet for now.
|
|
* 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
|
|
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.
|
|
* 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 ""
|
|
* 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
|
|
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.
|
|
This patch is not exhaustive.
|
|
|
|
modernize-loop-convert
modernize-deprecated-headers
|
|
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
|
|
|
|
|
|
* 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
|
|
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
|
|
|
|
Mantis-Issue: 423
Reviewed-by: Thorbjørn Lindeijer
|
|
|
|
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
|
|
|
|
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
|
|
Also added Xcode project for others to compile for Mac OSX.
Reviewed-by: Thorbjørn Lindeijer
|
|
One of the sound channels is reserved for notification sounds, of which the
volume can be configured separately. Currently, the only notification sound
that is played is for receiving whispers. That can be extended later.
The newmessage.ogg sound used currently is the one for receiving a message
with the Psi instant messenger.
Parts of this patch are based on the new message notification in ManaPlus.
Reviewed-by: Erik Schilling
|