soda3x / ArmaReforgerServerTool

Arma Reforger Dedicated Server Tool for Windows
GNU General Public License v3.0
31 stars 8 forks source link

Mod order can be changed by the user #93

Open benfleuty opened 2 days ago

benfleuty commented 2 days ago

Overview

DirtyWindshield asked in Discord about re-ordering mods. They require one of their mods to be loaded last. This cannot be done currently as the mods lists are alphabetized when the lists are modified.

Potential Solution Steps

Stage 1

Do not alphabetize the mod lists. This will produce a list of mods in the order that they are added. Users will need to add mods in the order that they need to be loaded. This should provide the expected functionality, although the UX is not great as the user will need to add and remove already enabled mods to get them in the right order.

Stage 2

Add move mod up/down buttons to move the mod up and down the list. This fixes the UX issue mentioned in stage 1.

UI Redesign

The mods component of the app could be redesigned to have one list of mods and flag them as either enabled or disabled. Only enabled mods would be included when generating the mods: [] JSON array for the server config. The ListView component should achieve this goal, but other UI elements may be preferable.

soda3x commented 2 days ago

Regarding the UI redesign part, I don't think 1 singular list is very conducive to a nice UX. I developed the current design from mod loaders that I've used from the past which I find to be intuitive. Akin to map rotations when setting up servers in games etc. A pool on the left of what you can choose from - move into the right side for what is selected.

If you have a lot of mods, 1 list can cause enabled/disabled mods to get lost in the list. My suggestion would be to instead allow for load order to be customised for only the enabled mods, so we get the benefits of both worlds. Alphabetised in available (easy to find a mod in a sea of mods), and not-alphabetised but order is changeable in the enabled mods.

Thoughts?

benfleuty commented 1 day ago

I'm not briliantly versed in WinForms so there may be better ways of doing this. My thoughts so far are to not alphabetize the enabledModsList. This will allow users to add mods in the order that they want them to load. Personally, I don't see much value in having this list alphabetized. If a user needs to find a mod in the list, the search function will find it.

Implementing toggleable alphabetization will require us to maintain unsorted lists of mods, and only display them as alphabetized is AZ is on.

Here's some late night brain spilling out. Certainly not final, nor is the syntax really correct, but hopefully the point comes across.

Adding a mod

sequenceDiagram
    DB->>listOfSavedMods: Load on start up
    listOfSavedMods->>AZmodsList: Alphabetize the list and save separate list
    AZmodsList->>UI: Update the UI
    loop adding mods
    user->>listOfSavedMods: User adds a mod
    listOfSavedMods->>AZmodsList: Update the AZ list
    AZmodsList->>UI: Update the UI
    listOfSavedMods->>DB: Save to DB
    end

Rearranging a mod in a list

sequenceDiagram
    alt trying to rearrange when in AZ mode
    note over UI,user: This should never happen as
    note over UI,user:  we will guard against it long before
    note over UI,user: but if it does, error.
    else load order mode
    user->>UI: User moves a mod up/down
    UI->>listOfSavedMods: UI buttons calls for the list to be updated with mod in new index
    listOfSavedMods->>listOfSavedMods: Mod index in list changed
    listOfSavedMods->>DB: Save to DB
    end

Activating AZ Mode

sequenceDiagram
    user->>UI: User enables AZ Mode
    UI->>AZmodsList: UI requests AZmodsList items
    AZmodsList->>listOfSavedMods: get list of mods
    listOfSavedMods-->>AZmodsList: list of mods
    AZmodsList->>AZmodsList: alphabetize
    AZmodsList->>UI: Display to the user