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

Fix/Changes: Combobox callback fixes/changes #1073

Closed
wants to merge 1 commit into from

Conversation

NickCloudAT
Copy link
Contributor

With this commit comboboxes won't throw an error for a "nil" callback anymore. For some reason the game can not keep track of callbacks correctly anymore.

Also added a "oldValue" to the onSelect/onChange function of the combobox to ensure the previous set value is still sent.

I would happily have some people test this to see if I broke something or not and give their 2 cent on this.

Some things I'm not yet sure and maybe somebody has a better idea:

  • Should the "oldValue" be nil if "self.selected" is not present or should we set it to the new value?
  • I put "oldValue" as the last argument as to not break compatibility with perhaps already existing comboboxes.

Related issue: #1068

With this commit comboboxes won't throw an error for a "nil" callback anymore.
For some reason the game can not keep track of callbacks correctly anymore.

Also added a "oldValue" to the onSelect/onChange function of the combobox to ensure the previous set value is still sent.
@ZenBre4ker
Copy link
Contributor

Didnt look at your changes but I addressed similar stuff in #984, I believe. Gonna check that tomorrow.

@saibotk
Copy link
Member

saibotk commented Oct 16, 2023

I have investigated this on my own and found the root cause for the issue.

Will open a PR to fix this without extra clean up functions, but why exactly are you adding the oldValue here? Do we need this?

@saibotk
Copy link
Member

saibotk commented Oct 16, 2023

@ZenBre4ker actually you made the same mistake:
https://github.com/TTT-2/TTT2/pull/984/files#diff-a910efa517f7a2fbab8e7128c8091e74f3e0af9cc28e617e969c31612c317c60R104

Will write up the explanation in my PR

@saibotk
Copy link
Member

saibotk commented Oct 16, 2023

Closed in favor of #1075

Thanks for investigating and writing this up!

@saibotk saibotk closed this Oct 16, 2023
@NickCloudAT NickCloudAT deleted the combobox-fix branch October 17, 2023 19:13
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.

3 participants