The second link is done by opening a
hidden info VGUI panel (essentially
ShowMOTDPanel but not visible) to a page that runs JavaScript's
window.open() to open a secondary popup window that is rendered in its own modal window.
I'm going to use the
Advanced ShowMOTDPanel function stock just because you'd have to remake ShowMOTDPanel to be hidden:
Code:
// in the plugin
#include <advanced_motd>
// in some callback
AdvMOTD_ShowMOTDPanel(client, "hidden page", "http://hostedcontent/makepopup", MOTDPANEL_TYPE_URL, false);
Code:
<!-- at http://hostedcontent/makepopup -->
<script>
window.open("http://hostedcontent/interactive", "_blank", `width=${screen.width},height=${screen.height}`);
</script>
Code:
<!-- at http://hostedcontent/interactive -->
<!-- your interactive HTML here -->
The custom CS:GO Battle Royale mode is a bit more complex under the hood (it does some fancy tricks with WebSockets between the hidden / visible views to make things run a bit more smoothly), but the same principles apply.
If you're on CS:GO and just want chat triggers / commands, grab your choice of Web Shortcuts plugin and load pages through that.
If you're working on a plugin yourself, I'd recommend using
VGUI URL Cache Buster and use
ShowMOTDPopupPanel in
the included stock file. It also fixes other MOTD panel issues being caused by Steam. (Disclaimer: I wrote this.)
Additional note: CS:GO's popups are a lot faster than TF2's; your experience with other games may vary.
__________________