Raised This Month: $32 Target: $400
 8% 

Solved [HL2DM] Menu/Panel API - Rendering Issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dubbeh
Senior Member
Join Date: Jul 2007
Old 01-28-2023 , 08:18   [HL2DM] Menu/Panel API - Rendering Issues
Reply With Quote #1

Hey Everyone,

Is it just me having issues with the HL2 DM Menu/Panel API under the latest Sourcemod or a known issue?

Menu/Panels are created ok, but fail to render on a clients screen.

This is under windows 10, running a local dedicated server

Update: Running the latest AMD drivers 22.11.2 incase it's a driver rendering issue, the menu code is working fine under other mods too.

The code is pretty much a direct copy from the Wiki, snippet below:

Code:
public void OnPluginStart()
{
	RegConsoleCmd("sm_paneltest", Command_PanelTest);
	RegConsoleCmd("sm_menutest", Command_MenuTest);
}

public Action Command_PanelTest(int iClient, int iArgs)
{
	pPanelTest = new Panel();

	pPanelTest.SetTitle("Panel Test:");

	pPanelTest.DrawItem("Choice 1");
	pPanelTest.DrawItem("Choice 2");

	pPanelTest.Send(iClient, PanelTestHandler, 20);

	delete pPanelTest;

	return Plugin_Handled;
}

public int PanelTestHandler(Menu menu, MenuAction action, int param1, int param2)
{
    if (action == MenuAction_Select) {
        CReplyToCommand(param1, "You selected item: %d", param2);
    } else if (action == MenuAction_Cancel) {
        CReplyToCommand(param1, "Client %d's menu was cancelled.  Reason: %d", param1, param2);
    }
    return 0;
}

public Action Command_MenuTest(int client, int args)
{
    Menu menu = new Menu(Menu_Test_Handler);
    menu.SetTitle("Do you like apples?");
    menu.AddItem("yes", "Yes");
    menu.AddItem("no", "No");
    menu.ExitButton = false;
    menu.Display(client, 20);
 
    return Plugin_Handled;
}

public int Menu_Test_Handler(Menu menu, MenuAction action, int param1, int param2)
{
    /* If an option was selected, tell the client about the item. */
    if (action == MenuAction_Select)
    {
        char info[32];
        bool found = menu.GetItem(param2, info, sizeof(info));
        PrintToConsole(param1, "You selected item: %d (found? %d info: %s)", param2, found, info);
    }
    /* If the menu was cancelled, print a message to the server about it. */
    else if (action == MenuAction_Cancel)
    {
        PrintToServer("Client %d's menu was cancelled.  Reason: %d", param1, param2);
    }
    /* If the menu has ended, destroy it */
    else if (action == MenuAction_End)
    {
        delete menu;
    }

    return 0;
}
Using:
SM Dev 1.12 - build 6972
MM : Source 1.12 - build 1165
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome

Last edited by dubbeh; 01-28-2023 at 14:49.
dubbeh is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 01-28-2023 , 13:42   Re: [HL2DM] Menu/Panel API - Rendering Issues
Reply With Quote #2

HL2DM only uses esc menus, which valve disabled by default in an update - client cvar "cl_showpluginmessages"

I made a plugin that guides players to re-enable it.
https://github.com/Alienmario/plugin-messages-assist
Alienmario is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 01-28-2023 , 14:48   Re: [HL2DM] Menu/Panel API - Rendering Issues
Reply With Quote #3

Ty Alienmario, would have had no idea if you didn't mention this.

I discovered this testing Radio after the post you made
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh 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 09:33.


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