-
Notifications
You must be signed in to change notification settings - Fork 140
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
Outputs for vgui_screen #264
Outputs for vgui_screen #264
Conversation
KeyValues* pkvCommand = pKeyValues->FindKey(s_nCommandDataSymbol); | ||
if (pEntity && pkvCommand) | ||
{ | ||
pEntity->HandleEntityCommand(pPlayer, pkvCommand); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is only used for vgui screens, instead of adding never-used CBaseEntity::HandleEntityCommand()
, wouldn't it make more sense to name the command something like "VGuiScreenCommand", checking entity type (classname or dynamic cast) here then handling it in CVGuiScreen::OnVGuiCommand()
, keeping everything localised?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intended that handler function to be generic, so other entity types could easily use it.
Edit: I originally designed that function for this entity: https://github.com/Petercov/Source-PlusPlus/blob/ec8c0337670a4de320502a8cc2855b3bb760f5ec/src/game/server/Human_Error/hlss_combine_interface.cpp#L218-L249
Could you clearly describe how it fires inputs to entities, I checked the files in Sin Episode before but I'm still confused |
… when the vgui_screen loses focus
Thank you so much for this PR, I was finally able to receive outputs from my VGUI Screens! This is a lifesaver, I'd love to see this merged to Mapbase in the future. |
Addresses #263
I had this already done from playing with the SiN Episodes maps in my mod. Any output on the vgui_screen entity that starts with a tilde (~) will be fired by the panel recieving a vgui command from its children that matches the string following the tilde.