Generalized Tinkers Guild Custom Work Dock Screen

Post ideas & suggestions you have pertaining to the game here.
Post Reply
Arkheias
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Mon Jun 02, 2014 8:06 pm

Instead of having the recipe list defined in the dock screen, I suggest defining it in the action and passing it through to the dock screen, that way the dock screen can be reused by anyone who wants to incorporate device fabrication into their mods.

basically, change this

Code: Select all


<Action name="Custom Work" key="C">
		...
		(scrShowScreen gScreen &dsTinkerCustomWork;)
		...
</Action>

...
	
	<DockScreen UNID="&dsTinkerCustomWork;"
			type=           "customItemPicker"
			backgroundID=   "&rsItemListScreen;"
			nestedScreen=   "true"
			>
		<List>
			(map (typGetData &svTinkers; 'Recipes) 'excludeNil theRecipe
				(tinkerCreateItem theRecipe 1)
				)
		</List>
		
		<Panes>
			<Default>
				<OnPaneInit>
					(block (theItem theRecipe theComponents desc componentDesc componentPrice workCost errorDesc missingComponents maxCount availableComponents)
						(setq theItem (scrGetItem gScreen))
						
						;	Find the recipe for this item
						
						(setq theRecipe
							(@ (filter (typGetData &svTinkers; 'Recipes) theRecipe
									(eq (@ theRecipe 'item) (itmGetType theItem))
									)
								0
								)
							)
...
to this

Code: Select all

<Action name="Custom Work" key="C">
	...
	(block Nil
		(setq gSovereign &svTinkers;)
		(setq gRecipes 'Recipes)
		(scrShowScreen gScreen "&dsTinkerCustomWork;")
		)
	...
</Action>

...

	<DockScreen UNID="&dsTinkerCustomWork;"
			type=           "customItemPicker"
			backgroundID=   "&rsItemListScreen;"
			nestedScreen=   "true"
			>
		<List>
			(map (typGetData gSovereign gRecipes) 'excludeNil theRecipe
				(tinkerCreateItem theRecipe 1)
				)
		</List>
		
		<Panes>
			<Default>
				<OnPaneInit>
					(block (theItem theRecipe theComponents desc componentDesc componentPrice workCost errorDesc missingComponents maxCount availableComponents)
						(setq theItem (scrGetItem gScreen))
						
						;	Find the recipe for this item
						
						(setq theRecipe
							(@ (filter (typGetData gSovereign gRecipes) theRecipe
									(eq (@ theRecipe 'item) (itmGetType theItem))
									)
								0
								)
							)
...
I have tested this (using a slightly modified version without the fancy intro pane or the fancy quest system to remember recipes for later) and I have gotten this setup to work such that one dock screen can simultaneously be used for multiple recipe lists in multiple sovereigns on the same station.
Cabbage Corp, the only mod with cabbages!

Please feel free to submit bug reports or issues related to the Cabbage Corp mod on the GitHub page, the forum thread, in a private message or even on the Xelerus page. Suggestions are fine too.
User avatar
FAD
Militia Captain
Militia Captain
Posts: 732
Joined: Thu Aug 10, 2006 5:33 am
Location: Area 51

That would be cool!
Post Reply