Commit graph

1566 commits

Author SHA1 Message Date
Charles Dang
1f0588883c MP Staging: make Faction Select button's purpose more clear
[ci skip]
2018-04-08 21:04:14 +11:00
Iris Morelle
3967fd190e gui2/log_settings: Make log options tooltips translatable
Fixes #2837.
2018-04-06 14:04:00 -03:00
Charles Dang
6615aa7efe Swapped the position and formatting of game names and titles in the MP lobby
Addresses point 2 of #2815.
2018-04-03 19:11:29 +11:00
Charles Dang
1903b05ab1 GUI2/Label: tweaked link color
[ci skip]
2018-04-03 15:25:44 +11:00
Charles Dang
23e78abb20 Help: massive refactor and cleanup of the help backend
This basically splits all the stuff in help/help_impl.*pp into multiple files by their
function, and refactors the entire workflow into a proper object-oriented interface in
modern C++.

There are still a features missing (such as hidden section parsing in the manager) that
I'll get back to.

Few incidental changes and fixes:
* Terrain topics now sorted alphabetically.
* Help text now small
* Fixed wrong toggle button id in browser. This is what was making it impossible to expand
  any sections.

The GUI2 help browser is now back in working order, inasmuch as you can view all sections'
and topics' text (save units').
2018-04-03 11:51:57 +11:00
Charles Dang
b32ccb05dd Help Browser: increased window height
[ci skip]
2018-03-26 12:21:24 +11:00
Charles Dang
db5abb7e63 GUI2/Text Box: refactored hint text interface
Previously, I had implemented the hint text ("Search)" and image (the magnifying glass)
as a custom text box definition. This caused some problems, though. Since the string was
hard-coded as part of a WFL formula, it couldn't be translated (see #2709 and #2732). It
also wasn't expandable to any other usecase.

Instead, I've added two new hint_text= and hint_image= keys to [text_box], wrapped the
"Search" text and magnifying image path in a helper macro, and refactored the default
definition to display the hint text and image when appropriate.

This also fixes a minor issue where selected text wouldn't remain highlighted when the
box wasn't focused when using the filter definition (it did with the default one).

This should fix the untranslatable "Search" text issue mentioned in both issues above.
The new string is in the wesnoth-lib textdomain.
2018-03-26 12:11:34 +11:00
Charles Dang
2b9c7b1abd GUI2/Canvas: allow formula values for [text] font_size= 2018-03-26 12:03:46 +11:00
Charles Dang
ebec4d6ce8 MP Login: removed Password Reminder functionality
Resolves #2748.

Essentially, all this did was tell users to go use the forum, so it wasn't worth
it to keep it and solve the infinite loading screen issues it was causing.

The server backend still needs to be cleaned up.

Also removed a dead reference to some "Change Username" button in the Login dialog's
code.
2018-03-26 02:15:53 +11:00
Charles Dang
8d1ec6216b Added two missing textdomain headers
[ci skip]

Should fix two of the issues mentioned in 2709.
2018-03-22 22:08:38 +11:00
Charles Dang
075a9bac34 Get the GUI2 in-game UI at least appearing
I decided to go with a modular approach, where both in-game and editor UI dialogs inherit
from a single base class, a pointer of which is owned by the display class. That can be
used for common functionality that needs be shared by all in-game dialogs.

Right now the new UI is just static. It works with most stuff, but not key presses. Working
on that...
2018-03-20 04:47:42 +11:00
Charles Dang
1167e3e78b Some build fixups to reflect changes since the help commits were originally made 2018-03-19 10:48:48 +11:00
Charles Dang
5193c7e7bf Help Browser: removed help topic padding 2018-03-19 10:48:06 +11:00
Charles Dang
75639bafd1 Help Browser: fixup topic title layout 2018-03-19 10:48:04 +11:00
Celtic Minstrel
854ade5d5c Help Browser: Show topic title 2018-03-19 10:45:09 +11:00
Charles Dang
71a89de7b2 Help Browser: properly implement toggling by clicking the book icons 2018-03-19 10:45:06 +11:00
Charles Dang
231a8ccbf2 Help Browser: implemented viewing of sub-sections/topics 2018-03-19 10:44:01 +11:00
Charles Dang
19eee7e806 Help Browser: improved layout stability and added next/back buttons (non-functional, of course) 2018-03-19 10:43:38 +11:00
Celtic Minstrel
fbd42a7378 Help Browser: Actually show the correct topics with the correct icons
This also fixes the lag when opening help and makes the topic text appear.
(The topic text is not parsed at the moment, though.)
2018-03-19 10:43:25 +11:00
Charles Dang
ed27b67f1e Port floating textbox/command console to GUI2
The old floating textbox was extremely entwined with the controller_base, play_controller, and menu_handler
classes. controller_base::have_keyboard_focus essentially controlled whether some events were executed based
on whether the floating textbox was open or not. Additionally, those events weren't even reached if a UI dialog
was open at all.

The new design features a singleton console class that can be called from anywhere, not just the game. I've also
decoupled the execution object from play_controller. The relevant functions in menu_handler are now passed to
the console as callbacks.

To work around map events such as clicking not being available if the console was open, I removed the exclusionary
is-in-dialog check from controller_base::handle_event and instead exit early out certain types of events using
controller_base::have_keyboard_focus. As mentioned in the accompanying comment, this isn't the best solution, but
it will do for now.

The new console also isn't fully feature-comparable with the old GUI1 one. The following are still missing:
* The checkbox, for use when sending messages.
* Tab completion.
* A crash occurs when existing the app if a game was exited with the console open.

I'm leaving the old floating_textbox code around for now for reference.
2018-03-19 01:22:18 +11:00
Charles Dang
8396b535c8 GUI2/Window: draw background image first instead of last
Originally was going to do this as workaround for the background tiling over the borders,
but I fixed the root cause of that instead. Still, this just makes more sense.
2018-03-19 01:22:05 +11:00
Charles Dang
e30a2aa520 Added static prototype for GUI2 in-game theme 2018-03-19 01:14:00 +11:00
Charles Dang
41f921bd38 GUI2/Canvas: refactor surface blitting out of drawing routines
This entirely refactors surface blitting out of the canvas. Instead, each canvas owns a texture. This texture
is completely redrawn any time the canvas if marked dirty, else the result is cached and drawn to the screen
each draw cycle.

All windows are now redrawn every draw cycle. The use of the cached canvas textures means there's no noticeable
performance difference (likely a performance gain, actually) from using surface blitting.

There's still some code to clean up and a few things to fix.
2018-03-19 01:13:23 +11:00
Charles Dang
a43623ff2d Screenshot Notification: cleaned up and tweaked a few things
* Added textdomain closure missing from 267510ea07
* Avoid use of invalidate_layout by having an em dash in the size field prior to
  saving. That's needed since GUI2 doesn't expand the label's canvas if its text
  is initially empty.
* Use a better button definition for the View button.
* Grouped Save and Close buttons together
2018-03-18 17:01:26 +11:00
Charles Dang
a18522acb8 File Dialog: removed label keys with empty values
[ci skip]

This doesn't do anything.
2018-03-18 17:01:24 +11:00
Jyrki Vesterinen
267510ea07 Show screenshot window before saving the screenshot
In particular, this allows the player to choose the filename before saving,
including the extension. If support for target format is present, Wesnoth
honors the extension and saves the screenshot in that format.

I also changed the default screenshot format back to PNG due to quality
issues JPEG has with pixel art. See discussion in pull request #2655.

This commit doesn't introduce any string changes. I used existing strings
for everything (sometimes having to take them from another textdomain).
2018-03-16 23:45:36 +02:00
Charles Dang
95d9eb7f1b Unit Attack: removed the Choose Weapon text
[ci skip]

Legacy from the GUI1 dialog, not really in line with our current UI.
Replaced it with a spacer.
2018-03-17 00:41:33 +11:00
Charles Dang
3a90f86674 Addressed more whitespace issues from #2613
[ci skip]
2018-03-12 03:48:59 +11:00
Charles Dang
5fc4dcf5fa Revert "Message Dialog: make all option rows have the same height"
[ci skip]

This reverts commit 0089357edb. It wasn't suitable for
all usecases, and it's impossible to make it a dialog option.

Fixes #2628
2018-03-11 14:02:16 +11:00
Charles Dang
471c9e876a Addressed a large chunk of the whitespace issues from #2613
[ci skip]
2018-03-09 11:37:00 +11:00
Charles Dang
0089357edb Message Dialog: make all option rows have the same height
[ci skip]
2018-03-05 13:55:43 +11:00
Charles Dang
9c83099613 MP Lobby: increased chatbox height on standard resolution
[ci skip]

* Increase chatbox height from 25% of the screen height to 28%
* Removed remaining horizontal spacer line
* Disabled horizontal scrollbar for the game list. I had set the mode to 'auto' in order to
  reserve space for the bar should it be needed. However, I've since decreased the amount of
  content in the game listbox, rendering the chance it will be needed much less likely.
2018-02-24 22:52:35 +11:00
Charles Dang
cc3d73621a Preferences Dialog: avoid offset-by-one handling for accl speeds
Since the slider values started at 1, they needed to be adjusted for speed
index access. Less confusing to start at 0.
2018-02-24 18:57:06 +11:00
Charles Dang
894cc6a3cc GUI2/Toggle Panel: switched to procedural border drawing for semi-transparent message variant
[ci skip]

This matches the regular toggle panel now.
2018-02-23 15:45:02 +11:00
Charles Dang
ca4b7dccff GUI2: removed excess spaces and newlines from font size macros
[ci skip]
2018-02-23 15:37:47 +11:00
Charles Dang
5f1005d5ce GUI2/Chatbox: removed room listbox header
[ci skip]

Headers don't do anything with horizontal listboxes.
2018-02-22 16:19:49 +11:00
Charles Dang
b35663e1bf GUI2/Chatbox: handle main border in including windows
[ci skip]

This is consistent with other widgets.
2018-02-22 15:13:48 +11:00
Charles Dang
38477ee23b MP Lobby: ensure turn/slots text always has enough space
[ci skip]
2018-02-20 15:13:22 +11:00
Charles Dang
72a80fed5b Removed GUI_NORMAL__RESOLUTION macro
[ci skip]

Not necessary since the "tiny" resolution was removed a long time ago, and the parameters
would implicitly convert to 0 engine-side.
2018-02-17 17:33:32 +11:00
Charles Dang
ec03dfcd08 Updated GUI2 schema for f4a1abdb9b 2018-02-14 14:48:30 +11:00
Charles Dang
1632afe1af Outro: used script font for text
[ci skip]
2018-02-14 14:40:31 +11:00
Charles Dang
7d647a6d3d Update GUI2 schema for 6bd9740 2018-02-14 09:18:31 +11:00
Charles Dang
0b77514031 Outro: improved text display
[ci skip]

Increased text size to 100 and made use of the light variant.
2018-02-14 04:05:50 +11:00
Charles Dang
b4c220260e MP Join Game: increase gold icon and text size
[ci skip]

Also removed some superfluous tooltips.
2018-02-11 10:36:50 +11:00
Charles Dang
7a7744c943 Game Load: some UI tweaks
[ci skip]

* Improved leader list display
* Made dialog slightly wider to reduce likelihood of a horizontal scrollbar appearing.
  Still not a perfect fix, but it's better.
2018-02-11 10:36:49 +11:00
Jyrki Vesterinen
3b88de6cbc Add sort order dropdown to add-on manager (#1747)
This dropdown allows the player to sort add-ons by name, author, size,
download count, type, or the time of last update or original upload.
Sorting by the last two hasn't been possible in the GUI2 add-on manager
before.

Closes #1747.
2018-02-10 18:06:38 +02:00
Charles Dang
c75ca87517 GUI2/Addon List: improved a bunch of stuff related to inline control buttons
* Flipped the arrow on the Update icon set to point downwards, since it's a download operation.
* Renamed existing small Update icon set Publish, and added downwards version to replace Update.
* Renamed all addon manager icons and their respective button definitions to be clearer.
* Moved unused small icon versions to their own subfolder.
* Added separate Publish inline button to image list. This is now used in all cases to publish,
  regardless of whether the addon has been uploaded previously or not. Prior to this, the Install
  button was used for non-published addons, and the Update one for published ones. This means the
* Refactor addon_list inline button setup to be clearer.
* Made inline Uninstall button display in all cases where an addon was installed, instead of just
  INSTALLED and NSTALLED_UPGRADABLE. It will not display if a publishable addon has not been
  published, however.
* Changed is_local check to match the ADDON_INSTALLED_LOCAL_ONLY. I figured this is a bit more
  robust. TODO: do the same in the addon manager itself?

Art assets credit to @Lordbob
2018-02-10 21:26:33 +11:00
Charles Dang
3b6da9a232 Addon Manager: include outdated addons in dependency check (fixes #1494)
Also added missing border around addon list in Install Dependencies.
2018-02-10 00:36:38 +11:00
Charles Dang
aeed6d5538 GUI2/Chatbox: disable chat history
[ci skip]

This prevents private chat logs being saved in your preferences file. History isn't
currently working anyway, and it seems weird to be saving logs this way, especially
since it also records private messages.
2018-02-09 07:20:51 +11:00
Charles Dang
01105cc924 MP Staging/MP Join Game: always draw leader sprite at 72x72 (fixes #1981)
This is also related to #1932. I fixed leader sprites being cropped in 41e674128f,
and that made sprites in MP Staging always scale to 72x72. However, large sprites like the
Fire Dragon's still drew at full size in MP Join Game since the damn tree nodes are being
recreated when new changes come in (a separate issue I need to fix). This change fixes the
size of leader sprites in both dialogs to 72x72 regardless of sprite size, so we're saved
any similar issues cropping up in the future even once I do fix the excessive node recreation
in MP Join Game.
2018-02-07 03:07:31 +11:00