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

Improve/fix the cast bar script previews #267

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gareth3001
Copy link
Contributor

  • Define CONST_PREVIEW_SPELLID in Plater.lua as well, and use this in all cases.
  • Allow the castNoInterrupt arg to actually let non-interruptible spells to be previewed.
  • Wipe DefaultCastScripts when recompiling all scripts.
  • Add all spell casting (2) scripts to DefaultCastScripts during compilation.
  • Sort the list of scripts to show in the preview window.
  • Use the number of preview scripts with a reasonable minimum of 12 for the preview cast height.

- Define CONST_PREVIEW_SPELLID in Plater.lua as well, and use this in all cases.
- Allow the castNoInterrupt arg to actually let non-interruptible spells to be previewed.
- Wipe DefaultCastScripts when recompiling all scripts.
- Add all spell casting (2) scripts to DefaultCastScripts during compilation.
- Sort the list of scripts to show in the preview window.
- Use the number of preview scripts with a reasonable minimum of 12 for the preview cast height.
@gareth3001
Copy link
Contributor Author

Example screenshots showing my profile's custom scripts being previewed as expected:
WoWScrnShot_022025_073126
WoWScrnShot_022025_072946

@cont1nuity
Copy link
Collaborator

cont1nuity commented Mar 3, 2025

Please don't clear the default list. Back-fill from there.
For the intent to show "custom" scripts, it would make sense to sort these properly to be always first to show.
Would require a custom compare function for the new sorting.

@gareth3001
Copy link
Contributor Author

I'm not sure how common it is for a profile to use both the standard Plater scripts and custom scripts, but I suppose it's possible. The most important part of my change was to allow non-Plater scripts to be previewed in this window. I'll take another crack and do the custom sorting you suggest, shouldn't be too hard -- probably just need to leave the default scripts table alone and track additional ones in a separate table.

@cont1nuity
Copy link
Collaborator

As I edited above: don't clear the default list. Use it for back-fill.

- Add CurrentCastScripts table to script library.
- Use CurrentCastScripts instead of DefaultCastScripts for tracking of cast bar scripts in the profile.
- Only preview enabled scripts, as previews don't work for disabled scripts.
- Sort the preview list so non-standard scripts come first, followed by all Plater default scripts. Use the [P] or [Plater] string in the name to detect these, as some aren't in the DefaultCastScripts table.
@gareth3001
Copy link
Contributor Author

Okay, I think I came up with a nice way to achieve the outcome you wanted. Instead of implementing a custom sort, I just put the default Plater scripts into a different temporary table and appended those after the full list had been processed. I've confirmed that this puts any custom scripts ahead of any Plater scripts tagged with [P] or [Plater] via a default profile with some extras added.

@gareth3001
Copy link
Contributor Author

As I edited above: don't clear the default list. Use it for back-fill.

Let me know if you have any other concerns about the latest version, thanks!

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

Successfully merging this pull request may close these issues.

2 participants