Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Опубликовано:

I'm trying to make a popup menu appear when the user presses the "center view" key. I have the waittill, blah blah blah bit working, but instead of the menu popping up, the HUD disappears and a cursor shows up for about 1/4 of a second, then everything goes again. Here's the menu:

 

#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"

#define CHOICE_GROUP			"quickcommands"

#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"

#include "ui_mp/popupstyle.inc"	
#include "ui/choices_setup_popmenu.menu"

#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X			186

#undef CHOICE_POPUP_BACKCOLOR
#define CHOICE_POPUP_BACKCOLOR  0.2 0.2 0.22 0.65

#define ORIGIN_QUICKMESSAGEWINDOW		0 16

{
menuDef
{
	IMPROVED_POPUP_SETUP_ONOPEN( menuShopMain, 10, 4, 210, ;, setDvar cl_bypassMouseInput "1";, 0 )
	onClose{ setDvar cl_bypassMouseInput "0" }

	CHOICE_POPMENU_TITLE( "Shop" )

	itemDef
	{
		name			"window"
		group			ingamebox
		visible			1
		rect			16 20 0 0
		origin			ORIGIN_QUICKMESSAGEWINDOW
		forecolor		1 1 1 1
		textfont		UI_FONT_NORMAL
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textaligny		8
		text			"Weapons"
		decoration
	}
	execKey "1" { scriptMenuResponse "1"; close menuShopMain }

	itemDef
	{
		name			"window"
		group			ingamebox
		visible			1
		rect			16 36 0 0
		origin			ORIGIN_QUICKMESSAGEWINDOW
		forecolor		1 1 1 1
		textfont		UI_FONT_NORMAL
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textaligny		8
		text			"Perks"
		decoration
	}
	execKey "2" { scriptMenuResponse "2"; close menuShopMain }

	itemDef
	{
		name			"window"
		group			ingamebox
		visible			1
		rect			16 52 0 0
		origin			ORIGIN_QUICKMESSAGEWINDOW
		forecolor		1 1 1 1
		textfont		UI_FONT_NORMAL
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textaligny		8
		text			"Killstreaks"
		decoration
	}
	execKey "3" { scriptMenuResponse "3"; close menuShopMain }

	itemDef
	{
		name			"window"
		group			ingamebox
		visible			1
		rect			16 68 0 0
		origin			ORIGIN_QUICKMESSAGEWINDOW
		forecolor		1 1 1 1
		textfont		UI_FONT_NORMAL
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textaligny		8
		text			"Equipment"
		decoration
	}
	execKey "4" { scriptMenuResponse "4"; close menuShopMain }

	itemDef
	{
		name			"window"
		group			ingamebox
		visible			1
		rect			16 84 0 0
		origin			ORIGIN_QUICKMESSAGEWINDOW
		forecolor		1 1 1 1
		textfont		UI_FONT_NORMAL
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textaligny		8
		text			"Refill Weapon Ammo ($500)"
		decoration
	}
	execKey "5" { scriptMenuResponse "5"; close menuShopMain }

	itemDef
	{
		name			"window"
		visible			1
		rect			16 164 0 0
		origin			ORIGIN_QUICKMESSAGEWINDOW
		forecolor		1 1 1 1
		textfont		UI_FONT_NORMAL
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textaligny		8
		text			"Close Menu"
		decoration
	}
}
}

 

The responding function:

menuShopMain(response)
{
self endon ( "disconnect" );

switch(response)
{
	case 1:
	break;

	case 2:
	break;

	case 3:
	break;

	case 4:
	break;

	case 5:
	break;
}
}

 

And the edit at line 232 of _menus.gsc:

 

else if ( !level.console )
	{
		if(menu == game["menu_quickcommands"])
			maps\mp\gametypes\_quickmessages::quickcommands(response);
		else if(menu == game["menu_quickstatements"])
			maps\mp\gametypes\_quickmessages::quickstatements(response);
		else if(menu == game["menu_quickresponses"])
			maps\mp\gametypes\_quickmessages::quickresponses(response);
		else if(menu == game["menu_shop_main"])
			scripts\altersurvival::menuShopMain(response);
	}

Any replies are appreciated.

Опубликовано:
I am not familiar with "menu_shop_main". How are you loading it and what are you replacing? How are you opening the menu? Through gsc code or dll code?

I assume he's placing it in ui_mp/scriptmenus/ (or wherever it was supposed to be, I forgot) in a downloadable IWD (or just the filesystem for development), and is using the openMenu/openPopupMenu script function to open it.

Опубликовано:

I creating custom menu with using minimap in menu like class its work but not working effects lines :(

where can I find definitions for ownerdraw i need definitions or number of definition with this effect.

thank you in advance for any response

Опубликовано:

Here's the code from cod4 that does the minimap (with all of the players, vehicles, and objectives)

	// Minimap background
itemDef
{
	name			"minimapBG"
	rect			(MINIMAP_X_MP - 14) (MINIMAP_Y_MP - 6) COMPASS_SIZE_MP COMPASS_SIZE_MP
	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	background		"minimap_background"
	ownerdraw		CG_PLAYER_COMPASS_BACK
	visible when ( !selecting_location() );
	decoration
}
// Minimap border
itemDef
       {
       	name			"minimapTickerBorder"
        rect			MINIMAP_X_MP (MINIMAP_Y_MP - 15) MINIMAP_W_MP 14
 	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	background		"minimap_tickertape_background"
          	visible when ( !selecting_location() );
	decoration
       }
// Minimap ticker
itemDef
       {
        name			"minimapTicker"
       	rect			MINIMAP_X_MP (MINIMAP_Y_MP - 12) MINIMAP_W_MP 9
   	origin 			MINIMAP_ORIGIN
        forecolor		1 1 1 1
       	background		"minimap_tickertape_mp"
        ownerdraw		CG_PLAYER_COMPASS_TICKERTAPE_NO_OBJ
	visible when ( !selecting_location() );
	decoration
       }
// Minimap
itemDef
	{
	name			"mini_map"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
	   	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	background		"compass_map_default"
	ownerdraw		CG_PLAYER_COMPASS_MAP
	visible when ( !selecting_location() );
	decoration
  	}     
// Objective pointers
itemDef
{
	name			"compasspointers"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
	   	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	background		"objective_line"
	ownerdraw		CG_PLAYER_COMPASS_POINTERS
	visible when ( !selecting_location() && dvarint( ui_hud_showobjicons ) > 0 );
	decoration
}
  	// Friendlies pointers
itemDef
{
	name			"compassfriendlies"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
    	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	ownerdraw		CG_PLAYER_COMPASS_FRIENDS
	visible when ( !selecting_location() );
}
// Enemy pings
itemDef
{
	name			"compassenemies"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
   	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	ownerdraw		CG_PLAYER_COMPASS_ENEMIES
	visible when ( !selecting_location() );
}
	// Helicopter pointers
itemDef
{
	name			"compasshelicopters"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
   	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	ownerdraw		CG_PLAYER_COMPASS_HELICOPTERS
	visible when ( !selecting_location() );
}
	// Plane pointers
itemDef
{
	name			"compassplanes"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
   	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1
	ownerdraw		CG_PLAYER_COMPASS_PLANES
	visible when ( !selecting_location() );
}
// Player direction indicator
itemDef
{
	name			"compassplayer"
	rect			MINIMAP_X_MP MINIMAP_Y_MP MINIMAP_W_MP MINIMAP_H_MP
   	origin 			MINIMAP_ORIGIN
	forecolor		1 1 1 1//HUD_FOREGROUND_ALPHA
	background		"compassping_player"
	ownerdraw		CG_PLAYER_COMPASS_PLAYER
	visible when ( !selecting_location() );
}

You need to be in a map for it to work.... if you want to have just a minimap display in the main menu you can use this

		itemDef 
	{
		name 		compasspreview
		style 			WINDOW_STYLE_SHADER 
		exp			material( "compass_map_" + dvarString( "dvar with the map name you want to show" ) ); 
		rect			-220 56 243 138 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP 
		origin 			0 0
		visible 		1 
	}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.