BUG - Module Editor

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).

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

Feature Request. It’s one of those things no-one ever got round to building.

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…

You disable player sides by not adding any.

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

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?

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.

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?’.

#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)

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?

  1. 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.

  2. 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.