66500 Commits

Author SHA1 Message Date
Charles Dang
bf1c038882 File Dialog: used fixed-size window instead of dynamic 2016-10-05 17:47:57 +11:00
Charles Dang
d72ff82cc6 File Dialog: make New Folder and Delete buttons invisible instead of hidden in read-only mode 2016-10-05 17:35:14 +11:00
Charles Dang
93d850faf9 File Dialog: set restore flag 2016-10-05 17:33:34 +11:00
Ignacio R. Morelle
d17ded1508 Cleaned up UI strings passed to the file dialog
Most of these were wordier than necessary (e.g. "Save the Map As"
instead of "Save Map As). Also replaced "want" with "wish" in external
prompts at vultraz's suggestion.
2016-10-05 03:14:50 -03:00
Ignacio R. Morelle
95a192fe79 preferences: Reword part of the file dialog message 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
8c14dc1872 gui2/tfile_dialog: Make it so the fileview and textbox "share" the focus
This allows the user to use the arrow keys to select fileview entries,
and character keys to enter a name into the textbox below, just like in
the GUI1 version.

Thanks to celticminstrel and vultraz for the tip.
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
ddd3dc7261 preferences: Make wesnothd search starting point sane, simplify code
The previous logic reinvents filesystem::directory_name() in a
platform-dependent fashion (it will break if the wesnothd path in
preferences has backslashes on Windows, which is exactly what the GUI2
file dialog delivers), and uses the compile-time install prefix
(non-Windows platforms) or the current working dir (all platforms)
instead of using the game executable's directory, which we can reliably
obtain on Windows or Linux, and automatically fall back to the cwd
otherwise.

Using filesystem::get_exe_dir() as a starting point instead allows for a
much simpler and platform-independent logic (except for the .exe
extension for the binary on Windows, of course).
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
2cc1f6692a gui2/tfile_dialog: Clarify defaults 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
285bbe7237 gui: Remove GUI1 filechooser
This switches all existing callsites to using gui2::tfile_dialog, and
fixes a build issue due to editor/controller/editor_controller.cpp
relying on an indirect include from gui/dialogs/editor/custom_tod.hpp
for a full type declaration.
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
8056d638f1 gui2/tfile_dialog: Add support for a filename extension hint
This allows setting a hint in save mode so that the name portion of the
filename will be selected whenever the user selects a file with a
matching extension on the fileview, and so that whenever the textbox is
cleared by code (e.g. when browsing into directories) it is pre-filled
with the extension with the cursor at the start.

With this, the dialog is now feature-complete compared to the GUI1
version.
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
3fa0fc9548 gui2/ttext_: Add a public method for setting the selection range
Unlike the internal (protected) methods, this makes sure to call
update_canvas() when done so that e.g. text_box's highlight rectangle
is properly updated on the canvas with the right variables so that it's
drawn after we're done handling events.
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
0f83718965 gui2/tfile_dialog: Set maximum dialog height 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
7b3fdedc85 gui2/tfile_dialog: Sort directory entries ignoring character case 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
0cd131b537 i18n: Add case-insenstitive icompare() function, document compare() 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
c89b7596ec gui2/tfile_dialog: Avoid redundant grid pointer retrieval 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
ef09ef9e6c gui2/tfile_dialog: Add deletion prompt and fix deleting folders 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
409b61f5be gui2/tfile_dialog: We can delete folders too 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
fc593270dc gui2/tfile_dialog: Allow callers to set a custom label for the OK button 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
6e1f6bb686 gui2/tfile_dialog: Initial port of the filechooser dialog to GUI2
This provides, as far as I can tell, all the filechooser functionality
that is actually in use in Open File mode except for the "type-ahead"
option that is used to set filename extension hints.

There's some newly-introduced border cases courtesy of Boost.Filesystem
that I really feel we shouldn't worry about for now:

 * // is handled weirdly thanks to BFS honoring the POSIX provision for
   implementation-defined behavior regarding it.
 * UNCs on Windows are not supported. Just like in mostly everywhere
   else in Wesnoth. Same applies to \\.\, \\?\ and \??\.
 * Non-directory path components on Windows are not handled very
   gracefully (particularly obvious with volumes mounted as NTFS
   junction points, or symbolic links for the Documents folder on
   Wine) due to quirks in BFS's path::canonical() method and how it
   relies on dereferencing individual path components to resolve dot
   entries.

Haven't tested all callers yet, they are still using the original
filechooser entry points for now. I need to remove those and make
everyone use gui2::tfile_dialog directly before this can be merged to
master.
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
d301f8027f fs: Add root_name() function 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
ff07aecdf0 fs: Add three-parameter form of normalize_path() that returns canonical paths
This means resolving . and .. components, which is an operation that may
fail if any component does not exist.
2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
f3795467dc fs: Add nearest_extant_parent() function and tests 2016-10-05 03:06:43 -03:00
Ignacio R. Morelle
ea9d077b89 fs: Add utility functions for the new file dialog
These include an alternate mode of normalize_path() that enforces the
platform's preferred path delimiter (i.e. backslash on Windows) on the
output, and a function to detect whether a path refers to a root
directory.

Unfortunately, the last bit requires introducing a new link-time
dependency on Windows, against a system library. It's guaranteed to be
always there but it seems kind of a waste. The alternative would be to
hand-parse the string but that seems even more of a waste. And no,
Boost.Filesystem can't do this in a straightforward fashion right now.
2016-10-05 03:06:43 -03:00
mattsc
e38dd8ff16 ai_helper: new utility functions to find attackable enemies
Attackable enemies are defined as visible (can’t attack it if I can’t
see it) and not petrified.

This is in preparation for making the Micro AIs deal correctly with
hidden and petrified enemies.
2016-10-04 17:17:16 -07:00
mattsc
b00e6d5d96 ai_helper.LS_to_triples: fix function name
For consistency with LS_of_triples.
2016-10-04 17:17:16 -07:00
Charles Dang
7ad4ba4083 Tooltips: some small tweaks to visuals 2016-10-05 10:52:29 +11:00
Charles Dang
485e24ee26 MP Staging: fixed UB when assigning chat connection in local game (bug #25142) 2016-10-05 10:32:06 +11:00
Charles Dang
9b6fc78690 Revert "MP Create: basic implementation of saved games as their own category (debug only)"
This reverts commit 9a569df848f3b7d774ac29c100a4f36c4923b7bd.

This commit somehow causes massive lag when opening the Campaign dialog with a large (several hundred) saves.
Somehow, the save_index was being regenerated every single time a new save was processed, likely due to
the calling of save.summary() in the create_engine initialization loop. It remains to be seen if this is a bug
in the save_index code, which seems possible.

This commit was also likely the cause of bug #25146. While the fix for that might have been simpler (short-circuiting
the campaign type conditional with a savefile corruption check), since this commit has already caused issues, it's
best to revert it and revisit this idea at another time.
2016-10-05 05:53:06 +11:00
Jyrki Vesterinen
f3cdd5b2f0 Update Visual Studio project 2016-10-04 20:53:56 +03:00
Charles Dang
e25aa4ac2c MP Create Game: use tooltips for mod descriptions 2016-10-04 19:36:29 +11:00
Charles Dang
a67809d240 Slightly bump initial tooltip width 2016-10-04 19:35:50 +11:00
Ignacio R. Morelle
7fa70375e1 gui2/canvas: Fix zero-width rectangles being painted 1 px-wide
This fixes the selection highlight for textboxes glitching into view as
a 1 px-wide highlight on the left end when there isn't an active
selection.
2016-10-04 01:43:40 -03:00
mattsc
5e005007bd Merge pull request #807 from wesnoth/ai-improvements-guardians
Improve move times for AI sides with many guardians
2016-10-03 17:18:10 -07:00
Ignacio R. Morelle
5375ad838f gui2/ttext_box: Move selection highlight to the right place 2016-10-03 20:06:30 -03:00
Ignacio R. Morelle
b1fe37b90b gui2/ttext_box: Restore selection highlight lost in version 1.13.3
It was unexplainedly dropped by commit
67cf95a5af3caefb3123da806126282997c1121d.
2016-10-03 20:01:31 -03:00
Charles Dang
0a4ff56d76 Merge pull request #808 from wesnoth/remove_sdl_gpu
Remove SDL_GPU #idfefs and library
2016-10-04 04:53:49 +11:00
ln-zookeeper
85c12f40a5 Removed Bugg's random trait and fixed his buggy transformation
He used to have an unintended random trait which got re-randomized when he changed type. Now he simply levels up to a Sea Orc, which works better visually as well.
2016-10-03 20:27:38 +03:00
ln-zookeeper
f894667eb1 Changed the weird Sea Orc attack animation timing 2016-10-03 20:04:58 +03:00
ln-zookeeper
1fbe90664b Centered frames of Sea Orc properly, and tweaked the shadow 2016-10-03 19:56:32 +03:00
ln-zookeeper
f350865b1d Centered frames of Orcish Archer properly 2016-10-03 19:32:26 +03:00
Nobun
91c9677b22 wmlxgettext: added support for plural forms (used on lua files) 2016-10-03 15:01:01 +02:00
Lari Nieminen
5ede2f8519 Clarify the display of the remaining ban duration to banned users 2016-10-03 14:19:31 +03:00
Andreas Löf
e497761d4e Remove SDL_GPU #idfefs and library
Commands run:
find . -type f -name "*.hpp" | xargs coan source --replace --no-transients -U"SDL_GPU"
find . -type f -name "*.cpp" | xargs coan source --replace --no-transients -U"SDL_GPU"

This was followed by grepping and a bit of manual editing to remove
defunct TODO items and the empty sdl/gpu.hpp file.
2016-10-03 23:54:02 +13:00
loonycyborg
fd1c94b2f8 scons: clean up unused sdl_net helper 2016-10-03 13:41:45 +03:00
loonycyborg
5a75a242c5 scons: remove obsolete raw_sockets option 2016-10-03 13:34:30 +03:00
Ignacio R. Morelle
7e1798f342 cmake: Drop ENABLE_SDL_GPU option
The code conditionals using SDL_gpu in the source tree are unmaintained
and likely broken. From past discussions with vultraz and Aginor, the
plan ahead is to completely drop SDL_gpu and its support code once
there's no risk of conflict with certain WIP branches.
2016-10-03 07:23:12 -03:00
Charles Dang
e7258407ec Cleaned up remaining uses of PANDORA define 2016-10-03 21:21:36 +11:00
Ignacio R. Morelle
2c5904ae0a cmake: Remove ENABLE_PANDORA option
Pretty much all of the code for supporting OpenPandora is gone from the
source tree, and the last two mentions have just been slated for
removal, so it's effectively dead.
2016-10-03 07:19:21 -03:00
Ignacio R. Morelle
ca5ef32636 Also drop mentions of SDL_net from documentation 2016-10-03 07:08:43 -03:00
Ignacio R. Morelle
4fe822b91b Drop mentions of SDL_net from documentati 2016-10-03 07:01:42 -03:00