Jump to content

group tabs for custom workstations?


owl79

Recommended Posts

I've been playing around with custom workstations, but noticed that they always show all recipes at once, and can't be sorted via tab icons. For example the vanilla campfire shows the groups chemicals, food/cooking and science, but a custom oven would not, despite having the exact same XUI setup and windows. Is there a way to add the group tabs to modded workstations?

Link to comment
Share on other sites

Yes

 

I've been playing around with custom workstations, but noticed that they always show all recipes at once, and can't be sorted via tab icons. For example the vanilla campfire shows the groups chemicals, food/cooking and science, but a custom oven would not, despite having the exact same XUI setup and windows. Is there a way to add the group tabs to modded workstations?

 

In recipes there will be work stations listed as craft area like "count "1" craft area work bench >

rename workbench to what ever you work station is.

example

 

recipe xml <recipe name="762mmBullet" count="1" craft_area="workBench">

New line <recipe name="762mmBullet" count="1" craft_area="yournamehereStation">

Now go to blocks.xml add this to your workstation

<property name="CraftingAreaRecipes" value="yourStation"/>

EXTRA if no using extends or want to change tools required

 

now go to the

go to XUI then the windows xml and add this

 

 

<window name="windowToolyourStationyournamehere" width="228" height="121" panel="Right" cursor_area="true">

<panel style="header.panel">

<sprite style="header.icon" sprite="ui_game_symbol_cookware" />

<label style="header.name" text="TOOLS" text_key="xuiTools" />

</panel>

<rect name="content" depth="0" pos="0,-46" height="75" disablefallthrough="true" on_press="true">

<grid name="inventory" rows="1" cols="2" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true" allow_sort_order="false" required_tools="sewingKit,Twine" required_tools_only="true">

<required_item_stack name="0" />

</grid>

</rect>

 

vanilla hirght width you can make it require what ever tool you want , change these sewingKit,Twine" to example repairkit,glasseye if you do not want to use all three slots change cols from 3 to 2 or 1,

Cheers hope this helps

Link to comment
Share on other sites

not sure if you can work around it (has been too long since I tested it)

 

in xui.xml

 

<window_group name="workstation_workbench" controller="XUiC_WorkstationWindowGroup">

 

 

I believe that red bit of text is the key.

 

// XUiC_CategoryList
public bool SetupCategoriesByWorkstation(string workstation)

string text = workstation.ToLower();
if (text != null)
{
 XUiC_CategoryList.fd001a = new Dictionary<string, int>(7)
 {
   { "forge", 0 },
   { "campfire", 1 },
   { string.Empty, 2 },
   { "workbench", 3 },
   { "skills", 4 },
   { "cementmixer", 5 },
   { "chemistrystation", 6 }
 };

 int num;
 if (XUiC_CategoryList.fd001a.TryGetValue(text, out num))
 {
   switch (num)
   {
   case 0:
     this.SetCategoryEntry(0, string.Empty, "ui_game_symbol_campfire", this.fd000b);
     this.SetCategoryEntry(1, "Building", "ui_game_symbol_map_house", this.fd0002);
     this.SetCategoryEntry(2, "Resources", "ui_game_symbol_resource", this.fd0003);
     this.SetCategoryEntry(3, "Ammo/Weapons", "ui_game_symbol_knife", this.fd0004);
     this.SetCategoryEntry(4, "Decor/Miscellaneous", "ui_game_symbol_chair", this.fd0005);
     this.SetCategoryEmpty(5);
     this.SetCategoryEmpty(6);
     this.SetCategoryEmpty(7);
     this.SetCategoryEmpty(8);
     return true;

     <...snip...>
   }
 }
}
this.SetCategoryEntry(0, string.Empty, "ui_game_symbol_campfire", this.fd000b);
this.SetCategoryEmpty(1);
this.SetCategoryEmpty(2);
this.SetCategoryEmpty(3);
this.SetCategoryEmpty(4);
this.SetCategoryEmpty(5);
this.SetCategoryEmpty(6);
this.SetCategoryEmpty(7);
this.SetCategoryEmpty(8);
return true;

Link to comment
Share on other sites

@Kaiser502

Thanks, I had already done all that, and also tried adding the line <property name="RecipeList" value="customworkstation"/>

But I still can't sort the station's recipes into groups. You have the sorting icons showing up? I always only have the leftmost one (campfire = "all").

 

campfire.jpg.766dc62bb5bd59f9356a3cccfa518c15.jpg

 

 

@StompyNZ

Thank you for the extra dll info. That xui edit was what I meant with them already having the same XUI setup, but this doesn't enable the group sorting icons either. So I'm guessing the new workstations would have to be added directly in the .dll as well? Unfortunately that'll be it for me then, the only .dll editing I've done was following detailed tutorials.

Link to comment
Share on other sites

  • 1 month later...
not sure if you can work around it (has been too long since I tested it)

 

in xui.xml

 

<window_group name="workstation_workbench" controller="XUiC_WorkstationWindowGroup">

 

 

I believe that red bit of text is the key.

 

// XUiC_CategoryList
public bool SetupCategoriesByWorkstation(string workstation)

string text = workstation.ToLower();
if (text != null)
{
 XUiC_CategoryList.fd001a = new Dictionary<string, int>(7)
 {
   { "forge", 0 },
   { "campfire", 1 },
   { string.Empty, 2 },
   { "workbench", 3 },
   { "skills", 4 },
   { "cementmixer", 5 },
   { "chemistrystation", 6 }
 };

 int num;
 if (XUiC_CategoryList.fd001a.TryGetValue(text, out num))
 {
   switch (num)
   {
   case 0:
     this.SetCategoryEntry(0, string.Empty, "ui_game_symbol_campfire", this.fd000b);
     this.SetCategoryEntry(1, "Building", "ui_game_symbol_map_house", this.fd0002);
     this.SetCategoryEntry(2, "Resources", "ui_game_symbol_resource", this.fd0003);
     this.SetCategoryEntry(3, "Ammo/Weapons", "ui_game_symbol_knife", this.fd0004);
     this.SetCategoryEntry(4, "Decor/Miscellaneous", "ui_game_symbol_chair", this.fd0005);
     this.SetCategoryEmpty(5);
     this.SetCategoryEmpty(6);
     this.SetCategoryEmpty(7);
     this.SetCategoryEmpty(8);
     return true;

     <...snip...>
   }
 }
}
this.SetCategoryEntry(0, string.Empty, "ui_game_symbol_campfire", this.fd000b);
this.SetCategoryEmpty(1);
this.SetCategoryEmpty(2);
this.SetCategoryEmpty(3);
this.SetCategoryEmpty(4);
this.SetCategoryEmpty(5);
this.SetCategoryEmpty(6);
this.SetCategoryEmpty(7);
this.SetCategoryEmpty(8);
return true;

Yes it works in somewhere here :) but there will have to bother and slightly change the software code (in the enumerator / defined variables). I have successfully added and removed groups :)

(Oh, how i envy those who can easily read C++ :D)

 

The fact that - i'm changing it in (IL) (it's difficult and confusing for me), because i don't know how to do it in C#...This is possible with ILSpy or similar ?

 

 

 

@owl79, @Veldian

sorry - it is on the edge of my capabilities and to properly explain it in steps i can't...

...maybe later - when i level up my skill in C++...

 

Now is there a way to remove the A"ALL" recpies tab that would make things better for what i have planned for stations i am working on, and would help reduce lagg by 50%

I think it will not help, because the lag occurs when using "search". As soon as you enter at least one character - there will be lag.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...