theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Feature: Select Default Pozyx Controlled Character #802

Closed benloh closed 7 months ago

benloh commented 7 months ago

Addresses #784.

This adds the ability to select a default character type as the starting character type for all new pozyx tags entering the simulation.

screenshot_1355

NOTES:

TO TEST

No pozyx-controllable characters defined

  1. For all character types, set # TAG isPozyxControllable **false**
  2. Reload the project
  3. Select project "SETUP"
  4. Click "Edit Project Settings"
  5. Open the "default character" menu: the menu should only show "-- select a character --", and there should be no character types available to choose.
  6. The first non-global character type will be selected for all pozyx tags even though there are no pozyx-controllable characters. This is to ensure that SOMETHING is selected.

One pozyx-controllable character defined

  1. For a single character type, set # TAG isPozyxControllable **true**
  2. Reload the project
  3. Select project "SETUP"
  4. Click "Edit Project Settings"
  5. Open the "default character" menu: the menu should show the character.
  6. Select the "default character" type.
  7. ~Click "Save Project Settings"~
  8. The Main page will reload.
  9. Any pozyx tag should be set to the default character type

More than one pozyx-controllable characters defined

  1. Do the same thing, only this time enabling multiple character types to be isPozyxControllable
  2. Open the "default character" menu: the menu should show all of the available character types.
  3. Select a "default character" type.
  4. ~Click "Save Project Settings"~
  5. The Main page will reload.
  6. Any pozyx tag should be set to the default character type

Character Type Script is removed

  1. Leaving multiple character types isPozyxControllable enabled...
  2. Delete character type you had previously set as the default
  3. Select project "SETUP"
  4. Click "Edit Project Settings"
  5. Open the "default character" menu: the menu should show "-- select a character --", meaning no default is selected.
  6. You actually have to reload the project ~or click "Save Project Settings" and "Save" the SETUP to return to the menu~.
  7. NOTE that the existing removed pozyx character type will actually remain until you reload the project.

No default defined

  1. Leaving multiple character types isPozyxControllable enabled...
  2. Select project "SETUP"
  3. Click "Edit Project Settings"
  4. Select "-- select a character --" to clear the default character type.
  5. ~Click "Save Project Settings"~
  6. The Main page should reload. The default pozyx tag should be randomly selected from the list of available isPozyxControllablecharacters.
jdanish commented 7 months ago

One minor issue - if you click "save" next to stage: save rather than "save project settings" it appears to retain the settings but require a reload by hand. Users shouldn't do that but may because of how scrolling hides the correct button. Fortunately, a hand reload switches the main correctly and all works as expected. So ... I think leave as-is given we are out of hours?

benloh commented 7 months ago

if you click "save" next to stage: save rather than "save project settings" it appears to retain the settings but require a reload by hand.

In order to NOT have the whole page reload as soon as you select a default character, we had to use the "Save Project Settings" button to trigger the reload. But in actuality the default character metadata is already updated as soon as you select the menu item. It was never an elegant solution.

I've simplified it:

  1. As soon as you select a default character, Main reloads. You lose the project settings screen, but the default character is immediately updated.
  2. The "Save Project Settings" button was always just a "Close Project Settings" button anyway -- the changes were applied as soon as you made a change. We kept using "Save..." because we had thought it was confusing (I vaguely recall going back and forth on this a few times). Since the changes are applied immediately, it doesn't matter if we lose the project settings screen, other than that you have to reselect it if you weren't one editing.

@jdanish Please let me know if you prefer this solution c4caf0d25ef412b9fc84358bf40c875cf848ff7b.

benloh commented 7 months ago

Wiki updated: https://github.com/theRAPTLab/gsgo/wiki/Project-Settings