D:\cygwin\wf_fusion_src_r8\CVSROOT\ui\ui_handbook_recon.c

/*
==============================================================================
The Weapons Factory - 
  
Modified code by Keith Pase

Copyright (C) 1997-2003 Weapons Factory Software

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

  ui_recon_handbook.c -- recon handbook
  

==============================================================================
*/

#include "ui_local.h"

static menuframework_s  s_handbook_recon_menu;
static char **recontext;

void Handbook_recon_MenuInit( void )
{
    int y = 0;
    int y_offset = UI_StringHeightOffset ( 0 );
    pmodelitem_t    *pmodelitem;

    s_handbook_recon_menu.x = uis.vidWidth / 2;
    s_handbook_recon_menu.y = uis.vidHeight / 2 - (130/uis.screensizeoffset_y);
    s_handbook_recon_menu.nitems = 0;

    Menu_AddNavHandbook( &s_handbook_recon_menu,1,qtrue);

    Menu_Init ( &s_handbook_recon_menu );

    ui_RegisterPModelItem( "playerconfig_menu_model", "slash", "redrecon", NULL, 0);
    pmodelitem = ui_PModelItemFindByName ("playerconfig_menu_model");
}

void Handbook_recon_MenuDrawText (void)
{
    int xm = 150/uis.screensizeoffset_x;
    int ym = 100/uis.screensizeoffset_y;

    M_Text_MenuDraw(recontext,xm,ym,M_yOffset(10), 30);
}



void Handbook_recon_MenuDraw(void)
{
    int y = 0;
    int x = uis.vidWidth - 536/(uis.screensizeoffset_x*uis.HandbookModelOffset_x);
    
    M_Nav_Draw();
    Menu_AdjustCursor( &s_handbook_recon_menu, 1 );
    Menu_Draw( &s_handbook_recon_menu );
    Handbook_recon_MenuDrawText();

    ui_DrawPModel( "playerconfig_menu_model", 450, x, 2, 0 );

}

const char *Handbook_recon_MenuKey( int key )
{
    switch ( key )
    {
        case K_ESCAPE:
            M_FreeText();
            M_Menu_Handbook_f ();
            return menu_out_sound;

        default:
            return Default_MenuKey( &s_handbook_recon_menu, key );
    }
}

void M_Menu_Handbook_recon_f (void)
{
    Handbook_recon_MenuInit();
    M_PushMenu( &s_handbook_recon_menu, Handbook_recon_MenuDraw, Handbook_recon_MenuKey );
    recontext = M_Menu_Text_f("handbook/recon.txt");
}