Page 1 of 10

Rematch 5.0

Posted: July 3rd, 2023, 4:45 am
by Gello
It's finally time for a new thread. This morning I've posted the Rematch 5 Beta to wowinterface:
https://www.wowinterface.com/downloads/ ... 5Beta.html

Feel free to post feedback here. This thread will hopefully be a place to ask questions, suggest changes, etc. not only during the beta but after it goes "live" as well. Of course you're welcome to post on wowinterface, curse or the official forums too. (I only have access to NA official forums, unfortunately.)

It's mentioned below but I highly recommend backing up your WTF folder before you install. And when you do install, delete your old Interface\AddOns\Rematch folder. (The files are entirely different.)

Changes

There are many (many) changes, not all listed here, but some highlights include:

General UI:
  • A more polished and consistent UI using modern elements like scrollboxes and views, while keeping a familiar look and feel
  • The toolbar now includes more buttons, including rarity and leveling stones (that automatically change based on summoned pet and stones you have), a Load Random Pets button, and a pet satchel button to cycle through buttons in more compact views
  • Tooltips now have an option for a delayed mouseover reaction speed (Slow, Normal, Fast) like pet cards and ability tooltips
  • Throughout the UI, text in the dark blue "rare" color is a little bit brighter to make it easier to read against dark backgrounds
  • Lists (pets, teams, targets, queue) can be separately made compact while other lists remain in their normal size
Standalone Window:
  • The standalone window can now be expanded into three panels like the journal, while still collapsible down to two or one panels (or minimized)
  • Tabs now align with the chosen anchor (eg. bottomright anchor will move tabs to bottomright)
  • The standalone window can now be anchored to center top and center bottom in addition to the four corners
Pets:
  • Pets can be marked and filtered with a "Pet Marker" similar to the target/world markers (skull, cross, star, etc.)
  • From the filter menu, pet markers can be renamed to use for whatever purpose you want. Rename star to "Pets to Buy", skull to "Tier 1 Pets", etc.
  • A list of filtered pets can be exported from the pet filter menu, optionally as a csv of their stats such as rarity, level and breed
  • Pets can now be sorted by three levels of sort instead of one
  • The number of teams a pet belongs to is now a sort option
  • Compact pet lists are now styled more similarly to the normal-sized pet lists
Pet Cards:
  • Pet cards are now minimizable for a more compact view of a pet's stats and abilities
  • More options to "flip" a pet card over, including changing modifier key or requiring a click
  • Background art for pet cards now include portrait, icon, pet type or no art in addition to expansion art
  • Pets of the 350+ notable targets now display their rarity and stats on the pet card, with abilities adjusted for their stats
  • Ability tooltips now have an option for background art of its icon or pet type
Teams:
  • Teams can now contain multiple targets
  • Teams are now organized into unlimited, scrollable, collapsable groups with up to 15 of them being shown as team tabs
  • Teams and groups can be picked up onto the mouse and reorganized by drag and drop, much like pets in the queue
  • In addition to drag and drop, a Team Herder tool from the Teams button allows easily moving many teams to other groups with simple clicks
  • Team groups can be colored and teams within will inherit their color
  • Leveling preferences and win records properties are now within the team edit dialog and not separate tooltips/dialogs
Targets:
  • Targets can now be assigned to multiple teams, with a priority order of teams you can reorder
  • The target list is now in its own tab with targets colored by the expansion they're from
  • Random counter pets can be loaded for any of the 350+ known targets to randomly pick high-level pets that are Strong Vs and Tough Vs the target's pets
  • When targeting something with more than one team, the target panel will display the topmost team with buttons to cycle through other teams
  • When targeting wild pets, the target panel at the top will now display the pet for viewing its pet card and abilities before you battle
  • Notable targets with known pets will always display their pets in the target panel in modes that always display the target panel
  • Target models in the target panel are now displayed as their better-curated 2D portrait
Leveling Queue:
  • A new Default Preferences in addition to Team and Group Preferences allows setting criteria regardless of the team loaded (such as a global max level for the queue)
  • The queue now uses a stable sort by default so all things being equal, pets remain in the order they were added/moved during a sort
  • Pets in a team can now be sorted to the top of the queue
  • The leveling queue can now be exported and imported
Options:
  • Many options were converted to dropdowns
  • Targeting Options has been renamed Interact Options with separate interact behaviors for target or mouseover of saved targets
  • (If looking for Auto Load, it's in one of the Interact Options dropdowns)
Features Removed:
  • Toolbar Option 'Move Toolbar To Bottom' was removed to make layouts easier to maintain
  • Standalone Window Option 'Combine Pets And Queue' was removed to make layouts easier to maintain, and it's no longer needed with 3-panel option
  • (If anything else is missing let me know. It may have been an oversight or moved elsewhere. The above two are the only two options intentionally removed that I can think of.)
Along with fixing bugs and optimizations, a few features are still in development and may show placeholder dialogs until complete:
  • Collection summary/statistics
  • Sending/receiving teams in-game to/from other Rematch users
  • Dealing with wrapped pets
  • Creating a script to pull out localization strings
Notes for existing Rematch users
  • Before installing this beta, I strongly recommend backing up your WTF folder (or the Rematch.lua within, described below) in case anything happens, so you don't lose your teams and settings to a bug in the beta.
  • Your queue, teams and many (not all) settings will seamlessly convert from Rematch 4 to 5 when you log in, but many settings will not carry over. Notably: Auto Load and related options will not automatically carry over. (These are in Interact Options now and have changed a lot.)
  • Some team names may be slightly renamed to add a number after them to keep them unique. If you had a team named Squirt with a target and another team named Squirt without a target, then the latter will be renamed to Squirt (2) (or an incrementing number if 2 already used). The team with the target will always be the "primary" team on an upgrade from 4.x to 5.x. In Rematch 5, teams are uniquely named regardless of whether they have targets or not.
  • While old Backup strings are supported, they contain no information about the tabs other than their names. The new backup export includes information about groups (icon, color, sort mode, whether it's shown as a tab). If you import this new backup into Rematch 4, it will not recognize the icons and such.
  • To do a large scale reorganization of your teams into new groups, I highly recommend using the Team Herder from the Teams button at the top of the Teams tab rather than dragging individual teams up/down the list. As you'll notice, when you pick up a team onto the mouse, it collapses other lists to choose where to drop it. (For drag and drop, if you prefer, search for the option "Require Click To Drag Teams". This may become default, I'm not sure yet.)
Beta feedback I'm most interested in
  • Is there anything that doesn't make sense? The addon should be usable without a manual. More advanced features should be evident when they're discovered.
  • Is there a bug? If so please describe the steps to reproduce it. I can realistically only fix bugs I can reproduce.
  • Is there any behavior that was unexpected? Let me know what behavior you expected vs what happened.
  • Is there a feature/option of Rematch 4 that you're not seeing? There are over 100 options to this addon and some were consolidated and some added. Some were probably missed. Some were dropped intentionally but feel free to ask.
  • Is there anything else that would be useful within the scope of this addon? The scope is a journal alternative for managing pets and teams.
How to install

It's a separate addon here at wowinterface here: https://www.wowinterface.com/downloads/ ... 5Beta.html
It's also on the beta channel on curseforge: https://www.curseforge.com/wow/addons/rematch

The instructions below assume you're installing from wowinterface:

Using Rematch 4 or any other addon is not a prerequisite to trying this beta. But if you're an existing Rematch user, this addon should be installed over your existing Rematch folder while out of the game. I recommend:
  1. Exit the game entirely.
  2. Make a backup of your existing WTF folder (or specifically, World of Warcraft\_retail_\WTF\Account\%AccountName%\SavedVariables\Rematch.lua).
  3. Delete the Rematch folder from your Interface\Addons folder (specifically, World of Warcraft\_retail_\Interface\AddOns\Rematch).
  4. Extract the above download to Interface\Addons (or ontop of existing one if you didn't delete).
  5. Log into the game.
(Do not attempt to upgrade this while logged into the game. The client will not recognize any new files and the addon will not work.)

If you're a Rematch 4 user, the first time you log into Rematch 5, it will make an internal backup of your Rematch 4 teams and settings and then convert everything to Rematch 5. The internal backup will persist for at least as long as the beta lasts.

If you decide you want to go back to Rematch 4, repeat the above steps except download and extract Rematch 4 found here:
https://www.wowinterface.com/downloads/ ... match.html

If you were using Rematch 4.15 or greater before, it should automatically restore the old teams and settings. (Note: any changes in Rematch 5 will not translate back to Rematch 4. Re-installing Rematch 4 will revert to your teams and settings before the upgrade to Rematch 5.)


Thanks for trying this beta and thanks in advance for feedback!

- Gello

8/4/2023 edit: It's now available on curseforge beta channel

Re: Rematch 5.0

Posted: July 17th, 2023, 12:22 am
by Caliban
Hi Gello,

This looks fantastic! Just a question; If I download this Beta, will I keep all my old lists and scripts (you made a script in the past for me which I'm very happy with and don't want to lose).

Also:

"A list of filtered pets can be exported from the pet filter menu, optionally as a csv of their stats such as rarity, level and breed"

This feature is fantastic! I can copy a pet list this way and on the armory on the way do my shopping!

Kris

Re: Rematch 5.0

Posted: July 17th, 2023, 4:44 am
by Gello
Caliban wrote:
July 17th, 2023, 12:22 am
If I download this Beta, will I keep all my old lists and scripts (you made a script in the past for me which I'm very happy with and don't want to lose).
Thanks!

Yes, you will keep your old scripts, teams, tabs, queue, notes, etc. Except I just found out I forgot to carry favorite filters over. That will be in next update likely next weekend.

The way this transition works is that all Rematch 4 saved stuff is saved as a backup unchanged. If you try Rematch 5 and decide you want to go back to Rematch 4, as long as it's version 4.15 or greater, Rematch 4 it will see a backup from Rematch 5 was made and put everything back in its place. So it's relatively safe to go back and forth.

That said, I still recommend making a backup of your WTF folder just in case, or the Rematch.lua file within that has your old saved stuff. Part of the purpose of this beta is to confirm that things work as they are supposed to work.

Re: Rematch 5.0

Posted: July 17th, 2023, 1:15 pm
by Schlumpf
Yes, you will keep your old scripts,
Only if we manage to map them back to the teams, which is done by name, so should™ be fine.

So far I found
  • please don't use https://wow.tools/casc/listfile/download/csv/unverified for allIcons, use https://github.com/wowdev/wow-listfile/raw/master/community-listfile.csv or https://github.com/wowdev/wow-listfile/raw/master/community-listfile-withcapitals.csv
  • clicking a "has been added to your pet journal" tooltip from chat does open rematch, but does not filter to pet.
  • the LibDataBroker launcher has vanished

For updating the scripts addon, I think integrating into the menu will be fine (although it feels weird to modify the menu despite your in-file documentation saying "menus should be built so they don't need to change" ;). Mapping script to currently loaded team should be fine as well, just need to use the new variables and add some rematch version detection. I haven't done all the mappings yet, but our users are already requesting compatibility with Rematch 5. :)

If I could have one wish for Rematch 5 it would be closer integration of scripts. I would imagine you only providing an API for "register user data blob with a team" and combined with that have the team menu modifications. This would
  • allow for importing team and script at the same time (very requested by xufu users) and also
  • properly clean up scripts when teams are deleted (currently we weirdly hook the delete-team menu item, but that isn't the only way to delete teams (i.e. delete group is missed).
  • We also hook some renaming cases (by hooking the dialog accept handlers, ewww)
all of which would be gone if we can attach our user data to your teams. Sure, we will lose ability to restore scripts based on our saved variables, but that would only be for Rematch-team-scripts (we do support others, but nobody uses those), and obviously if you get rid of Rematch, you don't need those scripts anymore either.

Is this something you're open about? Xufu users would really love you then, for sure. (Scripts&team at same time and mass script export are most requested features afaik and you would enable both.)

Re: Rematch 5.0

Posted: July 17th, 2023, 5:32 pm
by Gello
Thanks for the things to look at.

I can definitely make this more extensible. I thought I had an ExtendBadges bit but it appears taken out. (badges went through a lot of changes; aside from notes buttons they're non-interactive now. Maybe I'll just add a callback to do whatever to the listbutons.)

If td pet scripts has a need to add its own tab to Rematch it's pretty easy to do:

Code: Select all

-- create a frame with Rematch.frame as its parent
local f = CreateFrame("Frame",nil,Rematch.frame,"RematchPanelInsetFrameTemplate")
f.hello = f:CreateFontString(nil,"ARTWORK","GameFontNormalHuge")
f.hello:SetAllPoints(true)
f.hello:SetText("Hello, TestPanel")

-- and make sure it has a parentKey to Rematch.frame
Rematch.frame.TestPanel = f -- set parentKey to Rematch.frame from above

-- set up definitions for the modes (0=minimized, 1=single panel, 2=dual panel, 3=triple panel)
local definitions = {

  { -- add TestPanel to 3-panel modes
    mode = 3, view = "test", width = 844, height = 520, tab = "Test",
    panels = {
      {"TeamsPanel","TOPLEFT","Canvas","TOPRIGHT",-280,0,"BOTTOMRIGHT","Canvas","BOTTOMRIGHT",0,0},
      {"TestPanel","TOPLEFT","Canvas","TOPLEFT",0,0,"BOTTOMRIGHT","TeamsPanel","BOTTOMLEFT",-2,0}
    }
  },
  { -- add TestPanel to 2-panel modes
    mode = 2, view = "test", width = 562, height = 520, tab = "Test",
    panels = {
      {"TeamsPanel","TOPLEFT","Canvas","TOPRIGHT",-280,0,"BOTTOMRIGHT","Canvas","BOTTOMRIGHT",0,0},
      {"TestPanel","TOPLEFT","Canvas","TOPLEFT",0,0,"BOTTOMRIGHT","TeamsPanel","BOTTOMLEFT",0,0}
    }
  },
  { -- the tab won't be visible for single panel mode but this makes it visible in single panel
    mode = 1, view = "test", width = 340, height = 520, tab = "Test",
    panels = {
      {"TestPanel","TOPLEFT","Canvas","TOPLEFT",0,0,"BOTTOMRIGHT","Canvas","BOTTOMRIGHT",0,0}
    }
  }
}

-- register layout definitions
for _,def in pairs(definitions) do
  Rematch.layout:Register(def)
end
edit: above adds a teams panel alongside a custom panel, so it's possible to reuse the same panel across different layouts. You can put the team panel to the left, or make it take up the top half of the canvas. See layout/definitions.lua for how the other layouts are made. (If you decide to add a Scripts tab/panel, let me know and I have a few more simple things you might want to use, such as registering it to join UI updates and configuration changes (going from 2 to 3 panels for instance.))

The real challenge with the above is there's not enough space for more panel tabs in minimized or 1-panel views, the default ones will take priority.

There are also a few custom events you can register callbacks for:

Code: Select all

Rematch.events:Register(frame,"REMATCH_TEAM_LOADED",function(self,...)
  print("A team loaded but no args yet",...)
end)
This doesn't pass a teamID that was loaded but that can be done. I can add a REMATCH_TEAM_DELETED too.

I'll consider a way to register custom menu stuff, though feel free to edit the menus too. You should be able to get get the menu definitions and change them/reregister.

On integrating the export/import strings, I can possibly set custom fields but I'd need to add a delimiter. Maybe the :Ustuff<|u> and register a callback for something to handle stuff after the team is created, with a teamID.

Re: Rematch 5.0

Posted: July 18th, 2023, 4:40 pm
by Schlumpf
I don't see a reason for us to extend Rematch more than just adding an "edit script"/"add script" button in the context menu and adding the indicator whether a script exists to the team row. Other than that, we only need to hook team editing functions where the custom events might help. Adding a tab is neat, but not something I see a use for.
On integrating the export/import strings, I can possibly set custom fields but I'd need to add a delimiter. Maybe the :Ustuff<|u> and register a callback for something to handle stuff after the team is created, with a teamID.
If there is any chance of that happening, I'd very much prefer to wait for your mockup of that before I manually add all the UI hooking etc. If such an API existed, we would need to do barely anything, not a team-deleted event either, pretty much just "does {a given team id,the active team} have our custom data and if yet, which?" and "add this custom data to the {active team, given team id}".

I would treat them pretty much just like notes, but with a tag. I'd preferably
  • tell Rematch I am a plugin and want to save team data with the tag "pbs" and use the icon "blerb.blp" to mark a team having such data in the list
  • tell Rematch that team list entries with our data should call `edit_blob(team-id)` on clicking the badge
  • tell Rematch that the team menu shall contain "new script" for not having our data, "edit script" and "delete script" for existing data (the only possible actions for any plugin, these are just localisation strings)
  • check `Rematch.loadedTeam:pluginData('pbs')` at random times
  • call `Rematch.loadedTeam:{set,delete}PluginData('pbs', blob)` at random times
I guess on your data management side and import/export it could be pretty much just like notes. Data could be base64-d to avoid weird encoding stuff, I wouldn't mind.

The only annoying part is if you have plugin data without a plugin handling it. Guess a `?` icon with tooltip "This team has data for the '$tag' plugin, but plugin is not installed." would be fine. On Xufu we currently have notes as opt-in and probably would do scripts just the same, so this should pretty much only happen if people decide to stop using a plugin.

How likely are you to provide such an API? Do you want to toy with it? Should I toy with it in the Rematch code to do a mockup or something?

Re: Rematch 5.0

Posted: July 18th, 2023, 7:12 pm
by Gello
Schlumpf wrote:
July 18th, 2023, 4:40 pm
How likely are you to provide such an API? Do you want to toy with it?
Registering badges, extremely likely.
Registering menus, extremely likely.
Events, extremely likely.
Import/export strings, needs more research, can't say yet.

Including outside data within a rematch.savedTeam[teamID] is...already possible, but it makes me a little nervous that a third-party addon would store data in there. I will have to think about this more.

I don't understand "random times" for the other bits. I really really really don't want to get involved in supporting other addons to the extent that I need to include them in my regression testing. My experience with ElvUI skin support was so intensely awful that I will forever...I'm just going to stop there before I start swearing lol. So I will create events for callbacks and stuff, but the vague interactions will be up to you.

Re: Rematch 5.0

Posted: July 19th, 2023, 2:50 pm
by Schlumpf
Gello wrote:
July 18th, 2023, 7:12 pm
Schlumpf wrote:
July 18th, 2023, 4:40 pm
How likely are you to provide such an API? Do you want to toy with it?
Import/export strings, needs more research, can't say yet.

Including outside data within a rematch.savedTeam[teamID] is...already possible, but it makes me a little nervous that a third-party addon would store data in there. I will have to think about this more.
I totally understand the worry. I surely would make development easier for all us (i.e. exactly us) Rematch extenders.
Gello wrote:
July 18th, 2023, 7:12 pm
I don't understand "random times" for the other bits. I really really really don't want to get involved in supporting other addons to the extent that I need to include them in my regression testing. My experience with ElvUI skin support was so intensely awful that I will forever...I'm just going to stop there before I start swearing lol. So I will create events for callbacks and stuff, but the vague interactions will be up to you.
The random comes from us having an UI as well. We surely want to be able to edit the script from your team browser, but during battles themselves people do edit scripts, so at a from-your-perspective-random time there would be a "write addon blob" call. Similar, when starting a battle, we would query the data when entering a battle, something again not under your control.

It isn't *really* random, the test for `Team:setPluginData()` would be enough. In my mind world you would do your notes as "plugin data" with tag "note", so you'd test everything implicitly that way. The biggest reason to mention it is to not randomly peek into your data structures but to have explicit API calls for it.

Re: Rematch 5.0

Posted: July 22nd, 2023, 6:52 pm
by Gello
An update posted tonight to wowinterface has a few changes:
  • Collection summary added which includes a team battle summary tab for all recorded team battles
  • Fix for unique pets count in collection button at topleft of window
  • Updated handling of target names while waiting for them to be cached
  • Searches are now "accent-insensitive" on French, German, Italian, Spanish, Mexican, Portuguese, and Brazilian clients
  • Favorite filters now automatically import from Rematch 4
  • Added many ways to extend this addon from third-party addons, including events, badges and menus. See docs/extending.txt
  • Added LDB launcher
It may go up on beta channel of curse next weekend or weekend after.

For Schlumpf, relevant parts from extending.txt:

On events:

Code: Select all

Rematch uses an event dispatch system that outside addons can use:

    Event                   Argument       When
    REMATCH_UI_CONFIGURE    (none)         After the main Rematch window has changed configuration (minimized, panel changes, etc) or shows
    REMATCH_UI_RESIZE       (none)         After the main Rematch window has resized
    REMATCH_UI_UPDATE       (none)         After the main Rematch window has finished a global update of all shown panels
    REMATCH_TEAM_LOADED     teamID         A team is loaded or unloaded (can be nil for a team unloaded)
    REMATCH_TEAM_CREATED    teamID         After a new teamID is created
    REMATCH_TEAM_DELETED    teamID         After a teamID is deleted
    REMATCH_TEAM_UPDATED    teamID         After a teamID is changed (can be due to being overwritten by another team)
    REMATCH_TEAMS_CHANGED   (none)         After any teams changed (happens after other REMATCH_TEAM events and before UI is updated)
    REMATCH_TEAMS_READY     (none)         After login when teams are settled
    REMATCH_TEAMS_WIPED     (none)         After all teams are wiped by /rematch delete all teams

To register for these events:

    Rematch.events:Register(frame,"EVENT_NAME",callbackFunction)

Example:

    local frame = CreateFrame("Frame") -- your frame, anything really
    Rematch.events:Register(frame,"REMATCH_TEAM_LOADED",function(self,teamID)
        local team = Rematch.savedTeams[teamID]
        if team then
            print("Team",team.name,"just loaded")
        end
    end)
On badges:

Code: Select all

Badges are small icons on the right of list buttons, to show if a pet is leveling, if a team has preferences, etc.

At the moment, the Notes button is the only badge that can be clicked to do something. Support for custom clickable
badges may come in the future.

To add badge support:

    Rematch.badges:RegisterBadge(list,badge,icon,iconCoords,callback)

With these arguments:
    list        Either "pets", "teams" or "targets" to choose which list to add to
    badge       An arbitrary unique name for the badge
    icon        A filepath/fileID for the icon to use with the badge
    iconCoords  Optional texcoords for the icon an ordered table {left,right,top,bottom} can be nil
    callback    A function that takes a petID, teamID or targetID and returns true if badge should show

This example creates a "cats" badge that puts a badge on pets with 'Cat' in their species name:

    -- callback function to return whether the badge should be shown
    local function isCat(petID)
        local petInfo = Rematch.petInfo:Fetch(petID)
        if petInfo.speciesName and petInfo.speciesName:match("Cat") then
            return true
        end
    end

    -- register "cats" badge
    Rematch.badges:RegisterBadge("pets","cats","Interface\\Icons\\Ability_Druid_CatForm",{0.075,0.925,0.075,0.925},isCat)
    -- update Rematch UI if it's on screen (if it's not on screen it will be updated when it's shown) to show badges
    if Rematch.frame:IsVisible() then
        Rematch.frame:Update()
    end

This example adds a black tabby cat badge to every team that has a black tabby cat:

    -- callback function to return whether teamID has a black tabby cat
    local function hasBlackTabby(teamID)
        for _,petID in ipairs(Rematch.savedTeams[teamID].pets) do
            local petInfo = Rematch.petInfo:Fetch(petID)
            if petInfo.speciesID==42 then
                return true
            end
        end
    end

    -- register "tabby" badge
    Rematch.badges:RegisterBadge("teams","tabby","Interface\\Icons\\INV_Pet_Cats_BlackTabbyCat",{0.075,0.925,0.075,0.925},hasBlackTabby)
    -- update Rematch UI if it's on screen (if it's not on screen it will be updated when it's shown) to show badges
    if Rematch.frame:IsVisible() then
        Rematch.frame:Update()
    end

Note: Rematch.frame:Update() is only needed when the Rematch UI is on screen and something changes that should update badges.
When the addon is summoned or various other things (pets learned, teams saved, etc.) the UI will update badges automatically.
On menus:

Code: Select all

Menus are built from an ordered list of subtables that define each menu item. For instance this is TeamMenu from menus/teamMenu.lua:

    -- menu when you right-click a team in the team list
    local teamMenu = {
        {title=tm.GetTeamName},
        {text=L["Unload Team"], hidden=tm.IsTeamNotLoaded, func=tm.UnloadTeam},
        {text=L["Edit Team"], func=tm.EditTeam},
        {text=L["Set Notes"], func=tm.SetNotes},
        {text=L["Move Team"], func=tm.MoveTeam},
        {text=L["Load Saved Target"], hidden=tm.NoSavedTarget, func=tm.LoadSavedTarget },
        {text=tm.SetOrRemoveFavoriteText, func=tm.SetOrRemoveFavorite},
        {text=L["Share"], subMenu="ShareTeamMenu"},
        {text=L["Delete Team"], func=tm.DeleteTeam},
        {text=CANCEL},
    }
    rematch.menus:Register("TeamMenu",teamMenu)

It has a name "TeamMenu" that's used to show/reference the menu, and each item has properties, many of which can be a literal value
or a function that returns it's value when the menu is shown.

Note that even the text property can be a function. The function tm.SetOrRemoveFavoriteText is:

    function rematch.teamMenu:SetOrRemoveFavoriteText(teamID)
        local team = teamID and rematch.savedTeams[teamID]
        return (team and team.favorite) and L["Remove Favorite"] or L["Set Favorite"]
    end

The argments passed to these functions are dependent on the menu's context. For team menus they'll pass a teamID,
for pet menus they'll pass a petID, etc.

To add to one of these menus, use:

    Rematch.menus:AddToMenu(menuName,menuItem,afterText)

Where menuName is the name of the menu ("TeamMenu" in example above), menuItem is a single menu item table, and afterText
is the text property the new menu item should be placed after. If afterText is nil, then it will be placed at the start of
the menu. If placing it aftter a text that's a function (like SetOrRemoveFavoriteText above) then use the function as
the afterText.

In the function called from the func property of the menuItem, the first argument is the menuItem itself, and the second
(or further) is the context-specific subject.

For instance:

    local function printTeamID(self,teamID)
    print("This is",teamID,"var is",self.var)
    end

    local menuItem = {text="Print TeamID", var=123, func=printTeamID}

    Rematch.menus:AddToMenu("TeamMenu",menuItem)

Note: While many properties can be a literal or a function, custom properties of a menuItem (like var above) are
treated as a literal always.
On storing outside data within Rematch's saved variables, I'm afraid I'd rather not. I don't know if I'll go so far to validate on login to remove anything that shouldn't be in its savedvars, but I'm terrified of the burden it would place on me. If a team gets broken and I've asked a user to disable all other addons and it's still broken, it's on me to fix it. If another addon was tampering with it, I can't know what caused it or how to fix it. If the whole addon breaks (it shouldn't, but it's not impossible) due to changes in savedvars, it's on me to fix it. If another addon was tampering with it, I can't know what caused it or how to fix it.

I can totally understand how convenient it would be to store team-related data within the team itself, but that convenience comes at the cost of an untenable burden to me.

Re: Rematch 5.0

Posted: July 30th, 2023, 8:35 pm
by Justgiz
I'm having a bit of an issue when trying this beta (5.0.0-beta-07) my settings/teams/queue are not getting converted. I'm not getting any errors, and the addon seems to work just fine. Previous version I've been using is 4.15.2.

Here are my SavedVariables file, before and after loading the beta, for testing:

https://gist.github.com/gizzmo/b808742032520ba8101f73a89cf05ee9

(I used GitHub as pastebin didn't let me post it, and posting those files here would be a massive wall of text, hope thats ok)

P.S. Thanks for such a great addon! :D

Re: Rematch 5.0

Posted: July 31st, 2023, 3:17 am
by Gello
Justgiz wrote:
July 30th, 2023, 8:35 pm
I'm having a bit of an issue when trying this beta (5.0.0-beta-07) my settings/teams/queue are not getting converted
I believe I've found the cause. (The fix for favorite filters was in a bad spot, so it would think a conversion to Rematch 5 already happened--sorry about that!) An update will go up this morning (beta-08).

After installing the update, if settings/teams/queue still don't carry over, try this:

/rematch reset everything

A confirmation popup will appear. This will reset everything in Rematch 5--except for the saved Rematch 4 backup--and then reload the UI. During the reload the addon will think it's a new installation and bring in Rematch 4 stuff again.

Re: Rematch 5.0

Posted: July 31st, 2023, 8:53 pm
by Justgiz
Got some bad news. It appears the filters bug is back! Loaded up beta-08 and got the same error I got with beta-05.

Code: Select all

1x Rematch/roster/filters.lua:154: bad argument #1 to 'wipe' (table expected, got nil)
[string "=[C]"]: in function `wipe'
[string "@Rematch/roster/filters.lua"]:154: in function `Clear'
[string "@Rematch/roster/filters.lua"]:166: in function `ClearAll'
[string "@Rematch/savedvars/settings.lua"]:234: in function `?'
[string "@Rematch/main/events.lua"]:17: in function <Rematch/main/events.lua:13>

Locals:
(*temporary) = nil
(*temporary) = "table expected, got nil"
I did testing tho. I started deleting tables and keys from my SavedVariables file, to see what setting is not converting right. When I changed "Rematch4Settings.ResetFilters" to false, I got a new error:

Code: Select all

2x Rematch/savedvars/convert.lua:153: bad argument #1 to 'tinsert' (table expected, got nil)
[string "=[C]"]: in function `tinsert'
[string "@Rematch/savedvars/convert.lua"]:153: in function `ImportTeams'
[string "@Rematch/savedvars/convert.lua"]:23: in function `?'
[string "@Rematch/main/events.lua"]:17: in function <Rematch/main/events.lua:13>
[string "@Rematch/main/events.lua"]:26: in function `Fire'
[string "@Rematch/roster/roster.lua"]:134: in function `func'
[string "@Rematch/utils/timer.lua"]:56: in function <Rematch/utils/timer.lua:46>

Locals:
(*temporary) = nil
(*temporary) = "team:356"
(*temporary) = "table expected, got nil"

Re: Rematch 5.0

Posted: August 1st, 2023, 4:36 am
by Gello
All news is good news. :D It will be good to have this fixed before it's opened to a wider audience, so it's appreciated.

I won't have a chance to look at this until tonight, but if the savedvar you linked has favorite filters causing this error then it should be easy to narrow down so that's appreciated too.

The problem may be that Rematch 4 is using a different filter group for something than Rematch 5 does. An easy fix would be to check that the filter group is valid, but this tells me that one filter group may not import properly from Rematch 4 so I'll want to take a closer look.

Re: Rematch 5.0

Posted: August 1st, 2023, 10:12 pm
by Gello
Update going up tonight should fix the lua errors and properly import groups/teams. The savedvar files helped thanks for posting those.

The conversion from 4 to 5 should be more tolerant and hopefully the following isn't necessary for anyone, but if there's any lingering issues and you have no Rematch 5 saved teams you want to keep, you can run the following to wipe all Rematch 5 saved stuff and start over with Rematch 4's saved stuff:

Code: Select all

/rematch reset everything
If you have Rematch 5 saved teams you want to keep, you can also backup all teams (which will include groups), /rematch reset everything, and then import them back.

Re: Rematch 5.0

Posted: August 2nd, 2023, 11:46 am
by Justgiz
Thank you, the import worked flawlessly that I forgot I installed the new version while doing my morning rounds.

Ok, here are the oddities I've found so far:

Under "Standalone Window Options" the "Anchor To" setting: I see that it affects the direction when the window resizes with minimizing, and folding in and out the pets list, but it also moves the tabs (team,target,queue,options). I don' think thats intended, right?

Is there a new setting for scroll speed? Before I could scroll the pet list and see the tooltip update with every pet. But now it scrolls every two pets, so it skips one. Idea: With a list that's really long, an option that scrolls faster when holding down a modifier would be helpful.

Keybinding are missing. I.E. Opening the current team's notes.

With the "Preferred Window" set to maximized, and hitting escape twice to minimize then close the window, the window will open in a minimized state. Actually that setting doesn't seem to have any effect. Setting it to Journal does not change the action. (used the keybind, and minimap button)

Edit: I can also confirm what Schlumpf said earlier, about clicking the "You collected" popup opens Rematch, but does not filter or scroll to the newly added pet.

Re: Rematch 5.0

Posted: August 3rd, 2023, 4:46 am
by Gello
Under "Standalone Window Options" the "Anchor To" setting: I see that it affects the direction when the window resizes with minimizing, and folding in and out the pets list, but it also moves the tabs (team,target,queue,options). I don' think thats intended, right?
The panel tabs intentionally move to the corner chosen by the anchor so the window maximizes/minimizes outward from the tabs and the tabs stay in the same place. To me at least, it seemed frustrating to maximize the window and then the tab that maximized it is now across the screen, so to minimize it you have to move over to the tab and back and forth. (If you have 'Don't Minimize With Panel Tabs' checked, uncheck it and the reason should be easier to see.)
Is there a new setting for scroll speed?
This is using a newer scrollbox that has a lot of benefits but lost some control over details like scrolling speed. I can do some more digging later.
Keybinding are missing. I.E. Opening the current team's notes.
I'll add notes bind back. I intentionally dropped binds for pets, teams and queue since they seemed a little superfluous. Let me know if the latter should return.
With the "Preferred Window" set to maximized, and hitting escape twice to minimize then close the window, the window will open in a minimized state. Actually that setting doesn't seem to have any effect. Setting it to Journal does not change the action. (used the keybind, and minimap button)
I'll work on this. This option may disappear and when needed use the last-used-window. Its original intent was for the times the window is summoned in reaction to an event (targeting something with a team when options are set to show it etc). I really didn't like the idea of the whole journal covering most of the screen when you target something.
I can also confirm what Schlumpf said earlier, about clicking the "You collected" popup opens Rematch, but does not filter or scroll to the newly added pet.
This will be fixed but maybe not in the update tomorrow. I misunderstood and thought it was the floating battle pet tooltip that says to open in journal and hadn't been able to reproduce it. I just realized from your popup reference that this is the alert frame and not the floating battle pet tooltip. I forgot clicking that looked for the pet in the journal too. This is fixable.

Re: Rematch 5.0

Posted: August 3rd, 2023, 7:47 pm
by Justgiz
Gello wrote:
August 3rd, 2023, 4:46 am
The panel tabs intentionally move to the corner chosen by the anchor so the window maximizes/minimizes outward from the tabs and the tabs stay in the same place. To me at least, it seemed frustrating to maximize the window and then the tab that maximized it is now across the screen, so to minimize it you have to move over to the tab and back and forth. (If you have 'Don't Minimize With Panel Tabs' checked, uncheck it and the reason should be easier to see.)
I never use minimizing with clicking the tabs, but I do use the minimize/maximize button at the top right, and double clicking the top bar (and pressing escape). But having tabs on top just feels weird, as no other game UI element has them there.

Gello wrote:
August 3rd, 2023, 4:46 am
I'll add notes bind back. I intentionally dropped binds for pets, teams and queue since they seemed a little superfluous. Let me know if the latter should return.
I personally don't see a reason to, as long as when opening the window, it returns to the same tab as before. Which I think it does.

Gello wrote:
August 3rd, 2023, 4:46 am
I'll work on this. This option may disappear and when needed use the last-used-window. Its original intent was for the times the window is summoned in reaction to an event (targeting something with a team when options are set to show it etc). I really didn't like the idea of the whole journal covering most of the screen when you target something.
After some thinking, if you ignore that setting, the way its working now makes sense. I normally spam escape to close all windows. So it feels intuitive that opening the window again (via what ever means) it would go back to what ever state it was in before closing. (And if the escape minimize setting is enabled, the last state would be minimized.)

Gello wrote:
August 3rd, 2023, 4:46 am
This will be fixed but maybe not in the update tomorrow. I misunderstood and thought it was the floating battle pet tooltip that says to open in journal and hadn't been able to reproduce it. I just realized from your popup reference that this is the alert frame and not the floating battle pet tooltip. I forgot clicking that looked for the pet in the journal too. This is fixable.
👍

P.S. Took some time to look at the code (I like reading code, its a quirk) and its so simple. Build frames with XML and simple closures for events. I'm so used to using Ace3, and using OnInitialize, OnEnable, NewModule. Which are basically just wrappers for ADDON_LOADED,PLAYER_LOGIN, and "a new table". And the fact that you don't use a single embeded library, the messy LibStub issues of getting blamed for another addon causing an error when your version of a library is used.

Amazing. Fantastic work.

Re: Rematch 5.0

Posted: August 3rd, 2023, 8:22 pm
by Justgiz
Gello wrote:
August 3rd, 2023, 4:46 am
This is using a newer scrollbox that has a lot of benefits but lost some control over details like scrolling speed. I can do some more digging later.
I was intrigued with the new scrollbox. Its quite in-depth. Found the setting following down the tree of mixins:

RematchAutoScrollBoxTemplate -> ScrollBox inherits WowScrollBoxList / ScrollBoxListMixin / ScrollBoxBaseMixin / ScrollControllerMixin in OnLoad sets wheelPanScalar to 2.0 which affects the scrolling speed.

https://github.com/BigWigsMods/WoWUI/blob/96dd4ef2a8bc2fbe8ba2332bae1d5d1d1e993ab8/SharedXML/Scroll/ScrollController.lua#L83

Code: Select all

/run Rematch.petsPanel.List.ScrollBox.wheelPanScalar = 1

I would suggest maybe making a setting to change that, or even have faster speeds with a modifier?

Re: Rematch 5.0

Posted: August 3rd, 2023, 10:58 pm
by Justgiz
Found a new issue: Win/loss records are not being recorded. At least not in PVP.

First noticed with the settings: "Auto Track Win Records" and "For PVP Battles Only" turned on.
Tested with the latter turned off, and it tracked. Tested a 3rd time just to be sure and yes, PVP Battles are not tracked with the latter setting checked.

Side thought: It feels a little cumbersome to change those stats. 3 clicks. Was that different in Rematch4? I don't recall.

Re: Rematch 5.0

Posted: August 4th, 2023, 9:04 pm
by Justgiz
Found some weirdness with the team notes. Sometimes it'll turn into the tooltip mode, like when you hover over the notes icon for a team.
  • The only Notes option enabled is "Show Notes When Teams Load"
  • Load a Target that has a team, either by targeting a trainer or selecting them from targets tab
  • Click the load button 3 times.
Tested with only Rematch5 enabled.