Create account / Log in

Can someone help me out with menu logic in EditorWindow?

Discussion area for the development team.

Moderators: uckelman, Tim M

Can someone help me out with menu logic in EditorWindow?

Postby Cattlesquat » August 5th, 2020, 4:57 pm

I embarked on what I thought would be a super-simple exercise in changing some of the Help menu entries in the Editor to point at more updated files, more meaningful files, etc, etc. "How Hard Could It Be"???

But I've discovered that EditorWindow.java uses some kind of menu-indirection control system thing... AND I don't think it's actually working properly.

PROBLEM #1 - In the current "working" version, the 3rd menu entry is supposed to say "Reference Manual" but it instead displays the string "Component Help". (Also I don't understand why the code for that 3rd menu entry is done in a weird different way from e.g. the first entry. It's got like a GIF and stuff except that I never see a gif come up when I look at the actual menu).

PROBLEM #2 - If I decide to put in NEW entries, every single one of them displays the string "Help" as the menu item instead of the string I pass, even though I enter a normal new Editor.ModuleEditor.blah_blah_blah thing and put an entry in properties.

PROBLEM #3 - Why are there apparently two copies of e.g. Editor.properties in our project tree? Which is the one I'm supposed to use?

Any help most appreciated.

Brian
User avatar
Cattlesquat
 
Posts: 942
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Can someone help me out with menu logic in EditorWindow?

Postby uckelman » August 5th, 2020, 8:24 pm

Thus spake Cattlesquat:
>
> PROBLEM #3 - Why are there apparently two copies of e.g.
> Editor.properties in our project tree? Which is the one I'm supposed to
> use?

Are the two you're seeing

vassal-app/src/main/resources/VASSAL/i18n/Editor.properties
vassal-app/target/classes/VASSAL/i18n/Editor.properties

?

The former is the one which is checked in, the latter is the one which
gets copied to a staging area during builds and is not checked in.

Edit the one in src.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8985
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Can someone help me out with menu logic in EditorWindow?

Postby uckelman » August 5th, 2020, 8:25 pm

Thus spake Cattlesquat:
>
> PROBLEM #2 - If I decide to put in NEW entries, every single one of them
> displays the string "Help" as the menu item instead of the string I
> pass, even though I enter a normal new
> Editor.ModuleEditor.blah_blah_blah thing and put an entry in properties.

Related to #3: Are you sure you've edited the right properties file?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8985
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Can someone help me out with menu logic in EditorWindow?

Postby uckelman » August 5th, 2020, 8:40 pm

Thus spake Cattlesquat:
> I embarked on what I thought would be a super-simple exercise in
> changing some of the Help menu entries in the Editor to point at more
> updated files, more meaningful files, etc, etc. "How Hard Could It
> Be"???
>
> But I've discovered that EditorWindow.java uses some kind of
> menu-indirection control system thing... AND I don't think it's actually
> working properly.
>
> PROBLEM #1 - In the current "working" version, the 3rd menu entry is
> supposed to say "Reference Manual" but it instead displays the string
> "Component Help". (Also I don't understand why the code for that 3rd
> menu entry is done in a weird different way from e.g. the first entry.
> It's got like a GIF and stuff except that I never see a gif come up when
> I look at the actual menu).

Something is definitely not right there. The only place where
Editor.ModuleEditor.component_help is used is in ConfigureTree. It
looks like that's somehow clobbering the other menu entry, but I don't
see how exactly on a quick look.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8985
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Can someone help me out with menu logic in EditorWindow?

Postby Cattlesquat » August 5th, 2020, 8:51 pm

uckelman wrote:Related to #3: Are you sure you've edited the right properties file?


Okay, I was editing the one in the "src" tree, and indeed it turns out my changes have migrated over to the other one, so THAT part's now not confusing.

But yeah, the other more confounding stuff is still a problem. I started putting my new stuff "just following the pattern of what was there", and then it wasn't working so then I looked at what was already there and discovered it isn't-quite-exactly-working either.
User avatar
Cattlesquat
 
Posts: 942
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Can someone help me out with menu logic in EditorWindow?

Postby Brent Easton » August 5th, 2020, 11:10 pm

I have not played in this pool before, can't help sorry.
User avatar
Brent Easton
 
Posts: 3226
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Can someone help me out with menu logic in EditorWindow?

Postby Cattlesquat » August 6th, 2020, 2:35 am

This is now straightened out. PR #164 for details & fix.
User avatar
Cattlesquat
 
Posts: 942
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA


Return to Developers

Who is online

Users browsing this forum: No registered users and 7 guests