remembered seeing a code for backwards compatibility........
However, on Closer Inspection : it is missing what I was hunting :
it HAS :
Code: Select all
; Aliases for backwards compatibility ------------------------------
(setq comShowBuyScreen scrShowBuyScreen)
(setq comShowSellScreen scrShowSellScreen)
It would be helpful if the Buy Screen item was included in the Code.Xml for the future
Being AS we all know that dockscreen tags and screen calls can often regress to earlier versions
because some .xml pages never really update with the versions, they just carry over unless there are new images or items to add ( or somebody wants to ruin a perfectly good Destroyer by calling it a Frigate )
So, for my extension I have updated and added the following to cover the missing stuff.
Code: Select all
; Define various internal functions
(setq comShowBuyScreen (lambda (itemsToSell returnScreen installOptions)
(block Nil
; Set the return screen
(setq gPrevScreen (item returnScreen 0))
(setq gPrevPane (item returnScreen 1))
; Generate the function that computes price and availability
(switch
(isfunction itemsToSell)
(setq gMargin itemsToSell)
; If itemsToSell is set, then combine with station's Trade descriptors
(and itemsToSell (not (eq itemsToSell "*")))
(setq gMargin
(lambda (theItem)
(switch
(not (itmMatches theItem itemsToSell))
Nil
(intComputeSellPrice theItem)
)
)
)
; Otherwise, rely on station's Trade descriptors
(setq gMargin intComputeSellPrice)
)
; If this station installs devices after purchase, set some vars
(if installOptions
(block Nil
(setq gInstallCriteria (item installOptions 0))
(setq gTechLevel (item installOptions 1))
(setq gTechModifier (item installOptions 2))
(setq gCheckMilitaryID (item installOptions 3))
; Note: gInstallMargin = 100 means no markup
(setq gInstallMargin (add 100 (item installOptions 4)))
)
(setq gInstallCriteria Nil)
)
; Show the screen
(scrShowScreen gScreen "&dsRPGCommoditiesExchangeBuy;")
)
))
(setq comShowSellScreen (lambda (itemsToBuy returnScreen screenOptions)
(block Nil
; Set the return screen
(setq gPrevScreen (item returnScreen 0))
(setq gPrevPane (item returnScreen 1))
; Generate the function that computes price and availability
(switch
(isfunction itemsToBuy)
(setq gMargin itemsToBuy)
; If itemsToBuy is set, then combine with station's Trade descriptors
(and itemsToBuy (not (eq itemsToBuy "*")))
(setq gMargin
(lambda (theItem)
(switch
(not (itmMatches theItem itemsToBuy))
Nil
(intComputeBuyPrice theItem)
)
)
)
; Otherwise, rely on station's Trade descriptors
(setq gMargin intComputeBuyPrice)
)
; Handle some options (Nil is OK)
(setq gTitle (item screenOptions 0))
(setq gMaxPrice (item screenOptions 1))
; Show the screen
(scrShowScreen gScreen "&dsRPGCommoditiesExchangeSell;")
)
))