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

Outputs for vgui_screen #264

Merged

Conversation

Petercov
Copy link

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.

KeyValues* pkvCommand = pKeyValues->FindKey(s_nCommandDataSymbol);
if (pEntity && pkvCommand)
{
pEntity->HandleEntityCommand(pPlayer, pkvCommand);

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?

Copy link
Author

@Petercov Petercov Dec 23, 2023

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

@Yankumo-Koishi
Copy link

Yankumo-Koishi commented Dec 24, 2023

Could you clearly describe how it fires inputs to entities, I checked the files in Sin Episode before but I'm still confused

@se10leptakamara
Copy link

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.

@Blixibon Blixibon merged commit a8d69e5 into mapbase-source:develop Jan 4, 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.

5 participants