Deprecate the stretch parameter for images.

Late in the 1.8 cycle a resize mode was added, now is the time to start
to remove the old method.
This commit is contained in:
Mark de Wever 2010-04-26 20:32:46 +00:00
parent 9a20b5b38a
commit 33f6bb6f69
7 changed files with 17 additions and 26 deletions

View file

@ -50,6 +50,7 @@ Version 1.9.0-svn:
* Added the total number of villages to the status table lists
* Added a new attack dialog, available for testing with --new-widgets
* Patch #1645: Fixed a bug sending keyboard events to deactivated controls
* Deprecated the resize flag for gui2 image, use the resize_mode instead
* WML Engine:
* Deprecated [set_variable]'s random key, use rand instead
* Renamed [unit][status] healable to unhealable so it can default to 'no'

View file

@ -23,7 +23,7 @@
w = "(if(width - {GROOVE_LEFT} - {GROOVE_RIGHT} < 0
, 0, width - {GROOVE_LEFT} - {GROOVE_RIGHT}))"
h = 0
stretch = true
resize_mode = "stretch"
name = "buttons/scrollgroove{IMAGE_MIDDLE}-horizontal.png"
[/image]
@ -51,7 +51,7 @@
w = "(
if(positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT} < 0
, 0, positioner_length - {POSITIONER_LEFT} - {POSITIONER_RIGHT}))"
stretch = true
resize_mode = "stretch"
name = "buttons/scrollhorizontal{IMAGE_MIDDLE}{IMAGE_SUFFIX}"
[/image]

View file

@ -36,7 +36,7 @@
x = {OFFSET_SIDE_1}
y = 0
w = "(if(width < {OFFSET_TOTAL}, 0, width - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/translucent54-border-top.png"
[/image]
@ -50,7 +50,7 @@
x = "(width - {OFFSET_SIDE_2})"
y = {OFFSET_SIDE_1}
h = "(if(height < {OFFSET_TOTAL}, 0, height - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/translucent54-border-right.png"
[/image]
@ -64,7 +64,7 @@
x = {OFFSET_SIDE_1}
y = "(height - {OFFSET_SIDE_2})"
w = "(if(width < {OFFSET_TOTAL}, 0, width - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/translucent54-border-bottom.png"
[/image]
@ -78,7 +78,7 @@
x = 0
y = {OFFSET_SIDE_1}
h = "(if(height < {OFFSET_TOTAL}, 0, height - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/translucent54-border-left.png"
[/image]

View file

@ -24,7 +24,7 @@
x = 0
y = 0
w = "(width)"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/" + {_GUI_BASE_NAME} + "-border-top.png"
[/image]
@ -32,7 +32,7 @@
x = 0
y = "(height - {OFFSET_SIDE_2})"
w = "(width)"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/" + {_GUI_BASE_NAME} + "-border-bottom.png"
[/image]

View file

@ -22,7 +22,7 @@
y = {GROOVE_TOP}
h = "(if(height - {GROOVE_TOP} - {GROOVE_BOTTOM} < 0
, 0, height - {GROOVE_TOP} - {GROOVE_BOTTOM}))"
stretch = true
resize_mode = "stretch"
name = "buttons/scrollgroove{IMAGE_MIDDLE}-mid.png"
[/image]
@ -50,7 +50,7 @@
h = "(
if(positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM} < 0
, 0, positioner_length - {POSITIONER_TOP} - {POSITIONER_BOTTOM}))"
stretch = true
resize_mode = "stretch"
name = "buttons/scrollmid{IMAGE_MIDDLE}{IMAGE_SUFFIX}"
[/image]

View file

@ -30,7 +30,7 @@
x = {OFFSET_SIDE_1}
y = 0
w = "(if(width < {OFFSET_TOTAL}, 0, width - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/{BASE_NAME}-border-top.png"
[/image]
@ -44,7 +44,7 @@
x = "(width - {OFFSET_SIDE_2})"
y = {OFFSET_SIDE_1}
h = "(if(height < {OFFSET_TOTAL}, 0, height - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/{BASE_NAME}-border-right.png"
[/image]
@ -58,7 +58,7 @@
x = {OFFSET_SIDE_1}
y = "(height - {OFFSET_SIDE_2})"
w = "(if(width < {OFFSET_TOTAL}, 0, width - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/{BASE_NAME}-border-bottom.png"
[/image]
@ -72,7 +72,7 @@
x = 0
y = {OFFSET_SIDE_1}
h = "(if(height < {OFFSET_TOTAL}, 0, height - {OFFSET_TOTAL}))"
stretch = "true"
resize_mode = "stretch"
name = "dialogs/{BASE_NAME}-border-left.png"
[/image]

View file

@ -650,13 +650,6 @@ timage::timage(const config& cfg)
* h (f_unsigned = 0) The height of the image, if not zero the
* image will be scaled to the desired
* height.
* stretch (bool = false) Border images often need to be either
* stretched in the width or the height. If
* that's the case use stretch. It only
* works if only the height or the width is
* not zero. It will copy the first pixel
* to the others. (Note this mode is
* deprecated, use resize_mode instead.)
* resize_mode (resize_mode = scale)
* Determines how an image is scaled to fit
* the wanted size.
@ -692,13 +685,10 @@ timage::timage(const config& cfg)
*
*/
#if 0
/** @todo Enable in 1.9. */
if(!cfg["stretch"].empty()) {
ERR_GUI_D << "Image: The field 'strech' is "
"deprecated use 'resize_mode instead.\n";
ERR_GUI_D << "Image: The field 'stretch' is deprecated and "
"will be removed in 1.9.2. Use 'resize_mode' instead.\n";
}
#endif
/** @todo Remove in 1.9. */
if(stretch_ && resize_mode_ != stretch) {