wesnoth-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wesnoth-dev] Adding arithmetic operations to WML


From: Yann Dirson
Subject: Re: [Wesnoth-dev] Adding arithmetic operations to WML
Date: Sat, 19 Feb 2005 13:46:44 +0100
User-agent: Mutt/1.5.6+20040907i

On Fri, Feb 18, 2005 at 05:22:38PM -0600, Joseph Simmons wrote:
> {VARIABLE_OP } fufills this function, i believe. It is used like this:
> 
> {VARIABLE_OP EXPY add -1}
> 
> where EXPY is the variable being added to, add is the function being 
> performed (it can also multiply, IIRC),
> and -1 is the amount being added.
> 
> they don't take any number of arguments, but IMHO they make it 
> unnecessary to add a predefined
> preprocessor macro.

Hm, maybe.  If the [set_variable] tag is valid in any context, that
could do.

It would be even better (better than a preprocessor-based solution),
if we could write something like that in the themes file:

[resolution]
        id=parent

        {VARIABLE FONT_NORMAL 14]

        [label]
                id=foo
                font_size=$FONT_NORMAL
        [/label]
[/resolution]

[partialresolution]
        id=child
        inherits=parent

        {VARIABLE FONT_NORMAL 8}

[/partialresolution]


... and subsequently get font_size=8 in the resulting child resolution.

But that would additionally depends on when $variable expansion takes
place wrt [partialresolution] expansion.

Any quick answer, or should I look at the code ?

-- 
Yann Dirson    <address@hidden> |
Debian-related: <address@hidden> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]