A GUI for wmllint

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

I just pushed to master two more changes:
  • 31bf015: now the directory selection dialog remembers the last used folder
  • 970a739, 845d721 and d5a78d1: moved the wmlindent verbosity options to their own frame
Now it looks like this:
wmlindent tab.png
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
Tom_Of_Wesnoth
Posts: 208
Joined: January 14th, 2015, 4:03 pm
Location: Wesnoth 2020 and Wesnoth 2007

Re: A GUI for wmllint

Post by Tom_Of_Wesnoth »

That's looking good, very understandable and simple.
If presented with the opportunity, I would take great pleasure in becoming a world ruler.
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

I've discovered yet another issue. :augh:

If the user has a core/ based path selected and runs wmllint, the tool will run over core twice, producing double output. Probably the best way to solve this would be extending the core append conditional to say, if not skip core and if not user path in WESNOTH_CORE_PATH or something like that.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:If the user has a core/ based path selected and runs wmllint, the tool will run over core twice, producing double output. Probably the best way to solve this would be extending the core append conditional to say, if not skip core and if not user path in WESNOTH_CORE_PATH or something like that.
Rather than the core append conditional, instead I'd check if the add-on path is different from WESNOTH_CORE_DIR. Then again, I'll have to add a special case when someone excludes the core directory, and then adds it by using the directory selection dialog. :augh:
Anyway, good catch! ;) I'll fix it as soon as I find a good solution.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: A GUI for wmllint

Post by pauxlo »

Elvish_Hunter wrote:
vultraz wrote:The reason I added it was primarily for UMC users who want to run it without waiting for the 10 - 15 second delay it takes for it to parse core. Plus, core is NOT wmllint clean, resulting in annoying changes every time you run it.
IDEA! :D We can attach a callback function to the Skip core directory checkbutton, so when someone wants to use it, the Disable checks for unknown units checkbutton will be automatically checked and disabled (greyed out); on unchecking Skip core directory, the Disable checks for unknown units will be unchecked and will become active again. So, we'll keep the option AND avoid the nasty error messages. What do you think of it?
If I have a UMC which uses just my own units (defined in this UMC), I guess I still want to have the check for unknown units. So please don't disable the option totally – just having it off by default should be enough.
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: A GUI for wmllint

Post by Iris »

vultraz wrote:Plus, core is NOT wmllint clean, resulting in annoying changes every time you run it.
Just to clarify so that people don’t get the wrong idea, core is supposed to be always clean, especially before releasing. If it’s not, then it’s a bug. There are several known issues in master, but to my knowledge — and I know because I ran wmllint before releasing — 1.12 is completely clean.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

pauxlo wrote:
Elvish_Hunter wrote:If I have a UMC which uses just my own units (defined in this UMC), I guess I still want to have the check for unknown units. So please don't disable the option totally – just having it off by default should be enough.
The point is that almost all UMCs (not every UMC, I'm aware of that ;) ) rely on core units, and if our unwary UMC author decides to skip the core directory to spare time, he will be submerged by error messages, like I demonstrated with my run on Dead Water. You can still perform the checks for unknown units, but then you'll have to include the core directory (that is the default).
Sometimes, when developing a software, one must make choices: in that case, it's a choice to make easier handling the (by far) most common case.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
Ravana
Forum Moderator
Posts: 2952
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: A GUI for wmllint

Post by Ravana »

I do have one addon that is playable without any core units. So the question is whether the potential time difference is worth having. iirc core has only few hundred units. However I have never used wmllint for anything other than independent folder/file checking (meaning not in wesnoth file tree) so it doesnt even matter for me.

As of this gui I'm using latest version I could find, that is from last october.
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

Ravana wrote:So the question is whether the potential time difference is worth having.
The time spared is about fifteen seconds - however, it depends on your computer.
Ravana wrote:However I have never used wmllint for anything other than independent folder/file checking
That's one of the other choices that I had to made: I could have easily implemented a radiobutton allowing the user choosing to check a single directory or multiple files, but there's only so much stuff that one can put in a 800 x 480 window - the minimum resolution that the game uses. I had to choose allowing to select only directories, because usually a UMC developer wants to check his whole add-on in one go, not file by file.
Ravana wrote:As of this gui I'm using latest version I could find, that is from last october.
The above changes were added in version 1.12.1, so you can try them by downloading the latest Wesnoth version.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Elvish_Hunter wrote: there's only so much stuff that one can put in a 800 x 480 window - the minimum resolution that the game uses
I don't recall GUI.pyw using that resolution anywhere - and if it does, why does it need to? The wmltools gui is independent of the game.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:I don't recall GUI.pyw using that resolution anywhere
It does, in this block near the end of the file:

Code: Select all

    ROOT_W,ROOT_H=800,480
    root.geometry("{0}x{1}+{2}+{3}".format(ROOT_W,
                                           ROOT_H,
                                           int((root.winfo_screenwidth()-ROOT_W)/2),
                                           int((root.winfo_screenheight()-ROOT_H)/2)))
vultraz wrote:and if it does, why does it need to? The wmltools gui is independent of the game.
It's to ensure that any system capable to run Wesnoth - like early netbooks, that had exactly this resolution - is able to run this GUI.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
Ravana
Forum Moderator
Posts: 2952
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: A GUI for wmllint

Post by Ravana »

I can understand people playing with tiny screens, but does anyone deal with wml with that small screen?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

Ravana wrote:but does anyone deal with wml with that small screen?
Who knows? It's technically possible: a text editor doesn't require a big screen to work. Sure, if one day we'll decide to bump the minimum resolution of the game to, say, 1024 x 768, then I'll go and bump the minimum resolution of this GUI as well.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

I just pushed to master some new updates:
  • 57d2ece3deb7: until now, Windows users, when selecting a directory, had to see the Unix directory separator (slash), instead of their sual backwards slash. So I used os.path.normpath to fix this.
  • 3f3e0ce5f6fc: fixed the bug reported by vultraz. I still need to decide what to do when a user selects Skip core directory, and then selects again said core directory through teh add-ons selection box.
  • 63cac8ec70d4: until now, the Ctrl+A combination to select the whole text of a widget didn't work. I finally managed to fix this, but not without issues: first of all, the <<SelectAll>> event isn't fired correctly if the widget is disabled or readonly (so I had to find another way to make it working), and second the selection events didn't work at all with KeyPress events, but only with KeyRelease events. Image
  • b337e13070ec: when reading the content of a Text widget, tkinter has the habit of adding a newline at the end of its content, so I had to remove said newline.
Once they're tested a bit more, they'll be backported to the 1.12 series.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Ok, another weird bug found: if you double click a folder in the file browser, it doesn't expand; it only does if you click the little arrow. Double clicking just results in a 'waiting' cursor.

I'm not sure this is a gui.pyw bug, though. Sounds like a problem with the widget library or something else.

EDIT: possible second issue. I installed python 2.7.9 32 bit, and gui.pyw wouldn't start. It worked when I installed 64 bit, though. Can you confirm?
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
Post Reply