Page 1 of 1

Richtext

Posted: Sun Sep 15, 2019 8:36 am
by cz_zlobr
Hallo, I am using a lot of richtext in names of train stops, but after hitting F5 i cant see name for fluids - for example sulfiric waste water, acids etc. Some of them I can recognize and find out the name (for ex. acetylene), but it is quite big fortune. Is there any list of rich texts of fluids and gases? :) thank you

btw, Angel mods are one of the best i played :) keep going with this oustanding job :)

Re: Richtext

Posted: Sun Sep 15, 2019 10:28 am
by eradicator
This'll display a box with the names. Simply copy them (ctrl+a -> ctrl+c), and paste them into a text file or something.

Code: Select all

/c

local fluids = {}
for k,v in pairs(game.fluid_prototypes) do
  table.insert(fluids,'[fluid='..v.name..'] ')
  end
  
local c = game.player.gui.center
if c.fluidnames then c.fluidnames.destroy() end
local x = c.gui.center.add{
  name='fluidnames',type='text-box',text=table.concat(fluids,'\n')
  }
x.style.width = 400
x.style.height = 400
To get rid of the box you can either load a savegame or use:

Code: Select all

/c local c = game.player.gui.center if c.fluidnames then c.fluidnames.destroy() end

Re: Richtext

Posted: Sun Sep 22, 2019 5:42 pm
by cz_zlobr
You are the best one man! thank you! :-)