Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-14 Thread William Allen Simpson
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Ulrik Sverdrup wrote: > But we could go for consistency the other way around and change our > mind and use: > > :rule_name() > :name_translation() > :plural_translation() > > to follow the C function names > yes. follow the C function nam

Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-13 Thread Ulrik Sverdrup
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > I have worked through the patches one more time. I realized we have the special case for nations, were we must provide plural name translations as well. So for this class, we have three types: nation_rule_name(const struct nation_type *pnati

Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-13 Thread Ulrik Sverdrup
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Attached patch v1. Also attached test .sav file, that should work by just loading it with the server, no need to even start the game. Using suggested :rule_name() :translated_name() Sorted everything in the order the types are defined, that

Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-13 Thread Ulrik Sverdrup
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > > > If we only make the translated name available, it should be clear that > > it is not the rule name, so it should be name_translated() > > > No, it should be translated_name() Consistency, always consistency. > You don't want to have

Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-12 Thread William Allen Simpson
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Ulrik Sverdrup wrote: > 2007/7/13, William Allen Simpson <[EMAIL PROTECTED]>: >> No, that would be rule_name() and translated_name() > > I understand. I just try to think of that others who are not freeciv > coders should eventually use

Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-12 Thread Ulrik Sverdrup
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Thanks for replying to this, you are the one who knows the related code well. 2007/7/13, William Allen Simpson <[EMAIL PROTECTED]>: > > http://bugs.freeciv.org/Ticket/Display.html?id=39450 > > > Ulrik Sverdrup wrote: > > So we would have > >

Re: [Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-12 Thread William Allen Simpson
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Ulrik Sverdrup wrote: > So we would have > Unit_Type:rule_name() > Unit_Type:name() > etc. > No, that would be rule_name() and translated_name() It seems a good idea, as it would cache the *_name pointers, but are there high performanc

[Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-12 Thread Ulrik Sverdrup
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Resor Augusti 2007 Kolla åt Uta Swebus: Buss till berlin/hannover Flyg från berlin till kbh, vad kostar det? Design proposal Make use of the functions *_rule_name *_name_translation and add wrappers for them as methods on the following API

[Freeciv-Dev] (PR#39450) Make rule names available in the scripting api

2007-07-10 Thread Ulrik Sverdrup
http://bugs.freeciv.org/Ticket/Display.html?id=39450 > Make rule names available in the scripting api. Right now, in a callback in lua; for example: hut_entered_callback(punit) there is no way to get the rule name of punit, only the reverse by find.unit_type('Settlers') and similar. _