Jump to content

Recommended Posts

Alrighty,

 

So I managed to successfully add a custom recipe tab, with icon, and items that are in that respective tab.

What confuses me, however, is that upon mousing over the tab, there is no tab name that appears(like "Science" for the science tab and "Magic" for the magic tab.

 

This is the two lines of code in my modmain responsible for adding the tab.

GLOBAL.STRINGS.TABS.MEATY = "Meaty Stuff"GLOBAL.RECIPETABS['MEATY'] = {str = STRINGS.TABS.MEATY, sort=8, icon = "fleshhelmet.tex", icon_atlas = "images/inventoryimages/fleshhelmet.xml"}

The second line is working fine, as it gives the recipe tab an image.

The " GLOBAL. " was added to the first line after the text didn't work the first time.

Am I doing something wrong?

 

Alrighty,

 

So I managed to successfully add a custom recipe tab, with icon, and items that are in that respective tab.

What confuses me, however, is that upon mousing over the tab, there is no tab name that appears(like "Science" for the science tab and "Magic" for the magic tab.

 

This is the two lines of code in my modmain responsible for adding the tab.

GLOBAL.STRINGS.TABS.MEATY = "Meaty Stuff"GLOBAL.RECIPETABS['MEATY'] = {str = STRINGS.TABS.MEATY, sort=8, icon = "fleshhelmet.tex", icon_atlas = "images/inventoryimages/fleshhelmet.xml"}

The second line is working fine, as it gives the recipe tab an image.

The " GLOBAL. " was added to the first line after the text didn't work the first time.

Am I doing something wrong?

 

Try reversing the order

GLOBAL.RECIPETABS['MEATY'] = {str = STRINGS.TABS.MEATY, sort=8, icon = "fleshhelmet.tex", icon_atlas = "images/inventoryimages/fleshhelmet.xml"}

 

GLOBAL.STRINGS.TABS.MEATY = "Meaty Stuff"

Try reversing the order

GLOBAL.RECIPETABS['MEATY'] = {str = STRINGS.TABS.MEATY, sort=8, icon = "fleshhelmet.tex", icon_atlas = "images/inventoryimages/fleshhelmet.xml"}

 

GLOBAL.STRINGS.TABS.MEATY = "Meaty Stuff"

 

Tried that, didn't work.

On second glance, it seems the code I referenced to get this doesn't show the name either...(The Summons Mod)

Tried that, didn't work.

On second glance, it seems the code I referenced to get this doesn't show the name either...(The Summons Mod)

 

I took a look at wickerbottom's book tab (wickerbottom.lua and strings.lua)

 

-- from wickerbottom.lua

local booktab = {str = STRINGS.TABS.BOOKS, sort=999, icon = "tab_book.tex"}

inst.components.builder:AddRecipeTab(booktab)

 

Recipe("book_birds", {Ingredient("papyrus", 2), Ingredient("bird_egg", 2)}, booktab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})

Recipe("book_tentacles", {Ingredient("papyrus", 2), Ingredient("tentaclespots", 1)}, booktab, {SCIENCE = 3})

 

 

-- from strings.lua

STRINGS.RECIPE_DESC.BOOK_BIRDS = "1000 species: habits, habitats, and calls.",

STRINGS.RECIPE_DESC.BOOK_TENTACLES = "Let's learn about our subterranean friends!",

STRINGS.TABS.BOOKS = "Books",

 

 

Edited by MidrealmDM

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...