Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to apply Advanced Options changes to all profiles #305

Open
ryanm798 opened this issue Oct 25, 2024 · 4 comments
Open

A way to apply Advanced Options changes to all profiles #305

ryanm798 opened this issue Oct 25, 2024 · 4 comments
Assignees

Comments

@ryanm798
Copy link

I use a separate profile on each character to use different mounts between them. I often make edits to the advanced options to add new functionalities to the keybinds (summon certain utility mounts, run command to eject passengers, etc), but I want these changes to apply to all my profiles.

@mbattersby
Copy link
Collaborator

mbattersby commented Oct 26, 2024

Can you explain how you want this to work? (Assuming the way it works now will continue to be the default.)

I think it's a fine idea, but how do you think it would be done?

TL;DR, I don't know what the "way" is either.

@mbattersby mbattersby self-assigned this Oct 26, 2024
@ryanm798
Copy link
Author

I was thinking something like this:

Lite_Mount_Proposal

When editing the script, it would only apply to the current profile initially like normal.

Then, if you press "Copy Keybinding [x] to All Profiles", it will copy the script for the current keybind selected in the dropdown (let's call this keybind number "x") on the current profile, iterate over all the profiles and overwrite the script for keybind x on each.

The "Copy All Keybindings to All Profiles" button does the same but for every keybind.

To keep the UI less cluttered, you could leave off the 2nd button and just have the "copy keybinding x" button, and the user will just have to click through each keybind and press the button if they want to copy all of them.

@mbattersby
Copy link
Collaborator

Thanks for that, that's a really good idea.

I'm not actually sure I can do it though, the Ace-3.0 profiles don't make it easy to alter anything but the current profile and if I put in a bug it could easily delete everyone's complete settings which makes me super paranoid.

image

Something like this might be the best I can hope for, which would still involve cut-and-paste into the 4 but at least would persist. I'm not really sure how it would work though either, if you turned it on would it be on for all profiles or is it per-profile?

I don't have much time for enhancements right now, I got back from vacation and I'm behind on actually playing the game. I'll continue to think about this and see if an idea occurs.

@ryanm798
Copy link
Author

ryanm798 commented Oct 27, 2024

No worries, I understand. As far as editing non-active profiles, could something like this work?:

local currentProfile = LiteMount.db.profiles[LiteMount.db:GetCurrentProfile()]
if currentProfile then
    local newKeybinding1 = currentProfile.keybinding1
    local profiles = LiteMount.db:GetProfiles()
    for _, profileName in ipairs(profiles) do
        local profile = LiteMount.db.profiles[profileName]
        if profile then
            profile.keybinding1 = newKeybinding1
        end
    end
end

I just used ChatGPT for this, so apologies if it's nonsense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants