Code: Select all
(cat "Enter amount of " (scrGetData gScreen 'currency) " to add or subtract.\n"
See image.
It would be better if the currencies showed as plurals but just adding "s" to the text causes yuan and rin to show as yuans and rins. Ideally some way of referring to the EconomyType currency= code would be best but I don't know how to do this.
Code: Select all
currency= "rin|rin"
Possibly fmtNoun could be used but I can't make it work because I'm guessing. eg (fmtNoun (scrGetData gScreen 'currency) Nil Nil 0x0002) pluralizes everything, as does 0x40000 and 0x40002.
Or using the type or type name may be necessary, instead of the text from the list entry.
Any one got any ideas? The code needs to return "credits", "rin", "yuan", "euros" and, addtionally, "RUs".
Whole dockscreen code;
Code: Select all
<Dockscreen UNID="&dsD789GodCurrencyDockscreen;"
name= "Currency"
type= "customPicker"
backgroundID= "&rsPointJunoHero;"
nestedScreen= "true"
>
<List
rowHeight="44"
>
(map (typFind '$) theCurrency (typGetProperty theCurrency 'name))
</List>
<Panes>
<Default
showCounter="true"
>
<OnPaneInit>
<!--
<EconomyType UNID="&ecCreditEconomy;"
id= "credit"
currency= "credit(s)"
conversion= "100"
/>
<EconomyType UNID="&ecRinEconomy;"
id= "rin"
currency= "rin|rin"
conversion= "500"
/>
<EconomyType UNID="&ecYuanEconomy;"
id= "yuan"
currency= "yuan|yuan"
conversion= "50"
/>
<EconomyType UNID="&ecEuroEconomy;"
id= "euro"
currency= "euro|euros"
conversion= "150"
/>
<EconomyType UNID="&ecRUEconomy;"
id= "ru"
currency= "RU|RUs"
conversion= "85000"
>
-->
(block Nil
(scrSetData gScreen 'currency (scrGetListEntry gScreen))
(setq currList (typFind '$))
(setq listLength (count currList))
;(fmtNoun name nameFlags count formatFlags) - string
(scrSetDesc gScreen
(cat "Enter amount of " (scrGetData gScreen 'currency) " to add or subtract.\n"
(if (@ currList 0)
(cat (typGetProperty (@ currList 0) 'name) ": " (fmtNumber 'integer (plyGetCredits gPlayer (@ currList 0))) "\n")
)
(if (@ currList 1)
(cat (typGetProperty (@ currList 1) 'name) ": " (fmtNumber 'integer (plyGetCredits gPlayer (@ currList 1))) "\n")
)
(if (@ currList 2)
(cat (typGetProperty (@ currList 2) 'name) ": " (fmtNumber 'integer (plyGetCredits gPlayer (@ currList 2))) "\n")
)
(if (@ currList 3)
(cat (typGetProperty (@ currList 3) 'name) ": " (fmtNumber 'integer (plyGetCredits gPlayer (@ currList 3))) "\n")
)
(if (@ currList 4)
(cat (typGetProperty (@ currList 4) 'name) ": " (fmtNumber 'integer (plyGetCredits gPlayer (@ currList 4))) "\n")
)
)
)
)
</OnPaneInit>
<Actions>
<Action id="actionMillionCurrency">
(block Nil
(plyCredit gPlayer (scrGetData gScreen 'currency) 1000000)
(scrShowPane gScreen "Default")
)
</Action>
<Action id="actionZeroCurrency">
(block Nil
(plyCharge gPlayer (scrGetData gScreen 'currency) (plyGetCredits gPlayer (scrGetData gScreen 'currency)))
(scrShowPane gScreen "Default")
)
</Action>
<Action id="actionAddCurrency">
(block Nil
(plyCredit gPlayer (scrGetData gScreen 'currency) (scrGetCounter gScreen))
(scrShowPane gScreen "Default")
)
</Action>
<Action id="actionSubtractCurrency">
(block Nil
(plyCharge gPlayer (scrGetData gScreen 'currency) (scrGetCounter gScreen))
(scrShowPane gScreen "Default")
)
</Action>
<Action id="actionBack" cancel="1">
(scrExitScreen gScreen)
</Action>
</Actions>
</Default>
</Panes>
<Language>
<Text id="descDefault">
</Text>
<Text id="actionMillionCurrency">Add 1 [M]illion</Text>
<Text id="actionZeroCurrency">Set To [Z]ero</Text>
<Text id="actionAddCurrency">[A]dd Currency Amount</Text>
<Text id="actionSubtractCurrency">[S]ubtract Currency Amount</Text>
<Text id="actionBack">[B]ack</Text>
</Language>
</Dockscreen>