A GUI for wmllint

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

Moderators: Forum Moderators, Developers

Re: A GUI for wmllint

Postby Elvish_Hunter » January 23rd, 2015, 10:34 am

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby Tom_Of_Wesnoth » January 24th, 2015, 10:24 pm

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
Tom_Of_Wesnoth
 
Posts: 96
Joined: January 14th, 2015, 4:03 pm
Location: Wesnoth 2015 and Wesnoth 2007

Re: A GUI for wmllint

Postby vultraz » January 29th, 2015, 6:21 am

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
vultraz
Community Manager
 
Posts: 824
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Postby Elvish_Hunter » January 29th, 2015, 10:29 am

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby pauxlo » January 30th, 2015, 7:13 pm

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
pauxlo
 
Posts: 1005
Joined: September 19th, 2006, 8:54 pm

Re: A GUI for wmllint

Postby shadowm » January 30th, 2015, 7:37 pm

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.
I also made Wesnoth RCX, a team-color preview tool for artists and content creators.
Elsewhere: shadowmBlogFollow me on Twitter
User avatar
shadowm
Wesnoth.org Administrator
 
Posts: 6185
Joined: November 14th, 2006, 5:54 pm
Location: Chile

Re: A GUI for wmllint

Postby Elvish_Hunter » January 31st, 2015, 10:53 am

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby Ravana » January 31st, 2015, 5:14 pm

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
Ravana
Moderator
 
Posts: 1479
Joined: January 29th, 2012, 12:49 am
Location: Estonia

Re: A GUI for wmllint

Postby Elvish_Hunter » January 31st, 2015, 6:33 pm

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby vultraz » February 1st, 2015, 5:25 am

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
vultraz
Community Manager
 
Posts: 824
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Postby Elvish_Hunter » February 2nd, 2015, 10:59 am

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby Ravana » February 2nd, 2015, 2:16 pm

I can understand people playing with tiny screens, but does anyone deal with wml with that small screen?
User avatar
Ravana
Moderator
 
Posts: 1479
Joined: January 29th, 2012, 12:49 am
Location: Estonia

Re: A GUI for wmllint

Postby Elvish_Hunter » February 4th, 2015, 10:40 am

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby Elvish_Hunter » February 10th, 2015, 11:09 am

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 The Sojournings of Grog, Children of Dragons, A Rough Life and Wesnoth Lua Pack
Co-author of The White Troll
On Wesbreak until the 21th of December
User avatar
Elvish_Hunter
Developer
 
Posts: 1359
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Postby vultraz » February 27th, 2015, 5:09 am

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?
User avatar
vultraz
Community Manager
 
Posts: 824
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

PreviousNext

Return to Coder’s Corner

Who is online

Users browsing this forum: No registered users and 2 guests