Answer:
eradicator wrote:sprite = "utility/trash_bin"
eradicator wrote:sprite = "utility/trash_bin"
Make a new item with this picture as icon, then call this icon by sprite-button. Factorio style!Gergely wrote:It is the file "trash-bin.png" from the core graphics. But how do I refer to if I want to add a sprite-button GuiElement with this icon? Possibly without using direct file reference.
I want to create a scenario, not a modification of the game. I believe that this sub forum is for discussing questions related to the modding api which is being used by scenarios as well. Your method is a workaround to the problem rather than a solution.darkfrei wrote:Make a new item with this picture as icon, then call this icon by sprite-button. Factorio style!
Code: Select all
gui.add{name = k.."_trash_button", type = "sprite-button", sprite = "utility/trash_bin" ....
That is really helpful, but where can I find the list of names that go after "utility"?Rseding91 wrote:You can reference any of the utility-sprites through the name they use.
I still want to find the answer to this one though.Gergely wrote:but where can I find the list of names that go after "utility"?
Join the cool brigade and get yourself a shiny new text editor with which you can find out yourself!Gergely wrote:That is really helpful, but where can I find the list of names that go after "utility"?Rseding91 wrote:You can reference any of the utility-sprites through the name they use.
My post actually has the answer too:Gergely wrote:Oh finally! I can't believe it took THIS long for someone to finally give a "proper" answer!!
(Also, in the case you were wondering, I use Notepad++ which does have a directory search function. But such function is also available in the builtin Windows 10 search as well.)
I just think that learning to use directory search is extremely important for any factorio modder. So i formatted the answer in a way that would encourage you to do that.eradicator wrote:\data\core\prototypes\utility-sprites.lua
Code: Select all
Search "utility/" (5 hits in 3 files)
Factorio\data\base\scenarios\pvp\pvp.lua (1 hit)
Line 197: local bin = gui.add{name = k.."_trash_button", type = "sprite-button", sprite = "utility/trash_bin", tooltip = {"remove-team-tooltip"}}
Factorio\data\base\scenarios\team-production\team_production.lua (3 hits)
Line 367: game.play_sound{path = "utility/research_completed"}
Line 741: player.play_sound({path = "utility/game_lost"})
Line 744: player.play_sound({path = "utility/game_won"})
Factorio\data\base\tutorials\construction-robots\control.lua (1 hit)
Line 607: sprite = "utility/confirm_slot",
Learning is outdated? Huh. I beg to differ.Gergely wrote:Took this long, because everyone decided that instead of going a straight forward path, a curved path, such as a "learning curve" is better. This is today's outdated, but still widely used education.