summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-04-25GUI: Added support for multiple color palettes to ThemeThorbjørn Lindeijer1-0/+2
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.
2025-04-25GUI: Allow customizing the SkinType used by a WindowThorbjørn Lindeijer1-3/+7
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.
2025-04-02General code cleanupsThorbjørn Lindeijer1-20/+8
* 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.
2025-01-20Made client config statically typedThorbjørn Lindeijer1-5/+2
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-29Turned the PlayerRelation struct into an enum classThorbjørn Lindeijer1-1/+1
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-08-31Some margin and indentation tweaks in news and NPC dialogsThorbjørn Lindeijer1-1/+1
* 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-06-09Enable resizing windows from all sidesThorbjørn Lindeijer1-3/+10
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.
2024-03-12General code cleanupsThorbjørn Lindeijer1-16/+9
* 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-11Implemented ability to open external links in news and chatThorbjørn Lindeijer1-1/+1
* 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.
2024-02-22General code cleanupsThorbjørn Lindeijer1-7/+2
* 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-01-29Apply C++11 fixitsThorbjørn Lindeijer1-8/+5
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-7/+7
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-02-05Fixed spreading over tabs not spamming too muchErik Schilling1-16/+4
Now announcements will only get displayed on the current tab + on the local tab Reviewed-by: Thorbjørn Lindeijer
2012-02-05Fixed some layout issues with the chat windowThorbjørn Lindeijer1-1/+3
One pixel of the scroll bar wasn't visible since the mWidgetContainer is shifted by one pixel by gcn::TabbedArea::adjustSize, which wasn't being taken into account by our custom mWidgetContainer sizing code. Fixed that by just letting Guichan handle it. Another issue was that the tab scroll arrows were appearing before they were needed, since they took into account their own size when checking whether the tabs had enough space. Finally, a Layout has a default padding of 6 pixels but this is a little much for the chat window. I reduced it to 3 pixels now. Reviewed-by: Erik Schilling
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-16Renamed some file names for consistency with the class namesThorbjørn Lindeijer1-0/+543
This was already done by ManaPlus. It's a good idea anyway and it makes comparing the code a little easier. Reviewed-by: Yohann Ferreira