deprecation of message in [option]?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

deprecation of message in [option]?

Post by Gwledig »

Hi another worrying thing I have seen in logs getting my MP mods uptodate for 1.14 is this:

Code: Select all

20190713 21:01:01 warning deprecation: [option]message= has been deprecated and may be removed in version 1.15.0.
  Use label= instead.
I use the message in option to show an icon and description for things like recruitment menus, shop menus, spell menus, upgrade menus.

Here is an example in conquest from one of the recruitment menus:

Code: Select all

[option]
message=_ "&"+"units/human-loyalists/spearman.png~RC(magenta>red)"+"="+"Militia - 1 Gold
HP: 25
10-2 Damage
7 Movement"
I've had a look at options WML and have tried things like [option][message]... but no luck.

When using label= I end up with the text part of the message but the images I had been including don't show up, it looks like tag can't be used to display an icon and message next to it... I'm kinds of guessing there must be some option to show an image in this way but it certainly doesn't look as easy as it was with message=...
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: deprecation of message in [option]?

Post by Pentarctagon »

See here.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: deprecation of message in [option]?

Post by Gwledig »

Hm I did see https://wiki.wesnoth.org/DescriptionWML#WML_Format, this would be a massive update as each message would need a new bit of code with a separate image element, I certainly hope this doesn't happen in 1.15
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: deprecation of message in [option]?

Post by Pentarctagon »

It just means that:

Code: Select all

message=_ "&"+"units/human-loyalists/spearman.png~RC(magenta>red)"+"="+"Militia - 1 Gold
HP: 25
10-2 Damage
7 Movement"
becomes:

Code: Select all

image="units/human-loyalists/spearman.png~RC(magenta>red)"
description=_"Militia - 1 Gold
HP: 25
10-2 Damage
7 Movement"
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: deprecation of message in [option]?

Post by Gwledig »

thanks although description caused a big indent, managed to do this kindof thing with search & replace

Code: Select all

image=_ "units/human-peasants/peasant.png~RC(magenta>red)"
label=" Worker - 4 Gold
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: deprecation of message in [option]?

Post by octalot »

The translation mark (the underscore) should be on " Worker - 4 Gold", rather than on the image filename. This won't cause problems until you try to translate your add-on, but it will cause wmllint warnings now.
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: deprecation of message in [option]?

Post by Gwledig »

ah of course thanks for that
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Post Reply