gMargin and gShowCriteria

Post ideas & suggestions you have pertaining to the game here.
Post Reply
User avatar
Prophet
Militia Captain
Militia Captain
Posts: 826
Joined: Tue Nov 18, 2008 6:09 pm

Fri Oct 09, 2009 12:21 pm

I have a station with a large inventory and created multiple screens to view the items by category (weapons and ammo, shields and armour, etc.)

gShowCriteria was my saviour in this regard, however, to manipulate the prices I wanted to use a function in gMargin. This is where my problem began as dsExchangeBuy has this little code bit in the list options element:

Code: Select all

		(switch
			(not gMargin)
				(scrSetListFilter gScreen intComputeSellPrice)

			(isfunction gMargin)
				(scrSetListFilter gScreen gMargin)

			(scrSetListFilter gScreen gShowCriteria)	
			)
So if gMargin is Nil, I can't use gShowCriteria, if gMargin is an integer I can use gShowCriteria with no problems.
How would I go about using gMargin to filter the items to be shown? I tried calling scrSetListFilter manually within the gMargin function to no effect.
I ultimately created a &dsExchangeBuy2; with the small change of

Code: Select all

(isfunction gMargin)
				(scrSetListFilter gScreen gMargin)
to

Code: Select all

			(isfunction gMargin)
				(scrSetListFilter gScreen gShowCriteria)
Which did fix my problem and allow me to use gShowCriteria and apply gMargin to modify the prices.

I don't know if this is a bug or what I was trying to do wasn't an inteded use of dsExchangeBuy but it is a working solution if others have had this problem.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!

Post Reply