Age | Commit message (Collapse) | Author | Files | Lines |
|
input field.
|
|
Seems this color just wasn't copied over correctly due to being on a
different palette originally.
Also made Tab::draw use the correct outline color.
Addresses part of #98.
|
|
Since there was already specific support for theming different progress
bars with a custom color gradient, it was relatively straight-forward to
extend this to support custom text formats.
Thanks to @Meway for having an initial go at this feature!
Closes #111
|
|
By using SDL logging, we can rely on SDL to filter the log messages by
their priority before they get sent to our custom output function. For
example, we now no longer get entries for created and destroyed Window
instances by default, since these have only "debug" priority whereas the
default priority for the "app" category is "info".
We can also get log messages raised by SDL itself in our log now. Log
levels can be controlled per category through the "SDL_LOGGING"
environment variable.
Many existing log messages have been assigned a category based on their
existing prefix.
|
|
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.
|
|
It should be at least the minimum size. This was not the case when there
were no emotes provided by the server (as for Source of Tales
currently).
Issue manifested itself as `std::clamp` assert in debug builds, and
probably undefined but harmless behavior in release builds.
|
|
* When hovering an empty box in the shortcut window, the tooltip of a
previously hovered non-empty box would stay visible.
* When hovering to the right of a row of inventory items, the tooltip
for the left-most item on the next row would be displayed.
Also added some padding to shift the text and item icon a little in the
shortcut window when using the Jewelry theme.
|
|
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
|
|
This was broken by 79e4325192f3260ed4ded264e43da8429650bf72 due to there
being a case difference between the serverTypeToString and parseType
functions, causing loaded servers to be invalid due to unknown server
type.
Closes #105
|
|
Mainly using std::vector<std::unique_ptr<Item>> to automate memory
management.
|
|
|
|
The window needs to be slightly larger on Jewelry theme. By not
specifying a width, the layout will take care of this.
|
|
Allows more flexible customization as needed by Jewelry theme.
|
|
Instead of loading images directly, which is less flexible. In Jewelry
theme, these icons are embedded in the window.png image.
|
|
This enables customized outlines for each text color as well as adding
outlines for specific palettes, as done by the Jewelry theme.
Merged PARTY_CHAT_TAB and PARTY_SOCIAL_TAB into just PARTY_TAB since we
should probably be using the same color there anyway.
Split off WHISPER_TAB as separate color from WHISPER.
|
|
Each Skin can point to a different palette, which can be used to tweak text
colors where necessary. For now there is no generic solution for this, instead
a number of locations have been adjusted to take the palette into account:
* ChatWindow sets its palette on the BrowserBox used in its tabs.
* Popup sets its palette on child widgets when they are added (covering
BrowserBox, Label and TextBox).
* ItemPopup now uses its palette when looking up colors.
The BrowserBox now retrieves its numbered text colors from the theme. Also
added OLDCHAT, AWAYCHAT and GLOBAL theme colors, with ##g, ##o and ##a to
choose these colors respectively.
Fixed ImageRect move constructor.
TextPreview class was cleaned up from unused functionality.
Being name colors are no longer different between the name shown on the being
and the name shown in the SpeechDialog.
|
|
* Added Theme dropdown to Interface setup
* Added CARET theme color
* Fixed issue with logging errors in `check` function in `theme.cpp`
* Fixed XML::Children::Iterator to iterate only element nodes
* Changed default theme to "jewelry"
Changing the theme (or font size) shows a dialog that points out a restart is
required to apply these changes. This is necessary at the moment because many
things, like default or minimum window sizes, are only calculated once.
|
|
And made the Jewelry theme hide those buttons.
|
|
Due to getVerticalMarkerDimension and getHorizontalMarkerDimension not
being virtual, this unfortunately required copying a lot of code from
Guichan to make sure it calls our versions of these functions.
Also addressed a small issue where gcn::ScrollArea::checkPolicies was
not taking the frame size of the content into account.
|
|
Used "spacing" to store the additional space between the sticky button
and the edge of the window (or the close button).
Adjusted Popup and ToolWindow skins by one pixel to make the sticky
button align the same way as for the Window skin.
|
|
Now we can define icon names for each equipment box and then look up the
icon image through the theme, enabling some shared control over
equipment slot icons between the game data and GUI theme.
The icon for an equipment slot is also no longer rendered when the slot
has an item in it.
Removed the needless storing of equipment box positions and images in
the EquipmentWindow, because this information is readily available from
the InventoryHandler and the images are already loaded by the Theme.
|
|
* Added EquipmentBox and ItemSlot skin types.
* Allowed rectangles drawn by the theme to be not filled.
* Added width/height attributes to skin element since we needed a way to
specify the size of the item slots and equipment boxes.
|
|
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.
|
|
Sometimes I've used CamelCase and sometimes SNAKE_CASE for these values.
Since "enum class" values are always prefixed with the enum name, which
uses CamelCase, I find it more fitting to use it for the values as well.
Also fixes compilation on Windows where 'ERROR' was conflicting with a
define.
|
|
* Removed some unused includes and forward declarations.
* Use std::unique_ptr to automate cleanup.
* Use TextRenderer::renderText in BrowserBox to avoid code duplication.
* Removed unused STATE_NORMAL from StateFlags.
* Small layout fix in ServerDialog.
* Reduced rewrapping delay in BrowserBox to 33ms and disabled it
entirely when there are no more than 1000 lines to rewrap. The
rewrapping is usually fast enough.
|
|
Needs to allow space for all three buttons, especially since they are no
longer clipped to the window.
|
|
* Displayed Being was deleting its SpeechBubble after the
WindowContainer had already deleted it. Resolved by registering a
DeathListener.
* On dialog deletion, the CharHandler had become a roaming pointer but
was still accessed.
|
|
Added handling of padding and text format and added new "spacing" skin
variable which is used for the space between the label and the control
in case of CheckBox and RadioButton.
Small tweaks to UI layout in various places.
|
|
No need to cache the image in different colors since color modulation is
cheap these days.
|
|
The following widgets now support setting the font, text color, outline
color and shadow color through the theme:
* Button
* Tab
* Window (title)
* ProgressBar
The text format can be specified differently per skin state.
|
|
|
|
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.
|
|
* Moved previously hardcoded values for frame size, padding and title bar
height to the Skin.
* Added support for rendering colored rectangles (used for scroll bar
background).
* Scroll bar width is now determined by its skin.
* Added separate skins for horizontal and vertical scroll bars and horizontal
and vertical scroll markers and added a skin for the shortcut box.
* Added support for hovered state on window close button.
|
|
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.
|
|
|
|
|
|
This is cleaner overall since now each widget type no longer needs to
keep track of its own instances and updating of the GUI alpha. It also
introduces a single point from where the GUI theme support can be
enhanced.
Theme is no longer a singleton, though for now there is a single
instance owned by the Gui singleton.
Widgets adjusted to delegate their painting to the Theme:
* Button
* Tab
* TextField
* CheckBox
* RadioButton
* Slider
* DropDown
* ProgressBar
* ScrollArea
* ResizeGrip
* PlayerBox (by subclassing ScrollArea)
The Window and Popup widgets already use the theme through the Skin
class. They can actually use a different skin per instance, though this
feature is only used by the SpeechBubble.
|
|
These are not necessary since we can instead make sure the referenced
values match case, like we do for everything else.
This affects server types in the server list and colors referenced in
theme files. The server version was also compared case-insensitively
for some reason.
|
|
Now when NPCs text includes "###MoveUp;", it will get replaced by "Up",
or whatever key is currently bound to that action.
For compatibility reasons the key name can optionally have a "key"
prefix, for example "###keyMoveUp;".
Closes #73
|
|
Code appeared duplicated just because we don't draw the background, but
this could be done by overriding drawBackground instead.
|
|
No longer supported by manaserv and not supported by tmwAthena.
|
|
|
|
For historical reasons, sprites get a 16 pixel offset by default, which
is used to position them correctly on their tile.
When pixel-based movement was added, actors are now positioned on the
middle of a tile and the built-in offset was removed. Servers that use
sprites that do not rely on this offset can now set the spriteOffsetY
option to 0.
|
|
This extends the messages regarding abilities, replacing the specific
"attack" messages. It also unifies attribute handling, with a generic
system replacing specific variables for attributes like level, xp and
skills.
The inventory and equipment handling was adjusted such that equipped
items stay in the inventory.
Support for quest states was added.
Added:
* GPMSG_ABILITY_REMOVED
(mana/manaserv@e3fcc1a47db312933a0f5b7e725c5779a1a45722)
* GPMSG_ABILITY_COOLDOWN
(mana/manaserv@c2f00b2f3ba920cb25333d19a1d37d251342caf8)
* GPMSG_BEING_ABILITY_POINT
* GPMSG_BEING_ABILITY_BEING
(mana/manaserv@2f2393b6d190deb8958fcb806b58418508d25e28)
* GPMSG_ATTRIBUTE_POINTS_STATUS
(mana/manaserv@1e5a15c0a5e24fb4b358fff75a7082d65496e1f9)
* PGMSG_USE_ABILITY_ON_DIRECTION
(mana/manaserv@05fc955a3f8a03539088fa7569395434e29d90e8)
* GPMSG_BEING_ABILITY_DIRECTION
(mana/manaserv@54389afd7ba9fecf0761333185145e968e2453ae)
* GPMSG_QUESTLOG_STATUS
(mana/manaserv@66a98a3a0df795761328d62ef2ad07f81e383f9e)
Removed:
* PGMSG_ATTACK
* GPMSG_BEING_ATTACK
(mana/manaserv@f31277b327df701361391b1d4b8bd6f89f4e3109)
* GPMSG_PLAYER_EXP_CHANGE
* GPMSG_LEVELUP
* GPMSG_LEVEL_PROGRESS
(mana/manaserv@44ee071d7ece5a2023f79307f36e8a244c9e7b3a)
Changed:
* GPMSG_ABILITY_STATUS
(mana/manaserv@ba573fcc38580a01985172b9bc864c97ce855af3)
* GPMSG_BEING_LOOKS_CHANGE
(mana/manaserv@8ddda85d923a528c7497a628d2fe10fc40b80a1f)
* APMSG_CHAR_INFO
(mana/manaserv@4f5053f463fd8da0de1615ca6b0f212f02f3d653)
* APMSG_CHAR_CREATE_RESPONSE
(mana/manaserv@1263c729d85df649c7ab59726bddad7c8cd7ae81)
* GPMSG_NPC_BUYSELL_RESPONSE
(mana/manaserv@336ce321a9b996e56a61a5364bb32124efa84dd9)
Equipment changes (mana/manaserv@f712d68495dd8e040c32da3b1c85bcb7845543ec):
* Changed GPMSG_INVENTORY_FULL, GPMSG_EQUIP
* Removed PGMSG_MOVE_ITEM
* Added GPMSG_EQUIP_RESPONSE, GPMSG_UNEQUIP_RESPONSE, GPMSG_UNEQUIP
While this change deals with some of the protocol changes, there's still
many changes required in the UI regarding using of abilities (including
attacking), showing of certain attributes and quest log.
|
|
To match mana/manaserv@9ff69160ea1c3c64ea7012cd70a3b50ff4373264.
|
|
* Moved the memory buffer and mutex handling into the Download class to
simplify the code updating the UI in ServerDialog and UpdaterWindow.
* Replaced the "DownloadUpdate" callback function with simply polling
Download::getState, since in the end polling was happening anyway.
This changes also fixes handling of the Enter key while downloading
updates, which no longer cancels the update process. Also, when pressing
Escape while things are being downloaded, the first press cancels and
only the second press goes back to login.
Introduced a ThreadSafe template class, which wraps any type and makes
it only accessible by calling lock(). This ensures the data is never
accessed without locking the relevant mutex.
|
|
The UI became unresponsive as a result of not actually deleting the
OkDialog. The dialog is now managed by the AwayListener, which now
schedules Away dialog for deletion when necessary, using a DeathListener
to clear the reference to the dialog.
The WindowContainer now uses an std::set instead of std::list to keep
track of widgets scheduled for deletion, to avoid crashing when a widget
is scheduled for deletion multiple times.
|
|
* DebugWindow and SkillDialog were not deleting their tabs nor their tab
widgets.
* TabbedArea was not deleting its arrow buttons.
* Button was deleting its TextPopup on deletion of the last Button
instance, which was wrong because it was also being deleted by the
WindowContainer. Also removed some misplaced event forwarding to the
TextPopup.
TabbedArea is tricky because it does not automatically delete added tabs
or their widgets. Tab instances are only deleted when they were added by
name.
Issues found by Valgrind memory analyzer.
|
|
* ActorSpriteManager failed to delete its AutoCompleteLister instances.
* CharCreateDialog was relying on ~Window to delete its child widgets,
but it wasn't always adding all its widgets, so some failed to get
deleted. Now it only creates the widgets it needs.
* SkillDialog didn't delete its SkillModels.
* PlayerList didn't delete its player Avatar instances.
* Fixed deletion of the EffectManager.
Leaks located using AddressSanitizer.
|
|
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.
|