Hedgewars Theme Editor
I know there's already a Theme Creator done and with new theme format, it's not very useful actually, but I made my own editor for themes. It doesn't look like super-fancy .NET project and doesn't copy images for you, but it's very simple and has support for pretty every function in HW themes, being useful for beginners, who don't know every possibility. It's even forward-compatible, with support for multiple buried rectangles for objects.
Screenshots:
First page, with color selecting.
Second page, has pretty everything.
Third page, listing all images that can be customized
Fourth page, contains list of all non-standard images, customizes amount of objects etc.
The rectangle editor. It's super easy to use and helpful. It can also zoom infinitely (with 2x on the screenshot).
To use the editor, just copy the file (it comes in one exe!) to your theme directory and run. It automatically loads theme.cfg and list of all images.
Download (Windows binary): https://www.dropbox.com/s/jleeix34lmadeyg/HWThemeEditor.exe?dl=1
For other systems, there's source code: https://www.dropbox.com/s/lbshcgakcan139g/HWThemeEditor.rb?dl=0
To run the source, you need Ruby language and Gosu library.
Post here any problems/feedback etc.
Current version: v.10
Looks cool, thanks for your effort and sharing its result
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Looks promising. You should put it in your signature.
I would like to see hexadecimal number support, so numbers from $00 to $FF.LOL, ive wrote that, but then i saw last sentences on 0th post (I guess i can call that like this).Another thing, i see that the program takes all the images thats in the directory, so a suggestion, let the user set the directory when launched.
Im going to try to make a theme out of this. Well, gl hf for me i guess.
EDIT1: Im going to actually save this for the thing. You know. No spoilers.
Another suggestion, maybe Light Theme? White background and black text. Toggable by user.
oh hi
UPDATED! I added support for importing hex values. I also did some "silent updates" over time, fixing some things, so I'm saying it now.
I was thinking about this, but it would require setting the directory each time and I don't even have file explorer so... Other solution would be saving the directory, but this requires config file and I wanted to keep this editor in single file. Not sure if I'm changing it.
Black and white are default colors for my drawing functions, so I'd have to specify color for each text and the rest of colors are hard-coded (magic numbers, if you know what it is). Maybe one day...
My themes / Theme Editor / Code contributions /
Dank
heh nice
Why not using variables and/or locals, whatever that's called to store a value to execute it.
oh hi
Well, I should have done it from the beginning. Now I would have to change it all. I try to use dark themes pretty everywhere so I didn't even think about something like that.
My themes / Theme Editor / Code contributions /
Dank
sure thing
oh hi
Super good work with this, this will allow maps to have multiple terrain behaviors or im wrong??
I don't know what exactly do you mean, but it won't give additional functionality. It makes making themes easier, especially land objects.
My themes / Theme Editor / Code contributions /
Dank
No problem good work anyway, i was talking about multiple themes at same map...
He ment land object masks
oh hi
Bugs found:
- Water opacity is not reading
- I can get negative values on land object configuration
- Sometimes i cant delete rectangles on land object editor
oh hi
KarBoy, you may be using old version. These bugs are already fixed, but I made a "silent update".(sorry about that, I didn't feel like making a post for each small change, lol) Just download it again.
EDIT: Rectangles are bugged, will fix it soon.
EDIT2: OK, updated just now. You can no longer make negative rectangles. Also, I made a "legit" GUI (old one was a lacky, modified version), so you can now select text in textboxes and object dropdown is replaced with list.
My themes / Theme Editor / Code contributions /
Dank
You should mark build version in name then.
EDIT1: For some reason on land object editor, when I place a rectangle on half of the image, it gets some specifc amount of height immediately and I can't change it. Very weird.
oh hi
Sorry, I fixed it again. I hope it will work now XD
I also made the version number shown in top-right corner and in first post here. Also a small quick feature: you can now see how much you zoomed.
My themes / Theme Editor / Code contributions /
Dank
What the Hell?! Now Im getting 1pix height rectangles that I cant delete.
EDIT1: Reboot the program and now I can delete them. Weird.
oh hi
IMPOSSIBRU! YOU ARE CLICKING TOO FAST!
But seriously, you make a rectangle by clicking two times: first to make start point and second to make end point. You are probably trying to hold the button, which may result in second click producing one-pixel rectangle unintentionally. You can delete them, just need to be precise (zoom helps here).
My themes / Theme Editor / Code contributions /
Dank
Nope. 111x zoom, and its not highlighting
http://screenshooter.net/102638492/mvnrvdn
oh hi
That's... unfortunate. Looks like some zoom values actually don't stick to grid for some reason. I will investigate it further tomorrow. For now, just stick to x4 zoom or anything that is power of 2 (1,2,4,8,16 etc.) as it seems to work.
Anyways, good that someone finally used/tested this editor, but quite bad that you break it every few minutes XD
My themes / Theme Editor / Code contributions /
Dank
That's why I am here for, mate
EDIT1: Welp, I found something AGAIN. Having more than 8 'green' rectangles crashes the game engine with exit code 217. You should limit that.
EDIT2: Another thing I just discovered, is that when you open the program, and change some things to land objects and you've made config yourself on any of these, when you are trying to save, program crashes and doesn't return land object configuration.
oh hi
I figured out the problem. I made it so when you moved the screen, it always moved by 16 pixels, not taking zoom into account. This was fixed. I also made it possible to reload images, so you do't have to restart editor after each change and it's also possible to zoom with mouse wheel.
As for your errors, I don't know how they happened.
http://i.imgur.com/VzsIE36.png
Buuut, I made it that when the editor crashes, it displays the error, so you can copy/paste it here.
My themes / Theme Editor / Code contributions /
Dank
Make a rectangle, move up-right and then try it
Good. So far i haven't got that crash, but as soon as I will get it, I am going to pastebin it.
EDIT1: I have some suggestions for Colors page:
- Ability to type RGB values
- Scroll mouse to add/subtract RGB value
EDIT2: Why Border and Land Texture is not displayed in custom images (3rd page)?
EDIT3: Why am I so slow now?! In the object editor that is
EDIT4: Oh btw, I have 21 themes left to convert. This might take a while, even with your program.
oh hi
1. This feature is just not implemented yet. I have to organize the UI better to actually make space for it.
2. This is a bug that appears randomly in the library I'm using. It happens only on some computers and some times.
3. Are these themes using old format? I might make my editor import them. I didn't make this functionality, because I assumed very few themes are left like that.
My themes / Theme Editor / Code contributions /
Dank
I have at least 1 theme that is old formatted, so i guess you can do that.
oh hi
Revive Time!
welp, dun got crashed... http://screenshooter.net/102638492/ckqxrcu
Another thing worth mentioning is that when it crashed I didn't saw Reload images button since starting of that program.Ok, that's just slowing me down a lot. When I change directory of the theme editor, then activate it and hit Save right off the bat, it crashes with the same error. Another thing to mention is that there is theme.cfg in each theme present that I edited manually.
oh hi
Sorry for the issue, it's now fixed. I forgot to update name of one object and didn't notice it, since I didn't use sd-clouds.
In this version I also added possibility to import old-format themes. I also made a file protection (sort of) so the themes won't get corrupted in case of failed saving. And I made an experimental change, which prevents from removing spaces from lines when loading (previously it could for example load music name without spaces, actually the change fixes only this). Let me now if it breaks anything
Oh, and the reload button is next to save, but only on first page.
My themes / Theme Editor / Code contributions /
Dank
ARE YOU KIDDING ME?! caps, sry
on that crash, I lose entire theme.cfg file. Hopefully I will have better luck in newer version
oh hi
Sorry for that, there are safety measures in new version so it won't happen. Losing only a config file is not that bad actually. I remember that with old Theme Creator on this forum I lost my whole theme. It literally ate the whole directory and I had to redo all the images
#thebigeditofdestiny
ANOTHER UPDATE!
Editor will now detect all custom images. I added whole new page for this and it required smaller font to put everything. On the same page, it will also show some errors that crash the game. Ever happened that you run your theme and have an unknown error? Editor will try to detect it, like missing LandTex or 1-pixel horizont. It will not detect everything, but most errors are caused by too small images (usually 1 pixel). Also, it will check if any land object has a mask.
Other changes include faster scrolling speed in edit mode, notice if theme.cfg is created and this...
...done.
With this release I pretty cleared my TODO list. I hope it's not broken, lol
My themes / Theme Editor / Code contributions /
Dank
One of the crashing errors I commonly get is Sky and/or land objects are not 32-bit. That is caused of having those images indexed. You should add that.
EDIT1: Why I only see 1 icon image?
EDIT2: 3rd page, for some reason I see some spaces in underline on "Customization list of image names" text
EDIT3: I'm not quite sure if this is going to work and/or look/work good, but maybe create a template theme with all images on a button press?
EDIT4: Is it possible to make smaller zooms, like <1x?
Oh there we go, now im moving faster now. Speaking of speed, is it possible to have it customizable?
oh hi
Yup, engine currently expects png files to be in RGBA format.
So maybe theme editor could warn if a png does not have that format - or even convert it.
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Sneaky beaky sheepy appeared outta nowhere.
I tried to change image mode with ImageMagick, and it can't do it, however it can add an alpha channel. GIMP can do it however, but not in bulk :/
EDIT1: Images (for a theme that is) don't have to have alpha channel. I have some land textures that don't have alpha channel and it works without any problems.
EDIT2: I found a minor bug. Make a border image, call it NOT 'Border.png' , boot up the program, look at 4th page, rename the border to 'Border.png', reload images and on 4th page it's still written on the list on right. That also concludes Sky, in my case too.
EDIT3: Something I have noticed in older versions, cursor in music strings are offsetted incorrectly. That thing is confusing the hell out of me.
oh hi
ImageMagick can do it (I don't have commandline at hand, but it's setting type to truecolormatte and specifying 8 bits per channel or something).
Also GIMP can do stuff in bulk, when being run via command line in batch mode or something.
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Good to know.
EDIT1: I am out of themes to process. Now I'm gonna have to rely on my theme template.
oh hi
This seems to be the easiest way btw:
Is there any point to this condescending remark of yours?
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Welp, now I know. I'm gonna have to test this on my own on next occasion then.
EDIT1: I was double-checking if I haven't make up something stupid. lawl
oh hi
I can only access pixel color data. Checking depth of image is some advanced stuff and I'm not even sure if it's possible with tools I'm using.
I changed the editor to show only the smaller one since they are usually both the same anyway.
I don't know what would cause this. The only thing that comes in m mind is that when you have lower resolution than the window (800 x 600 in this case), it's scaled down to fit the screen, causing weird artifacts.
I was actually thinking about this and it's possible. But in the way that when you press button it will export a zip file containing images.
It would be possible, but to make editing possible, I'd have to change the way it works. Would it really be useful?
Yep.
Will be fixed in next version.
That's because I used wrong font XD. I will fix this too.
My themes / Theme Editor / Code contributions /
Dank
I would be, if you have a massive land object (which it shouldn't happen any time) or if you want to rush configuration of them [land objects].
Speaking of land object editor, is it possible on opening the land object, to center it on screen?
oh hi
Aaaaand... another update.
Rough changelog:
-reloading images now updates object list
-you can export zip containing template images (a mixture of default graphics with things from different themes)
-you can now zoom out infinitely
-opening edit mode centers the screen and resets zoom and speed (which is now changeable)
-added LandBackTex detection (forgot that one, lol)
-mouse wheel to scroll object list
-fixed inaccurate text cursor
-you can't explore outlands of edit mode anymore (scrolling boundary)
-added WSAD movement to edit mode
My themes / Theme Editor / Code contributions /
Dank
Hmm... you should update screenshots, because I think they are outdated
EDIT1: I lawl'd, I have a pure white land object and now I can't see the lines that go from the blue point. Can you change a color for them? If so, maybe change it when all of RGB values are exceeding some sort of a limit?
oh hi
Done.
My themes / Theme Editor / Code contributions /
Dank
Probably too early to share this, but...
UPDATE! This screenshot shows two new, important features:
My themes / Theme Editor / Code contributions /
Dank
Interesting, but cannot understand that language
That's one of the new features: localization support!
You will be able to translate the editor to your language. I will include the translations made by contributors, but that's after the release. Editor is able to select language based on system settings.
My themes / Theme Editor / Code contributions /
Dank
So, this became the thing...
(pls ignore empty lists and broken layout for now)
The new edit screen:
It won't have keyboard controls, so I added some buttons/bars. Left mouse button is now used to both add and remove rectangles and right button is used to move around.
My themes / Theme Editor / Code contributions /
Dank
Alright, the new version is almost finished.
Should I release beta or a completely polished release? I've done it to the point where you can already edit pretty much everything. Some cosmetic features are missing, like updating editor, when theme directory is modified or highlighting errors. But I think it's ready for testing.
So anyone interested in some beta?
EDIT:
Looks like nobody is interested T_T
Anyways, only two features left to do. Everything goes better than expected (alas slower than it should).
My themes / Theme Editor / Code contributions /
Dank
I'm interested in checking out the new version, when you release it.
mikade
Hedgewars Developer