Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

OHELP.H Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

OHELP.H

Go to the documentation of this file.
00001 //Filename    : OHELP.H
00002 //Description : Header file of object Help
00003 
00004 #ifndef __OHELP_H
00005 #define __OHELP_H
00006 
00007 //----------- Define constant -------------//
00008 
00009 #define NULL 0
00010 
00011 enum {                                            // Maximum no. of help info allowed
00012     MAX_HELP_INFO=200
00013 };
00014 
00015 //------------------------------------------//
00016 //
00017 // Structure of the HELP.RES :
00018 //
00019 // <Area X1>, <Area Y1>, <Area X2>, <Area Y2>
00020 // <Help Title>
00021 // <Help Text>
00022 //
00023 // <Page Break Code, CTRL-L>
00024 //
00025 // <Area X1>, <Area Y1>, <Area X2>, <Area Y2>
00026 // <Help Title>
00027 // <Help Text>
00028 //      .
00029 //                .
00030 // (Another help block, continue)
00031 //
00032 //------------------------------------------//
00033 
00034 //---------- Define struct HelpInfo ------------//
00035 
00037 struct HelpInfo {
00038     enum { HELP_CODE_LEN=8, HELP_TITLE_LEN=100 };
00039 
00040     char  help_code[HELP_CODE_LEN+1];               // either identify the help message by help code or area position
00041     short area800x600_x1, area800x600_y1, area800x600_x2, area800x600_y2;
00042     short area1024x768_x1, area1024x768_y1, area1024x768_x2, area1024x768_y2;
00043     short monster_human_interface;                  // 0 when display for both interfaces
00044     // 1 when display only for monster interface
00045     // 2 when display only for human interface
00046 
00047     char  help_title[HELP_TITLE_LEN+1];
00048 
00049     char* help_text_ptr;                            // offset of the help text in the text buffer
00050     short help_text_len;                            // length of the help text
00051 };
00052 
00053 class Blob2DW;
00054 class VgaBuf;
00055 
00058 class HelpSaveScreen {
00059     char      clear_flag;
00060     char      hiding_flag;
00061     char      hide_area_count;
00062     char      dummy;
00063     short       save_scr_x1, save_scr_y1, save_scr_x2, save_scr_y2;
00064 
00065 public:
00066     HelpSaveScreen();
00067     ~HelpSaveScreen();
00068 
00069     void      init();
00070     void      deinit();
00071     void      swap( HelpSaveScreen &);
00072 
00073     void      save_scr(int x1, int y1, int x2, int y2, VgaBuf* =0 );
00074     void      rest_scr(VgaBuf* =0, int keepUnclear=0 );
00075     void      hide_area(int x1, int y1, int x2, int y2);
00076     void      show_area();
00077     void      clear();
00078     void      unclear();
00079     int     is_clear();
00080 
00081     Blob2DW   *save_scr_buf;                      // have a save screen buffer for displaying the helpial text
00082 };
00083 
00084 //-----------------------------------------------//
00085 
00088 class Help {
00089 public:
00090     enum      { SCREEN_CODE_LEN=8 };
00091     enum      { CUSTOM_HELP_TITLE_LEN=80, CUSTOM_HELP_DETAIL_LEN=200 };
00092 
00093     char      custom_help_title[CUSTOM_HELP_TITLE_LEN+1];
00094     char      custom_help_detail[CUSTOM_HELP_DETAIL_LEN+1];
00095 
00096     char      help_code[HelpInfo::HELP_CODE_LEN+1];
00097     short     help_x, help_y;
00098     short     help_x1, help_y1, help_x2, help_y2;
00099 
00100     short       help_info_count;
00101 
00102     // ##### begin Gilbert 9/9 ######//
00103     short     first_help_by_help_code;
00104     short     last_help_by_help_code;
00105     short     first_help_by_area;
00106     short     last_help_by_area;
00107     // ##### end Gilbert 9/9 ######//
00108 
00109     HelpInfo    *help_info_array;
00110     char        *help_text_buf;
00111     int     help_text_buf_size;
00112 
00113     HelpSaveScreen  long_save_buf;
00114     HelpSaveScreen  short_front_buf;
00115     HelpSaveScreen  short_back_buf;
00116 
00117     short     last_mouse_x;
00118     short     last_mouse_y;
00119     int     mouse_still_time;
00120 
00121 public:
00122     Help();
00123     ~Help();
00124 
00125     void       init(char* resName);
00126     void       deinit();
00127 
00128     void       load(char*);
00129 
00130     void      push_screen(char* screenCode);
00131     void      pop_screen();
00132     void      set_screen(char* screenCode);
00133 
00134     void      set_help(int x1, int y1, int x2, int y2, char* helpCode);
00135     void      set_help2(int x1, int y1, int width, int height, char* helpCode);
00136     void      set_unit_help(int unitId, int rankId, int x1, int y1, int x2, int y2);
00137     void      set_custom_help(int x1, int y1, int x2, int y2, char* helpTitle, char* helpDetail=NULL);
00138 
00139     int     should_disp();
00140     void       disp();
00141     void      disp_help(int centerX, int centerY, char* helpTitle, char* helpDetail);
00142 
00143     void      disp_short_help(VgaBuf *);
00144     void      hide_short_help(VgaBuf *);
00145     void      hide_area(int x1, int y1, int x2, int y2);
00146     void      show_area();
00147 
00148     void      flip();
00149 };
00150 
00151 //-----------------------------------------------//
00152 
00153 extern Help help;
00154 #endif

Generated on Fri Aug 23 01:37:58 2002 for VirtualU by doxygen1.2.17