68304 Commits

Author SHA1 Message Date
Celtic Minstrel
c97adacfa7 Re-fix poison not being shown 2017-04-13 00:58:52 -04:00
Celtic Minstrel
f6b4917027 Some cleanup to the unit frame code
Explanations:
- Removed all the redundant constructor initializers
- Don't initialize the color members.
  (Otherwise what's the point of it being an optional?)
- Some collapsing of stuff like ? true : false and similar cases
- Use operator* and operator-> instead of get() for optionals
-
2017-04-13 00:05:23 -04:00
Celtic Minstrel
f3a574da46 Fix for GNA584 2017-04-12 23:37:39 -04:00
Celtic Minstrel
a8361986e9 Rename namespace util -> utils
This is because there was already a namespace utils, and having two namespaces with almost the same name is confusing.
2017-04-12 13:49:50 -04:00
Jyrki Vesterinen
f93353bebb Add an override specifier
Thanks to @matthiaskrgr for the compiler run.
2017-04-12 20:45:13 +03:00
Jyrki Vesterinen
48142dd821 Fix advanced preferences not shrinking when the player deselects them
It turns out that I had misunderstood the purpose of widget::layout_size_.
It's not a cache, it's an override. It's only set for widgets which have
been shrunk or whose sizes have otherwise been changed from the preferred
size.

As a result, commit c4be6a7ec881d74a0d46f3b068053b86bc1c7e17 ended up skipping relayout way too often.
2017-04-12 20:33:53 +03:00
Charles Dang
c57b58628c Story Viewer: implement text alpha fade-in/fade-out between screens 2017-04-13 04:01:02 +11:00
Charles Dang
e0751c1f54 GUI2: implement ability to set label alpha 2017-04-13 04:01:01 +11:00
ln-zookeeper
2f7f9a3f71 UtBS: Prevents Kaleh and Nym having purple XP bars while choices remain
This is pretty hacky and you can see the bars and numbers flicker purple during advancement, so this can be removed if a better way to achieve the same thing is implemented.
2017-04-12 19:05:04 +03:00
gfgtdf
289cf35aa2 add a comment 2017-04-12 15:31:49 +02:00
gfgtdf
75c21815f6 allow multi_page to contain differnt types of pages
although stacked_widget supports similar functionality this is currently
not easily doable from the lua gui2 api. In particular
1) stacked_widget cannot add pages dynamically
2) multi_page can only contain one type of widget.
3) a stacked_widget inside a multi_page is ineffective since it
generates many unused widgets
4) a multi_page inside a stacked_widget is just unhandy to use
2017-04-12 15:14:58 +02:00
gfgtdf
4908124f6f some clenaups
mainly adding backets to one-line if bodies
2017-04-12 15:14:58 +02:00
gfgtdf
c44de30a09 remove unused bool return value 2017-04-12 15:14:58 +02:00
Charles Dang
de8419deb7 Preferences Dialog: removed a hack related to the grid listbox usage 2017-04-12 23:40:13 +11:00
Charles Dang
c834d99556 Preferences: convert hotkey category list to a dropdown w/ checkboxes
This allows more space for the hotkey list.
2017-04-12 21:12:47 +11:00
Charles Dang
4f76c90d5c Revert erroneous change in 7d8380cd8781
These functions don't inherit from the dialog classes, they're part of MVC-style implementations.
2017-04-12 17:56:52 +11:00
Charles Dang
7d8380cd87 GUI2: marked inherited dialog functions (pre_show, etc) as virtual override
The virtual is for style consistency, the override because it should be done.
2017-04-12 17:44:51 +11:00
Charles Dang
f0dffab55a Tree View Node: rename tree_view_node_icon to tree_view_node_toggle
This better reflect its function
2017-04-12 17:00:03 +11:00
Charles Dang
da5f00c2b6 GUI2/Spacer: delegate size caluclations to the widget instead of the builder
This allows size formulae that rely on screen size variables, which can change, to correctly
update the size of the widget.
2017-04-12 16:13:43 +11:00
Celtic Minstrel
e3b5213f21 Update changelog
[ci skip]
2017-04-11 23:55:06 -04:00
Celtic Minstrel
fcc0da5bd4 Some cleanup of attack_type usage for enable_shared_from_this safety
- Call shared_from_this() instead of taking the address
- Don't use raw pointers to attack_type
- Change some cases of attack_type objects that weren't owned by a shared_ptr
  (either owned by another object or allocated directly on the stack)

List of files that currently call attack_type constructors:
- game_events/conditional_wml.cpp
- gui/dialogs/unit_attack.cpp
- scripting/lua_unit_attacks.cpp
- units/types.cpp
- units/unit.cpp

Each of these has been individually considered and made safe for use with
enable_shared_from_this. (Most of them already were safe.)
2017-04-11 17:15:38 -04:00
Charles Dang
2ca105e146 convert attack_type to use shared_from_this instead of instrusive_ptrs 2017-04-11 17:15:37 -04:00
Charles Dang
2a017b4862 Fixed duplicate key (typo) 2017-04-12 08:07:37 +11:00
Charles Dang
0c3260dc05 Finished deploying std::map::emplace (cont. e1a579da51)
Apparently, the last time I did this I only grepped for `insert(std::pair` not `insert(std::make_pair`. Oversight, much?
2017-04-12 07:51:42 +11:00
Charles Dang
a9e499bb64 Cleaned up register_*_property functions
Marked inline to fix unused function warnings
2017-04-12 07:32:05 +11:00
Charles Dang
e9eb98743e Gamestate Inspector: attempt to fix memleaks 2017-04-12 05:42:57 +11:00
Jyrki Vesterinen
c4be6a7ec8 Don't trigger relayout when a widget is hidden during initial layout
This fixes the add-on list not showing up when the player connects to an
empty add-on server with --new-widgets enabled.
2017-04-11 21:32:53 +03:00
Jyrki Vesterinen
aa762995e2 Add tooltips to add-on manager buttons 2017-04-11 21:32:53 +03:00
Charles Dang
f948d02509 Select Orb Colors: attempt to fix memleak 2017-04-12 05:26:53 +11:00
Charles Dang
07895df087 Outro: updated comments
[ci skip]
2017-04-12 05:10:59 +11:00
Charles Dang
117f1fc4c9 Outro: switch fade handling to hook into DRAW events instead of using a timer
This is safer since a timer ins't always guaranteed to run at the specified time.
2017-04-12 04:52:42 +11:00
mattsc
c590149102 Update Xcode project 2017-04-11 07:10:15 -07:00
Charles Dang
920f36d6df Updated CB projectfile 2017-04-11 16:26:36 +11:00
Celtic Minstrel
28184b3629 fixup! GUI2 Canvas: Add tile_center resize mode 2017-04-11 01:08:58 -04:00
Celtic Minstrel
898f9ea0c7 GUI2 Canvas: Add tile_center resize mode 2017-04-11 01:05:51 -04:00
Celtic Minstrel
aefbea950b Fix WFL debug output using an invalid vector 2017-04-11 01:01:19 -04:00
Celtic Minstrel
169cc9245e Some canvas documentation fixups 2017-04-11 01:01:18 -04:00
Celtic Minstrel
dde91f9a77 Move canvas shape class definitions into private header 2017-04-11 01:01:16 -04:00
Celtic Minstrel
1b42378bdc WFL: Add colon to debug_print() output with two parameters 2017-04-11 01:01:13 -04:00
Charles Dang
22ef217d38 Fixup cd08fab 2017-04-11 15:16:25 +11:00
Charles Dang
cd08fab8e4 Story Viewer: don't spawn floating image draw timer if delay is 0 2017-04-11 13:52:26 +11:00
gfgtdf
4608c2d368 wesnoth.set_dialog_value can now unfold treeview nodes (#978) 2017-04-11 03:59:22 +02:00
Celtic Minstrel
3d0bd73803 Fix behaviour of [heal_unit]amount= for negative/zero values (#979) 2017-04-10 21:58:46 -04:00
Celtic Minstrel
3f61eda282 Fix [animate_unit]amount=0 healing 1 hp 2017-04-10 21:31:15 -04:00
Charles Dang
e369e10eee Story Viewer: disabled title background for now
It's causing placement issues with some titles...
2017-04-11 03:37:18 +11:00
Charles Dang
c452a4cc25 Revert "Story Viewer: only show upper gradient if no title is present"
This reverts commit 512723055953580bc67c2772e928e475cd3cba2f on the behast of zookeeper.
2017-04-11 03:26:08 +11:00
Charles Dang
15daebd149 Outro: fixed text being shown for approx 2.5 seconds longer than specified
I was performing a value check on fade_step in the timer, and then multiplying it fivefold in the alpha
calculation, meaning full alpha was reached long before the fade in sequence stopped and the duration timer
was initialized.
2017-04-11 03:19:17 +11:00
Charles Dang
142ced01e1 Multipage: made add_page return the grid of the newly added page 2017-04-11 02:59:09 +11:00
Charles Dang
bbd9463b17 Story Viewer: fixed all floating images drawing in the same spot
Since all the floating images' data was set with a formula that relied on a canvas-wide variable whose value
was constantly changing and no serialization was done, the formulas all evaluated to the same location.

To fix this, we do away with the use of the variables and insert the necessary values directly into the formula
string.
2017-04-10 16:12:47 +11:00
gfgtdf
7e5e1e762f attempt to fix faction info sometimes missing in [side]
http://gna.org/bugs/?25638
2017-04-09 20:07:04 +02:00