Discussion:
[Ohrrpgce] SVN: teeemcee/10849 Fix Panel slice serialisation mistake which broke slice2bas
s***@HamsterRepublic.com
2018-11-07 13:17:18 UTC
Permalink
teeemcee
2018-11-07 05:17:17 -0800 (Wed, 07 Nov 2018)
868
Fix Panel slice serialisation mistake which broke slice2bas

Panel slices with a .percent = 0 didn't have their percent property saved when
serialising, it was mistakenly omitted as if 0 was the default (it's actually
0.5). This bug was introduced in r9509 where I stopped writing default-valued
properties. But since the save and load code matched, there were no problems
caused... except for in slice2bas, which reads a .slice file directly,
bypassing LoadPanelSlice, etc. (I didn't realise it did that! That's a
significant maintenance burden.) slice2bas interpreted the missing percent as
0.5 instead of 0.

So LoadPanelSlice needs to keep defaulting to 0 to support slice collections
saved in the last year, but I've fixed SavePanelSlice to always write 'percent',
and I've loaded+resaved all sourceslices to put in explicit 'percent' nodes to
fix slice2bas.
---
U wip/slice2bas.bas
U wip/slices.bas
U wip/slices.bi
U wip/sourceslices/default_item_plank.slice
U wip/sourceslices/default_spell_list_plank.slice
U wip/sourceslices/default_spell_screen.slice
U wip/sourceslices/default_spell_spell_plank.slice
U wip/sourceslices/default_status_screen.slice
U wip/sourceslices/default_virtual_keyboard_screen.slice

Loading...