Skip to content

Conversation

neimex23
Copy link
Contributor

@neimex23 neimex23 commented Sep 28, 2024

Hey good, I hope you are well. After a lot of time coding and very little because university things I started adding functionalities for ASC 3.0 after my new interface was finished.

I have a problem with the combobox that we used to set the active splitter did'nt set on Startup,

BEFORE HCM INTERFACE IMPLEMENT

LoadAutoSplitterSettings.Invoke(AutoSplitterInstance, [profCtrl, this]);
List<string> GameList = (List<string>)GetGames.Invoke(AutoSplitterInstance, null);
foreach (string i in GameList) comboBoxGame.Items.Add(i);
comboBoxGame.SelectedIndex = (int)GetSplitterEnable.Invoke(AutoSplitterInstance, null);
PracticeModeCheck.Checked = (bool)GetPracticeMode.Invoke(AutoSplitterInstance, null);

AFTER HCM INTERFACE IMPLEMENT

AutoSplitterCoreModule.AutoSplitterRegisterInterface(InterfaceASC);
comboBoxGame.Items.Clear();
foreach (string game in InterfaceASC.GameList)
{
    comboBoxGame.Items.Add(game);
}

 LoadAutoSplitterHotKeys();

You added
interfaceASC.ActiveGameIndex = GetSplitterEnable(); on ASC in RegisterHitCounterManagerInterface() Function
but the problem for manage this by the function is that called before fill ComboBox on HCM, then this raises an OutOfRange exception in the comboBox, to fix this im added GetActiveGameIndexMethod Function.
Remember that now ASC Fill ObservableCollection GameList after AutoSplitterRegisterInterface is invocated.

I dont know why PracticeMode still working but if it works that's enough, maybe is manage by other function.

@neimex23
Copy link
Contributor Author

Now ASC has the possibility to uploading and downloading profiles directly from a folder in the google drive and implement associated functions to handle profiles and splits effectively.

Implemented Functions:

  • GetProfiles(): Retrieves all profiles from HCM.
  • ProfileName(): Obtains the name of the current profile.
  • GetSplits(): Retrieves all splits for the current profile.

Enhanced Profile Creation:

To be able to enter the splits that are downloaded from drive I created a custom serialization that has as structure the name of the profile and the splits

  • Modified NewProfile(string profileTitle) to create a new profile using the provided parameter.
  • Maintains the existing window behavior when profiles are created in HCM.

The idea is after establishing the profile to go through a list that I have of splits and add them with

  • AddSplit(string SplitTitle);

Sin título
Sin título2
Roadmap.txt

Im still working in other functions like autohitcounter maybe i should edit some other function on HCM
I hope to release this in a few months after some beta testing, 
I got carried away by the size of this KEKW update. 
I'll leave you the roadmap so you have an idea of ​​how things are going.
I'll let you know when everything is official to do a new release of HCM, THX for all

@neimex23 neimex23 changed the title Bug fix where ActiveGameIndex is not set correctly on program Startup ASC 3.0 Compatibilization Mar 1, 2025
@neimex23
Copy link
Contributor Author

neimex23 commented Mar 1, 2025

I’m already in testing and beta phases with the new version of ASC. I’ll be coordinating with you soon to carry out an update.

Best regards

topeterk added a commit that referenced this pull request Mar 7, 2025
@topeterk
Copy link
Owner

topeterk commented Mar 7, 2025

Applied same changes as for v2 (see #40 for details)

@neimex23
Copy link
Contributor Author

neimex23 commented Mar 8, 2025

Awesome the names are clearer. I'm tested the new methods in Cloud Functions for profile creation, retrieval, and inserting splits, and everything is working correctly

@topeterk
Copy link
Owner

topeterk commented Mar 8, 2025

Nice to hear, shall we keep the PRs open (if you plan to add/change anything further) or shall I merge it already (from my side it looks fine).

@neimex23
Copy link
Contributor Author

i have some troubles removing GetActiveGameIndexMethod for this and HCMv2

foreach (string game in InterfaceASC.GameList)

HCM register ASCInterface First to get GameList before
https://github.com/neimex23/AutoSplitterCore/blob/335d8a39324fdf8108e65beb244f221ee700b1ad/Sources/ProgramModule/AutoSplitterMainModule.cs#L81

https://github.com/neimex23/AutoSplitterCore/blob/335d8a39324fdf8108e65beb244f221ee700b1ad/Sources/ProgramModule/AutoSplitterMainModule.cs#L98

after all

comboBoxGame.SelectedIndex = InterfaceASC.GetActiveGameIndex();

It is necessary to keep the GetActiveGameIndexMethod because RegisterHitCounterManagerInterface relies on the game list being populated before it can set the active game index. Specifically, the ComboBoxGame is not filled until after the registration process (referenced in Form1.cs line 88 and AutoSplitterMainModule.cs lines 81-98). This is important because ASC need ComboBox Filled to set a Active Index.
If insist on remove it i thinking in this solution

  Task.Run(async () =>
  {
      var expectedGameCount = GetGames().Count;
      while (interfaceASC.GameList.Count != expectedGameCount)
      {
          await Task.Delay(2000); // Wait Fill HCM comboboxGames to set Saved ActiveGameIndex
      }
      interfaceASC.ActiveGameIndex = GetSplitterEnable();
  });

but I'm not sure if this would be the right approach

topeterk added a commit that referenced this pull request Mar 19, 2025
(Required for better AutoSplitterCore integration, see #36)
@topeterk
Copy link
Owner

Yes you were right, the GameList was not changing the ComboBox directly when the collection gets changed by ASC. I fixed that in the commit, I just pushed. It should behave as in version 2 now.

So, in the debugger, when I change the result of GetSplitterEnable to, for example Celeste (7) then the ComboBox gets updated to the corrent entry in HCMv1 and HMCv2 on my side.

To test this, the ASC implementation looked this way in RegisterHitCounterManagerInterface which I think was the same what you were trying, right?

                interfaceASC.GameList.Clear();
                foreach (string game in GetGames())
                {
                    interfaceASC.GameList.Add(game);
                }

                interfaceASC.ActiveGameIndex = GetSplitterEnable(); //Before HCM Interface Change, ASC control mannualy on start the index of ComboBoxGame in Main Program
                //interfaceASC.GetActiveGameIndexMethod = () => GetSplitterEnable(); //After HCM Interface Change, HCM ask on Start The index of ComboBoxgame on ASC
                interfaceASC.SetActiveGameIndexMethod = (splitter) =>
                {

Hopefully this resolves the issue that you see or did I miss anything?

@topeterk
Copy link
Owner

Like in v2 #40 (comment) , I think we also do not need the open changes of this PR for v1 any more, right?

Is there anything else for v1, we need to look into?

@neimex23
Copy link
Contributor Author

#40 (comment) Nothing to do here

@topeterk
Copy link
Owner

topeterk commented Oct 7, 2025

Hi @neimex23 , just to double check again before closing this PR:
From what I see, the additional GetSplits including the usings is not used and can be removed?
The ProfileSelected call to ASC here can also be removed but it looks like to me that this is still needed?
https://github.com/topeterk/HitCounterManager/pull/36/files#diff-6255adbece3c3aa162e5afd1b8250d2f0f43ce91ca2bcbd09572fe066f2e006cR267
Can you also have a second look on these parts which of them we have to keep?

@neimex23
Copy link
Contributor Author

neimex23 commented Oct 7, 2025

GetSplits is for obtein all split for made a custom xml to upload current profile of hcm on cloud.

https://github.com/neimex23/AutoSplitterCore/blob/4e278e3084d98e6a837183abec574e18e138aecf/Sources/ProfileManager/GoogleAuth.cs#L429

ProfileSelected call asc with name for function profile link so you can register a profile hcm with asc and when is change on hcm its send the name to find what asc profile change.
https://github.com/neimex23/AutoSplitterCore/blob/4e278e3084d98e6a837183abec574e18e138aecf/Sources/Control/SplitterControl.cs#L322

So i need both

@topeterk
Copy link
Owner

topeterk commented Oct 7, 2025

Thanks for the fast response.

For the GetSplits, this seems to be a call to your SplitterControl which is further than fetching the actual data here:
https://github.com/neimex23/AutoSplitterCore/blob/4e278e3084d98e6a837183abec574e18e138aecf/Sources/Control/SplitterControl.cs#L346
So, if I am not mistaken, the GetSplits from our Interface isn't used.

When we are on the same page, do you want to update the PR and remove the obsolete usings and GetSplits?
(That, when only the profile selection call remains, I would then merge and close the PR)

@neimex23
Copy link
Contributor Author

neimex23 commented Oct 7, 2025

yes i think so, maybe is a old reference that we change for SplitsNames, but i cant find the reference to the function do you tell me.

@topeterk
Copy link
Owner

topeterk commented Oct 7, 2025

You are asking what SplitsNames actually does?
This will return the list from here:

public List<string> SplitsNames => [.. ProfileViewViewModel.ProfileSelected.Rows.Select(profileRowModel => profileRowModel.Title)];

@neimex23
Copy link
Contributor Author

neimex23 commented Oct 7, 2025

I mean, I don't understand what reference you're referring to when you talk about GetSplits in our interface.
dont exist a function called "GetSplits" https://github.com/topeterk/HitCounterManager/blob/master/Sources/AutoSplitterCoreModule.cs
or maybe you refered to SplitsNames

@neimex23
Copy link
Contributor Author

neimex23 commented Oct 7, 2025

aaah or you talk about this

public List<string> GetSplits()

@topeterk
Copy link
Owner

topeterk commented Oct 7, 2025

oh I see, in this PR on the top, I clicked on "Files changed" which shows a summary of all changes from this PR.
https://github.com/topeterk/HitCounterManager/pull/36/files
So, when I would merge this PR I will effectively change everything that is shown there.
GetSplits was added to the IProfileInfo but I cannot see any use of it.

@neimex23
Copy link
Contributor Author

neimex23 commented Oct 7, 2025

You can remove it (or i should do it?)
i think that i made this solution for SplitsNames but i can access this directly by profCtrl.SelectedProfileInfo.SplitName

@topeterk
Copy link
Owner

topeterk commented Oct 7, 2025

I can have a look that I change it with the merge commit.
I am not sure, if I can make changes to your branch directly.

@topeterk topeterk merged commit 350d3c9 into topeterk:master Oct 7, 2025
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