Currently Online

Latest Posts

Topic: Changing edge.png

Kusy
Avatar
Topic Opener
Joined: 2023-02-24, 19:21
Posts: 19
Ranking
Pry about Widelands
Posted at: 2024-04-22, 23:10

Hello there!

Can a world addon replace the 'edge.png' file from 'Widelands\data\world\pics'?


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2056
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-04-22, 23:18

Hi,
world add-ons can't do this, mainly because nobody asked for it yet face-smile.png
It should be possible to do this with a theme add-on simply by providing a custom world/pics/edge.png file. Would this be sufficient for you?
If no, it would not be hard to refactor this and make it accessible for world scripting instead of using a globally hardcoded image path.


Top Quote
Kusy
Avatar
Topic Opener
Joined: 2023-02-24, 19:21
Posts: 19
Ranking
Pry about Widelands
Posted at: 2024-04-22, 23:25

Thanks for the express reply!

Yeah, if it's possible to change it with a UI addon it's fine for me. Personally I feel it would be more at home in world addons, but then again I can understand why it's considered part of the UI.


Top Quote
Kusy
Avatar
Topic Opener
Joined: 2023-02-24, 19:21
Posts: 19
Ranking
Pry about Widelands
Posted at: 2024-05-12, 10:32

Ok, so simply adding the edge.png into a theme wad doesn't seem to work. Interestingly, it works on every other image in that folder.

I also tried to replace it in the data folder of Widelands and that does work, so it's not the image that's the problem.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2056
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-05-12, 11:41

Oh, I checked the code and it seems that this one file is being loaded directly from the filesystem, bypassing the theme lookup performed for other images. I'll make a branch to fix this…


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2056
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-05-12, 11:56

This was easy, PR is up: https://codeberg.org/wl/widelands/pulls/4814


Top Quote
Kusy
Avatar
Topic Opener
Joined: 2023-02-24, 19:21
Posts: 19
Ranking
Pry about Widelands
Posted at: 2024-05-12, 13:09

Awesome!


Top Quote