예제 #1
0
파일: ssd_ui.c 프로젝트: astrotycoon/grace
int set_ssd_data(SSDataUI *ui, Quark *q, void *caller)
{
    int retval = RETURN_SUCCESS;
    
    if (ui && q) {
        if (!caller) {
            /* commit the last entered cell changes */
            TableCommitEdit(ui->mw, FALSE);
        }
        
        if (!caller || caller == ui->col_label) {
            int col;
            if (GetSingleListChoice(ui->col_sel, &col) == RETURN_SUCCESS) {
                char *s = GetTextString(ui->col_label);
                ssd_set_col_label(q, col, s);
                xfree(s);
                
                /* FIXME: this is an overkill */
                update_ssd_ui(ui, q);
            }
        }
    }
    
    return retval;
}
예제 #2
0
bool Menu::Display(int player, page_t page)
{
	int keys = 0;
	const char *str = GetTextString(player, page, keys);

	if (!str)
		return false;

	static char buffer[2048];
	int len = ke::SafeSprintf(buffer, sizeof(buffer), "%s", str);

	CPlayer *pPlayer = GET_PLAYER_POINTER_I(player);

	pPlayer->keys = 0;
	pPlayer->menu = 0;

	UTIL_FakeClientCommand(pPlayer->pEdict, "menuselect", "10", 0);

	pPlayer->keys = keys;
	pPlayer->menu = menuId;
	pPlayer->newmenu = thisId;
	pPlayer->page = (int)page;

	UTIL_ShowMenu(pPlayer->pEdict, keys, -1, buffer, len);

	return true;
}
void Show_Presents(void)
{
	int timeRemaining = 8*ONE_FIXED-ONE_FIXED/2;
	do
	{
		CheckForWindowsMessages();
		{
			char *textPtr = GetTextString(TEXTSTRING_FOXINTERACTIVE);
			int y = (480-AvPMenuGfxStorage[AVPMENUGFX_PRESENTS].Height)/2;
			PlayMenuMusic();
			DrawMainMenusBackdrop();
	
			if (timeRemaining > 6*ONE_FIXED)
			{
			  //	DrawGraphicWithFadingLevel(&Starfield_Backdrop,timeRemaining-7*ONE_FIXED);
//				DrawAvPMenuGfx_Faded(AVPMENUGFX_BACKDROP, 0, 0, 15*ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_LEFTJUSTIFIED);
				FadedScreen((15*ONE_FIXED-timeRemaining*2)/3);
			}
			else if (timeRemaining > 5*ONE_FIXED)
			{
				RenderMenuText(textPtr,MENU_CENTREX,y,6*ONE_FIXED-timeRemaining,AVPMENUFORMAT_CENTREJUSTIFIED);
			}
			else if (timeRemaining > 4*ONE_FIXED)
			{
				RenderMenuText(textPtr,MENU_CENTREX,y,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
			}
			else if (timeRemaining > 3*ONE_FIXED)
			{
				RenderMenuText(textPtr,MENU_CENTREX,y,timeRemaining-3*ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
			}
			
			FlipBuffers();
		}
		#if ALLOW_SKIP_INTRO
		DirectReadKeyboard();	
		#endif
		FrameCounterHandler();
		timeRemaining-=NormalFrameTime;
	}
	#if ALLOW_SKIP_INTRO
	while((timeRemaining>0) && !GotAnyKey);
	#else
	while(timeRemaining>0);// && !GotAnyKey);
	#endif
}
void Show_ARebellionGame(void)
{
	int timeRemaining = 7*ONE_FIXED;
	do
	{
		CheckForWindowsMessages();
		{
			char *textPtr = GetTextString(TEXTSTRING_PRESENTS);
			int y = (480-AvPMenuGfxStorage[AVPMENUGFX_AREBELLIONGAME].Height)/2;
			DrawMainMenusBackdrop();
//			DrawAvPMenuGfx(AVPMENUGFX_BACKDROP, 0, 0, ONE_FIXED+1,AVPMENUFORMAT_LEFTJUSTIFIED);
			PlayMenuMusic();

			if (timeRemaining > 13*ONE_FIXED/2)
			{
//				DrawAvPMenuGfx(AVPMENUGFX_AREBELLIONGAME, MENU_CENTREX, y, 14*ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_CENTREJUSTIFIED);
				RenderMenuText(textPtr,MENU_CENTREX,y,14*ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_CENTREJUSTIFIED);
//				DrawGraphicWithAlphaChannel(&RebellionLogo,timeRemaining*2-13*ONE_FIXED);
 			}
			else if (timeRemaining > 5*ONE_FIXED)
			{
//				DrawAvPMenuGfx(AVPMENUGFX_AREBELLIONGAME, MENU_CENTREX, y, ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
				RenderMenuText(textPtr,MENU_CENTREX,y,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
//				DrawGraphicWithAlphaChannel(&RebellionLogo,0);
			}
			else if (timeRemaining > 3*ONE_FIXED)
			{
//				DrawAvPMenuGfx(AVPMENUGFX_AREBELLIONGAME, MENU_CENTREX, y, (timeRemaining-3*ONE_FIXED)/2,AVPMENUFORMAT_CENTREJUSTIFIED);
				RenderMenuText(textPtr,MENU_CENTREX,y,(timeRemaining-3*ONE_FIXED)/2,AVPMENUFORMAT_CENTREJUSTIFIED);
//				DrawGraphicWithAlphaChannel(&RebellionLogo, ONE_FIXED - (timeRemaining-3*ONE_FIXED)/2);
			}

			FlipBuffers();
		}
		DirectReadKeyboard();	
		FrameCounterHandler();
		timeRemaining-=NormalFrameTime;
	}
	#if ALLOW_SKIP_INTRO
	while((timeRemaining>0) && !GotAnyKey);
	#else
	while(timeRemaining>0);// && !GotAnyKey);
	#endif
}
예제 #5
0
// -----------------------------------------------------------------------------
// CWPPushMessage::GetVersionValue
// -----------------------------------------------------------------------------
//
TUint CWPPushMessage::GetVersionValue( TLex8& aPointer ) const
    {
    // Version-value is a short integer or text. Handle that.
    TUint result( 0 );

    if( !aPointer.Eos() )
        {
        TUint first( aPointer.Peek() );
        
        if( first > KShortIntegerMask )
            {
            result = GetShortInteger( aPointer );
            }
        else
            {
            GetTextString( aPointer );
            }
        }

    return result;
    }
void DrawInternationalizedString(MENU_TEXT_ITEM *itemPtr, int highlighted)
{
	char textBuffer[100];
	char *destPtr = textBuffer;
	char offset;
	
	/* KJL 17:39:03 05/03/97 - I hate Roxby. Due to the way he's set up the menu font
	I have to add 27+'a'-'A' (!) to each letter if I want it *not* to be highlighted. */
	if (!highlighted)
	{
		offset = 27+'a'-'A';	 
	}
	else
	{
		offset = 0;
	}

	if (itemPtr->StringID != TEXTSTRING_BLANK)
	{
		/* copy the string into the buffer */
		char *sourcePtr = GetTextString(itemPtr->StringID);
	
		while(*sourcePtr)
		{
			/* Roxby has a lot to answer for... */
			*destPtr++ = offset + (*sourcePtr++);
		}
   		
		/* if another string follows this string, add a space */
   		if (itemPtr->SecondStringPtr)
		{
			*destPtr++=' ';
		}
   	}
	
	/* add second string, if it exists */
	if (itemPtr->SecondStringPtr)
	{
		char *sourcePtr = itemPtr->SecondStringPtr;
	
		while(*sourcePtr)
		{
			/* Roxby has a lot to answer for... */
			*destPtr++ = offset + (*sourcePtr++);
		}
	}
	
	/* add null terminator to end of string */
	*destPtr = 0;
	
	{
		FONT_DESC packet;
		packet.fontnum = MENU_FONT_1;
		packet.string = textBuffer;
		packet.destx = itemPtr->X;
		packet.desty = itemPtr->Y;
		packet.just = FJ_LEFT_JUST;
		packet.width = 320;

		BLTString(packet);
	}
}
예제 #7
0
// -----------------------------------------------------------------------------
// CWPPushMessage::ParseContentType
// -----------------------------------------------------------------------------
//
void CWPPushMessage::ParseContentType( TLex8& aPointer )
    {
    // Go through the whole content type header.
    while( !aPointer.Eos() )
        {
        // Each parameter might be well-known (integer) or unknown (text)
        if( IsIntegerValue( aPointer ) )
            {
            // For well-known parameters, the token is an integer value
            TUint paramToken( I64LOW( GetIntegerValue( aPointer ) ) );

            // These are filled with results from parsing.
            TInt resultInteger( 0 );
            TPtrC8 resultString;
            
            // Make sure paramToken fits into KParameterTypes table
            if( paramToken 
                < sizeof(KParameterTypes)/sizeof(TParameterCodingType))
                {
                // Get the coding and use it to determine how we should decode 
                // the next parameter value. We actually ignore all results 
                // except short integer (SEC) and text-value (MAC), but the 
                // rest of the parameters have to be parsed anyway.
                TParameterCodingType coding( KParameterTypes[paramToken] );

                switch( coding )
                    {
                    case EQValue:
                        GetQValue( aPointer );
                        break;

                    case EWellKnownCharset:
                        GetWellKnownCharset( aPointer );
                        break;

                    case EVersionValue:
                        GetVersionValue( aPointer );
                        break;

                    case EIntegerValue:
                        GetIntegerValue( aPointer );
                        break;

                    case ETextString:
                        GetTextString( aPointer );
                        break;

                    case EFieldName:
                        GetFieldName( aPointer );
                        break;

                    case EShortInteger:
                        resultInteger = GetShortInteger( aPointer );
                        break;

                    case EConstrainedEncoding:
                        GetConstrainedEncoding( aPointer );
                        break;

                    case EDeltaSecondsValue:
                        GetDeltaSecondsValue( aPointer );
                        break;

                    case ENoValue:
                        GetNoValue( aPointer );
                        break;

                    case ETextValue:
                        resultString.Set( GetTextValue( aPointer ) );
                        break;

                    case EDateValue:
                        GetDateValue( aPointer );
                        break;

                    default:
                        break;
                    }

                // We have a result. We're actually only interested in
                // SEC and MAC parameters, so we save them here.
                switch( paramToken )
                    {
                    case KWSPHeaderSEC:
                        iSEC = resultInteger;
                        break;

                    case KWSPHeaderMAC:
                        iMAC.Set( resultString );
                        break;

                    default:
                        break;
                    }
                }
            }
        else
            {
            // Unknown parameter. Its name is in text, and the value
            // might be an integer or text.
            GetTokenText( aPointer );
            if( IsIntegerValue( aPointer ) )
                {
                GetIntegerValue( aPointer );
                }
            else
                {
                GetTextValue( aPointer );
                }
            }
        }
    }
예제 #8
0
// -----------------------------------------------------------------------------
// CWPPushMessage::ParseInitiatorURI
// -----------------------------------------------------------------------------
//
void CWPPushMessage::ParseInitiatorURI( TLex8& aPointer )
    {
    iInitiator.Set( GetTextString( aPointer ) );
    }
예제 #9
0
파일: cheat.c 프로젝트: Scraft/avpmp
void HandleCheatModes(void)
{
	PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr);
	
	#if 1
	playerStatusPtr->securityClearances = 0;
	#else
	/* KJL 16:28:54 05/11/97 - reveal map */
	if (KeyboardInput[KEY_F9])
	{
		extern SCENE Global_Scene;
		extern int ModuleArraySize;
		MODULE **moduleList;
   		int i;
		
		moduleList = MainSceneArray[Global_Scene]->sm_marray;

		for(i = 0; i < ModuleArraySize; i++)
		{
			MODULE *modulePtr = moduleList[i];

			if (modulePtr && modulePtr->m_mapptr)
			{
				modulePtr->m_flags |= m_flag_visible_on_map;
			}
		}    					       
		NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED));
	}
		
			
//#if !GAMEFLOW_ON
#if 0

	/* give all security levels */	
	if (KeyboardInput[KEY_F10])
	{
		playerStatusPtr->securityClearances = 0xffffffff;
		NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED));
	}
	if (KeyboardInput[KEY_F5])
	{
		playerStatusPtr->securityClearances = 0x3f;
		NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED));
	}
#endif

	#if 1
	/* give all weapons & ammo */
	if((KeyboardInput[KEY_F11]))
    {
 	}
	#endif
	/* give immortality */
	if (KeyboardInput[KEY_F12])
	{
		if(AvP.Network==I_No_Network)
		{
			NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED));
			playerStatusPtr->IsImmortal = 1;
		}
		else
		{
			/* commit suicide */
			CauseDamageToObject(Player->ObStrategyBlock, &certainDeath, ONE_FIXED,NULL);
		}
	}
	#endif
}