69459 Commits

Author SHA1 Message Date
Ignacio R. Morelle
fcba9f498d wmlunits: Refactoring and quote clean-up 2017-08-11 03:41:44 -04:00
Ignacio R. Morelle
743d8c2278 wmlunits: More cleanup 2017-08-11 02:01:48 -04:00
Ignacio R. Morelle
b7b4efcf76 wmlunits: pylint pass 2 2017-08-11 01:46:40 -04:00
Ignacio R. Morelle
b660be8fd7 wmlunits: Refactor + pylint pass 1 2017-08-11 00:44:27 -04:00
Ignacio R. Morelle
400d419b54 wmlunits: New pop-up menu implementation
The new code has a smaller markup fingerprint (no more inline event
Javascript attributes) and it also ports the outer-click-dismiss
functionality over from the wiki. It raises the Javascript engine
requirements to IE 9 and later, though, which is inline with the home
page code.
2017-08-11 00:02:04 -04:00
Ignacio R. Morelle
a0029c06d1 wmlunits: Couple of cosmetic fixes 2017-08-09 03:10:07 -04:00
Ignacio R. Morelle
4d5a4fc4c6 wmlunits: Escape generated URLs and WML-defined output
Some refactoring and a lot of code changes are involved in this.
Basically, wmlunits has always fully trusted its WML input. This has
several implications:

 * URLs such as the ones for unit detail views tend to contain
   unescaped characters which are forbidden in URLs, such as spaces.
   While browsers generally tolerate this well, the result is still
   invalid HTML. The same applies to URLs used for inline CSS (e.g.
   background-image).

 * Most information read from WML such as unit names, descriptions,
   campaign names, era names, and so on, was blindly trusted and could
   allow an attacker to inject malicious HTML into units.wesnoth.org by
   uploading an add-on that would pass the units.wesnoth.org build
   process.

The resulting code might not be extent of regressions, but hopefully
we'll identify them quickly. This commit contains some additional noise
in the form of style fixes around offending lines as well. Backporting
to 1.12 is, as far as I understand, unnecessary since units.wesnoth.org
uses the master branch version of wmlunits, but it might be worth
evaluating whether to issue a warning for the 1 person in the world who
might be running the 1.12 version of the units.wesnoth.org toolchain on
their own facilities (okay, let's face it, nobody would ever do that).
2017-08-09 02:51:57 -04:00
Ignacio R. Morelle
7625b5c5b2 wmlunits: Use www.wesnoth.org URLs for resources 2017-08-08 20:50:54 -04:00
Ignacio R. Morelle
edf270abef wmlunits: Tidy up unit tree attributes a bit using mini tables 2017-08-08 20:25:17 -04:00
Ignacio R. Morelle
2134d048a7 wmlunits: Use figure dashes instead of hyphens for empty placeholders 2017-08-08 05:24:01 -04:00
Ignacio R. Morelle
78e44d7270 wmlunits: Revised color scales per vultraz's feedback 2017-08-08 05:23:44 -04:00
Ignacio R. Morelle
692a59f297 wmlunits: Add coloring classes to unit attributes in the unit details view
This applies to resistances, movement costs, and defense.
2017-08-08 04:54:00 -04:00
Ignacio R. Morelle
c63102c4a9 wmlunits: Make sure all language menu table rows are equal in length 2017-08-08 04:53:36 -04:00
Ignacio R. Morelle
d14c0dccd4 wmlunits: Hide Terrain column label from the unit view page 2017-08-08 02:17:19 -04:00
Ignacio R. Morelle
75a5af127a wmlunits: Fix issues with off-by-one column counts in unit view tables 2017-08-08 02:15:45 -04:00
Ignacio R. Morelle
53bc16b91f wmlunits: Various formatting/structure improvements
* There is now a link back to units.wesnoth.org on the navbar preceding
  Home.
* The mulitplication sign is used for attack stats to match 1.13.x.
* Made the Terrain table in the unit detail pages a bit more proper
  markup-wise.
* Advances from/to on the unit detail page displays a dash when empty
  and also has a comma-separated list of unit links in it. The same goes
  for the abilities list.
2017-08-07 04:05:29 -04:00
Ignacio R. Morelle
7e2538a828 wmlunits: Allow styling unit attributes in the unit tree view 2017-08-07 02:36:54 -04:00
Ignacio R. Morelle
ee66b96025 wmlunits: Use CSS to ensure sprites still fit in the tree when overlaid 2017-08-07 02:35:56 -04:00
Ignacio R. Morelle
6b5ba55fbc wmlunits: Restore build timestamp at the end 2017-08-07 01:27:13 -04:00
Ignacio R. Morelle
d4fb543451 wmlunits: Make the sidebar and popup menus markup more proper (<ul>/<li>)
The language menu gets to stay as a <div> containing a table for now
since doing columns with lists is still not that well supported across
browsers (as well as the CSS columns spec as a whole -- too many legacy
browsers floating around).
2017-08-06 23:57:36 -04:00
Ignacio R. Morelle
e9287e5b6b wmlunits: Rechristening Overview as the Build Report, table structure cleanup 2017-08-06 16:36:14 -04:00
Ignacio R. Morelle
d0c43b89c4 wmlunits: SEO-friendly page titles, and extra root element classes 2017-08-06 16:35:00 -04:00
Ignacio R. Morelle
416e3b5479 wmlunits: First markup clean-up pass 2017-08-06 15:52:05 -04:00
Ignacio R. Morelle
8bf57d6fe0 wmlunits: Wire in Wesmere header and trailer 2017-08-06 14:10:48 -04:00
Celtic Minstrel
98648ddf63 Revert to using hex instead of base64 for cache filenames (fixes #1871) 2017-08-02 20:41:26 -04:00
Celtic Minstrel
e58992c015 Remove windows from the stack in the event of an exception (fixes #1622) 2017-08-02 20:27:50 -04:00
gfgtdf
34d13addad fix minimap in gui2
if terrain drawing is disabled in perferences
Fixes #1484
2017-08-02 19:36:43 +02:00
gfgtdf
8abb21e707 reformat side_drop network message.
it is now in a [side_drop] tag instead of on toplevel. this make it
easier process. In paarticular a workaround in playturn_network_adapter
is no longer needed and should be removed after 1.13.9
2017-08-02 19:36:43 +02:00
Jyrki Vesterinen
8e5a73270a Fix #include path for serialization/unicode.hpp 2017-08-02 20:10:51 +03:00
Celtic Minstrel
047120e2fa Use UTF8 length to decide if a TEXTINPUT is a hotkey (should fix #1855) 2017-08-02 20:10:51 +03:00
gfgtdf
62ec3b3951 Better tracking whether the unit was changed during movement.
Fixes #1565

Previosuly the anitmators fake unit was reset whenever any wml/lua was executed
causing animations issues ( #1565 ). Now we only reset it when the unit
appearance  was actually changed by wml.

appearance_changed_ is mutable because set_hidden() is const.
appearance_changed_ is initially true so that the code updates the unit in
case that the unit was completeley reset ( [unstore_unit] etc.)

EDIT: set_hidden() doesn't set appearance_changed_ anymore becasue it's also
called by the movement animation code which made appearance_changed_ always
true when we checked it at move.cpp
2017-08-01 23:20:09 +02:00
Nobun
3f287b9098 wmlxgettext: fix UTF-8 issue: #1785 (#1793)
Also: -o parameter is now mandatory. STOUT redirection still possible
2017-07-31 22:29:46 -04:00
Celtic Minstrel
cf3017b43e GUI2/Timer: Minor code cleanup 2017-07-30 22:45:44 -04:00
gfgtdf
55f0ccad5c fixes to widget resolutions 2017-07-31 04:37:40 +02:00
Charles Dang
287d27c37f MP Join Game: fixed player list being incorrect (fixes #1867 and probably #1598)
Basically switched this dialog to take userlist data from the server instead of the scenario config,
since the former caused various issues as listed in #1867.

I've also removed the manual call to update_player_list in pre_show since it's not really necessary
(and I don't have any list data to pass there anyway) since the network handler will call it once it
receives data.

A similar change isn't needed in MP Staging since the connect engine handles all the user list stuff.
2017-07-31 12:23:43 +11:00
Charles Dang
c5dc04c900 Handle context menus on mouse up instead of mouse down
This is more consistent behavior with apps in general.
2017-07-31 10:27:27 +11:00
Charles Dang
8815965b29 Fixup tests for db44561d334c 2017-07-31 10:26:58 +11:00
Charles Dang
42d146979a GUI2/Loading Screen: cleaned up some unused stuff
For some reason, when I first implemented this dialog, I had it manage it own window pointer like modal_dialog
or modeless_dialog and display itself non-modal-y, despite being a modal dialog... IIRC it was probably some
ill-conceived attempt at "threading" so the game could load the config while it displayed. That's a moot point
now since the dialog was soon after refactored to use actual threading, rendering these bits useless.

# Conflicts:
#	src/gui/dialogs/loading_screen.cpp
2017-07-31 04:34:04 +11:00
Charles Dang
c29ea03212 GUI2: removed superfluous build_window methods from a few dialogs
build_window is *not* virtual in modal_dialog, not were these methods doing anything different from
modal_dialog's even if it were.
2017-07-31 04:32:49 +11:00
Charles Dang
813c0a50f9 GUI2: made use of the great unique_ptr in a few places
# Conflicts:
#	src/gui/core/event/handler.cpp
2017-07-31 04:32:48 +11:00
Charles Dang
2416f10ddd GUI2/Window: minor cleanup
Simplified a setter and added some members to the ctor initializer list.
2017-07-31 04:32:05 +11:00
Charles Dang
db44561d33 GUI2/Modeless Dialog: minor cleanup, implement a TODO
* Use a unique_ptr for the window member.
* Made use of the new remove_from_window_stack function (its impl was copied from this code)
* Only attempt ows removal if window display mode is modeless (since if mode is tooltip, no
  ptr was added to the list anyway.

# Conflicts:
#	src/gui/dialogs/modeless_dialog.cpp
2017-07-31 04:32:05 +11:00
Charles Dang
e724bdf483 GUI2/Modal Dialog: don't use pop_back to remove window ptr from open window stack
This seems to have been the cause of some crashes and weird behavior with the new command console.
Likely the problem came from the wrong pointer being removed from the ows, but exactly why a modal
dialog was even being opened I don't know.

Still, this is a safer method overall and it guarantees the correct pointer is always removed.
2017-07-31 04:30:13 +11:00
Charles Dang
fd7877c26c GUI2/Addon Manager: removed some excessive borders in the low resolution definition 2017-07-31 04:30:13 +11:00
Charles Dang
02ed22b8f2 GUI2/Toggle Button: added medium-sized icon button definition 2017-07-31 04:30:12 +11:00
Charles Dang
5a90290050 GUI2/Image: added scaled-to-size definition 2017-07-31 04:30:12 +11:00
Charles Dang
05210ae1f2 GUI2: fixed some overlay drawing issues with icon toggle buttons
Not sure why, but in some cases the overlay calculations were getting screwed up. This makes them use
the general centered image macro, with accompanying fallback safety checks.
2017-07-31 04:30:11 +11:00
Charles Dang
6f1a13c3a6 GUI2/Image: added tiled-to-size image definition 2017-07-31 04:30:11 +11:00
ln-zookeeper
f818745c72 Revisions to gate/door terrains by doofus-01 (manual merge of PR #1839)
Merged manually for slightly different compatibility code and for better image compression.
2017-07-30 20:07:43 +03:00
doofus-01
b7382e2df3 should have been in previous commit, squash 2017-07-31 02:53:35 +11:00