Raised This Month: $ Target: $400
 0% 

Interactive Overlay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oeN.
Junior Member
Join Date: Apr 2018
Old 04-13-2018 , 07:56   Interactive Overlay
Reply With Quote #1

Hi,

I was curious about creating interactive interface (inventory, shop) with clickable objects (images). I did some research and all I found is using Env_screenoverlay to show images on client screen. Now comes the hard part - making it interactive. I know it's possible, don't know if using screen overlay or it's something different. I have found this:
https://youtu.be/M-m7a9-ddRM?t=2m20s
And that's something I'm looking for. Any ideas how it's made?
oeN. is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 04-13-2018 , 08:26   Re: Interactive Overlay
Reply With Quote #2

This is not an overlay. Are several motds with php pages.

Last edited by brunoronning; 04-13-2018 at 08:26.
brunoronning is offline
oeN.
Junior Member
Join Date: Apr 2018
Old 04-13-2018 , 08:32   Re: Interactive Overlay
Reply With Quote #3

Quote:
Originally Posted by brunoronning View Post
This is not an overlay. Are several motds with php pages.
Makes sense now. Using MOTD can do the trick.
oeN. is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 04-13-2018 , 08:35   Re: Interactive Overlay
Reply With Quote #4

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.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 04-13-2018 at 08:36.
nosoop is offline
oeN.
Junior Member
Join Date: Apr 2018
Old 04-13-2018 , 09:00   Re: Interactive Overlay
Reply With Quote #5

Thanks for all the information! Now I should be able to create what I wanted.

Last edited by oeN.; 04-13-2018 at 09:00.
oeN. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode