Corrupted GUI after changing resolution [Solved]

Started by Licht61, Tue 23/02/2021 09:49:09

Previous topic - Next topic

Licht61

Yesterday I accidentally changed the resolution of the game in General Settings (from 320x200 to 1980x1080), while agreeing to reformat the GUI.

I tried to change everything back, but now my GUI "shrank" like this:


I tried to create a second project to look at the width-height parameters of each element and manually rewrite them into the main project, but still many settings are knocked down (the buttons are clickable in the corners, the text is shifted, and so on)


Can you tell me how to fix this?

Crimson Wizard

If you have a project backup then you may try doing export/import GUI (or return to backup version). Same export/import may be used if your project just uses GUI from template without much changes.

Otherwise, only by hand.

I am not fully certain what do you mean "buttons clickable in the corners", if you mean only small part of button is clickable - that usually means their real Width/Height is still smaller than the graphic.

Licht61

Didn't know that GUI could be imported. Thanks!

But when I trying to import and run the build - this error shows:

Crimson Wizard

I don't know what exactly did you do, have you deleted previous GUI? where did you export new GUI from?
The error means simply that lblOverHotspot no longer exists.

Licht61

I created a project with the Sierra preset, exported the GUI from there, went to my main project, deleted the old GUIs (which were broken due to a change in resolution), imported the GUIs saved from the new project and assigned them the same ID that the deleted ones had.

Crimson Wizard

Quote from: Licht61 on Tue 23/02/2021 11:28:23
I created a project with the Sierra preset, exported the GUI from there, went to my main project, deleted the old GUIs (which were broken due to a change in resolution), imported the GUIs saved from the new project and assigned them the same ID that the deleted ones had.

Well, if your project had something different (more GUIs, more controls on them) than in Sierra template, then there will be mismatches, that you'd have to fix yourself.

Unless you saved more times after that you could try restore old guis by renaming Game.agf.bak file to Game.agf in your project folder, then try different approach (you'd have to close Editor without saving for that).
If you saved more than 1 time then Game.agf.bak already contains new changes probably.

Don't you have any backup of your project to which you could revert, or import guis from?

Licht61

Found source of problem.

Some GUIs have buttons inside: for example gIconbar has btnIconWalk. This button has own setting\properties and script name (btnIconWalk).

When importing, which I described above (with deleting of "compressed" old GUIs), for some reason, I have these names with "2" in the end (btnIconWalk2). So game was crashing on launch, because I didn't see that new "2" in names.

I just deleted this number, saved project and everything work fine now.

SMF spam blocked by CleanTalk