Is it possible to have localized screenshots in the tips and tricks section?

Looking for a mod? Have a review on a mod you'd like to share?
User avatar
dodther
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Mar 20, 2024 2:17 am
Contact:

Is it possible to have localized screenshots in the tips and tricks section?

Post by dodther »

Can you tell me if there is a mechanism for substituting localized screenshots depending on the locale in the tips and hints section?
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Is it possible to have localized screenshots in the tips and tricks section?

Post by IsaacOscar »

What? I didn't know you could have screenshots in tips and tricks.
They're supposed to be simulations (Bassically a mini factorio game that runs, and so should use whatever local happens to be active).

If all you want is some text to be different for different languages that should be easy with custom locale ksys.
User avatar
dodther
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Mar 20, 2024 2:17 am
Contact:

Re: Is it possible to have localized screenshots in the tips and tricks section?

Post by dodther »

In addition to the simulation, there are just .png images. Of course, the text is translated without any issues. But the image remains in English. So I'm wondering if it's possible to replace the image depending on the locale.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Is it possible to have localized screenshots in the tips and tricks section?

Post by IsaacOscar »

dodther wrote: Tue Jan 07, 2025 10:41 am In addition to the simulation, there are just .png images. Of course, the text is translated without any issues. But the image remains in English. So I'm wondering if it's possible to replace the image depending on the locale.
You mean the icon? https://lua-api.factorio.com/latest/pro ... html#icons
Or are you using a different field?

I'm pretty sure icon's cannot be localised. You can make a modding interface request for that, but I doubt Wube will do it (as it would be a lot of work, and icons probably shouldn't have text on them anyway, as they're very small).
User avatar
dodther
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Mar 20, 2024 2:17 am
Contact:

Re: Is it possible to have localized screenshots in the tips and tricks section?

Post by dodther »

2025-01-07_20-48-54.png
2025-01-07_20-48-54.png (245.14 KiB) Viewed 555 times
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Is it possible to have localized screenshots in the tips and tricks section?

Post by IsaacOscar »

dodther wrote: Tue Jan 07, 2025 12:08 pm 2025-01-07_20-48-54.png
You should not be using a screenshot for that.
I assume this GUI exists in factorio already?
You should be creating the GUI at runtime:

Code: Select all

data:extend{{
	type = "tips-and-tricks-item",
	simulation = {
		...
		init = [[
			player = game.simulation.create_test_player{name = "Some Name"}
			local frame = player.gui.screen.add{type = "frame", caption = {"locale.key"}}
			.... ]]      
See https://lua-api.factorio.com/latest/classes/LuaGui.html and https://lua-api.factorio.com/latest/cla ... ement.html

Look at the in game tips and tricks for examples of stuff you can do! (E.g., the first one in this file creates a nice little table https://github.com/wube/factorio-data/b ... ations.lua).
Post Reply

Return to “Questions, reviews and ratings”