Create account / Log in

BUG - Module Editor

Issues with the Vassal engine.

Moderators: uckelman, Tim M

BUG - Module Editor

Postby Korval » May 14th, 2020, 1:22 pm

BUG #1: [Definition of Player Sides] had been deleted and there is (apparently) no way to add it back in...
Unclear why this should be able to be deleted in the editor, but if it can be deleted, there should also be a way to add it back in

If there is a need to (effectively) not have player sides, instead of deleting the tab/property (not sure what you guys call this), it could simply have a flag that "disables player sides".

BUG #2: The "Copy/Paste" functionality doesn't seem to work between 2 module editor windows
(given Bug #1) I was planning to create a new module and then copy many of the existing things over from the old module (that still had an intact [Definition of Player Sides] to the new module (e.g., Copy HELP in Module #1, Paste in Module #2).
Korval
 
Posts: 13
Joined: April 3rd, 2020, 5:16 pm

Re: BUG - Module Editor

Postby Brent Easton » May 15th, 2020, 11:14 am

BUG #1: [Definition of Player Sides] had been deleted and there is (apparently) no way to add it back in...


Quite a few of the top-level components don't have a menu command to add them back in if you delete them.

You can add the [Definition of Player Sides] back in by selecting 'Add Imported Class' at the module level and importing VASSAL.build.module.PlayerRoster

BUG #2: The "Copy/Paste" functionality doesn't seem to work between 2 module editor windows


Feature Request. It's one of those things no-one ever got round to building.
User avatar
Brent Easton
 
Posts: 2982
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: BUG - Module Editor

Postby Korval » May 29th, 2020, 1:53 pm

Brent Easton wrote:
BUG #1: [Definition of Player Sides] had been deleted and there is (apparently) no way to add it back in...


Quite a few of the top-level components don't have a menu command to add them back in if you delete them.

You can add the [Definition of Player Sides] back in by selecting 'Add Imported Class' at the module level and importing VASSAL.build.module.PlayerRoster
... .


FWIW - I would highly recommend that IF a top level component can be deleted (BTW - is this a good idea? Versus making "inactive" or commenting out, etc.?), then there should be a menu command to add it back in...
Korval
 
Posts: 13
Joined: April 3rd, 2020, 5:16 pm

Re: BUG - Module Editor

Postby shilinski » May 29th, 2020, 3:11 pm

Korval wrote:If there is a need to (effectively) not have player sides, instead of deleting the tab/property (not sure what you guys call this), it could simply have a flag that "disables player sides".

You disable player sides by not adding any.
shilinski
 
Posts: 167
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: BUG - Module Editor

Postby twenck » June 7th, 2020, 4:48 pm

when this accidentally happened to me, I fixed it by opening the buildFile from another module in a text editor, copying the missing line, and pasting into the buildFile of the offending module.

Tom
twenck
 
Posts: 34
Joined: October 27th, 2017, 11:15 pm

Re: BUG - Module Editor

Postby Brent Easton » June 7th, 2020, 10:28 pm

I have done some investigation and there a 3 ways to handle this issue.

1. Add commands to the right-click menu to allow these components to be added back in. I think this would be confusing as most of the time, these components already exist and this would just clutter up the top-level drop-down menu. Also, having 2 of these in a module error.

2. Add a 'DoNotDeleteMe' marker (probably an Interface) to these components that the module editor will detect and grey-out the Delete and Cut commands for these components. Most work, but probably the best option as it will prevent people from accidentally deleting something like their Prototypes definitions.

3. The easiest and simplest option is to use some existing code that has not been maintained correctly. There are 11 components that Vassal builds by default when you create a new Module. When a module starts up, there are 3 of these classes that are created automatically if they don't exist. I think this list needs to be extended to cover all of the components that do not have a command to add them back in. In practice, this means that if you delete the Definition of Side, for example, the next time you edit the module, a default Definition of Sides would be created for you. The disadvantage of this option, is you have to recreate the component from scratch.

Components affected (i.e. can be deleted, but not created):
- Module Help
- Definition of Sides
- Global Options
- Game Piece Image Definitions (*)
- Global Properties (*)
- Prototype Definitions
- Translations (*)

The ones marked (*) are currently re-created automatically on editing a module (see option 3).

Thoughts?
User avatar
Brent Easton
 
Posts: 2982
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: BUG - Module Editor

Postby Cattlesquat » June 8th, 2020, 1:54 am

I don't *think* force-recreating any of those would affect the ability of custom classes to override things, right? So that sounds okay.

#2 also sounds okay, but if #3 is easier it seems fine.
User avatar
Cattlesquat
 
Posts: 565
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: BUG - Module Editor

Postby Brent Easton » June 8th, 2020, 2:01 am

I think option 3 needs to be done regardless. It will solve the problem if people edit the buildfile and accidentally remove these components. It's literally a 5 minute fix, I don't see any need not to.

I'm tending to think option #2 is needed, especially as there is no 'Are you sure you want to delete this?'.
User avatar
Brent Easton
 
Posts: 2982
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: BUG - Module Editor

Postby Cattlesquat » June 8th, 2020, 3:00 am

#3 would be sufficient to mitigate the huge flaw of a non-expert user being able to inadvertently damage his module to the point where it isn't reparable from within the tool. #2 would certainly be even more friendly (and personally I would hide delete/cut entirely, not just grey them out)
User avatar
Cattlesquat
 
Posts: 565
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: BUG - Module Editor

Postby uckelman » June 14th, 2020, 9:51 pm

Thus spake Brent Easton:
> I have done some investigation and there a 3 ways to handle this issue.
>
> 1. Add commands to the right-click menu to allow these components to be
> added back in. I think this would be confusing as most of the time,
> these components already exist and this would just clutter up the
> top-level drop-down menu. Also, having 2 of these in a module error.

The only reason I can see for allowing this is if you have an element
with a bunch of children, all of which you want to delete, so the
reason for deleting the parent and adding it back is that's just faster
than deleting the children one by one.

Is there another reason for deleting one of these items which I'm not
seeing?

> 2. Add a 'DoNotDeleteMe' marker (probably an Interface) to these
> components that the module editor will detect and grey-out the Delete
> and Cut commands for these components. Most work, but probably the best
> option as it will prevent people from accidentally deleting something
> like their Prototypes definitions.
>
> 3. The easiest and simplest option is to use some existing code that has
> not been maintained correctly. There are 11 components that Vassal
> builds by default when you create a new Module. When a module starts up,
> there are 3 of these classes that are created automatically if they
> don't exist. I think this list needs to be extended to cover all of the
> components that do not have a command to add them back in. In practice,
> this means that if you delete the Definition of Side, for example, the
> next time you edit the module, a default Definition of Sides would be
> created for you. The disadvantage of this option, is you have to
> recreate the component from scratch.
>
> Components affected (i.e. can be deleted, but not created):
> - Module Help
> - Definition of Sides
> - Global Options
> - Game Piece Image Definitions (*)
> - Global Properties (*)
> - Prototype Definitions
> - Translations (*)
>
> The ones marked (*) are currently re-created automatically on editing a
> module (see option 3).
>
> Thoughts?

So... how many items would it actually add to the context menus if we made
sure any item you can delete is there? (I think I see maybe 3 on the root
context menu? Are there more?)

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


Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 1 guest