68287 Commits

Author SHA1 Message Date
Celtic Minstrel
88280285ee Fixup non-virtual destructor 2017-04-08 21:15:32 -04:00
Celtic Minstrel
abcd235fdb Merge pull request #972 from wesnoth/lua_ai_fallback
Add fallback_human() action to the Lua AI
2017-04-08 20:36:49 -04:00
Celtic Minstrel
dd7296a359 Update changelog 2017-04-08 20:31:35 -04:00
Celtic Minstrel
795592fe12 Merge branch 'wfl_memleak_fix' 2017-04-08 20:22:00 -04:00
Celtic Minstrel
ac6a62046e Add wesnoth.log_replay which adds stuff to the saved game in [upload_log] 2017-04-08 20:20:31 -04:00
Celtic Minstrel
abb47d13ab Minor cleanup of ai_testing output
(There were some missing spaces in the output)
2017-04-08 20:20:30 -04:00
Celtic Minstrel
32681af978 fix unused code, found by cppcheck.
[src/game_initialization/multiplayer.cpp:685]: (style) Variable 'label' is assigned a value that is never used.
2017-04-08 20:20:28 -04:00
Matthias Krüger
165204f159 unit.cpp: remove unused variable. Found by cppcheck.
[src/units/unit.cpp:2061]: (style) Unused variable: remove_indices
2017-04-08 20:20:27 -04:00
Charles Dang
ec6191a68e Updated changelog for editor unit crash fix 2017-04-09 11:08:00 +11:00
Jyrki Vesterinen
0b02ba0876 Make variant constructor from std::shared_ptr a template
For some reason, when the variant constructor only accepts
std::shared_ptr<const variant_callable>, MSVC2013 gets confused about which
constructor it should call when it has, say,
std::shared_ptr<ai::attack_analysis>. Making the constructor a template
fixes it.
2017-04-08 19:17:49 -04:00
Celtic Minstrel
d536d6ab76 Implement a destructor subscription system for formula_callable
This allows the variant_callable to store a shared_ptr to its callable while ensuring that
callables that were allocated on the stack or as part of a larger structure are not
double-freed.
2017-04-08 19:17:48 -04:00
Jeffrey 'Sigurd' Westcoat
ec2d734acd WML: Add base_income key to [store_side] (#976) 2017-04-08 19:05:49 -04:00
Celtic Minstrel
2df28aa3cb Merge pull request #961 from Wedge009/bug_14503_fix
Prevent alpha underflow and reduce Shadow translucency (bug #14503)
2017-04-08 19:04:47 -04:00
Celtic Minstrel
753df47137 Story viewer: Use a slightly fuzzy rounded rectangle as the title background 2017-04-08 19:00:36 -04:00
Celtic Minstrel
508a493736 GUI2 Canvas: Draw rectangle fill before border 2017-04-08 18:29:17 -04:00
Celtic Minstrel
f016ed96f4 GUI2 Canvas: Enable filled rounded rectangles 2017-04-08 18:28:26 -04:00
Celtic Minstrel
2dbdc7ec66 GUI2 Canvas: Enable drawing filled circles 2017-04-08 18:04:07 -04:00
mattsc
e0d221fa4b Fix "no previous prototype" warnings 2017-04-08 13:58:32 -07:00
Celtic Minstrel
2eed69822b Travis: Consider non-virtual destructors an error in base classes
This also fixes another case where one was missing.
2017-04-08 16:40:37 -04:00
Celtic Minstrel
d9f771b5b9 Fix non-virtual destructor in variant_value_base 2017-04-08 16:27:23 -04:00
Charles Dang
887a99ecee Fixup 7364d72
And removes an unnecessary reset of the unused gameboard.
2017-04-09 05:13:39 +11:00
Charles Dang
0d9806df59 GUI2/Canvas: fixed comment formatting causing a compiler warning 2017-04-09 04:59:57 +11:00
Charles Dang
eaea9be117 Unit: re-deployed resources::units for ability handling (bug #23834)
This ensures that units can be fetched even if a game board isn't present.
This also removed an unnecessary assert for the presence of resources::tod_manager (it wasn't used).
2017-04-09 04:59:15 +11:00
Charles Dang
4bc0ac0041 Variable: remove asserts on resources::gamedata absence
In the case of as_nonempty_range, the function was rewritten to remove absolute reliance on gamedata.
In the other case, we simply silently return now.
2017-04-09 04:57:09 +11:00
Charles Dang
7364d72860 Editor: properly set resources::filter_con 2017-04-09 04:53:30 +11:00
Charles Dang
f9dadbb80a Restored resources::units in a limited context
This is a partial revert of ed15163b95317. Most place still use resources::gameboard->units(), but
they should still point to the same place.

This was done since the editor doesn't have a game_board and needs a way to specify a global unit_map.
2017-04-09 04:51:30 +11:00
Wedge009
9078ec5c55 Avoid floating-point equality comparisons.
The assumption is that the highlight ratio is only ever 0.5, 1.0, or 1.5. This might be true now... but probably best to avoid equality comparisons if possible.
2017-04-09 02:28:51 +10:00
Wedge009
f8fa22ccc0 Prevent alpha underflow (bug #14503)
Shadows - like most ghost units - have varying alpha levels as part of their animation, however, the Shadow also has the Nightstalker ability which reduces alpha by 0.5 (invisible unit).
As a result, there is an alpha underflow when the animation frames vary from -0.1 to 0.3.
By using a multiplication instead of an addition-1, as suggested by CelticMinstrel, the alpha variation becomes 0.2 to 0.4, avoiding the underflow and making the Shadow slightly less translucent at night.
2017-04-09 02:28:39 +10:00
Jyrki Vesterinen
fb3cae64df Fix a severe performance regression on filtering add-ons
For some reason, it only occurred in debug builds when I tested.

The problem was that partial relayout didn't respect
invalidate_layout_blocker. As a result, in situations such as populating a
listbox one entry at a time, the layout system ended up performing dozens
of full relayouts that, not surprisingly, is extremely expensive.

Regression from commit 01035f0adcc40a81eddc9aab8637ee3674830735.
2017-04-08 18:45:28 +03:00
Celtic Minstrel
76dcfcb32f GUI2 Canvas: Implement rounded rectangle shape
Currently it's outline only.
2017-04-08 08:30:00 -04:00
gfgtdf
fe098418f7 ignore blank (unset) values when generating config checkums. 2017-04-08 14:19:38 +02:00
Celtic Minstrel
9b2eac1920 Simplify storyscreen title definition 2017-04-08 07:22:37 -04:00
Celtic Minstrel
e46b10af0e Story viewer: Shrink translucent background behind title to a box 2017-04-08 03:37:41 -04:00
Charles Dang
1ba98d6e42 Story Viewer: tweak upper gradient opacity
[ci skip]
2017-04-08 18:09:34 +11:00
Charles Dang
5127230559 Story Viewer: only show upper gradient if no title is present 2017-04-08 18:01:42 +11:00
Celtic Minstrel
88420357b0 Story Viewer: add translucent background behind title 2017-04-08 17:56:51 +11:00
Celtic Minstrel
348d2e1bb2 Some cleanup of GUI2 formulas
This is mainly about shifting WML macro inclusions into a where clause,
especially when they appear multiple times in a specific formula.
2017-04-08 00:58:39 -04:00
Charles Dang
3a3e6fe725 Fixup 03c7b3d
* Cleaner variable set method
* Fix variable name
2017-04-08 15:19:05 +11:00
Charles Dang
03c7b3debd Story Viewer: hide title if there's no title to show, and display text panel borders appropriately
NOTE: not sure what the FIXME seems not to be an issue now. Perhaps due to the grid relayout happening as a result of
`set_vertical_alignment`.
2017-04-08 15:06:10 +11:00
Charles Dang
5fbd4a727b Story Viewer: deployed new alignment set API
The set_origin method worked, but not in every circumstance. For example, if the story box were not aligned to the bottom of the
screen in the initial part, it would not be correctly place. If you resized the screen while the box was not at the bottom, it
would return there. This was due to set_origin being purely temporary - ie, the layout engine did not record the new position,
and when invalidate_layout was called, the default (per the dialog WML) position of 'bottom' was restored.

This new method fixes the above issues. It also fixes an issue the old GUI2 screen had where a top-aligned box would also obscure
any available title.
2017-04-08 14:39:50 +11:00
Charles Dang
d7b564e2a7 GUI2/Widget: added ability to set widget alignment on the fly 2017-04-08 14:32:27 +11:00
Charles Dang
2053362c97 GUI2/Grid: added child getter by contained widget 2017-04-08 11:24:00 +11:00
gfgtdf
8c4e09e940 allow to to use a custom rng in helper.rand 2017-04-07 15:05:56 +02:00
Charles Dang
99de242524 GUI2: 'initialise' -> 'initialize' 2017-04-07 22:03:49 +11:00
gfgtdf
9d2b0f64dc support container variables in [options] (#975)
options setting attributes in a container like
```
[options]
  [slider]
    id="container.attribute"
    ....
  [/slider]
[/options]
```
were broken in a previous refactor in 1.13.0. This commit should restore them.
2017-04-07 00:06:58 -04:00
Charles Dang
2107145e75 Story Viewer: fixed not-found error when returning from part where bg panel was hidden 2017-04-07 12:43:51 +11:00
Charles Dang
3b24361f1a Story Viewer: added proper nav button definitions 2017-04-07 12:19:40 +11:00
Charles Dang
0a2ba65046 GUI2: simplify GUI_WINDOW_FIXED_SIZE_CENTERED x,y calc 2017-04-07 12:13:21 +11:00
Charles Dang
a0ff2a5e96 GUI2: made GUI_CENTERED_IMAGE more robust and deployed it for buttons instead of a custom macro 2017-04-07 12:11:09 +11:00
Charles Dang
a5b795c57a Story Viewer: implemented correct display of panel borders based on story text position 2017-04-07 11:29:47 +11:00