Most of it is pretty easy but I'm getting confused on how to swap the multi-line screen desc for dsRPGLoot over to the translate friendly code as per https://ministry.kronosaur.com/record.hexm?id=72242
Here's the original code:
Code: Select all
<OnPaneInit>
(block (thisItem)
(setq thisItem (scrGetItem gScreen))
(if thisItem
(block (fitCount availCount desc)
(setq availCount (itmGetCount thisItem))
(setq fitCount (objGetFitCount gPlayerShip thisItem))
(setq gMaxCount (min availCount fitCount))
(setq desc (cat "Unit mass: " (strMassString (itmGetMass thisItem))))
(if (gr gMaxCount 1)
(setq desc (cat desc " (" gMaxCount " at " (strMassString (multiply (itmGetMass thisItem) gMaxCount)) ")"))
)
(setq desc (cat desc "\n\n"))
(switch
(eq gMaxCount 0)
(setq desc (cat desc "You do not have enough space to carry " (itmGetName thisItem 4) "."))
(eq gMaxCount 1)
(setq desc (cat desc "You have enough room to carry one " (itmGetName thisItem 0) "."))
(gr availCount fitCount)
(setq desc (cat desc "You have enough room to carry only " fitCount " " (itmGetName thisItem 2) "."))
(setq desc (cat desc "You have enough room to carry all " (itmGetName thisItem 8) "."))
)
(scrSetDesc gScreen desc)
)
(setq gMaxCount 0)
)
; Enable/disable actions
(scrEnableAction gScreen 0 (gr gMaxCount 0))
)
</OnPaneInit>
But would it be better to have the actual <Text id> as a single entry with three variables, unitMass for the first line, doNotHave/nil to cater for gMaxCount=0, and carryAmount to fill after "enough room to carry"?
Rather than having three separate Texts for unit mass, the empty line and then the final line of text and merging them into one?
Roughly something like this:
Code: Select all
<Text id="descElysiumLoot"
(cat
"Unit Mass: " %unitMass% " /n/n"
"You " %doNotHave% "have enough room to carry " %carryAmount% "."
)
</Text>
doNotHave being either the text "do not " or nothing, and
carryAmount being the relevant item name and one/only/all/fitCount as required.
Also do the %variables% need scrTranslate or scrSetDescTranslate here or will the game recognize variables from the code in the same dockscreen?
Any ideas about what should go where and why will be greatly appreciated because I probably should have started with something simpler! I've looked at the Trading Post code in 1.8a3 but it is confusing me more than helping.
Actually there probably needs to be a variable for one/only/all on the last line as well.