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

Update player's name on user components and lobby members panel #1164

Merged
merged 2 commits into from Nov 25, 2020

Conversation

braem
Copy link
Member

@braem braem commented Nov 22, 2020

Closes #1162

Unfortunately there's no steam callback for changing names (at least from what I read of the steamworks API), so I took the approach of just updating it more often.

  • Main menu user component updates when drawer is closed. Not on open as you can't see it with the drawer open anyhow.
  • Profile page's user component updates when the tab is clicked on. For some reason OnPageShow isn't being called when opening the drawer though. Intentional?
  • Lobby name & avatar now update with any lobby change.
  • Fixed steam name being always being overwritten by user data in user component (SetUser sets the steam name then calls FillControlsWithUserData that overwrites it with the one in user data). Result though is us not using the locally stored username.

Checklist

  • I have thoroughly tested all of the code I have modified/added/removed to ensure something else did not break
  • If there is a localization token change, I have updated the momentum_english_ref.res file with the changes, ran tokenizer.py to generate an up-to-date localization file, and have committed both the .res file changes and the new localization .txt file
  • If I introduced new h/cpp files, I have added them to the appropriate project's VPC file (server_momentum.vpc / client_momentum.vpc / etc)
  • If I have added or modified any visual assets (models, materials, panels, effects, etc), I have taken screenshots / videos of them and attached them to this PR directly (screenshots uploaded through github, videos uploaded to youtube and linked)
  • If I have modified any console command, console variable, or momentum entity, I have opened an issue (or a PR) for it in the Momentum Mod documentation repository
  • My commits are relatively small and scoped to the best of my ability
  • My branch has a clear history of changes that can be easy to follow when being reviewed commit-by-commit
  • My branch is functionally complete; the only changes to be done will be those potentially requested in code review

@SCell555
Copy link
Member

Doesn't PersonaStateChange_t callback get fired for local player?

@braem
Copy link
Member Author

braem commented Nov 23, 2020

Doesn't PersonaStateChange_t callback get fired for local player?

It does, didn't realize that. Makes things much nicer :D. Didn't realize the avatar panel does this so just need to focus on names here.

TF2 should do this.. they only update player name on main menu when doing certain actions :x

@braem braem changed the title Update player's name & avatar more often Update player's name on user components and lobby members panel Nov 23, 2020
@braem
Copy link
Member Author

braem commented Nov 23, 2020

I moved the lobby callback to DrawerPanel_Lobby so I could update the lobby owner name.

@braem braem force-pushed the fix/name-update branch 2 times, most recently from 963cb05 to 4cff1d9 Compare November 23, 2020 20:28
Copy link
Member

@Gocnak Gocnak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually slight change I noticed

mp/src/game/client/momentum/ui/controls/UserComponent.cpp Outdated Show resolved Hide resolved
@Gocnak Gocnak merged commit c08f2a1 into develop Nov 25, 2020
@Gocnak Gocnak deleted the fix/name-update branch November 25, 2020 01:56
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.

Changing steam name doesn't update on player card & lobby tab
3 participants