home *** CD-ROM | disk | FTP | other *** search
/ Fun Online 1997 April / FOL0497.iso / win95 / tvml.z / atlas.tvm < prev    next >
Text File  |  1997-02-27  |  185KB  |  8,286 lines

  1. local
  2.  
  3.     int    bit_type=8
  4.     int    yes=1,no=0
  5.     int    cd_virsion=yes
  6.     int     make_3ds_to_bin=no
  7.     int    busy_mover
  8.     int    interface_on_screen
  9.     int    popups_are_on
  10.     int    new_index[0]
  11.     int    old_index[266]
  12.  
  13.     int    text_down_id 
  14.     int    text_up_id 
  15.     int    change_text
  16.  
  17.     int    tile_game_left
  18.     int    tile_game_right
  19.  
  20.  
  21.     int    test_prog=1
  22.     int    loadphoto
  23.     int    big_start
  24.     int    tile_speed
  25.     int     random_moves
  26.     int    exit_tile
  27.     int    total_moves
  28.     int    help_game1
  29.     int    help_id_on
  30.  
  31.  
  32.     int    fun_facts_on[270]
  33.     int    kf_pic_on[270]
  34.     int     kf_txt_on[270]
  35.     int     pic_txt_on[270]
  36.  
  37.  
  38.     int    rnd_pic_check[266]
  39.     int    rnd_pic_cnt
  40.     int    af_pic_on[266]
  41.     int    af_txt_on[266]
  42.     int    da_txt_on[266]
  43.     int    vid_txt_on[266]
  44.  
  45.     int    last_cap_count
  46.     int    set_up_film
  47.     int    popup_the_sprite
  48.     int    small_map1
  49.     int    small_map2
  50.     int    small_map3
  51.     int    small_map4
  52.  
  53.     int    flag_id_on
  54.     int    photo_id_on
  55.  
  56.  
  57.     int     last_sprite_country
  58.  
  59.     int    up_id_on
  60.     int    down_id_on
  61.     int    list_id_on
  62.     int    fun_id_on
  63.     int    d3_id_on
  64.     int    where_id_on
  65.     int    zoom_id_on
  66.     int    country_left_id
  67.     int    country_right_id
  68.     int    back_button_id
  69.  
  70.  
  71.  
  72.     int    flag_id_on_main
  73.     int    photo_id_on_main
  74.     int    up_id_on_main
  75.     int    down_id_on_main
  76.     int    list_id_on_main
  77.     int    fun_id_on_main
  78.     int    d3_id_on_main
  79.     int    where_id_on_main
  80.  
  81.  
  82.     int    country_left_id_main
  83.     int    country_right_id_main
  84.     int    back_button_id_main
  85.  
  86.     int    zoom_id_on_main
  87.  
  88.  
  89.  
  90.  
  91.     int    bar_map1
  92.     int    bar_map2
  93.     int    bar_map3
  94.     int    bar_map4
  95.  
  96.     int    current_bar_c
  97.  
  98.     int    bar_text_map1
  99.     int    bar_text_map2
  100.     int    bar_text_map3
  101.     int    bar_text_map4
  102.     int    bar_text_map_lable
  103.  
  104.     photo_cr as string[300]
  105.     circle_id as int[10]
  106.     flood_id as int[10][10]
  107.     lable_id as int[10][10]
  108.     line_id as int[10][10]
  109.  
  110.     cir_key as int[10]
  111.     cir_cir as int[10]
  112.     cir_cir_fill as int[10]
  113.  
  114.     not_avail1 as int[5]
  115.     not_avail2 as int[5]
  116.  
  117.     int    small_start
  118.     int    country_set
  119.     int    combo_small_start
  120.     int    combo_small
  121.     int    combo_big_start
  122.     int    combo_big
  123.     int    sprites_on
  124.     int    loadphoto_l
  125.     int    flag_hold,dummy
  126.     int    count_key_facts
  127.     load_ext as filename
  128.     int     objHTMLBox1
  129.     int     objHTMLBox2
  130.     int     objHTMLBox3
  131.     load_ext2 as filename
  132.     load_ext3 as filename
  133.     load_ext4 as filename
  134.     load_3ds_cd_files as filename
  135.     int    id,id1,id2,count_extra,count,letter_count,next_image,new_number,x,y,l,count_c
  136.     int    radius,start_x,start_y,mode,sect,p_count,draw_first,max_des_key
  137.     int    world_map=-1,large_text_button=4,large_pic=2,big=100,small=1,games=11,fun_facts=12
  138.     int    show_dates=14,show_amasing=15,show_film=16,games1=21,games2=22
  139.     int    down=1,up=0,where=9,a
  140.     int    graph[5],red[11],green[11],blue[11],pie_desc[11],pie_number[11],pie_number_old[11],total_slides[300]
  141.     int    land_name[300][6],land_number[300][6],labor_name[300][10],labor_number[300][10]
  142.     int    rel_name[300][10],rel_number[300][10]
  143.     
  144.     key_facts_local as filename
  145.     key_facts as filename
  146.     key_facts_vid as filename
  147.  
  148.     int    show_3d_interface
  149.     int    total_images,count3,count2,def_count,count_pos,line_pos
  150.     int    CurrentObject=1
  151.     read_text as string[25]
  152.     int    click_it[200]
  153.     int    play_it[200]
  154.     int    on_3d
  155.     int    check_text
  156.     int    show_flag
  157.  
  158.     int    show_where
  159.     string abc
  160.     string overview[10]
  161.     int    total_over
  162.  
  163.     int    map_on_screen
  164.     int    flag_on_screen
  165.  
  166.     int    new_country_text
  167.     int    loop_exit=0
  168.  
  169.     int     pop_up_small
  170.     int     pop_up_big
  171.     int    hit_3d=0
  172.  
  173.     int    show_3d[20]
  174.     int    click3d
  175.  
  176.     string    show_3d_desc[30]
  177.  
  178.  
  179.     string    small_cap[0],large_cap[0]
  180.  
  181.     string    popup_cap_l[830],popup_cap_s[830]
  182.  
  183.     float    one_rad,angle,flood_angle,total_angle,new_x,new_y,lable_x,lable_y,max,form,check_the_per
  184.     float    the_per[5],bar1[5],old_max
  185.  
  186.     filename country,check_file,menu_load,file_name
  187.  
  188.     string    country_code,check,slide_txt,current_country,header_top,header_text
  189.     string    area[266],prod[300],pop[300],graph_name[5],country_list[300],number[10],name[10],des_key[11]
  190.     string    list_1[0],list_2[0],list_3[0]
  191.  
  192.     server_icons as filename 
  193.     server_cache as filename 
  194.     server as filename 
  195.     server_local as filename 
  196.     server_sounds as filename 
  197.     server_maps as filename 
  198.     server_menu as filename 
  199.     server_games as filename
  200. //    the_main_path as filename =`http://194.80.180.23/web/`
  201.     the_main_path as filename =`http://www.fol.de/`
  202.  
  203.  
  204.  
  205.     main as string
  206.     new_line as string
  207.     total_lines as string[100]
  208.     total    as int
  209.     stop_scroll as int
  210.     int line_cnt   
  211.     int new_len
  212.     int current_pos
  213.     main2 as string
  214.     int lines_shown
  215.  
  216.  
  217.  
  218.  
  219.     include `apps\world\data-ge.tvm`
  220.  
  221.     include `apps\world\games\global.tvm`
  222.     include `apps\world\games\grid.tvm`
  223.     include `apps\world\games\quick.tvm`
  224.  
  225.  
  226.  
  227. //    include `apps/world/newworld/code/rwvars.tvm`
  228.  
  229.  
  230. /**************** Renderware ******************/
  231.  
  232.     const
  233.         boolean WantRenderWareModels = false
  234.         boolean WantRenderWareConvertMessages = false
  235.         boolean animtest = false
  236.  
  237.         boolean CreateBinary = FALSE, LoadBinary = FALSE, AlwaysLoad = TRUE
  238.  
  239.         homepath as filename = ``
  240.         CreateDir as filename = `c:\wolf\`
  241.         LocalSource as boolean = TRUE
  242.  
  243.         LocalSourceDir as filename   = `apps/cache`
  244.         RemoteSourceDir as filename  = the_main_path+`tvml/apps/world/newworld/3d`
  245. //        RemoteSourceDir as filename = `http://www.mbay.net/~tvml/apps`
  246.  
  247.         LocalTextureDir as filename = `apps\world\textures\`
  248.         RemoteTextureDir as filename = `http://www.tvml.co.uk/apps/wolf/maps/`
  249.  
  250.         MAXOBJECTS as int = 1
  251.         MAXPARTS as int =300
  252.  
  253.         DEFAULT_WINDOW_WIDTH    as int=320
  254.         DEFAULT_WINDOW_HEIGHT   as int=240
  255.  
  256.         MAXIMUM_WINDOW_WIDTH    as int=640
  257.         MAXIMUM_WINDOW_HEIGHT   as int=480
  258.  
  259.     var
  260.         int winxpos=14, winypos=65
  261.         int xpos=0, ypos=0
  262. //        int xpos=192, ypos=144
  263.         int w=640, h=480
  264.  
  265.         SBI_FLAGS bi_default = BI_STATUS|BI_MENU
  266.         SBI_FLAGS bi_flag = bi_default
  267.         int SCX, SCY
  268.  
  269.  
  270.  
  271.  
  272.     const
  273.         int MAXROOMS = 500
  274.  
  275.         
  276.  
  277.  
  278.     var
  279.         filename RoomDir[MAXROOMS]
  280.         filename RoomName[MAXROOMS]
  281.         float Roomdata[MAXROOMS][4]
  282.         Filename BackName[MaxRooms]
  283.         int CurrentRoom, FirstRoom, LastRoom, NumberOfRooms
  284.         RwReal pos[3]
  285.         newroom as int
  286.  
  287. /**************** Renderware ******************/
  288.  
  289.  
  290.  
  291.  
  292.     float ThisRoomData[4]
  293.  
  294.     boolean res
  295.     int olddir = 1
  296.  
  297.  
  298.  
  299. // Room 3D
  300.  
  301.  
  302.     /* Binary /text control flags */
  303.  
  304.  
  305.  
  306. const
  307.     //int FastScale = 2, SlowScale = 1
  308.     int FastScale = 2, SlowScale = 1
  309.     DEFAULT_CAMERA_TILT     as RwReal = 0.0
  310.  
  311.  
  312.     DEFAULT_STEP_HEIGHT     as RwReal = 0.3
  313.  
  314.     MAX_ANIM_TEXTURE        as int = 10
  315.     MAXIMUM_OBJECTS            as int =200
  316.  
  317.             // Maximum forward speed of player
  318.  
  319.     // Freedom control constants
  320.  
  321.     int RotateX = 1, RotateY = 2, RotateZ = 4
  322.     int MoveX   = 8 , MoveY   =16, MoveZ   =32
  323.     int RotateXYZ = RotateX|RotateY|RotateZ
  324.     int MoveXYZ   = MoveX|MoveY|MoveZ
  325.  
  326.     /* What kind of action to take on mouse events. */
  327.     int MMNoAction=0, MMPanAndZoomCamera =1, MMTiltCamera =2, MMHeightCamera =3, MMRotateClump=4, MMMoveClump=5,MMRotateClumpX =6,MMRotateClumpY =7,MMRotateClumpZ=8
  328.  
  329. var
  330.     MaxSpeed as RwReal = 0.4
  331. //    RwStream BStream
  332.     depth as int
  333.     ModelHeight as RwReal
  334.     VScale as int = SlowScale
  335.     RwReal ZoomScale = 1.0
  336.     boolean fast=false, Zoom=false, crouch=false, torch=false, ghost=false
  337.  
  338.     boolean userw = true
  339.  
  340.     RwLight TorchLight
  341.  
  342.     appdir  as filename
  343.     appname as filename
  344.  
  345.     Destroyed as boolean=FALSE
  346.  
  347.     TimerActive as boolean
  348.  
  349.     RoomExitFlag as int
  350.     DEFAULT_CAMERA_HEIGHT   as RwReal = 1.2
  351.     DEFAULT_COL_HEIGHT    as RwReal =DEFAULT_CAMERA_HEIGHT - DEFAULT_STEP_HEIGHT
  352.     MovementSpeed as RwReal
  353.  
  354. var
  355.     at as RwReal[3]
  356.     Scene as RwScene
  357.     Camera as RwCamera
  358.  
  359.     MouseMoveMode as int = MMNoAction
  360.  
  361.     int StartX ,StartY ,LastX ,    LastY ,    Width ,    Height, FirstX, FirstY
  362.  
  363.     CamZDelta as RwReal
  364.     CamPanDelta as RwReal
  365.     CamTilt  as RwReal = DEFAULT_CAMERA_TILT
  366.  
  367.     DragClump as RwClump
  368.     RoomClump as RwClump
  369.  
  370.     Name3d as RwClump
  371.  
  372.     RwReal fforward, pan, floorheight = DEFAULT_CAMERA_HEIGHT
  373.  
  374.     boolean ThreeDInitialized, RoomInitialized
  375.  
  376.     TextureArray as RwTexture[MAX_ANIM_TEXTURE]
  377.     TextureCount as int = 0
  378.  
  379.     BBoxList     as RwReal[MAXIMUM_OBJECTS][2][3]
  380.  
  381.     BBoxList2    as RwReal[MAXIMUM_OBJECTS][2]
  382.     BBoxList2Index as int
  383.  
  384.     objTagsN    as int    [MAXOBJECTS]
  385.     objTags        as string [MAXOBJECTS][1 to MAXPARTS]
  386.     //filename BACKDROPFILENAME        =`back.bmp`
  387.     filename BACKDROPFILENAME        =`land.bmp`
  388.     RwRaster *backdrop
  389.  
  390. //    include `apps\world\newworld\code\3dstring.tvm`
  391.  
  392. sub printrwerror( str as string )
  393.     print str, " ", RwStrError( RwGetError() ), "\n"
  394. endsub
  395.  
  396. //    include `apps\newworld\code\room3.tvm`
  397.  
  398. /**********************************************************************
  399.  *
  400.  * File :     room.tvm
  401.  *
  402.  * Abstract : RenderWare room demo for TVML
  403.  *
  404.  **********************************************************************
  405.  *
  406.  * This file is a product of TVML Ltd.
  407.  *
  408.  * This file is provided as is with no warranties of any kind and is
  409.  * provided without any obligation on TVML Ltd.
  410.  *
  411.  * TVML Ltd. will not, under any circumstances, be liable for any
  412.  * lost revenue or other damages arising from the use of this file.
  413.  *
  414.  * Copyright (c) 1995 TVML Ltd
  415.  *
  416.  * All Rights Reserved.
  417.  *
  418.  * RenderWare is a trademark of Canon Inc.
  419.  *
  420.  ************************************************************************/
  421.  
  422. function ReadCompressedModel( rootfile as filename ) as RwClump
  423. local
  424.     cmpfile as filename
  425.     binfile as filename
  426.     int err
  427.     RwStream B
  428.     RwClump clump=NULL
  429.     str as string
  430.     int ctype
  431. end local
  432.  
  433.     if depth = 8 then
  434.         cmpfile = rootfile + `8.cmp`
  435.         binfile = rootfile + `8.bin`
  436.     else
  437.         cmpfile = rootfile + `16.cmp`
  438.         binfile = rootfile + `16.bin`
  439.     endif
  440.  
  441.     // compress will fetch from anywhere including across the net and report errors
  442. //    print "Trying compressed source ", cmpfile, "\n"
  443. //    err = compress ( cmpfile, binfile, TEXT, NONE, NONE )
  444.     if !err then
  445.         B = RwOpenStreamFilename( rwSTREAMREAD, binfile );
  446.         if B == NULL then
  447.             print "Error opening binary stream\n", binfile
  448.             return NULL
  449.         endif
  450.  
  451.         // skip TVML header
  452.         err = !RwReadStream( B, str, 7 );
  453.  
  454.         err |= !RwReadStreamChunkType( B, CType )
  455.         err |= !RwReadStreamChunk( B, rwCHUNKCLUMP,  Clump,  0 )
  456.         if err then
  457.             printrwerror( "Error reading clump chunk from binary " + string( binfile ) )
  458.             return NULL
  459.         endif
  460.  
  461.         RwCloseStreamFile( B )
  462.     endif
  463.  
  464.     return clump
  465.  
  466. end function
  467.  
  468.  
  469.  
  470. function SaveAsBinary( clump as RwClump, where as filename ) as boolean
  471. local
  472.     RwStream B
  473.     int ok
  474.     int err
  475. endlocal
  476.  
  477.     if depth = 8 then
  478.         where += `8`
  479.     else
  480.         where += `16`
  481.     endif
  482.  
  483.     B = RwOpenStreamFilename( rwSTREAMWRITE, where + `.bin` )
  484.  
  485.     if ( B == NULL ) then
  486.         printrwerror( "Error opening stream for write ")
  487.         return false
  488.     endif
  489.  
  490.     ok = RwWriteStreamChunk( B, rwCHUNKCLUMP,  Clump,  rwSAVECHUNKALL );
  491.     if !ok then
  492.         printrwerror( "Error writing clump chunk")
  493.         return false
  494.     endif
  495.  
  496.     ok = RwCloseStreamFile( B );
  497.     if !ok then
  498.         printrwerror( "Error closing stream" ) ;
  499.         return false
  500.     endif
  501.  
  502.     err = compress (where + `.bin`, where + `.cmp`, TEXT, AHUFF, NONE )
  503.  
  504.     if err then
  505.         print "Compress error", err, "\n"
  506.         return false
  507.     endif
  508.  
  509.     return true
  510. end function
  511.  
  512.  
  513.  
  514.  
  515. function OpenBinhary( cmpfile as filename, root as filename, depth inout int ) as RwStream
  516. local
  517.     srcfile as filename
  518.     int err
  519. end local
  520.  
  521.     srcfile = `apps\` + root
  522.     mkdir srcfile
  523.  
  524.     srcfile += `\` + root
  525.     if LocalSource then
  526.         cmpfile += `\` + root + `\` + root
  527.     else
  528.         cmpfile += `/` + root + `/` + root
  529.     endif
  530.  
  531.     RwGetDeviceInfo( rwRENDERDEPTH, depth )
  532.     if depth = 16 then
  533.         srcfile += `16.src`
  534.         cmpfile += `16.cmp`
  535.         print "Using 16-bit data\n"
  536.     else
  537.         srcfile += `8.src`
  538.         cmpfile += `8.cmp`
  539.         print "Using 8-bit data\n"
  540.     endif
  541.  
  542.     print "Checking", srcfile, "\n"
  543.     if AlwaysLoad || !checkfile( srcfile, exists ) then
  544.  
  545.         print "Decompressing", cmpfile, " to ", srcfile, "\n"
  546.         err = compress ( cmpfile, srcfile, TEXT, NONE, NONE )
  547.         if err then
  548.             print "Error decompressing : ", err, "\n"
  549.             remove( srcfile )
  550.             return NULL
  551.         endif
  552.     endif
  553.  
  554.     return RwOpenStreamFilename( rwSTREAMREAD, srcfile )
  555. end function
  556.  
  557.  
  558. function GetMaxBBox( clump as RwClump, bll inout RwReal[3], fur inout RwReal[3] ) as RwClump
  559. local
  560.     RwReal bll1[3], fur1[3]
  561.     int i
  562. end local
  563.  
  564.     RwGetClumpBBox( clump, bll1, fur1 )
  565.     for i = 0 to 2 loop
  566.         bll[i] = fmin( [ bll1[i], bll[i] ] )
  567.         fur[i] = fmax( [ fur1[i], fur[i] ] )
  568.     end for
  569.  
  570.     return clump
  571. end function
  572.  
  573.  
  574.  
  575. sub UpdateTorch( pos inout RwReal[3] )
  576. local
  577.     pos2 as RwReal[3]
  578. end local
  579.     
  580.     RwSetLightPosition( TorchLight, pos[0], pos[1], pos[2] )
  581.     RwGetCameraLookAt( Camera, pos2 )
  582.     RwSetLightVector( TorchLight, pos2[0], pos2[1], pos2[2] )  //+random()
  583. end sub
  584.  
  585.  
  586. function CreateTorch() as boolean
  587.     TorchLight = RwCreateLight(rwDirectional, -0.5, 1.0, 0.5, 1.0)
  588.     if (TorchLight == NULL) then
  589.         print "Error creating the RenderWare torch light\n"
  590.         return FALSE
  591.     endif
  592.  
  593.     RwSetLightColor( TorchLight, 0.3, 0.3, 0.3 )
  594.     RwSetLightState( TorchLight, rwOFF )
  595. //    RwSetLightConeAngle( TorchLight, 95.0 )
  596.     RwAddLightToScene(Scene, TorchLight)
  597.     return true
  598. end function
  599.  
  600.  
  601. sub SetViewport( vscale as int )
  602. local
  603.     int w, h
  604. endlocal
  605.  
  606.     WinGetClientRect w, h
  607.     RwSetCameraViewport(Camera, 0, 0, w/vscale, h/vscale )
  608.     RwSetCameraBackdropViewportRect(Camera, 0, 0, w/vscale, h/vscale )
  609. endsub
  610.  
  611.  
  612. /**********************************************************************
  613.  *
  614.  * Functions.
  615.  *
  616.  **********************************************************************/
  617.  
  618.  
  619. function AddAnimTextures(Texture as RwTexture ) as RwTexture
  620. local
  621.     str as string
  622. endlocal
  623.  
  624.     if ( RwGetTextureNumFrames(Texture) > 1 ) then
  625.         RwGetTextureName( texture, str )
  626.         print textureCount, str, '\n'
  627.         TextureArray[TextureCount++] = Texture
  628.     endif
  629.     return Texture
  630. endfunction
  631.  
  632.  
  633.  
  634.  
  635. function LoadTags( object as int, tagfile as filename ) as int
  636. local
  637.     oneline as string
  638.     l as int
  639.     tagstr as string
  640.     tag as int
  641.     n as int=0
  642. end local
  643.  
  644.     tagfile += `.hdr`
  645.     if checkfile( tagfile, exists ) then
  646.         open tagfile for read as #1
  647.  
  648.         while not feof ( #1 ) loop
  649.             oneline = inputline$( #1 )
  650.             if left$( oneline, 12 ) = '#define TAG_' then
  651.                 l = len( oneline )
  652.                 oneline = right$( oneline, l - 12 )
  653.                 tagstr = substr$( ' ', oneline )
  654.                 oneline = left$( oneline, l - len( tagstr ) - 12 )
  655.                 input from tagstr, tag
  656.                 objTags[ object ][ tag ] = oneline
  657.                 n++
  658.             end if
  659.         end while
  660.  
  661.         close #1
  662.     end if
  663.  
  664.     return n
  665. end function
  666.  
  667.  
  668. sub PrintTags( object as int, n as int )
  669. local
  670.     i as int
  671. end local
  672.  
  673.     print n, "tags\n"
  674.     for i=1 to n loop
  675.         print using "'%d' '%s'\n", i, objTags[ object ][i]
  676.     end loop
  677.  
  678. end sub
  679.  
  680.  
  681. function fast_ LocalInit3D( ) as boolean
  682. local
  683.     rectright as int
  684.     rectbottom as int
  685.     Light as RwLight
  686.     string str
  687.     filename fname
  688.     pos as RwReal[3]
  689.  
  690.     filename flamespath
  691.     RwClump flames
  692. endlocal
  693.  
  694. //    Set the shape path to enable texture loading
  695.  
  696. //    RwSetDebugTraceState rwON 
  697.  
  698.     RwGetDeviceInfo( rwRENDERDEPTH, depth )
  699.  
  700.     RwSetShapePath(homepath + LocalTextureDir, rwREPLACE)
  701.     RwSetShapePath(homepath + LocalSourceDir + appdir, rwPOSTCONCAT)
  702. //    RwGetNamedTexture("face.bmp")
  703.     Camera = RwCreateCamera(MAXIMUM_WINDOW_WIDTH, MAXIMUM_WINDOW_HEIGHT)
  704.     if Camera == NULL then
  705.         if RwGetError() == RwErrorCode'E_RW_NOMEM then
  706.             print "Insufficient memory to create the RenderWare camera\n"
  707.         else
  708.             print "Error creating the RenderWare camera\n"
  709.         endif
  710.         return FALSE
  711.     endif
  712.  
  713.     RwTiltCamera(Camera, CamTilt)
  714.     //RwSetCameraBackColor(Camera, 0.5, 0.5, 1.0)
  715.     RwSetCameraViewwindow(Camera, 1.0, 1.0)
  716.         backdrop = RwReadRaster(BACKDROPFILENAME, rwGAMMARASTER | rwDITHERRASTER);
  717.         ifc (backdrop != NULL)   PRINT "READ BACKDROP" RwSetCameraBackdrop(Camera, backdrop)
  718.      RwSetCameraBackdropViewportRect(Camera,0,0,320,240);
  719.     PRINT "HERE"
  720.     RwSetCameraNearClipping( Camera, 0.03 )
  721.  
  722.     Scene = RwCreateScene()
  723.     if Scene = NULL then
  724.         print "Error creating the RenderWare scene\n"
  725.         return FALSE
  726.     endif
  727.  
  728.     //Light = RwCreateLight(rwDIRECTIONAL, 0.1, -1.0, -0.5, 1.0)
  729.         Light = RwCreateLight(rwPoint, 0.3, 1.0, 2.5, 1.0)
  730.     if Light == NULL then
  731.         print "Error creating the RenderWare light\n"
  732.         return FALSE
  733.     endif
  734.  
  735.     //RwAddLightToScene(Scene, Light)
  736.  
  737.     if animtest then
  738.         flamespath = `c:\rwwin\src\sample\rwmaze\`
  739.         RwSetShapePath(flamespath + `TEXTURES`, rwREPLACE)
  740.         RwSetShapePath(flamespath + `SCRIPTS`, rwPOSTCONCAT)
  741.         flames = RwReadShape( `flames.rwx` )
  742.  
  743.         if flames == NULL then
  744.             printrwerror( "Error reading flames clump" )
  745.         else            
  746.             RwAddClumpToScene( Scene, flames )
  747.             RwSetClumpDataInt( flames, 4 )
  748.         endif
  749.     endif
  750.  
  751.     WinGetClientRect rectright, rectbottom
  752.     RwDeviceControl(rwWINSETOUTPUTSIZE, Camera, rectright, rectbottom)
  753.     RwSetCameraViewport(Camera, 0, 0, rectright , rectbottom )
  754.  
  755.     if !CreateTorch() then
  756.         return false
  757.     endif
  758.  
  759.     ThreeDInitialized = TRUE
  760.  
  761.     return TRUE
  762. endfunction
  763.  
  764. /**********************************************************************/
  765.  
  766. sub TidyUp3D()
  767.     if Scene != NULL then
  768.         RwDestroyScene(Scene)
  769.     endif
  770.     if Camera != NULL then
  771.         RwDestroyCamera(Camera)
  772.     endif
  773.     RwClose
  774. endsub
  775. /**************************************************************************/
  776.  
  777. function fast_ AddObj( appdir as filename, appname as filename, height as RwReal, ix as RwReal, iy as RwReal, iz as RwReal, xpos as int, ypos as int ) as boolean
  778. local
  779.     RwConvertOptions opts = optPROTOTYPE|optCOMMENTS|optCENTRE//|optHEADER
  780.     RwTexture cbTexture
  781.     RwClump cbclump, clump
  782.  
  783.     RwReal scale
  784.     int oldtag, newtag, n, i
  785.  
  786.     RwReal bll[3], fur[3]
  787. endlocal
  788. checkandreadpalette(server_local+`factor.pal`)
  789.  
  790.     Set3dsConvertOptions opts|optNORMALIZE, optTEXTUREEXT|optTEXTURE|optFORESHORTEN|optLit|optFIlter, optHS, 1.0, 1.0, 0.3, 0.59, 0.11, 0.5
  791.  
  792.     RoomClump = ReadCompressedModel(LocalSourceDir + appdir + `\` + appname)
  793.  
  794.     //RoomClump = Rw3dsReadShape(LocalSourceDir + appdir + `\` + appname + `.3ds`)
  795.     //SaveAsBinary(RoomClump , LocalSourceDir + appdir + `\` + appname)
  796.  
  797.  
  798.  
  799.     if not WantRenderWareModels then
  800.         remove LocalSourceDir + appdir + `\` + appname + `.rwx`        //may not exist but doesn't matter
  801.     endif
  802.  
  803.     bll[0] = 0;        bll[1] = 5.5;        bll[2] = 0
  804.     fur[0] = 0;        fur[1] = 0;        fur[2] = 0
  805.  
  806.     RwForAllClumpsInHierarchy( RoomClump, GetMaxBBox( cbclump, bll, fur ), cbclump )
  807.     RwForAllClumpsInHierarchy( RoomClump, GetMaxBBox( cbclump, bll, fur ), cbclump )
  808.     fur[1] -= bll[1]
  809.     scale = Height/fur[1]
  810.     scale = 0.2
  811.     RwTranslateMatrix( RwScratchMatrix(), 0, -bll[1], 0, rwREPLACE )
  812.     RwScaleMatrix( RwScratchMatrix(), scale, scale, scale, rwPOSTCONCAT )
  813.     RwTransformClump( RoomClump, RwScratchMatrix(), rwPOSTCONCAT )
  814.  
  815.         RwAddClumpToScene(Scene, RoomClump)
  816.  
  817. end function
  818.  
  819.  
  820. /**********************************************************************/
  821.  
  822. function fast_ AddRoom( appdir as filename, appname as filename, height as RwReal, ix as RwReal, iy as RwReal, iz as RwReal, xpos as int, ypos as int ) as boolean
  823. local
  824.     RwConvertOptions opts = optPROTOTYPE|optCOMMENTS|optCENTRE//|optHEADER
  825.     RwTexture cbTexture
  826.     RwClump cbclump, clump
  827.  
  828.     RwReal scale
  829.     int oldtag, newtag, n, i
  830.  
  831.     RwReal bll[3], fur[3]
  832. endlocal
  833.  
  834.     ifc(cd_virsion==no)
  835.     {
  836.         filecopy(remotesourcedir+`/`+appdir+`/`+appname+`.3ds`,localSourceDir+`/`+appdir+`/`+appname+`.3ds`)
  837.     }
  838.  
  839.  
  840.  
  841.  
  842.  
  843.     checkandreadpalette(server_local+`factor.pal`)
  844.  
  845.     //default_Camera_height=RoomData[currentRoom][4]
  846.     DEFAULT_COL_HEIGHT = DEFAULT_CAMERA_HEIGHT - DEFAULT_STEP_HEIGHT
  847.  
  848.     if RoomData[currentRoom] [0] >15 then
  849.         MovementSpeed=100
  850.         MaxSpeed=20.00
  851.        else
  852.         Movementspeed =500
  853.         Maxspeed =0.2
  854.         end if
  855.  
  856.  
  857.     if RoomClump <> null then
  858.         RoomInitialized = false
  859.         RwDestroyClump( RoomClump )
  860.         RoomClump = null
  861.     endif
  862.  
  863.     if WantRenderWareConvertMessages then
  864.         SetConvertMessageLevel enabled, rwCONVERTVERBOSE
  865.     else
  866.         SetConvertErrorLevel   disabled, rwCONVERTWARN
  867.     endif
  868.  
  869.     Set3dsConvertOptions opts|optNORMALIZE, optTEXTUREEXT|optTEXTURE|optFORESHORTEN|optFilter, optHS, 1.0, 1.0, 0.3, 0.59, 0.11, 0.5
  870.     ifc(cd_virsion==yes)
  871.     {
  872.         RoomClump = ReadCompressedModel(load_3ds_cd_files + appdir + `\` + appname)
  873.     }
  874.     else
  875.     {
  876. print "this is it ",LocalSourceDir + appdir + `\` + appname + `.3ds`
  877.         RoomClump = Rw3dsReadShape(LocalSourceDir + `\` + appdir + `\` + appname + `.3ds`)
  878.     }
  879.  
  880.  
  881.     ifc(make_3ds_to_bin==yes)
  882.     {
  883.         RoomClump = Rw3dsReadShape(LocalSourceDir + appdir + `\` + appname + `.3ds`)
  884.         if RoomClump != NULL then
  885.             SaveAsBinary(RoomClump , LocalSourceDir + appdir + `\` + appname)
  886.         endif
  887.     }
  888.  
  889.     if (RoomClump == NULL) then
  890.         print "Error reading Script\n"
  891.         return FALSE        
  892.     endif
  893.  
  894.     //endif
  895.     
  896. //endloop    
  897.     n = LoadTags( 0, LocalSourceDir + appdir + `\` + appname )
  898.     //remove LocalSourceDir + appname + appdir + `\` + `.hdr`
  899.     objTagsN[ 0 ] = n
  900.  
  901.  
  902.     if not WantRenderWareModels then
  903.         //remove LocalSourceDir + appdir + `\` + appname + `.rwx`        //may not exist but doesn't matter
  904.         null
  905.     endif
  906.  
  907.     bll[0] = 0;        bll[1] = 0.5;        bll[2] = 0
  908.     fur[0] = 0;        fur[1] = 0;        fur[2] = 0
  909.  
  910.     RwForAllClumpsInHierarchy( RoomClump, GetMaxBBox( cbclump, bll, fur ), cbclump )
  911.  
  912.     fur[1] -= bll[1]
  913.     scale = Height/fur[1]
  914.     RwTranslateMatrix( RwScratchMatrix(), 0, -bll[1], 0, rwREPLACE )
  915.     RwScaleMatrix( RwScratchMatrix(), scale, scale, scale, rwPOSTCONCAT )
  916.     RwTransformClump( RoomClump, RwScratchMatrix(), rwPOSTCONCAT )
  917.  
  918.     RwAddClumpToScene(Scene, RoomClump)
  919.  
  920.     if checkfile( LocalSourceDir + appdir + `\` + appname + `.dat`, exists ) then
  921.         open LocalSourceDir + appdir + `\` + appname + `.dat` for read as #1
  922.         while not feof( #1 ) loop
  923.             input #1, oldtag, newtag
  924.             Clump = RwFindTaggedClump( RoomClump, oldtag )
  925.             if Clump != NULL then
  926. //                print "Tagging ", oldtag, " as ", newtag, '\n'
  927.                 //RwSetClumpDataInt( Clump, newtag )
  928.                 null
  929.             else
  930.                 print "Tag ", oldtag, " not found\n"
  931.             end if
  932.         end while
  933.         close #1
  934.     end if
  935.  
  936.     RwResetCamera(camera)
  937.     CamTilt = DEFAULT_CAMERA_TILT
  938.     RwTiltCamera(Camera, CamTilt)
  939.     RwSetCameraPosition(Camera, ix, DEFAULT_CAMERA_HEIGHT+iy, -iz)
  940. //    RwSetCameraLookAt( Camera, 0,0, 0 ) //-1
  941.  
  942.          // now add chappy to the scene
  943.  
  944.             //clump = ManSetup(LocalSourceDir, 0, int(iy)+2 , 0)
  945.         
  946.             //if clump != NULL then
  947.             //    RwAddClumpToScene(scene, clump);
  948.             //    print "add man"
  949.             //    print RoomName[currentRoom]
  950.             //end if
  951.  
  952.  
  953.  
  954. //    if !CreateTorch() then
  955. //        return false
  956. //    endif
  957.         RwGetCameraPosition(Camera, pos )
  958.         UpdateTorch( pos )
  959.         RwSetLightState( TorchLight, rwON )
  960.  
  961.     RoomInitialized = true
  962.  
  963.     return true
  964.     
  965.     
  966. end function
  967.  
  968.  
  969. var
  970.     boolean collided
  971.     OldCameraPos as RwReal[3]
  972.     CameraPos as RwReal[3]
  973.     Camerabll as RwReal[3]
  974.     Camerafur as RwReal[3]
  975.  
  976.     CameraPos2 as RwReal
  977.     Camerabll2 as RwReal
  978.     Camerafur2 as RwReal
  979.     OldCameraPos2 as RwReal
  980.  
  981.     int CameraVX, CameraVY
  982.     RwReal GroundHeight, OldGroundHeight
  983.  
  984.  
  985. function printvec( vec inout RwReal[3] ) as string
  986.     return print (vec[0], vec[1], vec[2])
  987. endfunction
  988.  
  989.  
  990. function OldCameraInsideBox( bll inout RwReal[3], fur inout RwReal[3] ) as boolean
  991.     if OldCameraPos[0] <= bll[0] or OldCameraPos[0] >= fur[0] 
  992.     or OldCameraPos[1] <= bll[1] or OldCameraPos[1] >= fur[1] 
  993.     or OldCameraPos[2] <= bll[2] or OldCameraPos[2] >= fur[2] then
  994.         return false
  995.     else
  996.         return true
  997.     endif
  998. end function
  999.  
  1000.  
  1001. function BoxIntersectsCamera( bll inout RwReal[3], fur inout RwReal[3] ) as boolean
  1002.     if  ((Camerabll[0] >= bll[0] and Camerabll[0] <= fur[0]) or
  1003.          (Camerafur[0] >= bll[0] and Camerafur[0] <= fur[0]))
  1004.     and ((Camerabll[1] >= bll[1] and Camerabll[1] <= fur[1]) or
  1005.          (Camerafur[1] >= bll[1] and Camerafur[1] <= fur[1]))
  1006.     and ((Camerabll[2] >= bll[2] and Camerabll[2] <= fur[2]) or
  1007.          (Camerafur[2] >= bll[2] and Camerafur[2] <= fur[2])) then
  1008.         return true
  1009.     else
  1010.         return false
  1011.     endif
  1012. end function
  1013.  
  1014.  
  1015.  
  1016. function BoxCoaxialWithCameraY( bll inout RwReal[3], fur inout RwReal[3] ) as int
  1017. local
  1018.     total as int=0
  1019. end local
  1020.  
  1021.     if (Camerabll[0] >= bll[0] and Camerabll[0] <= fur[0]) or
  1022.        (Camerafur[0] >= bll[0] and Camerafur[0] <= fur[0]) then
  1023.         total += 1
  1024.     endif
  1025.  
  1026.     if (Camerabll[2] >= bll[2] and Camerabll[2] <= fur[2]) or
  1027.        (Camerafur[2] >= bll[2] and Camerafur[2] <= fur[2]) then
  1028.         total += 3
  1029.     endif
  1030.  
  1031.     // Reject clump that is above the camera
  1032.     if Camerafur[1] <= bll[1]  then
  1033.         total = 0
  1034.     endif
  1035.  
  1036.     return total = 4
  1037. end function
  1038.  
  1039.  
  1040.  
  1041. sub fast_ docollision( ) 
  1042. local
  1043.     RwReal bll[3], fur[3]
  1044.     RwClump child
  1045. end local
  1046.  
  1047.     child = RwGetFirstChildClump( RoomClump )
  1048.     collided = false
  1049.  
  1050.     while not collided and child <> NULL loop
  1051.         RwGetClumpBBox( child, bll, fur )
  1052.  
  1053.         if not OldCameraInsideBox( bll, fur ) and BoxIntersectsCamera( bll, fur ) then
  1054.             collided = TRUE
  1055.  
  1056.             
  1057.                 
  1058.         endif
  1059.  
  1060.         child = RwGetNextClump( child )
  1061.     end while
  1062.  
  1063. //    if collided  then sound `apps/newworld/sound/hit.wav wave` end if
  1064. end sub
  1065.  
  1066.  
  1067.  
  1068. function FindFloor( CameraPos inout RwReal[3] ) as RwReal
  1069. local
  1070.     RwReal bll[3], fur[3]
  1071.     RwReal floor = -100.0, feet
  1072.     RwClump clump
  1073. end local
  1074.  
  1075.     if Crouch then
  1076.         feet = CameraPos[1] - DEFAULT_STEP_HEIGHT - DEFAULT_COL_HEIGHT/2
  1077.     else
  1078.         feet = CameraPos[1] - DEFAULT_STEP_HEIGHT - DEFAULT_COL_HEIGHT
  1079.     end if
  1080.  
  1081.     clump = RwGetFirstChildClump( RoomClump )
  1082.     while clump <> null loop
  1083.         RwGetClumpBBox( clump, bll, fur )
  1084.  
  1085.         if bll[0] <= CameraPos[0] and fur[0] >= CameraPos[0] and bll[2] <= CameraPos[2] and fur[2] >= CameraPos[2] then
  1086.             if fur[1] > floor and fur[1] <= feet + DEFAULT_STEP_HEIGHT then
  1087.                 floor = fur[1]
  1088.             endif
  1089.         endif
  1090.  
  1091.         clump = RwGetNextClump( clump )
  1092.     end while
  1093.  
  1094.     if floor = -100.0 then
  1095.         return 0
  1096.     else
  1097.         return floor - feet
  1098.     endif
  1099. end function
  1100.  
  1101.  
  1102.  
  1103. sub MakeCameraBBox()
  1104. local
  1105.     const o1 as RwReal = 0.07
  1106.     const o2 as RwReal = 0.04
  1107. endlocal
  1108.  
  1109.     Camerabll[0] = CameraPos[0] - o2
  1110.     Camerafur[0] = CameraPos[0] + o2
  1111.     if Crouch then
  1112.         Camerabll[1] = CameraPos[1] - DEFAULT_COL_HEIGHT/2
  1113.     else
  1114.         Camerabll[1] = CameraPos[1] - DEFAULT_COL_HEIGHT
  1115.     end if
  1116.  
  1117.     Camerafur[1] = CameraPos[1] + o2
  1118.     Camerabll[2] = CameraPos[2] - o1
  1119.     Camerafur[2] = CameraPos[2] + o1
  1120.  
  1121. end sub
  1122.  
  1123.  
  1124. /*
  1125.  * Move the camera forward.  We cannot use RwVCMoveCamera() since the
  1126.  * camera is potentially tilted up or down - we want to move forward
  1127.  * only in the XZ plane.
  1128.  */
  1129.  
  1130. sub fast_ moveforward(fforward as RwReal)
  1131. local
  1132.     RwReal at[3],pos[3], floorheight
  1133.     RwClump cbclump, child
  1134. endlocal
  1135.  
  1136.     RwGetCameraLookAt(Camera, at)
  1137.  
  1138.     if fforward != 0 then
  1139.         if fforward > MaxSpeed then
  1140.             fforward = MaxSpeed
  1141.         elsif fforward < -MaxSpeed then
  1142.             fforward = -MaxSpeed
  1143.         endif
  1144.  
  1145.         RwGetCameraPosition( Camera, OldCameraPos )
  1146.  
  1147.         RwWCMoveCamera(Camera, at[0]*fforward, 0, at[2]*fforward )
  1148.         RwGetCameraPosition( Camera, CameraPos )
  1149.  
  1150. //        floorheight = FindFloor( CameraPos )
  1151.  
  1152. //        RwWCMoveCamera(Camera, 0, floorheight, 0 )
  1153.         MakeCameraBBox()
  1154.  
  1155.         docollision()
  1156.  
  1157.         if collided and not ghost then
  1158.             RwWCMoveCamera(Camera, -(at[0]*fforward), -floorheight, -(at[2]*fforward))
  1159.         endif
  1160.     end if
  1161.  
  1162.  
  1163. end sub
  1164.  
  1165.  
  1166.  
  1167. /*
  1168.  * Handle window resize. The most important job here is to change the
  1169.  * size of the camera's viewport (if preserving the aspect ratio of
  1170.  * the viewport is necessary, then the viewwindow should also be
  1171.  * changed at this point to reflect then new aspect ratio of the
  1172.  * viewport).
  1173.  */
  1174. sub fast_ HandleSize(width as int, height as int)
  1175.  
  1176.     /*
  1177.      * The window has been resized. Therefore, it is necessary to
  1178.      * to modify the camera's viewport to be the same size as the
  1179.      * client area of the window.
  1180.      */
  1181.     if width >400 then 
  1182.           VScale = FastScale
  1183.           VScale = SlowScale    
  1184.         else
  1185.           Vscale = SlowScale
  1186.     end if
  1187.  
  1188.     RwDeviceControl(rwWINSETOUTPUTSIZE, Camera, width, height)
  1189.     RwSetCameraViewport(Camera, 0, 0, width/VScale, height/VScale)
  1190.     RwSetCameraBackdropViewportRect(Camera, 0,0, width/VScale, height/VScale)
  1191.  
  1192.     /* viewwindow aspect ratio of 1:1 regardless of viewport aspect ratio */
  1193. /*    if ((width != 0) && (height != 0)) then
  1194.         if (width >= height) then
  1195.             RwSetCameraViewwindow(Camera, 1.0, (1.0*( float(height)/float(width) )) )
  1196.         else
  1197.             RwSetCameraViewwindow(Camera, (1.0*( float(width)/float(height) )), 1.0)
  1198.         endif
  1199.     endif
  1200. */
  1201.     /*
  1202.      * Ensure the entire window is repainted. Note, we stop MS Windows
  1203.      * repainting the window as RenderWare paints the entire background.
  1204.      */
  1205.     WinInvalidateRect
  1206. endsub
  1207.     
  1208. /**********************************************************************/
  1209.  
  1210. /*
  1211.  * This functions handles the left mouse button going down. Its main
  1212.  * job is to determine the kind of action to be taken when the mouse
  1213.  * moves, such as spinning a clump, or panning the camera. This involves
  1214.  * examining the virtual keys that were depressed when the mouse button
  1215.  * went down and attempting to pick a clump under the mouse pointer
  1216.  * position.
  1217.  */
  1218. sub fast_ HandleLeftButtonDown(x as int, y as int , vKeys as int )
  1219.  
  1220.     if (vKeys & MK_DEFS'MK_CONTROL) then
  1221.         MouseMoveMode = MMHeightCamera
  1222.     elsif (vKeys & MK_DEFS'MK_SHIFT) then
  1223.         MouseMoveMode = MMTiltCamera
  1224.     else
  1225.         MouseMoveMode = MMPanAndZoomCamera
  1226.         fforward = 0.0
  1227.         pan = 14.0
  1228.  
  1229.         if !Fast then
  1230.             Vscale = SlowScale
  1231.         endif
  1232.     endif
  1233.  
  1234.     /*
  1235.      * If any form of action is to be taken on mouse move, remember the
  1236.      * the current x and y position of the mouse and capture future
  1237.      * mouse movement.
  1238.      */
  1239.  
  1240.     if (MouseMoveMode != MMNoAction) then
  1241.         WinSetCapture
  1242.         LastX = x
  1243.         LastY = y
  1244.         WinClientToScreen LastX, LastY
  1245.  
  1246.         StartX = x
  1247.         StartY = y
  1248.         WinClientToScreen StartX, StartY
  1249.     endif
  1250. endsub
  1251.  
  1252. /**********************************************************************/
  1253.  
  1254.  
  1255. sub fast_ HandleRightButtonDown(x as int, y as int, vkeys as int)
  1256. local
  1257.     vx as int
  1258.     vy as int
  1259.     vw as int
  1260.     vh as int
  1261.  
  1262.     XDelta as RwReal
  1263.     YDelta as RwReal
  1264.  
  1265. //pickrecord
  1266.     picktype as RwPickObject
  1267.     pickclump as RwClump
  1268.     pickpolygon as RwPolygon3d
  1269.     vindex as int
  1270.     d2 as int
  1271.     pickx as RwReal
  1272.     picky as RwReal
  1273.     pickz as RwReal
  1274.     tag as float
  1275. endlocal
  1276.  
  1277.     MouseMoveMode = MMNoAction
  1278.  
  1279.     if (Scene != NULL) then
  1280.         RwPickScene(Scene, x, y, Camera, picktype, pickclump, pickpolygon, vindex, d2, pickx, picky, pickz)
  1281.  
  1282.         if (Picktype == RwPickObject'rwPICKCLUMP) then
  1283.             /* The objects in the scene which are manipulatable are tagged with 2. */
  1284.  
  1285.             tag = RwGetClumpDataInt(Pickclump)
  1286.             //if tag then
  1287.                 DragClump = Pickclump
  1288.                 MouseMoveMode = MMMoveClump
  1289.                 if int(tag) bitand RotateY  then
  1290.                         MouseMoveMode = MMRotateClumpY
  1291.                 //sound `apps/newworld/sound/creak.wav wave`
  1292.                 //newroom =1
  1293.                 //currentRoom=10
  1294.                 //elseif tag bitand (MoveX|MoveZ) then
  1295.                 
  1296.  
  1297.                 elseif
  1298.                     
  1299.                       (vKeys & MK_DEFS'MK_CONTROL) then
  1300.                     MouseMoveMode = MMRotateClumpX
  1301.                 elseif
  1302.                     
  1303.  
  1304.                       (vKeys & MK_DEFS'MK_shift) then
  1305.                     MouseMoveMode = MMRotateClumpZ
  1306.                         
  1307.                 endif
  1308.             endif
  1309.         //endif
  1310.     endif
  1311.  
  1312.     if (MouseMoveMode != MMNoAction) then
  1313.         RwGetCameraViewport(Camera, vx, vy, vw, vh)
  1314.         FirstX = vx + (vw >> 1)
  1315.         FirstY = vy + (vh >> 1)
  1316.         WinClientToScreen FirstX, FirstY
  1317.         LastX = x
  1318.         LastY = y
  1319.         WinClientToScreen LastX, LastY
  1320.  
  1321.         WinSetCapture
  1322.     endif
  1323.  
  1324. endsub
  1325.  
  1326. /**********************************************************************/
  1327.  
  1328. /*
  1329.  * Handle a movement of the mouse. If a previous left or right mouse
  1330.  * button down event has set a mouse move mode then this function will
  1331.  * take the necessary actions. For example, pan and zooming the camera,
  1332.  * panning the light, dragging or spinning a clump etc.
  1333.  */
  1334. sub fast_ HandleMouseMove(x as int, y as int)
  1335. local
  1336.     centrex as int
  1337.     centrey as int
  1338.  
  1339.     foffx as float
  1340.     foffy as float
  1341.     width as int
  1342.     height as int
  1343.     offx as int
  1344.     offy as int
  1345.     boolean DummyBool
  1346.     //at as RwReal[3]
  1347.     RwReal hyp, cosangle
  1348.     RwMatrix4d mat, matr
  1349.     RwReal tlate[3]
  1350.     int OldVScale = VScale
  1351.     RwReal adj
  1352.  
  1353.     int dx, dy
  1354.     string tag
  1355.  
  1356. endlocal
  1357.     
  1358.     WinClientToScreen x, y
  1359.     RwGetCameraViewport(Camera, DummyBool, DummyBool, width, height)
  1360.  
  1361.  
  1362.     /* MouseMoveMode tells us what kind of action to perform. */
  1363.  
  1364.     if MouseMoveMode == MMPanAndZoomCamera then
  1365.         /*
  1366.          * We are panning and zooming the camera. Movement of the
  1367.          * mouse in the X direction will pan the camera about the
  1368.          * origin of world coordinate space, and movement of the mouse
  1369.          * in the Y direction will zoom the camera into and out of the
  1370.          * the scene.
  1371.          */
  1372.         /*
  1373.          * Pan the camera by mouse X delta degrees.
  1374.          */
  1375.  
  1376.         RwGetCameraPosition(Camera, at)
  1377.  
  1378.         pan = float(Startx - x) / 10.0
  1379.         fforward = float(Starty - y) / MovementSpeed
  1380.  
  1381.         pan /=ZoomScale
  1382.  
  1383.     elsif MouseMoveMode == MMHeightCamera then
  1384.         RwGetCameraPosition(Camera, at)
  1385.         adj = float(Lasty - y) / 50.0
  1386.  
  1387.         adj /= ZoomScale
  1388.  
  1389.         at[1] += adj
  1390.         RwSetCameraPosition( Camera, at[0], at[1], at[2] )
  1391.     elsif MouseMoveMode == MMTiltCamera then
  1392.         /*
  1393.          * Pan the camera by mouse X delta degrees.
  1394.          */
  1395.         RwRotateMatrix(RwScratchMatrix(), 0.0, 1.0, 0.0, float(LastX - x), rwREPLACE)
  1396.         RwTransformCameraOrientation(Camera, RwScratchMatrix())
  1397.         RwTiltCamera(Camera, float(y - LastY))
  1398.  
  1399.         RwGetCameraPosition( Camera, at )
  1400.         UpdateTorch( at )
  1401.  
  1402.     elsif MouseMoveMode == MMRotateClump then
  1403.         foffx = float(x - LastX)/ float(width)
  1404.         RwPushScratchMatrix()
  1405.         RwRotateMatrix(RwScratchMatrix(), (0.0), (0.0), (1.0), foffx * (180.0), rwREPLACE)
  1406.         RwTransformClumpJoint(DragClump, RwScratchMatrix(), rwPOSTCONCAT)
  1407.         RwPopScratchMatrix()
  1408.  
  1409.     elsif MouseMoveMode == MMRotateClumpx then
  1410.         foffx = float(x - LastX)/ float(width)
  1411.         RwPushScratchMatrix()
  1412.         RwRotateMatrix(RwScratchMatrix(), (1.0), (0.0), (0.0), foffx * (180.0), rwREPLACE)
  1413.         RwTransformClumpJoint(DragClump, RwScratchMatrix(), rwPOSTCONCAT)
  1414.         RwPopScratchMatrix()
  1415.  
  1416.  elsif MouseMoveMode == MMRotateClumpY then
  1417.         foffx = float(x - LastX)/ float(width)
  1418.         RwPushScratchMatrix()
  1419.         RwRotateMatrix(RwScratchMatrix(), (0.0), (1.0), (0.0), foffx * (180.0), rwREPLACE)
  1420.         RwTransformClumpJoint(DragClump, RwScratchMatrix(), rwPOSTCONCAT)
  1421.         RwPopScratchMatrix()
  1422.  
  1423.      elsif MouseMoveMode == MMRotateClumpZ then
  1424.         foffx = float(x - LastX)/ float(width)
  1425.         RwPushScratchMatrix()
  1426.         RwRotateMatrix(RwScratchMatrix(), (0.0), (0.0), (1.0), foffx * (180.0), rwREPLACE)
  1427.         RwTransformClumpJoint(DragClump, RwScratchMatrix(), rwPOSTCONCAT)
  1428.         RwPopScratchMatrix()
  1429.  
  1430.     elsif MouseMoveMode == MMMoveClump then
  1431.         foffx = float(x - LastX)/ float(width)
  1432.         foffy = float(y - LastY)/ float(height)
  1433.         RwGetCameraLookAt( Camera, at )
  1434.         hyp = sqrt( at[0]*at[0] + at[2]*at[2] )
  1435.         cosangle = at[2]/hyp
  1436.  
  1437.         tlate[0] = -foffx/(ZoomScale*4)
  1438.         tlate[1] = 0
  1439.         tlate[2] = -foffy/(ZoomScale*4)
  1440.             
  1441.         RwPushScratchMatrix()
  1442.         RwRotateMatrixCos( RwScratchMatrix(), 0,1,0, cosangle, at[0], rwREPLACE )
  1443.         RwTransformVector( tlate, RwScratchMatrix() )
  1444.  
  1445.         RwTranslateMatrix( RwScratchMatrix(), tlate[0], 0.0, tlate[2], rwREPLACE)
  1446.         RwTransformClump(DragClump, RwScratchMatrix(), rwPOSTCONCAT)
  1447.         RwPopScratchMatrix()
  1448.     endif
  1449.     
  1450.     /* Remember the current X and Y for next time. */
  1451.     LastX = x
  1452.     LastY = y
  1453. endsub
  1454.  
  1455. /**********************************************************************/
  1456.  
  1457. /*
  1458.  * Handle the left mouse button comming back up. The basic action is
  1459.  * to turn off mouse move actions and release mouse capture.
  1460.  */
  1461. sub fast_ HandleLeftButtonUp( )
  1462.     /*
  1463.      * If we were engaged in a mouse move action and the button has come
  1464.      * back up, then terminate the action and release mouse capture.
  1465.      */
  1466.     if (MouseMoveMode != MMNoAction) then
  1467.         MouseMoveMode = MMNoAction
  1468.         fforward = 0.0
  1469.         pan = 0.0
  1470.  
  1471.         if !Fast then
  1472.             Vscale = SlowScale
  1473.         endif
  1474.  
  1475.         WinReleaseCapture
  1476.     endif
  1477. endsub
  1478.  
  1479.  
  1480. /**********************************************************************/
  1481.  
  1482. /*
  1483.  * Handle the right mouse button comming back up. The basic action is
  1484.  * to turn of mouse move actions and release mouse capture.
  1485.  */
  1486. sub fast_ HandleRightButtonUp( )
  1487.  
  1488.     RwSetCameraLookUp(Camera, 0.0, 1.0, 0.0)
  1489.  
  1490.     /*
  1491.      * If we were engaged in a mouse move action and the button has come
  1492.      * back up, then terminate the action and release mouse capture.
  1493.      */
  1494.     if (MouseMoveMode != MMNoAction) then
  1495.         MouseMoveMode = MMNoAction
  1496.         fforward = 0.0
  1497.         pan = 0.0
  1498.  
  1499.         if !Fast then
  1500.             Vscale = SlowScale
  1501.         endif
  1502. //        DragClump = NULL
  1503.         WinReleaseCapture
  1504.     endif
  1505. endsub
  1506.  
  1507. /**********************************************************************/
  1508.  
  1509. /*
  1510.  * Handle window paint messages by re-rendering the entire scene and
  1511.  * copying the camera's entire viewport to the display.
  1512.  */
  1513. sub fast_ HandlePaint()
  1514. local
  1515.     int w, h
  1516. endlocal
  1517.  
  1518.     /*
  1519.      * As we are repainting the entire window we invalidate the
  1520.      * camera's viewport to ensure the whole window gets updated
  1521.      * (and not simply the parts that will be damaged by the render
  1522.      * operation).
  1523.      */
  1524.  
  1525.     WinGetClientRect w, h
  1526.     HandleSize( w, h )
  1527.  
  1528.     WinBeginPaint
  1529.     RwInvalidateCameraViewport(Camera)
  1530.     RwBeginCameraUpdate(Camera)
  1531.     RwClearCameraViewport(Camera)
  1532.     RwRenderScene(Scene)
  1533.     RwEndCameraUpdate(Camera)
  1534.     RwShowCameraImage(Camera)
  1535.     WinEndPaint
  1536. endsub
  1537.  
  1538.  
  1539.  
  1540. /*
  1541.  * Handle MS Window's timer expiry. This function will perform any
  1542.  * animation actions necessary, including spinning clumps and animating
  1543.  * textures.
  1544.  */
  1545. sub fast_ HandleTimer()
  1546. local
  1547.     int i
  1548. endlocal
  1549.         WinKillTimer 1
  1550.         TimerActive = false
  1551.  
  1552. //if update =1 then 
  1553.     /* Perform any "momentum" camera moves. */
  1554.     if ( (pan != 0.0) || (fforward != 0.0) ) then
  1555.         RwRotateMatrix(RwScratchMatrix(), 0.0, 1.0, 0.0, pan, rwREPLACE)
  1556.         RwTransformCameraOrientation(Camera, RwScratchMatrix())
  1557.         moveforward(fforward)
  1558.     
  1559.     endif
  1560.     //flicker the torch !    
  1561. //    RwSetLightColor( TorchLight, 1.0, 1.0, random() )
  1562.     RwGetCameraPosition(Camera, pos )
  1563.     UpdateTorch( pos )
  1564.     // move the man
  1565.     //ManUpdate()
  1566.     //AnimateRoom()
  1567.     forc (i = 0;  i < TextureCount; i++ )
  1568.         RwTextureNextFrame(TextureArray[i])
  1569.  
  1570.     RwInvalidateCameraViewport(Camera)
  1571.     RwBeginCameraUpdate(Camera)
  1572.     RwClearCameraViewport(Camera)
  1573.     RwRenderScene(Scene)
  1574.     RwEndCameraUpdate(Camera)
  1575.     RwShowCameraImage(Camera)
  1576. //end if
  1577.  
  1578.         WinSetTimer  1, 10
  1579.         TimerActive = true
  1580. endsub
  1581. /**********************************************************************/
  1582.  
  1583. sub RemoveEventHandlers( )
  1584.     OffWinEvent   WM_CREATE
  1585.     OffWinEvent   WM_SIZE
  1586.     OffWinEvent   WM_KEYDOWN
  1587.     OffWinEvent   WM_KEYUP
  1588.     OffWinEvent   WM_CHAR
  1589.     OffMouseEvent LBUTTONDOWN
  1590.     OffMouseEvent RBUTTONDOWN
  1591.     OffMouseEvent MOUSEMOVE
  1592.     OffMouseEvent LBUTTONUP
  1593.     OffMouseEvent RBUTTONUP
  1594.     OffWinEvent   WM_PAINT
  1595.     OffWinEvent   WM_TIMER
  1596.     OffWinEvent   WM_DESTROY
  1597. endsub
  1598.  
  1599.  
  1600. sub SetupEventHandlers( )
  1601. local
  1602.     key       as int
  1603.     Reason    as int
  1604.     NewSize   as BOOL
  1605.     NewWidth  as int
  1606.     NewHeight as int
  1607.     MouseXPos as int
  1608.     MouseYPos as int
  1609.     keys  as int
  1610.     dummy as BOOL
  1611.     timercount as int
  1612.     char  as int
  1613.     // RwReal pos[3]
  1614. endlocal
  1615.  
  1616.      OnWinEvent WM_CREATE, dummy, dummy, {
  1617.         break on
  1618. //        print "CREATE\n"
  1619.         WinSetTimer  1, 10
  1620.         TimerActive = true
  1621.         }
  1622.  
  1623.      OnWinEvent WM_SIZE, Reason, NewSize, {
  1624.         break off
  1625. //        print "SIZE\n"
  1626.         if RoomInitialized then
  1627.             NewWidth = NewSize & %xffff
  1628.             NewHeight = NewSize >> 16
  1629.  
  1630.             if Reason = SIZE_REASON'SIZE_MINIMIZED then
  1631.                 if TimerActive then
  1632.                     WinKillTimer 1
  1633.                     TimerActive = false
  1634.                 endif
  1635.             else
  1636.                 if !TimerActive then
  1637.                     WinSetTimer 1, 10
  1638.                     TimerActive = true
  1639.                 endif
  1640.  
  1641.                 HandleSize( NewWidth, NewHeight)
  1642.             endif
  1643.         endif
  1644.         }
  1645.  
  1646.  
  1647.     OnMouseEvent LBUTTONDOWN, MouseXPos, MouseYPos, keys, {
  1648.         break on
  1649. //        print "LBUTTONDOWN\n"
  1650.         if RoomInitialized then
  1651.             HandleLeftButtonDown(MouseXPos/VScale, MouseYPos/VScale, keys)
  1652.         endif
  1653.         }
  1654.  
  1655.     OnMouseEvent RBUTTONDOWN, MouseXPos, MouseYPos, keys, {
  1656.         break on
  1657. //        print "RBUTTONDOWN\n"
  1658.         if RoomInitialized then
  1659.             HandleRightButtonDown(MouseXPos/VScale, MouseYPos/VScale, keys)
  1660.         endif
  1661.         }
  1662.  
  1663.     OnMouseEvent MOUSEMOVE, MouseXPos, MouseYPos, keys, {
  1664.         break on
  1665. //        print "MOUSEMOVE\n"
  1666.         if RoomInitialized then
  1667.             if MouseMoveMode != MMNoAction then
  1668.                 HandleMouseMove(MouseXPos/VScale, MouseYPos/VScale)
  1669.             endif
  1670.         endif
  1671.         }
  1672.  
  1673.     OnMouseEvent LBUTTONUP, MouseXPos, MouseYPos, keys, {
  1674.         break on
  1675. //        print "LBUTTONUP\n"
  1676.         if RoomInitialized then
  1677.             HandleLeftButtonUp()
  1678.         endif
  1679.         }
  1680.  
  1681.     OnMouseEvent RBUTTONUP, MouseXPos, MouseYPos, keys, {
  1682.         break on
  1683. //        print "RBUTTONUP\n"
  1684.         if RoomInitialized then
  1685.             HandleRightButtonUp()
  1686.         endif
  1687.         }
  1688.  
  1689.     OnWinEvent WM_PAINT, dummy, dummy, {
  1690.         break on
  1691. //        print "PAINT\n"
  1692.         if ThreeDInitialized then
  1693.             HandlePaint()
  1694.         endif
  1695.         }
  1696.  
  1697.     OnWinEvent WM_TIMER, dummy, dummy, {
  1698.         break on
  1699.     
  1700.     if newroom then
  1701.     NewRoom=0
  1702.  
  1703.     
  1704.         res = AddRoom(    RoomDir[CurrentRoom], RoomName[CurrentRoom],
  1705.                     RoomData[CurrentRoom][0], RoomData[CurrentRoom][1],
  1706.                     RoomData[CurrentRoom][2], RoomData[CurrentRoom][3], xpos, ypos)
  1707.  
  1708.  
  1709.     
  1710.  
  1711.     endif
  1712.         if RoomInitialized then
  1713.             HandleTimer()
  1714.         endif
  1715.  
  1716.  
  1717.         }
  1718.  
  1719.     OnWinEvent WM_DESTROY, dummy, dummy, {
  1720.         break off
  1721. //        print "DESTROY\n"
  1722.  
  1723.         RemoveEventHandlers()
  1724.         WinKillTimer 1
  1725. /*        if ThreeDInitialized then
  1726.             TidyUp3D()
  1727. //            Discard3dChars()
  1728.         endif
  1729.  
  1730.         DeinitRw()
  1731. */        Destroyed = TRUE
  1732.         RoomExitFlag = KEYCODE'KEY_END
  1733.         }
  1734.  
  1735.  
  1736. //     OnWinEvent WM_KEYDOWN, key, dummy, {
  1737. //        break on
  1738. //        print "KEYDOWN", key, "\n"
  1739. //
  1740. //        if RoomInitialized then
  1741. //            if keycode'( key = key_home or key = key_end or key = key_left or key = key_right or key = key_up or key = key_pgup or key = key_pgdn) then
  1742. //                //RoomExitFlag = key
  1743. //                    WinKillTimer 1
  1744. //                     TimerActive = false
  1745. //                     WinShowWindow 0,hide
  1746. //                    wait 100
  1747. //
  1748. //            endif
  1749. //
  1750. //        endif
  1751. //        }
  1752. /*
  1753.      OnWinEvent WM_KEYUP, char, dummy, {
  1754.         break on
  1755.         print "KEYUP", char, "\n"
  1756.         }
  1757. */
  1758.      OnWinEvent WM_CHAR, char, dummy, {
  1759.         break on
  1760. //        print "CHAR", char, "\n"
  1761.         if RoomInitialized then
  1762.             if(char == asc('z') || char == asc('Z')) then
  1763.                 Zoom = !Zoom
  1764.  
  1765.                 if Zoom then
  1766.                     ZoomScale = 4.0
  1767.                 else
  1768.                     ZoomScale = 1.0
  1769.                 endif
  1770.  
  1771.                 RwSetCameraViewWindow( Camera, 1/ZoomScale, 1/ZoomScale )
  1772.  
  1773.             elsif(char == asc('c') || char == asc('C')) then
  1774.                 Crouch = !Crouch
  1775.  
  1776.                 RwGetCameraPosition(Camera, pos )
  1777.                 if Crouch then
  1778.                     pos[1] = pos[1]-DEFAULT_COL_HEIGHT/2
  1779.                 else
  1780.                     pos[1] = pos[1]+DEFAULT_COL_HEIGHT/2
  1781.                 endif
  1782.         
  1783.                 RwSetCameraPosition(Camera, pos[0], pos[1], pos[2] )
  1784.                 UpdateTorch( pos )
  1785.  
  1786.             elsif(char == asc('u') || char == asc('U')) then
  1787.                 Crouch = false
  1788.                 Zoom = false
  1789.  
  1790.                 RwSetCameraViewWindow( Camera, 1.0, 1.0 )
  1791.         
  1792.                 RwGetCameraPosition(Camera, pos )
  1793.                 pos[1] = DEFAULT_CAMERA_HEIGHT
  1794.                 RwSetCameraPosition(Camera, pos[0], pos[1], pos[2] )
  1795.                 UpdateTorch( pos )
  1796.  
  1797.             elsif ( char == asc('t') || char == asc('T') ) then
  1798.                 Torch = !Torch
  1799.  
  1800.                 if Torch then
  1801.                     RwGetCameraPosition(Camera, pos )
  1802.                     UpdateTorch( pos )
  1803.                     RwSetLightState( TorchLight, rwON )
  1804.                     
  1805.                 else
  1806.                     RwSetLightState( TorchLight, rwOFF )
  1807.                 endif
  1808.  
  1809.             elsif ( char == asc('g') || char == asc('G') ) then
  1810.                 Ghost = !Ghost
  1811.  
  1812.             elsif ( char == asc('r') || char == asc('R') ) then
  1813.                 Crouch = false
  1814.                 Zoom = false
  1815.                 ghost = false
  1816.  
  1817.                 RwResetCamera( Camera )
  1818.                 RwGetCameraPosition(Camera, pos )
  1819.                 pos[1] = DEFAULT_CAMERA_HEIGHT
  1820.                 RwSetCameraPosition(Camera, pos[0], pos[1], pos[2] )
  1821.                 UpdateTorch( pos )
  1822.  
  1823.             elsif(char == asc('f') || char == asc('F')) then
  1824.                 Fast = !Fast
  1825.  
  1826.                 if Fast then
  1827.                     VScale = FastScale
  1828.                 else
  1829.                     Vscale = SlowScale
  1830.                 endif
  1831.  
  1832.                 SetViewport( VScale )
  1833.  
  1834.             elsif(char == asc('a') || char == asc('A')) then
  1835.             
  1836.                 RwGetCameraPosition(Camera, pos )
  1837.             print "x ",pos[0]," y ",pos[1]," z ",pos[2],"\n"
  1838.  
  1839.  
  1840.  
  1841.  
  1842.             elseif char = asc(' ') then
  1843.                     newroom =1
  1844.                     currentRoom++
  1845.                     
  1846.             
  1847.         endif    
  1848.         endif
  1849.     }
  1850.  
  1851. endsub
  1852.  
  1853. /**********************************************************************/
  1854.  
  1855. initcode as int
  1856.  
  1857.  
  1858. function fast_ StartRoom( app as string ) as boolean
  1859.     destroyed = false
  1860.  
  1861.     SetupEventHandlers()
  1862.     //WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_CAPTION
  1863.     initcode = InitRw(app, WS_MAXIMIZEBOX|WS_POPUP,
  1864.              winxpos+xpos, winypos+ypos, DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT, MAXIMUM_WINDOW_WIDTH , MAXIMUM_WINDOW_HEIGHT )
  1865.  
  1866.     if initcode > 0 then
  1867.         print "InitRw() failure code", initcode, "\n"
  1868.         RemoveEventHandlers()
  1869.     else
  1870.         if initcode = -1 then
  1871.             print "Display not running in a native RenderWare depth of 8 or 16 bits\n"
  1872.         endif
  1873.  
  1874.         if ! LocalInit3D( ) then
  1875.             print "LocalInit3D() failed\n"
  1876.             WinClose
  1877.         else
  1878.             LocalInitDoneRw
  1879.             return true
  1880.         endif
  1881.     endif
  1882.  
  1883.     return false
  1884. end function
  1885.  
  1886. sub ShutdownRoom()
  1887.  
  1888.  
  1889.  
  1890.     if ThreeDInitialized then
  1891.         winclose
  1892.         timerActive = false
  1893.         loop
  1894.             null
  1895.         until destroyed
  1896.  
  1897.         tidyup3d()
  1898.  
  1899.         deinitrw()
  1900.     endif
  1901.  
  1902.  
  1903.  
  1904.  
  1905.     //WinKillTimer 1
  1906.      //TimerActive = false
  1907.      //WinShowWindow 0,hide
  1908.     //wait 100
  1909.     //if ThreeDInitialized then
  1910.     //    TidyUp3D()
  1911.         //Discard3dChars()
  1912.         //ManDestroy()
  1913.     //endif
  1914.  
  1915.     //DeinitRw()
  1916.     //wait 1000
  1917. end sub
  1918.  
  1919.  
  1920. //    include `apps/world/newworld/code/vr.tvm`
  1921.     sub InitRoomData()
  1922.     local
  1923.         int i,j
  1924.     endlocal
  1925.  
  1926.         for i=0 to MAXROOMS-1 loop
  1927.             RoomData[i][0] = 16.0
  1928.             for j=1 to 3 loop
  1929.                 RoomData[i][j] = 0
  1930.             endfor
  1931.         endfor
  1932.  
  1933.         // Room names
  1934.         FirstRoom = 0
  1935.  
  1936.         RoomDir[0] = `encyone`
  1937.         RoomDir[1] = `encyone`
  1938.         RoomDir[2] = `encyone`
  1939.         RoomDir[3] = `encyone`
  1940.         RoomDir[4] = `encyone`
  1941.         RoomDir[5] = `encyone`
  1942.  
  1943.         RoomDir[6] = `encyone`
  1944.         RoomDir[7] = `encyone`
  1945.         RoomDir[8] = `encyone`
  1946.         RoomDir[9] = `encyone`
  1947.         RoomDir[10] = `encyone`
  1948.  
  1949.         RoomDir[11] = `encyone`
  1950.         RoomDir[12] = `encyone`
  1951.         RoomDir[13] = `encyone`
  1952.         RoomDir[14] = `encyone`
  1953.         RoomDir[15] = `encyone`
  1954.  
  1955.         RoomDir[16] = `encyone`
  1956.         RoomDir[17] = `encyone`
  1957.         RoomDir[18] = `encyone`
  1958.         RoomDir[19] = `encyone`
  1959.         RoomDir[20] = `encyone`
  1960.  
  1961.         RoomDir[21] = `encyone`
  1962.         RoomDir[22] = `encyone`
  1963.         RoomDir[23] = `encyone`
  1964.         RoomDir[24] = `encyone`
  1965.         RoomDir[25] = `encyone`
  1966.  
  1967.         RoomDir[26] = `encyone`
  1968.         RoomDir[27] = `encyone`
  1969.         RoomDir[28] = `encyone`
  1970.         RoomDir[29] = `encyone`
  1971.         RoomDir[30] = `encyone`
  1972.  
  1973.         RoomDir[31] = `encyone`
  1974.         RoomDir[32] = `encyone`
  1975.         RoomDir[33] = `encyone`
  1976.         RoomDir[34] = `encyone`
  1977.         RoomDir[35] = `encyone`
  1978.  
  1979.         RoomDir[36] = `encyone`
  1980.         RoomDir[37] = `encyone`
  1981.         RoomDir[38] = `encyone`
  1982.         RoomDir[39] = `encyone`
  1983.         RoomDir[40] = `encyone`
  1984.  
  1985.  
  1986.         RoomDir[41] = `encyone`
  1987.         RoomDir[42] = `encyone`
  1988.         RoomDir[43] = `encyone`
  1989.         RoomDir[44] = `encyone`
  1990.         RoomDir[45] = `encyone`
  1991.  
  1992.         RoomDir[46] = `encyone`
  1993.         RoomDir[47] = `encyone`
  1994.         RoomDir[48] = `encyone`
  1995.         RoomDir[49] = `encyone`
  1996.         RoomDir[50] = `encyone`
  1997.  
  1998.         RoomDir[51] = `encyone`
  1999.         RoomDir[52] = `encyone`
  2000.         RoomDir[53] = `encyone`
  2001.         RoomDir[54] = `encyone`
  2002.         RoomDir[55] = `encyone`
  2003.         RoomDir[56] = `encyone`
  2004.  
  2005.         RoomDir[57] = `encyone`
  2006.         RoomDir[58] = `encyone`
  2007.         RoomDir[59] = `encyone`
  2008.         RoomDir[60] = `encyone`
  2009.         RoomDir[61] = `encyone`
  2010.         RoomDir[62] = `encyone`
  2011.         RoomDir[63] = `encyone`
  2012.         RoomDir[64] = `encyone`
  2013.         RoomDir[65] = `encyone`
  2014.         RoomDir[66] = `encyone`
  2015.         RoomDir[67] = `encyone`
  2016.         RoomDir[68] = `encyone`
  2017.         RoomDir[69] = `encyone`
  2018.         RoomDir[70] = `encyone`
  2019.         RoomDir[71] = `encyone`
  2020.         RoomDir[72] = `encyone`
  2021.         RoomDir[73] = `encyone`
  2022.         RoomDir[74] = `encyone`
  2023.         RoomDir[75] = `encyone`
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.         backName[1]=`bskyh.bmp` //1
  2033.         backName[2]=`bskyh.bmp` //1
  2034.         backName[3]=`bskyf.bmp` //1
  2035.         backName[4]=`bskyf.bmp` //1
  2036.         backName[5]=`bkgnd.bmp` //1
  2037.         backName[6]=`bkgnd.bmp` //1
  2038.         backName[7]=`bskyf.bmp` //1
  2039.         backName[8]=`bskyh.bmp` //1
  2040.         backName[9]=`bkgnd.bmp` //1
  2041.         backName[10]=`bskyh.bmp` //1
  2042.         backName[11]=`bskyh.bmp` //1
  2043.         backName[12]=`bskyn.bmp` //1
  2044.         backName[13]=`bkgnd.bmp` //1
  2045.         backName[14]=`bskyh.bmp` //1
  2046.         backName[15]=`bkgnd.bmp` //1
  2047.         backName[16]=`bkgnd.bmp` //1
  2048.         backName[17]=`bskyh.bmp` //1
  2049.         backName[18]=`bkgnd.bmp` //1
  2050.         backName[19]=`bskyh.bmp` //1
  2051.         backName[20]=`bktara.bmp` //1
  2052.         backName[21]=`bskyF.bmp` //1
  2053.         backName[22]=`bskyF.bmp` //1
  2054.         backName[23]=`bskyh.bmp` //1
  2055.         backName[24]=`bkgnd.bmp` //1
  2056.         backName[25]=`bkgnd.bmp` //1
  2057.         backName[26]=`bskyF.bmp` //1
  2058.         backName[27]=`bskyF.bmp` //1
  2059.         backName[28]=`bkgnd.bmp` //1
  2060.         backName[29]=`bkgnd.bmp` //1
  2061.         backName[30]=`bkgnd.bmp` //1
  2062.         backName[31]=`bskyh.bmp` //1
  2063.         backName[32]=`bkgnd.bmp` //1
  2064.         backName[33]=`bskyF.bmp` //1
  2065.         backName[34]=`bkgnd.bmp` //1
  2066.         backName[35]=`bkgnd.bmp` //1
  2067.         backName[36]=`bkgnd.bmp` //1
  2068.         backName[37]=`bskyf.bmp` //1
  2069.         backName[38]=`bkgnd.bmp` //1
  2070.         backName[39]=`bkgnd.bmp` //1
  2071.         backName[40]=`bkgnd.bmp` //1
  2072.  
  2073.         backName[41]=`bskyf.bmp` //1
  2074.         backName[42]=`bskyf.bmp` //1
  2075.         backName[43]=`bskyf.bmp` //1
  2076.         backName[44]=`bskyf.bmp` //1
  2077.         backName[45]=`bskyf.bmp` //1
  2078.         backName[46]=`bskyf.bmp` //1
  2079.         backName[47]=`bskyf.bmp` //1
  2080.         backName[48]=`bskyn.bmp` //1
  2081.         backName[49]=`bskyn.bmp` //1
  2082.         backName[50]=`bskyf.bmp` //1
  2083.     
  2084.  
  2085.         backName[51]=`bskyf.bmp` //1
  2086.         backName[52]=`bskyh.bmp` //1
  2087.         backName[53]=`bskyf.bmp` //1
  2088.         backName[54]=`bskyf.bmp` //1
  2089.         backName[55]=`bskyf.bmp` //1
  2090.         backName[56]=`bskyf.bmp` //1
  2091.  
  2092.         backName[57]=`bskyf.bmp` //1
  2093.         backName[58]=`bskyf.bmp` //1
  2094.         backName[59]=`bskyf.bmp` //1
  2095.         backName[60]=`bskyf.bmp` //1
  2096.         backName[61]=`bskyf.bmp` //1
  2097.         backName[62]=`bskyf.bmp` //1
  2098.         backName[63]=`bskyh.bmp` //1
  2099.         backName[64]=`bkgnd.bmp` //1
  2100.         backName[65]=`bskyf.bmp` //1
  2101.         backName[66]=`bkgnd.bmp` //1
  2102.         backName[67]=`bkgnd.bmp` //1
  2103.         backName[68]=`bkgnd.bmp` //1
  2104.         backName[69]=`bskyf.bmp` //1
  2105.         backName[70]=`bkgnd.bmp` //1
  2106.         backName[71]=`bkgnd.bmp` //1
  2107.         backName[72]=`bskyh.bmp` //1
  2108.         backName[73]=`bkgnd.bmp` //1
  2109.         backName[74]=`bkgnd.bmp` //1
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117. RoomName[1]=`1`
  2118. RoomName[2]=`2`
  2119. RoomName[3]=`3`
  2120. RoomName[4]=`4`
  2121. RoomName[5]=`5`
  2122. RoomName[6]=`6`
  2123. RoomName[7]=`7`
  2124. RoomName[8]=`8`
  2125. RoomName[9]=`9`
  2126. RoomName[10]=`10`
  2127. RoomName[11]=`11`
  2128. RoomName[12]=`12`
  2129. RoomName[13]=`13`
  2130. RoomName[14]=`14`
  2131. RoomName[15]=`15`
  2132. RoomName[16]=`16`
  2133. RoomName[17]=`17`
  2134. RoomName[18]=`18`
  2135. RoomName[19]=`19`
  2136. RoomName[20]=`20`
  2137. RoomName[21]=`21`
  2138. RoomName[22]=`22`
  2139. RoomName[23]=`23`
  2140. RoomName[24]=`24`
  2141. RoomName[25]=`25`
  2142. RoomName[26]=`26`
  2143. RoomName[27]=`27`
  2144. RoomName[28]=`28`
  2145. RoomName[29]=`29`
  2146. RoomName[30]=`30`
  2147. RoomName[31]=`31`
  2148. RoomName[32]=`32`
  2149. RoomName[33]=`33`
  2150. RoomName[34]=`34`
  2151. RoomName[35]=`35`
  2152. RoomName[36]=`36`
  2153. RoomName[37]=`37`
  2154. RoomName[38]=`38`
  2155. RoomName[39]=`39`
  2156. RoomName[40]=`40`
  2157. RoomName[41]=`41`
  2158. RoomName[42]=`42`
  2159. RoomName[43]=`43`
  2160. RoomName[44]=`44`
  2161. RoomName[45]=`45`
  2162. RoomName[46]=`46`
  2163. RoomName[47]=`47`
  2164. RoomName[48]=`48`
  2165. RoomName[49]=`49`
  2166. RoomName[50]=`50`
  2167.  
  2168. RoomName[51]=`51`
  2169. RoomName[52]=`52`
  2170. RoomName[53]=`53`
  2171. RoomName[54]=`54`
  2172. RoomName[55]=`55`
  2173. RoomName[56]=`56`
  2174.  
  2175. RoomName[57]=`57`
  2176. RoomName[58]=`58`
  2177. RoomName[59]=`59`
  2178. RoomName[60]=`60`
  2179. RoomName[61]=`61`
  2180. RoomName[62]=`62`
  2181. RoomName[63]=`63`
  2182. RoomName[64]=`64`
  2183. RoomName[65]=`65`
  2184. RoomName[66]=`66`
  2185. RoomName[67]=`67`
  2186. RoomName[68]=`68`
  2187. RoomName[69]=`69`
  2188. RoomName[70]=`70`
  2189. RoomName[71]=`71`
  2190. RoomName[72]=`72`
  2191. RoomName[73]=`73`
  2192. RoomName[74]=`74`
  2193. RoomName[75]=`75`
  2194.  
  2195.  
  2196.  
  2197. LastRoom=a
  2198.  
  2199. NumberOfRooms = LastRoom - FirstRoom + 1
  2200.  
  2201.         // Scale factor
  2202.             
  2203.             RoomData[1][0] = 10.0
  2204.             RoomData[1][1] = 0.0
  2205.             RoomData[1][2] = 4.0
  2206.             RoomData[1][3] = -3.0
  2207.  
  2208.             RoomData[2][0] = 10.0
  2209.             RoomData[2][1] = 0.0
  2210.             RoomData[2][2] = 1.0
  2211.             RoomData[2][3] = 0.0
  2212.  
  2213.             RoomData[3][0] = 3.5
  2214.             RoomData[3][1] = 0.0
  2215.             RoomData[3][2] = 1.3
  2216.             RoomData[3][3] = -7.0
  2217.  
  2218.             RoomData[4][0] = 4.0
  2219.             RoomData[4][1] = 0.0
  2220.             RoomData[4][2] = 1.3
  2221.             RoomData[4][3] = -1.0
  2222.  
  2223.             RoomData[5][0] = 4.0
  2224.             RoomData[5][1] = 0.0
  2225.             RoomData[5][2] = 0.0
  2226.             RoomData[5][3] = -7.0
  2227.  
  2228.             RoomData[6][0] = 2.0
  2229.             RoomData[6][1] = 0.0
  2230.             RoomData[6][2] = 0.0
  2231.             RoomData[6][3] = -4.0
  2232.  
  2233.             RoomData[7][0] = 5.0
  2234.             RoomData[7][1] = 0.0
  2235.             RoomData[7][2] = 2.3
  2236.             RoomData[7][3] = -3.0
  2237.  
  2238.             RoomData[8][0] = 4.0
  2239.             RoomData[8][1] = 0.0
  2240.             RoomData[8][2] = 1.0
  2241.             RoomData[8][3] = -2.0
  2242.  
  2243.             RoomData[9][0] = 4.0
  2244.             RoomData[9][1] = 0.0
  2245.             RoomData[9][2] = 0.0
  2246.             RoomData[9][3] = -4.0
  2247.  
  2248.             RoomData[10][0] = 11.0
  2249.             RoomData[10][1] = 0.0
  2250.             RoomData[10][2] = 4.0
  2251.             RoomData[10][3] = -4.0
  2252.  
  2253.             RoomData[11][0] = 10.0
  2254.             RoomData[11][1] = 0.0
  2255.             RoomData[11][2] = 4.0
  2256.             RoomData[11][3] = -4.0
  2257.  
  2258.             RoomData[12][0] = 10.0
  2259.             RoomData[12][1] = 0.7
  2260.             RoomData[12][2] = 6.0
  2261.             RoomData[12][3] = -6.0
  2262.  
  2263.             RoomData[13][0] = 4.0
  2264.             RoomData[13][1] = -1.5
  2265.             RoomData[13][2] = 0.8
  2266.             RoomData[13][3] = -1.0
  2267.  
  2268.             RoomData[14][0] = 4.0
  2269.             RoomData[14][1] = -0.25
  2270.             RoomData[14][2] = 1.0
  2271.             RoomData[14][3] = -1.5
  2272.  
  2273.             RoomData[15][0] = 4.0
  2274.             RoomData[15][1] = 0.0
  2275.             RoomData[15][2] = 0.0
  2276.             RoomData[15][3] = -5.0
  2277.  
  2278.             RoomData[16][0] = 10.0
  2279.             RoomData[16][1] = -1.0
  2280.             RoomData[16][2] = 5.0
  2281.             RoomData[16][3] = -7.0
  2282.  
  2283.             RoomData[17][0] = 10.0
  2284.             RoomData[17][1] = 0.0
  2285.             RoomData[17][2] = 4.0
  2286.             RoomData[17][3] = -7.0
  2287.  
  2288.             RoomData[18][0] = 20.0
  2289.             RoomData[18][1] = -0.75
  2290.             RoomData[18][2] = 10.25
  2291.             RoomData[18][3] = -1.25
  2292.  
  2293.             RoomData[19][0] = 5.0
  2294.             RoomData[19][1] = 0.5
  2295.             RoomData[19][2] = 1.0
  2296.             RoomData[19][3] = -2.0
  2297.  
  2298.             RoomData[20][0] = 20.0
  2299.             RoomData[20][1] = -2.0
  2300.             RoomData[20][2] = 13.0
  2301.             RoomData[20][3] = -20.0
  2302.  
  2303.             RoomData[21][0] = 4.0
  2304.             RoomData[21][1] = 0.0
  2305.             RoomData[21][2] = 1.0
  2306.             RoomData[21][3] = -1.5
  2307.  
  2308.             RoomData[22][0] = 50.0
  2309.             RoomData[22][1] = -2.0
  2310.             RoomData[22][2] = 14.0
  2311.             RoomData[22][3] = -6.0
  2312.  
  2313.             RoomData[23][0] = 20.0
  2314.             RoomData[23][1] = 1.0
  2315.             RoomData[23][2] = 11.0
  2316.             RoomData[23][3] = -2.0
  2317.  
  2318.             RoomData[24][0] = 4.0
  2319.             RoomData[24][1] = 0.0
  2320.             RoomData[24][2] = 2.0
  2321.             RoomData[24][3] = -5.0
  2322.  
  2323.             RoomData[25][0] = 20.0
  2324.             RoomData[25][1] = 1.0
  2325.             RoomData[25][2] = 11.0
  2326.             RoomData[25][3] = -20.0
  2327.  
  2328.             RoomData[26][0] = 30.0
  2329.             RoomData[26][1] = 0.0
  2330.             RoomData[26][2] = 11.7
  2331.             RoomData[26][3] = 1.0
  2332.  
  2333.             RoomData[27][0] = 4.0
  2334.             RoomData[27][1] = -1.0
  2335.             RoomData[27][2] = 1.8
  2336.             RoomData[27][3] = -1.0
  2337.  
  2338.             RoomData[28][0] = 4.0
  2339.             RoomData[28][1] = 0.0
  2340.             RoomData[28][2] = 1.0
  2341.             RoomData[28][3] = -3.0
  2342.  
  2343.             RoomData[29][0] = 4.0
  2344.             RoomData[29][1] = 0.0
  2345.             RoomData[29][2] = 1.0
  2346.             RoomData[29][3] = -3.0
  2347.  
  2348.             RoomData[30][0] = 20.0
  2349.             RoomData[30][1] = 1.0
  2350.             RoomData[30][2] = 11.0
  2351.             RoomData[30][3] = -20.0
  2352.  
  2353.             RoomData[31][0] = 100
  2354.             RoomData[31][1] = -3.3
  2355.             RoomData[31][2] = 63.5
  2356.             RoomData[31][3] = 0.0
  2357.  
  2358.             RoomData[32][0] = 4.0
  2359.             RoomData[32][1] = 1.0
  2360.             RoomData[32][2] = 0.0
  2361.             RoomData[32][3] = -5.0
  2362.  
  2363.             RoomData[33][0] = 10.0
  2364.             RoomData[33][1] = -3.0
  2365.             RoomData[33][2] = 5.8
  2366.             RoomData[33][3] = 4
  2367.  
  2368.             RoomData[34][0] = 4.0
  2369.             RoomData[34][1] = 0.0
  2370.             RoomData[34][2] = 1.5
  2371.             RoomData[34][3] = -10.0
  2372.  
  2373.             RoomData[35][0] = 4.0
  2374.             RoomData[35][1] = 0.25
  2375.             RoomData[35][2] = 1.0
  2376.             RoomData[35][3] = -4.0
  2377.  
  2378.             RoomData[36][0] = 20.0
  2379.             RoomData[36][1] = -8.5
  2380.             RoomData[36][2] = 11.0
  2381.             RoomData[36][3] = -25.0
  2382.  
  2383.             RoomData[37][0] = 10.0
  2384.             RoomData[37][1] = -1.1
  2385.             RoomData[37][2] = 4.0
  2386.             RoomData[37][3] = -4.0
  2387.  
  2388.             RoomData[38][0] = 20.0
  2389.             RoomData[38][1] = -6.0
  2390.             RoomData[38][2] = 13.0
  2391.             RoomData[38][3] = -65.0
  2392.  
  2393.             RoomData[39][0] = 20.0
  2394.             RoomData[39][1] = 0.0
  2395.             RoomData[39][2] = 9.0
  2396.             RoomData[39][3] = -35.0
  2397.  
  2398.             RoomData[40][0] = 20.0
  2399.             RoomData[40][1] = 0.0
  2400.             RoomData[40][2] = 9.0
  2401.             RoomData[40][3] = -20.0
  2402.  
  2403.             RoomData[41][0] = 100.0
  2404.             RoomData[41][1] = -8.0
  2405.             RoomData[41][2] = 60.0
  2406.             RoomData[41][3] = -60.0
  2407.  
  2408.             RoomData[42][0] = 100.0
  2409.             RoomData[42][1] = -14.0
  2410.             RoomData[42][2] = 43.0
  2411.             RoomData[42][3] = -20.0
  2412.  
  2413.             RoomData[43][0] = 10.0
  2414.             RoomData[43][1] = -1.0
  2415.             RoomData[43][2] = 4.0
  2416.             RoomData[43][3] = -4.0
  2417.  
  2418.             RoomData[44][0] = 10.0
  2419.             RoomData[44][1] = 2.0
  2420.             RoomData[44][2] = 2.0
  2421.             RoomData[44][3] = -12.0
  2422.  
  2423.             RoomData[45][0] = 100.0
  2424.             RoomData[45][1] = 5.0
  2425.             RoomData[45][2] = 45.5
  2426.             RoomData[45][3] = -76.0
  2427.  
  2428.             RoomData[46][0] = 20.0
  2429.             RoomData[46][1] = 0.0
  2430.             RoomData[46][2] = 8.0
  2431.             RoomData[46][3] = -4.0
  2432.  
  2433.             RoomData[47][0] = 150.0
  2434.             RoomData[47][1] = -26.0
  2435.             RoomData[47][2] = 77.0
  2436.             RoomData[47][3] = -55.0
  2437.  
  2438.             RoomData[48][0] = 15.0
  2439.             RoomData[48][1] = 1.0
  2440.             RoomData[48][2] = 4.0
  2441.             RoomData[48][3] = -10.0
  2442.  
  2443.             RoomData[49][0] = 50.0
  2444.             RoomData[49][1] = 1.0
  2445.             RoomData[49][2] = 40.0
  2446.             RoomData[49][3] = -20.0
  2447.  
  2448.             RoomData[50][0] = 20.0
  2449.             RoomData[50][1] = -4.0
  2450.             RoomData[50][2] = 6.0
  2451.             RoomData[50][3] = -8.0
  2452.  
  2453.  
  2454.             RoomData[51][0] = 10.0
  2455.             RoomData[51][1] = 0.0
  2456.             RoomData[51][2] = 4.0
  2457.             RoomData[51][3] = -6.5
  2458.  
  2459.             RoomData[52][0] = 10.0
  2460.             RoomData[52][1] = 0.0
  2461.             RoomData[52][2] = 4.0
  2462.             RoomData[52][3] = -9.0
  2463.  
  2464.             RoomData[53][0] = 3.5
  2465.             RoomData[53][1] = 0.0
  2466.             RoomData[53][2] = 0.8
  2467.             RoomData[53][3] = -2.5
  2468.  
  2469.             RoomData[54][0] = 10.0
  2470.             RoomData[54][1] = 0.0
  2471.             RoomData[54][2] = 3.0
  2472.             RoomData[54][3] = -3.0
  2473.  
  2474.             RoomData[55][0] = 4.0
  2475.             RoomData[55][1] = 0.0
  2476.             RoomData[55][2] = 1.3
  2477.             RoomData[55][3] = -6.0
  2478.  
  2479.             RoomData[56][0] = 4.0
  2480.             RoomData[56][1] = 0.0
  2481.             RoomData[56][2] = 0.0
  2482.             RoomData[56][3] = -2.0
  2483.  
  2484.  
  2485.             RoomData[57][0] = 5.0
  2486.             RoomData[57][1] = -0.3
  2487.             RoomData[57][2] = 2.0
  2488.             RoomData[57][3] = -9.0
  2489.  
  2490.  
  2491.             RoomData[58][0] = 10.0
  2492.             RoomData[58][1] = 0.4
  2493.             RoomData[58][2] = 3.0
  2494.             RoomData[58][3] = -2.0
  2495.  
  2496.             RoomData[59][0] = 4.0
  2497.             RoomData[59][1] = 0.0
  2498.             RoomData[59][2] = 2.0
  2499.             RoomData[59][3] = -13.0
  2500.  
  2501.             RoomData[60][0] = 11.0
  2502.             RoomData[60][1] = 0.0
  2503.             RoomData[60][2] = 3.5
  2504.             RoomData[60][3] = -7.5
  2505.  
  2506.             RoomData[61][0] = 10.0
  2507.             RoomData[61][1] = 1.0
  2508.             RoomData[61][2] = 4.0
  2509.             RoomData[61][3] = -12.0
  2510.  
  2511.             RoomData[62][0] = 10.0
  2512.             RoomData[62][1] = 0.7
  2513.             RoomData[62][2] = 3.0
  2514.             RoomData[62][3] = -6.0
  2515.  
  2516.             RoomData[63][0] = 30.0
  2517.             RoomData[63][1] = -4.0
  2518.             RoomData[63][2] = 20
  2519.             RoomData[63][3] = -4.0
  2520.  
  2521.  
  2522.             RoomData[64][0] = 4.0
  2523.             RoomData[64][1] = -0.25
  2524.             RoomData[64][2] = 1
  2525.             RoomData[64][3] = -3.2
  2526.  
  2527.  
  2528.             RoomData[65][0] = 10.0
  2529.             RoomData[65][1] = -1.0
  2530.             RoomData[65][2] = 4.0
  2531.             RoomData[65][3] = -8.0
  2532.  
  2533.  
  2534.  
  2535.  
  2536.             RoomData[66][0] = 10.0
  2537.             RoomData[66][1] = 0.2
  2538.             RoomData[66][2] = 4.4
  2539.             RoomData[66][3] = -7.0
  2540.  
  2541.  
  2542.             RoomData[67][0] = 10.0
  2543.             RoomData[67][1] = 0.0
  2544.             RoomData[67][2] = 4.0
  2545.             RoomData[67][3] = -8.0
  2546.  
  2547.  
  2548.             RoomData[68][0] = 10.0
  2549.             RoomData[68][1] = 0.0
  2550.             RoomData[68][2] = 4.0
  2551.             RoomData[68][3] = -6.0
  2552.  
  2553.             RoomData[69][0] = 10.0
  2554.             RoomData[69][1] = -0.7
  2555.             RoomData[69][2] = 2.3
  2556.             RoomData[69][3] = -6.0
  2557.  
  2558.             RoomData[70][0] = 10.0
  2559.             RoomData[70][1] = 0.0
  2560.             RoomData[70][2] = 4.0
  2561.             RoomData[70][3] = -12.0
  2562.  
  2563.             RoomData[71][0] = 4.0
  2564.             RoomData[71][1] = 0.0
  2565.             RoomData[71][2] = 1.5
  2566.             RoomData[71][3] = -3.0
  2567.  
  2568.             RoomData[72][0] = 10.0
  2569.             RoomData[72][1] = 0.9
  2570.             RoomData[72][2] = 4.3
  2571.             RoomData[72][3] = -2.6
  2572.  
  2573.                         RoomData[73][0] = 10.0
  2574.             RoomData[73][1] = 1.0
  2575.             RoomData[73][2] = 6.0
  2576.             RoomData[73][3] = -8.0
  2577.  
  2578.                         RoomData[74][0] = 4.0
  2579.             RoomData[74][1] = 0.0
  2580.             RoomData[74][2] = 2.0
  2581.             RoomData[74][3] = -4.0
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.     end sub
  2588.  
  2589.  
  2590.  
  2591. sub start_vr()
  2592.  
  2593. InitRoomData()
  2594.  
  2595.  
  2596.  
  2597. if !StartRoom("Inside the Alchemist's Lair") then
  2598.     BrowserExit
  2599. endif
  2600.  
  2601. //CurrentRoom = FirstRoom
  2602.  
  2603. checkandreadpalette(server_local+`factor.pal`)
  2604.  
  2605.     RoomExitFlag = -1
  2606.     BACKDROPFILENAME=backName[CurrentRoom]
  2607. print "backdrop=",backName[CurrentRoom],"\n"
  2608.     backdrop = RwReadRaster(BACKDROPFILENAME, rwGAMMARASTER | rwDITHERRASTER);
  2609.         ifc (backdrop != NULL)    RwSetCameraBackdrop(camera, backdrop)
  2610.      RwSetCameraBackdropViewportRect(camera,0,0,320,240);
  2611.  
  2612.  
  2613.     res = AddRoom(    RoomDir[CurrentRoom], RoomName[CurrentRoom],
  2614.                     RoomData[CurrentRoom][0], RoomData[CurrentRoom][1],
  2615.                     RoomData[CurrentRoom][2], RoomData[CurrentRoom][3], xpos, ypos)
  2616.  
  2617. end sub
  2618.  
  2619. sub nostart_vr()
  2620.  
  2621. SCX = GetSystemMetrics(SM_CXSCREEN)
  2622. SCY = GetSystemMetrics(SM_CYSCREEN)
  2623.  
  2624.  
  2625.  
  2626.  
  2627. InitRoomData()
  2628.  
  2629.  
  2630.  
  2631. if !StartRoom("Inside the Alchemist's Lair") then
  2632.     BrowserExit
  2633. endif
  2634.  
  2635. //CurrentRoom = FirstRoom
  2636. loop
  2637.     RoomExitFlag = -1
  2638.     BACKDROPFILENAME=backName[CurrentRoom]
  2639. print "backdrop=",backName[CurrentRoom],"\n"
  2640.     backdrop = RwReadRaster(BACKDROPFILENAME, rwGAMMARASTER | rwDITHERRASTER);
  2641.         ifc (backdrop != NULL)    RwSetCameraBackdrop(camera, backdrop)
  2642.      RwSetCameraBackdropViewportRect(camera,0,0,320,240);
  2643.  
  2644.  
  2645.     res = AddRoom(    RoomDir[CurrentRoom], RoomName[CurrentRoom],
  2646.                     RoomData[CurrentRoom][0], RoomData[CurrentRoom][1],
  2647.                     RoomData[CurrentRoom][2], RoomData[CurrentRoom][3], xpos, ypos)
  2648.  
  2649.     if res then
  2650.         // Windows messages get lost without this
  2651.         loop
  2652.             if not TimerActive then
  2653.                 wait 100
  2654.             endif
  2655.             wait 100
  2656.         until RoomExitFlag <> -1
  2657.     else
  2658.         CurrentRoom += olddir
  2659.     endif
  2660.  
  2661.     if RoomExitFlag = keycode'KEY_END then
  2662.         loopexit
  2663.     elsif RoomExitFlag = keycode'KEY_HOME then
  2664.         olddir = +1
  2665.         CurrentRoom = FirstRoom
  2666.     elsif RoomExitFlag = keycode'KEY_LEFT then
  2667.         olddir = -1
  2668.         CurrentRoom--
  2669.     elsif RoomExitFlag = keycode'KEY_RIGHT then
  2670.         olddir = +1
  2671.         CurrentRoom++
  2672.     elsif RoomExitFlag = keycode'KEY_PGDN then
  2673.         olddir = -1
  2674.         CurrentRoom-=5
  2675.     elsif RoomExitFlag = keycode'KEY_PGUP then
  2676.         olddir = +1
  2677.         CurrentRoom+=5
  2678.     endif
  2679.  
  2680.     if CurrentRoom < FirstRoom then
  2681.         CurrentRoom += NumberOfRooms
  2682.     elsif CurrentRoom > LastRoom then
  2683.         CurrentRoom -= NumberOfRooms
  2684.     endif
  2685.  
  2686. endloop
  2687. print "loops end"
  2688.  
  2689.         WinKillTimer 1
  2690.         TimerActive = false
  2691.         ShutdownRoom()
  2692.  
  2693. endsub
  2694.  
  2695. sub display_object(item as int)
  2696. currentRoom=item
  2697.  
  2698.  
  2699.  
  2700. //if TimerActive then
  2701.  
  2702. if ThreeDinitialized then
  2703.     BACKDROPFILENAME=backName[CurrentRoom]
  2704. print "backdrop=",backName[CurrentRoom],"\n"
  2705.  
  2706.     backdrop = RwReadRaster(BACKDROPFILENAME, rwGAMMARASTER | rwDITHERRASTER);
  2707.         ifc (backdrop != NULL)    RwSetCameraBackdrop(camera, backdrop)
  2708.      RwSetCameraBackdropViewportRect(camera,0,0,320,240);
  2709.  
  2710.      res = AddRoom(    RoomDir[CurrentRoom], RoomName[CurrentRoom],
  2711.                     RoomData[CurrentRoom][0], RoomData[CurrentRoom][1],
  2712.                     RoomData[CurrentRoom][2], RoomData[CurrentRoom][3], xpos, ypos)
  2713.     winsettimer 1,10
  2714.     WinShowWindow 0,show
  2715.     timeractive = TRUE
  2716. else
  2717.         
  2718.  
  2719.     
  2720.  
  2721.     start_vr()
  2722. endif
  2723. end sub
  2724.  
  2725. sub Kill_3d()
  2726.  
  2727.     sound server_sounds+`apps/test.mid sequencer`
  2728.     id1=998
  2729.     settext id1, " "
  2730.     on_3d=no
  2731.     if TimerActive then
  2732.         WinKillTimer 1
  2733.         TimerActive = false
  2734.         WinShowWindow 0,hide
  2735.         wait 100
  2736.     endif
  2737.  
  2738. end sub
  2739.  
  2740. sub set_server_info()
  2741. local
  2742.  
  2743. string    cd_drive
  2744. check_copy as int
  2745. end local
  2746.  
  2747.         cd_drive=getinfo(CDROMS)
  2748.  
  2749.         setreadonlycache enabled,filename(cd_drive),`/`       //Use this read only cashe for www.fol.de
  2750. //        setreadonlycache enabled,filename(cd_drive),`/web/`  //Use this read only cashe for 194.80.180.23
  2751.  
  2752.  
  2753.         server_icons =the_main_path+`tvml/apps/world/icons/`    //Where to get the popup icons from
  2754.         server = the_main_path+`tvml/apps/world/countrys/`    //Where to get all the world maps from + images + text
  2755.  
  2756.         key_facts=the_main_path+`tvml/apps/world/key/`        //Where all key fact data is
  2757.  
  2758.  
  2759.  
  2760.         load_3ds_cd_files =filename(cd_drive)+`tvml/apps/world/newworld/3d/`  //This is for the 3d bin files
  2761.         server_sounds = filename(cd_drive)+`tvml/apps/world/sounds/`          //Sounds used for 2d + 3d icons
  2762.  
  2763.  
  2764.         server_local  = `apps/world/images/`        //The main interface
  2765.         server_maps  = `apps/world/maps/`        //All the world Maps
  2766.         server_menu  =`apps/world/menus/`        //Menus for the statistics
  2767.         server_games =`apps/world/games/`        //interface for the games
  2768.  
  2769.  
  2770.         key_facts_vid    = filename(cd_drive)+`tvml/apps/world/key/`  //Not used at the moment
  2771.         key_facts_local    =`apps/world/key/`                  //interface for key facts    
  2772.  
  2773.  
  2774.  
  2775.         server_cache = `apps/world/cache/`            //Where to copy all cached text files
  2776.  
  2777.  
  2778. end sub
  2779.  
  2780.  
  2781.  
  2782. sub load_image_to_screen(start_x_pos as int ,start_y_pos as int,x_size as int,y_size as int,type as int,speed_type as int,load_it as filename)
  2783. local
  2784.     int flag_hold_f
  2785. end local
  2786.  
  2787.         Print "http Image file = ",load_it,"\n"
  2788.  
  2789.     ifc(busy_mover==no)
  2790.     {
  2791.         SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  2792.         SpriteFlags2 233, enabled|visible, UNBOUND
  2793.     }
  2794.     flag_hold_f=0
  2795.     activepage 0
  2796.     saveimage 1280,960,x_size,y_size,jpg, load_it, ``, dummy, { flag_hold_f = 1 }
  2797.     while not flag_hold_f loop
  2798.         hold
  2799.         print flag_hold_f
  2800.     endwhile
  2801.     activepage 1
  2802.  
  2803.     loadimage start_x_pos,start_y_pos,x_size,y_size,jpg, load_it
  2804. //    while not flag_hold_f loop
  2805. //        hold
  2806. //        print flag_hold_f
  2807. //    endwhile
  2808.         Print "http Image file now done = ",load_it,"\n"
  2809.     
  2810.     activepage 0
  2811.     clearscreen start_x_pos,start_y_pos,x_size,y_size,standard,1,255
  2812.     delsprite 233
  2813.     busy_mover=no
  2814. end sub 
  2815.  
  2816.  
  2817. sub read_overview(over_view_name as filename)
  2818. local
  2819.     int over_count
  2820. end local
  2821.  
  2822.     open over_view_name for read as #1
  2823.     over_count=0
  2824.     whilec(!feof(#1))
  2825.     {
  2826.         overview[over_count] = inputline$(#1)
  2827.         over_count++
  2828.     }
  2829.     close #1
  2830.     total_over=over_count
  2831.  
  2832. print "OVERBIWE LINES=",total_over 
  2833.  
  2834. end sub
  2835.  
  2836.  
  2837. sub show_overview()
  2838. local
  2839.     int over_count
  2840.  
  2841. end local
  2842.  
  2843.     pencolor 255,255,255
  2844.     forc(over_count=0;over_count<total_over;over_count++)
  2845.     {
  2846.         ifc(over_count==0)
  2847.         {
  2848.             FONT "TIMESROMAN.BOLD",15,30
  2849.             id=over_count*1000
  2850.             ifc(country_set==1)
  2851.                 settext id, overview[over_count]
  2852.             else
  2853.                 label id, 126,720+(over_count*40), 1100, 40, left, overview[over_count]
  2854.         }
  2855.         else
  2856.         {
  2857.             FONT "TIMESROMAN",15,30
  2858.         }
  2859.         id=over_count*1000
  2860.         ifc(country_set==1)
  2861.             settext id, overview[over_count]
  2862.         else
  2863.             label id, 126,720+(over_count*40), 1100, 200, wrap|left, overview[over_count]
  2864.     }
  2865.  
  2866.  
  2867.  
  2868. end sub
  2869.  
  2870.  
  2871. sub show_overview_on_text_screen()
  2872. local
  2873.     int over_count
  2874.  
  2875. end local
  2876.  
  2877. print change_text,"ch\n"
  2878.     pencolor 0,0,0
  2879.     forc(over_count=1;over_count<total_over+1;over_count++)
  2880.     {
  2881.         ifc(over_count==1)
  2882.         {
  2883.             FONT "TIMESROMAN.BOLD",15,30
  2884.             id=over_count*1000
  2885.         }
  2886.         else
  2887.         {
  2888.             FONT "TIMESROMAN",15,30
  2889.         }
  2890.         id=over_count*1000
  2891.         ifc(change_text==2)
  2892.             settext id, overview[over_count-1]
  2893.         else
  2894.             label id, 150,130+(over_count*50), 900, 500, wrap|left, overview[over_count-1]
  2895.     }
  2896.  
  2897.  
  2898.  
  2899. end sub
  2900.  
  2901.  
  2902. sub hold_buttons(hold_button as int)
  2903.  
  2904.  
  2905.     id=500 //search
  2906.     iconbuttonid id,  672,0,116,124,enabled,none,1,100,100,100,
  2907.     {
  2908.         null
  2909.     }
  2910.     id=403 //help
  2911.     iconbuttonid id,  912,0,112,124,enabled,none,1,106,106,106,
  2912.     {
  2913.         null
  2914.     }
  2915.     id=426 //EXIT
  2916.     iconbuttonid id,  1130,0,146,124,enabled,none,1,108,108,108,
  2917.     {
  2918.         null
  2919.     }
  2920.     id=401 //World MAP
  2921.     iconbuttonid id,  792,0,120,124,enabled,none,1,102,102,102,
  2922.     {
  2923.         null
  2924.     }
  2925.     ifc(hold_button!=2)
  2926.     {
  2927.         id=413 //country left
  2928.         deleteobject country_left_id
  2929.         country_left_id=getnextobjectid()
  2930.         iconbuttonid id,  30,30,58,72,enabled,none,2,300,301,302,
  2931.         {
  2932.             null
  2933.         }
  2934.         id=412 //country right
  2935.         deleteobject country_right_id
  2936.         country_right_id=getnextobjectid()
  2937.         iconbuttonid id,  88,30,58,72,enabled,none,2,304,305,306,
  2938.         {
  2939.             null
  2940.         }
  2941.         deleteobject country_left_id_main
  2942.         deleteobject country_right_id_main
  2943.  
  2944.     }
  2945.     id=402 //print 
  2946. //    iconbuttonid id,  1028,0,108,124,enabled,none,1,104,104,104,
  2947. //    {
  2948. //        null
  2949. //    }
  2950.  
  2951.     ifc(hold_button==1)
  2952.     {
  2953.         ifc(show_where==1)
  2954.         {
  2955.             id=411 //Where
  2956.             where_id_on=getnextobjectid()
  2957.             iconbuttonid id,  1086,184,150,140,enabled,none,1,124,124,124,
  2958.             {
  2959.                 null
  2960.             }
  2961.             deleteobject    where_id_on_main
  2962.         }
  2963.         else
  2964.         {
  2965.             deleteobject    where_id_on
  2966.             deleteobject    where_id_on_main
  2967.         }
  2968.  
  2969.         ifc(show_3d_interface>0)
  2970.         {
  2971.             id=410 //next 3d object fro demo only
  2972.             d3_id_on=getnextobjectid()
  2973.             iconbuttonid id,  1130,332,150,140,enabled,none,1,122,122,122,
  2974.             {
  2975.                 null    
  2976.             }
  2977.             deleteobject    d3_id_on_main
  2978.         }
  2979.         else
  2980.         {
  2981.             deleteobject    d3_id_on
  2982.             deleteobject    d3_id_on_main
  2983.         }
  2984.         ifc(fun_facts_on[new_number]==1)
  2985.         {
  2986.             id=407 //fun facts
  2987.             fun_id_on=getnextobjectid()
  2988.             iconbuttonid id,  754,488,150,140,enabled,none,1,116,116,116,
  2989.             {
  2990.                 null
  2991.             }
  2992.             deleteobject    fun_id_on_main
  2993.         }
  2994.         else
  2995.         {
  2996.             deleteobject    fun_id_on
  2997.             deleteobject    fun_id_on_main
  2998.         }
  2999.         id=409 //games
  3000.         iconbuttonid id,  1098,492,150,140,enabled,none,1,120,120,120,
  3001.         {
  3002.             null
  3003.         }
  3004.         ifc(total_slides[new_number]>0)
  3005.         {
  3006.             id=415 //Image up
  3007.             deleteobject    up_id_on
  3008.             deleteobject    down_id_on
  3009.             deleteobject    list_id_on
  3010.             up_id_on=getnextobjectid()
  3011.             iconbuttonid id,  670,620,56,68,enabled,none,2,308,308,308,
  3012.             {
  3013.                 null
  3014.             }
  3015.  
  3016.             id=416 //Image down
  3017.             down_id_on=getnextobjectid()
  3018.             iconbuttonid id,  724,620,56,68,enabled,none,2,312,312,312,
  3019.             {
  3020.                 null
  3021.             }
  3022.             id=480    //photo list
  3023.             list_id_on=getnextobjectid()
  3024.             iconbuttonid id,  572,612,120,100,enabled,none,1,144,144,144,
  3025.             {
  3026.                 null
  3027.             }
  3028.             deleteobject    up_id_on_main
  3029.             deleteobject    down_id_on_main
  3030.             deleteobject    list_id_on_main
  3031.  
  3032.         }
  3033.         else
  3034.         {
  3035.             deleteobject    up_id_on_main
  3036.             deleteobject    down_id_on_main
  3037.             deleteobject    list_id_on_main
  3038.             deleteobject    up_id_on
  3039.             deleteobject    down_id_on
  3040.             deleteobject    list_id_on
  3041.         }
  3042.         id=423 //Large Image
  3043.         deleteobject zoom_id_on
  3044.         zoom_id_on=getnextobjectid()
  3045.         iconbuttonid id,  0,600,120,124,enabled,none,1,142,142,142,
  3046.         {
  3047.             null
  3048.         }
  3049.         id=422 //Large text
  3050.         iconbuttonid id,  0,716,120,104,enabled,none,1,138,138,138,
  3051.         {
  3052.             null
  3053.         }
  3054.         id=408    //Stats
  3055.         iconbuttonid id,  936,584,150,140,enabled,none,1,118,118,118,
  3056.         {
  3057.             null
  3058.         }
  3059.         ifc(total_slides[new_number]>0)
  3060.         {
  3061.             id=406    //Photo
  3062.             photo_id_on=getnextobjectid()
  3063.             iconbuttonid id,  706,328,150,140,enabled,none,1,114,114,114,
  3064.             {
  3065.                 null
  3066.             }
  3067.             deleteobject    photo_id_on_main
  3068.         }
  3069.         else
  3070.         {
  3071.             deleteobject    photo_id_on
  3072.             deleteobject    photo_id_on_main
  3073.  
  3074.         }
  3075.         id=404  //country map
  3076.         iconbuttonid id,  926,122,152,140,enabled,none,1,110,110,110,
  3077.         {
  3078.             null
  3079.         }
  3080.         ifc(show_flag==0)
  3081.         {
  3082.             id=405    //flag
  3083.             deleteobject    flag_id_on
  3084.             flag_id_on=getnextobjectid()
  3085.             iconbuttonid id,  752,166,150,140,enabled,none,1,112,112,112,
  3086.             {
  3087.                 null
  3088.             }
  3089.             deleteobject    flag_id_on_main
  3090.         }
  3091.         else
  3092.         {
  3093.             deleteobject    flag_id_on
  3094.             deleteobject    flag_id_on_main
  3095.         }
  3096.  
  3097.     }
  3098.  
  3099.  
  3100. end sub
  3101.  
  3102.  
  3103.  
  3104. sub fast_ handle_popup( id as int x as int the_map_size as int )
  3105. local
  3106.     int last_id
  3107. endlocal
  3108.  
  3109.         font "HELVETICA",11,22
  3110.  
  3111.         if x then
  3112.  
  3113.  
  3114.             if the_map_size==1 then
  3115.                 id1=998
  3116.                 settext id1, popup_cap_l[strtoi(read_text[id-1])]
  3117.                 sound server_sounds+filename(itostr(play_it[id-1]))+`.wav wave`
  3118.             else
  3119.                 id1=997
  3120.                 settext id1, popup_cap_l[strtoi(read_text[id-1])]
  3121.                 sound server_sounds+filename(itostr(play_it[id-1]))+`.wav wave`
  3122.             endif
  3123.             last_id=id
  3124.         else
  3125.  
  3126.  
  3127.             if id==last_id then
  3128.  
  3129.                 if on_3d==no then
  3130.                     if the_map_size==1 then
  3131.                         id1=998
  3132.                         settext id1, " "
  3133.                         sound `apps/2222.wav wave`
  3134.                     else
  3135.                         id1=997
  3136.                         settext id1, " "
  3137.                         sound `apps/2222.wav wave`
  3138.                     endif
  3139.                 endif
  3140.             endif
  3141.         endif
  3142. end sub
  3143.  
  3144.  
  3145.  
  3146. sub show_sprite(the_map_size as int)
  3147.  
  3148. local
  3149.     string    read_string
  3150.     string    sprite_label[20]
  3151.  
  3152.     int    id,x,y,sprite_count,offset_x,offset_y,ttt
  3153.     int    pos_x[25],pos_y[25],sprit_no[25]
  3154.     int    last_id,icon_start,read_icon
  3155.     float factor_size_x,factor_size_y,check_pos
  3156.     int    del_sp_cnt
  3157. end local
  3158.     
  3159. //    ifc(test_prog==1)
  3160. //        return
  3161.  
  3162.  
  3163.     deleteobject popup_the_sprite
  3164.     sprites_on=yes
  3165.     ifc(the_map_size==1)
  3166.     {
  3167.         factor_size_x=(320.0/501.0)
  3168.         factor_size_y=(320.0/501.0)
  3169.         offset_x=30
  3170.         offset_y=130
  3171.     }
  3172.     else
  3173.     {
  3174.         factor_size_x=1
  3175.         factor_size_y=1
  3176.         offset_x=140
  3177.         offset_y=132
  3178.     }
  3179.  
  3180. //    hold_buttons(the_map_size)
  3181.  
  3182.     restoredata icon_pos
  3183.     icon_start=(new_number-1)*60
  3184.  
  3185.  
  3186.     forc(sprite_count=1;sprite_count<total_images+1;sprite_count++)
  3187.     {
  3188.         input data icon_pos[icon_start] , sprit_no[sprite_count]
  3189.         icon_start++
  3190.         input data icon_pos[icon_start] ,read_icon
  3191.         icon_start++
  3192.         check_pos=float(read_icon)
  3193.         check_pos*=factor_size_x
  3194.         check_pos+=offset_x
  3195.         pos_x[sprite_count]=int(check_pos)
  3196.         input data icon_pos[icon_start] , read_icon
  3197.         icon_start++
  3198.         check_pos=float(read_icon)
  3199.         check_pos*=factor_size_y
  3200.         check_pos+=offset_y
  3201.         pos_y[sprite_count]=int(check_pos)
  3202.  
  3203.  
  3204.         ifc(the_map_size==1)
  3205.         {
  3206.             ifc(pos_y[sprite_count]>482)
  3207.                 pos_y[sprite_count]=482
  3208.             ifc(pos_y[sprite_count]<130)
  3209.                 pos_y[sprite_count]=130
  3210.  
  3211.             ifc(pos_x[sprite_count]>542)
  3212.                 pos_x[sprite_count]=542
  3213.             ifc(pos_x[sprite_count]<30)
  3214.                 pos_x[sprite_count]=30
  3215.         }
  3216.  
  3217.  
  3218.     
  3219.     }
  3220.  
  3221.  
  3222.     ACTIVEPAGE 0
  3223. //    transparentcolour 246,255,252,244
  3224.     transparentcolor  255,255,255
  3225.  
  3226.  
  3227.     ifc(last_sprite_country!=new_number)
  3228.     {
  3229.         last_sprite_country=new_number
  3230.         ifc(pop_up_small==yes  && the_map_size==1)
  3231.         {
  3232.             pop_up_small=no
  3233.             forc(sprite_count=1;sprite_count<total_images+1;sprite_count++)
  3234.             {
  3235.                 sprite sprite_count, pos_x[sprite_count], pos_y[sprite_count], looped, 1, 1000, [sprit_no[sprite_count]]
  3236.                 SpriteFlags2 sprite_count, enabled|visible|popup  , UNBOUND
  3237. //                SpriteFlags sprite_count, true, true, false, true, UNBOUND
  3238.                 SpritePopup sprite_count, 0, false
  3239.                 spritebbox sprite_count,pos_x[sprite_count],pos_y[sprite_count],128,128
  3240.                 spritepopup sprite_count,15,true
  3241.                 wait 1000
  3242.             }
  3243.         }
  3244.         else
  3245.         {
  3246.             ifc(pop_up_big==yes)
  3247.             {
  3248.                 pop_up_big=no
  3249.                 forc(sprite_count=1;sprite_count<total_images+1;sprite_count++)
  3250.                 {
  3251.                     sprite sprite_count, pos_x[sprite_count], pos_y[sprite_count], looped, 1, 1000, [sprit_no[sprite_count]]
  3252.                     SpriteFlags2 sprite_count, enabled|visible|popup, UNBOUND
  3253.                     SpritePopup sprite_count, 0, false
  3254.                     spritebbox sprite_count,pos_x[sprite_count],pos_y[sprite_count],128,128
  3255.                     spritepopup sprite_count,15,true
  3256.                     wait 1000
  3257.                 }
  3258.             }
  3259.         }
  3260.  
  3261.     }
  3262.         click3d=0
  3263.         last_id=0
  3264.         forc(sprite_count=1;sprite_count<total_images+1;sprite_count++)
  3265.         {
  3266.             show_3d_desc[sprite_count]=" "
  3267.             sprite sprite_count, pos_x[sprite_count], pos_y[sprite_count], looped, 1, 1000, [sprit_no[sprite_count]]
  3268.             ifc(click_it[sprite_count-1]>0 && the_map_size==1)
  3269.             {
  3270.                 SpriteFlags2 sprite_count, clickable|enabled|visible|popup,UNBOUND
  3271.                 show_3d[click3d]=click_it[sprite_count-1]
  3272.                 show_3d_desc[click3d]=popup_cap_l[strtoi(read_text[sprite_count-1])]
  3273.                 click3d++
  3274.             }
  3275.             else
  3276.                 SpriteFlags2 sprite_count, enabled|visible|popup,UNBOUND
  3277.             SpritePopup sprite_count, 0, false
  3278.         }
  3279.  
  3280.  
  3281.     pencolor 255,255,255
  3282.  
  3283.     font "HELVETICA",11,22
  3284.     id=998
  3285.     label id, 126,628, 440, 102, left|wrap," "
  3286.     id=997
  3287.     label id, 132,900, 1002, 102, centre|wrap, " "
  3288.  
  3289.     popup_the_sprite=getnextobjectid()
  3290.     on_sprite_popup id, x
  3291.     { 
  3292.         handle_popup( id, x, the_map_size )
  3293.     }
  3294.     deleteobject popups_are_on
  3295.     popups_are_on=getnextobjectid()
  3296.     on_sprite_drop id, x, y,
  3297.     { 
  3298.         ifc(the_map_size==1)
  3299.         {
  3300.             sound `apps/2222.wav wave`
  3301.             small_start=1
  3302.             deleteobject zoom_id_on
  3303.             ifc(sprites_on==yes)
  3304.             {
  3305.                 forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  3306.                     delsprite del_sp_cnt
  3307.             }
  3308.  
  3309.             on_3d=yes
  3310.                 sound server_sounds+`longplay/`+filename(itostr(click_it[id-1]))+`.mid sequencer`
  3311.             display_object(click_it[id-1])
  3312.             flag_hold=0
  3313.             SetFilenameProperty loadphoto, "LoadImageNotify", server_local +`/bkgnd`+load_ext
  3314.             while not flag_hold loop
  3315.                 hold
  3316.             endwhile
  3317.  
  3318.  
  3319. //            LOADIMAGE 30,130,640,480,jpg,server_local +`/bkgnd`+load_ext
  3320.  
  3321.         }
  3322.     }    
  3323. end sub
  3324.  
  3325. sub work_out_rad()
  3326.  
  3327.     one_rad=3.14*2
  3328.     one_rad/=360
  3329.  
  3330. end sub
  3331.  
  3332. sub work_angle(new_angle as float)
  3333.  
  3334.     new_angle*=3.6
  3335.     total_angle+=new_angle
  3336.     angle=total_angle
  3337.     angle*=one_rad
  3338.     flood_angle=total_angle-(new_angle/2)
  3339.     flood_angle*=one_rad
  3340.  
  3341. end sub
  3342.  
  3343. sub draw_circle(draw_pie_no as int)
  3344.  
  3345.     circle_id[draw_pie_no]=getnextobjectid()
  3346.     CIRCLE start_x,start_y,radius
  3347.  
  3348. end sub
  3349.  
  3350. sub draw_line()
  3351.  
  3352.     new_y=radius*sin(angle)
  3353.     new_x=radius*cos(angle)
  3354.     new_x+=start_x
  3355.     new_y+=start_y
  3356.     pencolor 0,0,100
  3357.     line
  3358.     [
  3359.         start_x,start_y,int(new_x),int(new_y)
  3360.     ]
  3361.  
  3362. end sub
  3363.  
  3364. sub draw_flood(draw_pie_no as int, p_count as int, current_cir as int)
  3365. local
  3366.     int r,g,b
  3367.     float new_x1, new_y1
  3368.     pie_lable as string
  3369. endlocal
  3370.  
  3371.     new_y=radius/2*sin(flood_angle)
  3372.     new_x=radius/2*cos(flood_angle)
  3373.     new_x1 = new_x*0.75
  3374.     new_y1 = new_y*0.75
  3375.     lable_y=radius*1.15*sin(flood_angle)
  3376.     lable_x=radius*1.15*cos(flood_angle)
  3377.     new_x+=start_x
  3378.     new_y+=start_y
  3379.     new_x1+=start_x
  3380.     new_y1+=start_y
  3381.     lable_x+=start_x
  3382.     lable_y+=start_y
  3383.     pencolor  255, 255, 255
  3384.     line_id[current_cir][p_count]=getnextobjectid()
  3385.     line
  3386.     [
  3387.         int(new_x),int(new_y),int(lable_x),int(lable_y)
  3388.     ]
  3389.     ifc(pie_number[p_count]>0)
  3390.         pie_lable=itostr(pie_number_old[p_count])
  3391.     else
  3392.         pie_lable=itostr(pie_number[p_count])
  3393.     pie_lable=pie_lable+"% "
  3394.     ifc(lable_x<new_x)
  3395.     {
  3396.         lable_id[current_cir][p_count]=getnextobjectid()
  3397.         ifc(lable_y<new_y)
  3398.             text int(lable_x)-45,int(lable_y)-35,pie_lable
  3399.         else
  3400.             text int(lable_x)-35,int(lable_y),pie_lable
  3401.     }
  3402.     else
  3403.     {
  3404.         lable_id[current_cir][p_count]=getnextobjectid()
  3405.         ifc(lable_x>new_x)
  3406.             text int(lable_x),int(lable_y)-25,pie_lable
  3407.         else
  3408.             text int(lable_x),int(lable_y),pie_lable
  3409.     }
  3410.     pencolor  red[pie_desc[p_count] ],green[pie_desc[p_count]],blue[pie_desc[p_count]]
  3411.  
  3412.     flood_id[current_cir][p_count]=getnextobjectid()
  3413.     floodfill int(new_x1),int(new_y1)
  3414.  
  3415.     pencolor  255, 255, 255
  3416.  
  3417. end sub
  3418.  
  3419.  
  3420. sub tryit( x as int, y as int ,draw_pie_no as int, pie_type as int, current_cir as int)
  3421. local
  3422.     max_cut as int
  3423.     largest as int
  3424.     int pie_big
  3425. endlocal
  3426.  
  3427. restoredata fcolour
  3428.  
  3429.     start_x=x
  3430.     start_y=y
  3431.     radius=90
  3432.     total_angle=0
  3433.  
  3434.     largest=1
  3435.     ifc(pie_type==1)
  3436.     {
  3437.         max_cut=5
  3438.         forc(p_count=1;p_count<6;p_count++)
  3439.         {
  3440.             pie_desc[p_count]=land_name[draw_pie_no][p_count]
  3441.             pie_number[p_count]=land_number[draw_pie_no][p_count]
  3442.             pie_number_old[p_count]=land_number[draw_pie_no][p_count]
  3443.             ifc(pie_number[p_count]>pie_big)
  3444.             {
  3445.                 pie_big=pie_number[p_count]
  3446.                 largest=p_count
  3447.             }
  3448.  
  3449.         }
  3450.     }
  3451.  
  3452.     ifc(pie_type==2)
  3453.     {
  3454.         max_cut=8
  3455.         pie_big=0
  3456.         forc(p_count=1;p_count<9;p_count++)
  3457.         {
  3458.             pie_desc[p_count]=labor_name[draw_pie_no][p_count]
  3459.             pie_number[p_count]=labor_number[draw_pie_no][p_count]
  3460.             pie_number_old[p_count]=labor_number[draw_pie_no][p_count]
  3461.             ifc(pie_number[p_count]>pie_big)
  3462.             {
  3463.                 pie_big=pie_number[p_count]
  3464.                 largest=p_count
  3465.             }
  3466.         }
  3467.     }
  3468.  
  3469.  
  3470.     ifc(pie_type==3)
  3471.     {
  3472.         max_cut=9
  3473.         forc(p_count=1;p_count<10;p_count++)
  3474.         {
  3475.             pie_desc[p_count]=rel_name[draw_pie_no][p_count]
  3476.             pie_number[p_count]=rel_number[draw_pie_no][p_count]
  3477.             pie_number_old[p_count]=rel_number[draw_pie_no][p_count]
  3478.             ifc(pie_number[p_count]>pie_big)
  3479.             {
  3480.                 pie_big=pie_number[p_count]
  3481.                 largest=p_count
  3482.             }
  3483.         }
  3484.     }
  3485.  
  3486.  
  3487.     forc(p_count=1;p_count<10;p_count++)
  3488.     {
  3489.         ifc(pie_number[p_count]==1)
  3490.         {
  3491.             pie_number[p_count]=3
  3492.             pie_number[largest]-=2
  3493.         }
  3494.         ifc(pie_number[p_count]==2)
  3495.         {
  3496.             pie_number[p_count]=3
  3497.             pie_number[largest]--
  3498.         }
  3499.     }
  3500.  
  3501.     draw_first=1
  3502.     
  3503.  
  3504.     ifc(pie_number[1]==999)
  3505.     {
  3506.         PENCOLOR 255,255,255
  3507.         TRANSPARENCY 50
  3508.         fillmask0
  3509.         not_avail1[current_cir]=getnextobjectid()
  3510.         text x-20,y-40,"Not"
  3511.         not_avail2[current_cir]=getnextobjectid()
  3512.         text x-50,y-10,"Available"
  3513.  
  3514.         LINESTYLE SOLID
  3515.         PENWIDTH 1
  3516.         draw_circle(current_cir)
  3517.         TRANSPARENCY 0
  3518.         FILLMASK1 255,255,255
  3519.     }
  3520.     else
  3521.     {
  3522.         FILLMASK1 255,255,255
  3523.         TRANSPARENCY 0
  3524.         PENCOLOR 0,0,0
  3525.         LINESTYLE SOLID
  3526.         PENWIDTH 1
  3527.         work_out_rad()
  3528.         draw_circle(current_cir)
  3529.         work_angle(0)
  3530.         forc(p_count=1;p_count<max_cut;p_count++)
  3531.         {
  3532.             ifc(pie_number[p_count]>0)
  3533.             {
  3534.                 ifc(draw_first=1)
  3535.                 {
  3536.                     draw_line()
  3537.                     draw_first=0
  3538.             
  3539.                 }
  3540.                 work_angle(pie_number[p_count])
  3541.                 draw_line()
  3542.                 draw_flood(draw_pie_no,p_count,current_cir)    
  3543.     
  3544.             }
  3545.         }
  3546.  
  3547.     
  3548.         ifc(pie_number[p_count]>0)
  3549.         {
  3550.             work_angle(pie_number[p_count])
  3551.             draw_flood(draw_pie_no,p_count,current_cir)    
  3552.         }
  3553.     }
  3554.  
  3555. endsub
  3556.  
  3557. sub pie_bar(menu_number as int)
  3558.  
  3559.     FONT "HELVETICA.BOLD",13,26
  3560.     tryit( 172, 570 , graph[0],menu_number,1)
  3561.     tryit( 482, 570 ,graph[1],menu_number,2)
  3562.     tryit( 792, 570 ,graph[2],menu_number,3)
  3563.     tryit( 1102, 570 ,graph[3],menu_number,4)
  3564.  
  3565. end sub
  3566.  
  3567.  
  3568. sub add_sprites()
  3569. local
  3570.  
  3571.     int    icon_start,next_icon
  3572. end local
  3573.  
  3574.     ifc(new_number==261)
  3575.         return    
  3576.  
  3577.     ifc(new_number==21)
  3578.         return    
  3579.  
  3580.     delsprite 0
  3581.     delsprite 1
  3582.     delsprite 2
  3583.     delsprite 3
  3584.     delsprite 4
  3585.     delsprite 5
  3586.     delsprite 6
  3587.     delsprite 7
  3588.     delsprite 8
  3589.     delsprite 9
  3590.     delsprite 10
  3591.     delsprite 11
  3592.     delsprite 12
  3593.     delsprite 13
  3594.     delsprite 14
  3595.     delsprite 15
  3596.     delsprite 16
  3597.     delsprite 17
  3598.     delsprite 18
  3599.     delsprite 19
  3600.     delsprite 20
  3601.  
  3602. //    transparentcolour 246,255,252,244
  3603.     transparentcolor 255,255,255
  3604.     SPRITEFILE gif,server_icons+country+`.gif`
  3605.     show_3d_interface=0
  3606.     restoredata icon_data
  3607.     icon_start=(new_number-1)*64
  3608.     input data icon_data[icon_start] , total_images 
  3609.     icon_start++
  3610.     ifc(total_images==0)
  3611.     {
  3612.         null
  3613.     }
  3614.     else
  3615.     {
  3616.  
  3617.         count3=0
  3618.         forc(count2=0;count2<15;count2++)
  3619.         {
  3620.             forc(count_extra=0;count_extra<10;count_extra++)
  3621.             {    
  3622.                 input data icon_data[icon_start] , read_text[count3]
  3623.                 icon_start++
  3624.                 input data icon_data[icon_start] , click_it[count3]
  3625.                 ifc(click_it[count3]>0)
  3626.                     show_3d_interface=1
  3627.                 icon_start++
  3628.                 input data icon_data[icon_start] , play_it[count3]
  3629.                 icon_start++
  3630.                 count3++
  3631.                 ifc(count3==total_images)
  3632.                 {
  3633.                     breakc
  3634.                 }
  3635.             }
  3636.             ifc(count3==total_images)
  3637.             {
  3638.                 breakc
  3639.             }
  3640.         }
  3641.         count_pos=0
  3642.         line_pos=0
  3643.         forc(def_count=1;def_count<total_images+1;def_count++)
  3644.         {
  3645.  
  3646.             DEFSPRITE def_count, count_pos*128, line_pos*128,128,128
  3647.             count_pos++
  3648.             ifc(count_pos==10)
  3649.             {
  3650.                 count_pos=0
  3651.                 line_pos++
  3652.             }
  3653.         }
  3654.     
  3655.     }
  3656.  
  3657.     transparency 50
  3658.  
  3659.  
  3660.  
  3661. end sub 
  3662.  
  3663.  
  3664. sub show_country(show_pic as int)
  3665. local
  3666.     int read_number,id_check
  3667.     int    hotxs[100],hotys[100],hotxe[100],hotye[100],store_country[100]
  3668.     string    map_name[30]
  3669. end local
  3670.  
  3671.     ifc(interface_on_screen==no)
  3672.     {
  3673.         ifc(country_set!=1)
  3674.         {
  3675.             load_image_to_screen(0,0,1280,960,1,255,server_local+`main`+load_ext)
  3676.         }
  3677.     }
  3678.     interface_on_screen=no
  3679.     restoredata highlight_map
  3680.     read_number=new_number-1
  3681.     read_number*=6
  3682.     input data highlight_map[read_number],id_check,hotxs[0],hotys[0],hotxe[0],hotye[0],map_name[0]
  3683.     ifc(strtoi(map_name[0])==0)
  3684.     {
  3685.         show_where=0
  3686.     }
  3687.     else
  3688.         show_where=1
  3689.  
  3690.     restoredata total_flag_data
  3691.     read_number=new_number-1
  3692.     input data total_flag_data[read_number],show_flag
  3693.     ifc(last_sprite_country!=new_number)
  3694.     {
  3695.         add_sprites()
  3696.     }
  3697.     FONT "HELVETICA",24,48
  3698.     pencolor  255,255,255
  3699.     ACTIVEPAGE 0
  3700.     hold_buttons(1)
  3701.     clearscreen 0,0,1279,959,standard,1,255
  3702.  
  3703.     ifc(country_set==1)
  3704.     {
  3705.         id=99
  3706.         settext id, header_top
  3707.     }
  3708.     else
  3709.     {
  3710.         id=99
  3711.         label id, 190,40, 550, 60, left, header_top
  3712.         FONT "HELVETICA",11,22
  3713.         pencolor  255,255,255
  3714.         id=98
  3715.         label id, 126,628, 440, 102, left|wrap," "
  3716.     }
  3717.  
  3718.     FILLMASK1 255,255,255
  3719.     TRANSPARENCY 0
  3720.     PENCOLOR 0,0,0
  3721.     LINESTYLE SOLID
  3722.     PENWIDTH 4
  3723.  
  3724.     show_overview()
  3725.  
  3726.     ifc(show_pic==yes)
  3727.     {
  3728.         ifc(busy_mover==no)
  3729.         {
  3730.             SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  3731.             SpriteFlags2 233, enabled|visible, UNBOUND
  3732.             busy_mover=yes
  3733.         }
  3734.         hit_3d=0
  3735.         id=98
  3736.         settext id," "
  3737.  
  3738.         id=998
  3739.         settext id, " "
  3740.         hit_3d=0
  3741.         flag_hold=0
  3742.         ifc(country_set==1)
  3743.         {
  3744.             SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/map320`+load_ext3
  3745.             while not flag_hold loop
  3746.                 hold
  3747.             endwhile
  3748.         }
  3749.         else
  3750.         {
  3751.             loadphoto=getnextobjectid()
  3752.             saveimage 28,130,640,480,jpg, server_local  +`/bkgnd`+load_ext, ``, dummy, { flag_hold = 1 }
  3753.             while not flag_hold loop
  3754.                 hold
  3755.             endwhile
  3756.             wait 100
  3757.             flag_hold=0
  3758.             SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/map320`+load_ext3
  3759.             while not flag_hold loop
  3760.                 hold
  3761.             endwhile
  3762.  
  3763.  
  3764.         }
  3765.         ifc(busy_mover=yes)
  3766.         {
  3767.             delsprite 233
  3768.             busy_mover=no
  3769.         }
  3770.         show_sprite(1)
  3771.         count=0
  3772.     }
  3773.     ifc(busy_mover=yes)
  3774.     {
  3775.         delsprite 233
  3776.         busy_mover=no
  3777.     }
  3778.  
  3779.     browsersetcursorbusy false
  3780.  
  3781. end sub
  3782.  
  3783.  
  3784. sub title()
  3785.  
  3786.     SCX = GetSystemMetrics(SM_CXSCREEN)
  3787.     SCY = GetSystemMetrics(SM_CYSCREEN)
  3788.  
  3789.     ShowBrowserWindow Fullscreen
  3790.     ifc(scx==800)
  3791.     {
  3792.             xpos=80
  3793.             ypos=60
  3794.             SetBrowserWindowPos  0, 0
  3795.             SetBrowserWindowSize SCX,SCY
  3796.     }
  3797.     else
  3798.     {
  3799.         ifc(scx<800)
  3800.         {
  3801.             xpos=0
  3802.             ypos=0
  3803.             SetBrowserWindowPos  0, 0
  3804.             SetBrowserWindowSize 640, 480
  3805.         }
  3806.         else
  3807.         {
  3808.             xpos=192
  3809.             ypos=144    
  3810.             SetBrowserWindowPos  0, 0
  3811.             SetBrowserWindowSize SCX,SCY
  3812.         }
  3813.     }
  3814.     load_image_to_screen(0 ,0,1280,960,1,255,server_local+`title`+load_ext)
  3815.  
  3816.  
  3817.  
  3818. //    ACTIVEPAGE 1
  3819. //    LOADIMAGE 0,0,1280,960,JPG,server_local+`title`+load_ext
  3820. //    ACTIVEPAGE 0
  3821. //    clearscreen 0,0,1280,960,standard,1,255
  3822.     wait 1000
  3823. end sub
  3824.  
  3825. sub start_screen() 
  3826. local
  3827.     read_count as int
  3828.     check_it as int
  3829. end local
  3830.  
  3831.     country=`129`
  3832.     new_number=129
  3833.     header_top=list_2[129]
  3834.     header_text=list_1[129]
  3835.  
  3836.     restoredata area_data
  3837.     restoredata pop_data
  3838.     restoredata prod_data
  3839.     restoredata total_slide_data
  3840.  
  3841.     forc(read_count=1;read_count<266;read_count++)
  3842.     {
  3843.         input data area_data , area[read_count] 
  3844.     }
  3845.  
  3846.     forc(read_count=1;read_count<266;read_count++)
  3847.     {
  3848.         input data pop_data , pop[read_count] 
  3849.     }
  3850.  
  3851.     forc(read_count=1;read_count<266;read_count++)
  3852.     {
  3853.         input data prod_data ,prod[read_count] 
  3854.     }
  3855.  
  3856.     forc(read_count=1;read_count<266;read_count++)
  3857.     {
  3858.         input data total_slide_data , total_slides[read_count]
  3859.  
  3860.     }
  3861.  
  3862.  
  3863.  
  3864.  
  3865.     rnd_pic_cnt=1
  3866.     forc(read_count=1;read_count<266;read_count++)
  3867.     {
  3868.         input data  fun_facts, check_it
  3869.  
  3870.         input data  fun_facts, fun_facts_on[read_count]
  3871.  
  3872.         input data  fun_facts, af_pic_on[read_count]
  3873.         input data  fun_facts, kf_pic_on[read_count]
  3874.         input data  fun_facts, af_txt_on[read_count]
  3875.         input data  fun_facts, pic_txt_on[read_count]
  3876.         input data  fun_facts, da_txt_on[read_count]
  3877.         input data  fun_facts, kf_txt_on[read_count]
  3878.         input data  fun_facts, vid_txt_on[read_count]
  3879.         ifc(af_pic_on[read_count]==1)
  3880.         {
  3881.             rnd_pic_check[rnd_pic_cnt]=read_count
  3882.             rnd_pic_cnt++
  3883.         }
  3884.  
  3885.     }
  3886.  
  3887.     forc(read_count=1;read_count<811;read_count++)
  3888.     {
  3889.         input data popup_cap_new , check_it
  3890.         input data popup_cap_new , popup_cap_l[check_it]
  3891.     }
  3892.  
  3893.     forc(read_count=1;read_count<266;read_count++)
  3894.     {
  3895.         input data photo_facts, check_it
  3896.         input data photo_facts , photo_cr[check_it]
  3897.     }
  3898.  
  3899.     graph[0]=129
  3900.     graph[1]=249
  3901.     graph[2]=90
  3902.     graph[3]=122
  3903.     graph_name[0]="Kenya"
  3904.     graph_name[1]="Vereinigte Staaten"
  3905.     graph_name[2]="Deutschland"
  3906.     graph_name[3]="Japan"
  3907.  
  3908. end sub
  3909.  
  3910.  
  3911. sub games_screen()
  3912.  
  3913. //    load_image_to_screen(0 ,0,1280,960,1,255,server_games+`gamsel`+load_ext)
  3914.  
  3915.     ACTIVEPAGE 1
  3916.     LOADIMAGE 0,0,1280,960,JPG,server_games+`/gamsel`+load_ext
  3917.     ACTIVEPAGE 0
  3918.     clearscreen 0,0,1279,959,standard,1,255
  3919.  
  3920. end sub
  3921.  
  3922.  
  3923. sub games_screen1()
  3924.  
  3925. //    load_image_to_screen(0 ,0,1280,960,1,255,server_games+`tile`+load_ext)
  3926.  
  3927.     activepage 1
  3928.     loadimage 0,0,1280,960,gif,server_games+`tile`+load_ext
  3929.     activepage 0
  3930.     clearscreen 0,0,1280,960,standard,1,255
  3931.  
  3932. end sub
  3933.  
  3934. sub games_screen2()
  3935.     activepage 1
  3936.     loadimage 0,0,1280,960,gif,server_games+`quick`+load_ext
  3937.     activepage 0
  3938.     clearscreen 0,0,1280,960,standard,1,255
  3939. end sub
  3940.  
  3941.  
  3942. sub show_text_pic()
  3943. local 
  3944.  
  3945.     int pic_txt
  3946.     line_in as string 
  3947.  
  3948. end local
  3949.  
  3950.     ifc(pic_txt_on[new_number]==1)
  3951.     {
  3952.         open key_facts+country+`/pic`+country+`.txt` for read as #1
  3953.         pencolor  255,255,255
  3954.         whilec(!feof(#1))
  3955.         {
  3956.             line_in = inputline$(#1)
  3957.         }
  3958.         close #1
  3959.         FONT "HELVETICA",11,22
  3960.         id=819
  3961.         label id, 10,650, 644, 148, wrap|left, line_in
  3962.     }
  3963.  
  3964. end sub
  3965.  
  3966.  
  3967. sub show_text_am()
  3968. local 
  3969.  
  3970.     int pic_txt
  3971.     line_in as string 
  3972.     line_in2 as string 
  3973.     start as int 
  3974.  
  3975. end local
  3976.  
  3977.     ifc(af_txt_on[new_number]==1)
  3978.     {
  3979.         open key_facts+country+`/af`+country+`.txt` for read as #1
  3980.         pencolor  0,0,0
  3981.         pic_txt=0
  3982.         start=1
  3983.         whilec(!feof(#1))
  3984.         {
  3985.             line_in = inputline$(#1)
  3986.             ifc(len(line_in)==0)
  3987.             {
  3988.                 start=0
  3989.                 line_in = inputline$(#1)
  3990.             }
  3991.             ifc(start==1)
  3992.             {
  3993.                 FONT "HELVETICA.BOLD",12,24
  3994.             }
  3995.             else
  3996.             {
  3997.                 FONT "HELVETICA",12,24
  3998.             }
  3999.             id=129+pic_txt
  4000.             label id, 745,330+(pic_txt*30), 480, 362, left, line_in
  4001.             pic_txt++
  4002.         }
  4003.         close #1
  4004.     }
  4005.  
  4006.  
  4007. end sub
  4008.  
  4009.  
  4010. sub show_text_kf()
  4011. local 
  4012.  
  4013.     int pic_txt
  4014.     line_in as string 
  4015.     line_in2 as string 
  4016.     check as string
  4017. end local
  4018.  
  4019.     ifc(kf_txt_on[new_number]==1)
  4020.     {
  4021.         open key_facts+country+`/kf`+country+`.txt` for read as #1
  4022.         pencolor  0,0,0
  4023.         pic_txt=0
  4024.         whilec(!feof(#1))
  4025.         {
  4026.             line_in = inputline$(#1)
  4027.             FONT "HELVETICA",14,28
  4028.             check=mid$(line_in,0,4)
  4029.             ifc(check=="FlΣc")
  4030.                 FONT "HELVETICA.BOLD",13,26
  4031.             check=mid$(line_in,0,7)
  4032. //            ifc(check=="Capital"  | check=="Populat" | check=="Languag" | check=="Religio" |check=="Governm" | check=="Currenc")
  4033.                                                                                                                                    
  4034.             ifc(check=="Hauptst"  | check=="Sprache" | check=="Bev÷lke" | check=="Religio" |check=="Staatsf" | check=="WΣhrung")
  4035.                 FONT "HELVETICA.BOLD",13,26
  4036.             id=229+pic_txt
  4037.             label id, 710,215+(pic_txt*35), 500, 362, left, line_in
  4038. //            label id, 754,220+(pic_txt*35), 462, 362, left, line_in
  4039.             pic_txt++
  4040.         }
  4041.         close #1
  4042.     }
  4043.  
  4044. end sub
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050. sub show_am()
  4051.  
  4052.     load_image_to_screen(0 ,0,1280,960,1,255,key_facts_local+`keya`+load_ext)
  4053.  
  4054.     ifc(af_pic_on[new_number]==1)
  4055.     {
  4056.         ACTIVEPAGE 0
  4057.         LOADIMAGE 74,330,640,480,jpg,server_local  +`/bkgnd`+load_ext
  4058.         LOADIMAGE 74,330,640,480,jpg,key_facts+country+`/af`+country+load_ext2
  4059.     }
  4060.     show_text_am()
  4061.     sound key_facts_local+`afsd.wav wave`
  4062.  
  4063. end sub
  4064.  
  4065.  
  4066.  
  4067.  
  4068. sub fun_screen()
  4069.  
  4070.  
  4071.     load_image_to_screen(0 ,0,1280,960,1,255,key_facts_local+`keyf`+load_ext)
  4072.     wait 500
  4073.     ifc(kf_pic_on[new_number]==1)
  4074.     {
  4075.         ACTIVEPAGE 0
  4076.         LOADIMAGE 28,130,640,480,jpg,server_local  +`/bkgnd`+load_ext
  4077.         LOADIMAGE 28,130,640,480,jpg,key_facts+country+`/kf`+country+load_ext2
  4078.         pencolor  255,255,255
  4079.         FONT "HELVETICA",11,22
  4080.         id =1010
  4081.         label id,740,930,800,48,left,"Photo:"+photo_cr[new_number]
  4082.     }
  4083.     transparentcolor 255,255,255
  4084.     fillmask0
  4085.  
  4086.  
  4087.  
  4088.  
  4089. //    show_text_pic()
  4090. //    show_text_kf()
  4091.  
  4092. end sub
  4093.  
  4094.  
  4095. sub add_text_to_screen()
  4096.  
  4097.  
  4098.     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  4099.     SpriteFlags2 233, enabled|visible, UNBOUND
  4100.  
  4101.     id=1000
  4102.     settext id, " "
  4103.     id=2000
  4104.     settext id, " "
  4105.  
  4106.     show_overview_on_text_screen()
  4107.  
  4108.     FONT "HELVETICA",24,48
  4109.     pencolor  255,255,255
  4110.     id=99
  4111.     settext id,  header_top
  4112.     transparentcolor 255,255,255
  4113.     fillmask0
  4114.  
  4115.     pencolor  156,156,198
  4116.  
  4117.     deleteobject   text_up_id 
  4118.     text_up_id=getnextobjectid()
  4119.     id=918 //text up large
  4120.     iconbuttonid id,  1184,780,62,60,enabled,none,2,320,321,322,{null}
  4121.     deleteobject   text_down_id 
  4122.     text_down_id=getnextobjectid()
  4123.     id=919 //text down large
  4124.     iconbuttonid id,  1182,838,62,58,enabled,none,2,324,325,326,{null}
  4125.  
  4126.  
  4127.     check_text=checkfile(server_cache+country+`.txt`,readable)
  4128.  
  4129.     ifc(check_text)
  4130.     {
  4131.         id=1000
  4132.         settext id, " "
  4133.         id=2000
  4134.         settext id, " "
  4135.  
  4136.         objHTMLBox2=getnextobjectid()
  4137.         customtextwindow 148,128,1012,802,server_cache+country+`.txt`,918,919
  4138.     }
  4139.     else
  4140.     {
  4141.         check_text=filecopy(server + country +`/`+country+`.txt`,server_cache+country+`.txt`)
  4142.         id=1000
  4143.         settext id, " "
  4144.         id=2000
  4145.         settext id, " "
  4146.         objHTMLBox2=getnextobjectid()
  4147.         customtextwindow 148,128,1012,802,server_cache+country+`.txt`,918,919
  4148.     }
  4149.  
  4150.     delsprite 233
  4151.  
  4152. end sub
  4153.  
  4154. sub     large_text()
  4155.  
  4156.     pop_up_small=no
  4157.  
  4158.     load_image_to_screen(0 ,0,1280,960,1,255,server_local+`/lagtxt`+load_ext)
  4159.  
  4160. //    ACTIVEPAGE 1
  4161. //    LOADIMAGE 0,0,1280,960,JPG,server_local+`/lagtxt`+load_ext
  4162. //    ACTIVEPAGE 0
  4163. //    clearscreen 0,0,1279,959,standard,1,255
  4164.  
  4165. //    show_overview_on_text_screen()
  4166.  
  4167.     FONT "HELVETICA",24,48
  4168.     pencolor  255,255,255
  4169.     id=99
  4170.     label id, 190,40, 550, 60, left, header_top
  4171.     add_text_to_screen()
  4172.  
  4173. end sub
  4174.  
  4175.  
  4176. sub show_pic(slide_number as filename,slide_check as int, size as int,slide_number2 as filename)
  4177. local
  4178.  
  4179.     int    help
  4180.     int    del_sp_cnt
  4181. end local
  4182.  
  4183.     ifc(sprites_on==yes)
  4184.     {
  4185.         forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  4186.             delsprite del_sp_cnt
  4187.     }
  4188.  
  4189.     pencolour  0,255,255,255
  4190.     FONT "HELVETICA",11,22
  4191.     activepage 0
  4192.  
  4193.  
  4194.     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  4195.     SpriteFlags2 233, enabled|visible, UNBOUND
  4196.  
  4197.     ifc(slide_check==0)
  4198.     {
  4199.         ifc(size==small)
  4200.         {
  4201.             id=98
  4202.             settext id," "
  4203.             id=998
  4204.             settext id, " "
  4205.     
  4206.             slide_number=filename("map320")
  4207.             flag_hold = 0
  4208.             ifc(small_start==1)
  4209.             {
  4210.                 small_start=0
  4211.                 loadphoto=getnextobjectid()
  4212.                 saveimage 28,130,640,480,jpg, server_local  +`/bkgnd`+load_ext, ``, dummy, { flag_hold = 1 }
  4213.                 while not flag_hold loop
  4214.                     hold
  4215.                 endwhile
  4216.                 wait 100
  4217.                 flag_hold=0
  4218.                 SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/`+ slide_number +load_ext3
  4219.                 while not flag_hold loop
  4220.                     hold
  4221.                 endwhile
  4222.             }
  4223.             else
  4224.             {
  4225.                 SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/`+ slide_number +load_ext3
  4226.                 while not flag_hold loop
  4227.                     hold
  4228.                 endwhile
  4229.             }
  4230.             show_sprite(1)
  4231.             FILLMASK0
  4232.         }
  4233.         else
  4234.         {    
  4235.             id=97
  4236.             settext id," "
  4237.             slide_number=filename("map")
  4238.             hit_3d=0
  4239.             flag_hold = 0
  4240.             ifc(big_start==1)
  4241.             {
  4242.                 big_start=0
  4243.                 loadphoto_l=getnextobjectid()
  4244.                 saveimage 140,132,1002,752,jpg, server_local  +`/lgback`+load_ext, ``, dummy, { flag_hold = 1 }
  4245.                 while not flag_hold loop
  4246.                     hold
  4247.                 endwhile
  4248.                 wait 100
  4249.                 flag_hold=0
  4250.                 SetFilenameProperty loadphoto_l, "LoadImageNotify", server + country +`/`+ slide_number +load_ext2
  4251.                 while not flag_hold loop
  4252.                     hold
  4253.                 endwhile
  4254.             }
  4255.             else
  4256.             {
  4257.                 SetFilenameProperty loadphoto_l, "LoadImageNotify", server + country +`/`+ slide_number +load_ext2
  4258.                 while not flag_hold loop
  4259.                     hold
  4260.                 endwhile
  4261.             }
  4262.             show_sprite(2)
  4263.         }
  4264.  
  4265.     }
  4266.     else
  4267.     {
  4268.         ifc(size==small)
  4269.         {
  4270.             help=0
  4271.             id=98
  4272.             settext id," "
  4273.             flag_hold = 0
  4274.             FONT "HELVETICA",11,22
  4275.             id=998
  4276.             settext id, " "
  4277.             id=98
  4278.             settext id,large_cap[count]
  4279.             ifc(small_start==1)
  4280.             {
  4281.                 small_start=0
  4282.                 loadphoto=getnextobjectid()
  4283.                 saveimage 28,130,640,480,jpg, server_local  +`/bkgnd`+load_ext, ``, dummy, { flag_hold = 1 }
  4284.                 while not flag_hold loop
  4285.                     hold
  4286.                 endwhile
  4287.                 wait 100
  4288.                 flag_hold=0
  4289.                 SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/`+ slide_number+`s`+load_ext3
  4290.  
  4291. //                loadphoto=getnextobjectid()
  4292. //                saveimage 28,130,640,480,jpg, server + country +`/`+ slide_number+`s`+load_ext3, ``, dummy, { flag_hold = 1 }
  4293.                 while not flag_hold loop
  4294.                     hold
  4295.                 endwhile
  4296.             }
  4297.             else
  4298.             {
  4299.                 SetFilenameProperty loadphoto, "LoadImageNotify", server_local  +`/bkgnd`+load_ext
  4300.                 while not flag_hold loop
  4301.                     hold
  4302.                 endwhile
  4303.                 wait 100
  4304.                 flag_hold = 0
  4305.                 SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/`+ slide_number +`s`+load_ext3
  4306.                 while not flag_hold loop
  4307.                     hold
  4308.                 endwhile
  4309.  
  4310.             }
  4311.         }
  4312.         else
  4313.         {
  4314.             FONT "HELVETICA",11,22
  4315.             id=997
  4316.             settext id, " "
  4317.             id=97
  4318.             settext id,large_cap[count]
  4319.             help=0
  4320.             flag_hold = 0
  4321.             ifc(big_start==1)
  4322.             {
  4323.                 big_start=0
  4324.  
  4325.                 loadphoto_l=getnextobjectid()
  4326.                 saveimage 140,132,1002,752,jpg, server_local  +`/lgback`+load_ext, ``, dummy, { flag_hold = 1 }
  4327.                 while not flag_hold loop
  4328.                     hold
  4329.                 endwhile
  4330.                 wait 100
  4331.                 flag_hold=0
  4332.                 SetFilenameProperty loadphoto_l, "LoadImageNotify", server + country +`/`+ slide_number +`l`+load_ext2
  4333.  
  4334. //                loadphoto_l=getnextobjectid()
  4335. //                saveimage 140,132,1002,752,jpg, server + country +`/`+ slide_number +`l`+load_ext2, ``, dummy, { flag_hold = 1 }
  4336.                 while not flag_hold loop
  4337.                     hold
  4338.                 endwhile
  4339.             }
  4340.             else
  4341.             {
  4342.                 SetFilenameProperty loadphoto_l, "LoadImageNotify", server_local  +`/lgback`+load_ext
  4343.                 while not flag_hold loop
  4344.                     hold
  4345.                 endwhile
  4346.                 wait 100
  4347.                 flag_hold = 0
  4348.                 SetFilenameProperty loadphoto_l, "LoadImageNotify", server + country +`/`+ slide_number +`l`+load_ext2
  4349.                 while not flag_hold loop
  4350.                     hold
  4351.                 endwhile
  4352.             }
  4353.         }
  4354.         ifc(sprites_on==yes)
  4355.         {
  4356.             forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  4357.                 delsprite del_sp_cnt
  4358.         }
  4359.     }
  4360.     delsprite 233
  4361.     browsersetcursorbusy false
  4362.  
  4363.     
  4364. end sub
  4365.  
  4366. sub set_large()
  4367.  
  4368.     big_start=1
  4369.     pencolor  255,255,255
  4370.     clearscreen 0,0,1279,959,standard,1,255
  4371.     FONT "HELVETICA",24,48
  4372.     id=99
  4373.     label id, 190,40, 550, 60, left, header_top
  4374.     clearscreen 0,0,1280,960,standard,1,255
  4375.     pencolor  241,230,119
  4376.     id=97
  4377.     label id, 132,900, 1002, 68, centre, " "
  4378.     load_image_to_screen(0 ,0,1280,960,1,255,server_local+`lagimg`+load_ext)
  4379.  
  4380. //    ACTIVEPAGE 1
  4381. //    LOADIMAGE 0,0,1280,960,JPG,server_local+`lagimg`+load_ext
  4382. //    ACTIVEPAGE 0
  4383. //    clearscreen 0,0,1280,960,standard,1,255
  4384.  
  4385.     show_pic(filename(itostr(count)),count,big,filename(itostr(next_image)))
  4386.  
  4387. end sub
  4388.  
  4389. sub menu_bar(menu_number as int)
  4390.  
  4391.     menu_load = filename( itostr(menu_number) )
  4392.     load_image_to_screen(0 ,840,1280,120,1,255,server_menu+menu_load+load_ext)
  4393.  
  4394. //    ACTIVEPAGE 1
  4395. //    LOADIMAGE 0,840,1280,120,jpg,server_menu+menu_load+load_ext
  4396. //    ACTIVEPAGE 0
  4397. //    clearscreen 0,840,1280,120,standard,1,255
  4398.     iconbuttonid id,  106,864,118,66,enabled,none,1,222,222,222,
  4399.     {
  4400.         null
  4401.     }
  4402.  
  4403. end sub
  4404.  
  4405. sub display_text(start_point_x as int ,start_point_y as int, text_number as int,menu_number as int)
  4406. local
  4407.     string    the_desc_with,temp_string
  4408.     int    string_count
  4409. end local
  4410.  
  4411.     the_desc_with=""
  4412.     temp_string=ftostr(the_per[text_number],"%.0f")
  4413.     forc(string_count=0;string_count<len(temp_string);string_count++)
  4414.     {
  4415.         ifc(string_count>0)
  4416.         {
  4417.             ifc(len(temp_string)-string_count==3 || len(temp_string)-string_count==6 || len(temp_string)-string_count==9)
  4418.             {    
  4419.                 the_desc_with=the_desc_with+","
  4420.             }
  4421.         }
  4422.         the_desc_with=the_desc_with+mid$(temp_string,string_count,1)
  4423.     }
  4424.     ifc(menu_number==1)
  4425.         the_desc_with+=" sq km"
  4426.  
  4427.     FONT "HELVETICA.BOLD",12,24
  4428.  
  4429.  
  4430.     id=444+text_number
  4431.     ifc(text_number==0)
  4432.         bar_text_map1=getnextobjectid()
  4433.     ifc(text_number==1)
  4434.         bar_text_map2=getnextobjectid()
  4435.     ifc(text_number==2)
  4436.         bar_text_map3=getnextobjectid()
  4437.     ifc(text_number==3)
  4438.         bar_text_map4=getnextobjectid()
  4439.     label id, start_point_x,start_point_y, 220, 68, centre, the_desc_with
  4440.     ifc(menu_number==3 && text_number==0)
  4441.     {
  4442.         id=411
  4443.         bar_text_map_lable=getnextobjectid()
  4444.         label id, 0,435, 1290, 68, centre, "Brutto-Sozialprodukt pro Kopf in US$"
  4445.     }
  4446.  
  4447.  
  4448. end sub
  4449.  
  4450. sub bar(menu_number as int, new_bar_line as int)
  4451.  
  4452.     TRANSPARENCY 0
  4453.     PENWIDTH 0
  4454.     fillmask0
  4455.  
  4456.     max=1
  4457.     forc(count_c=0;count_c<4;count_c++)
  4458.     {
  4459.         ifc(menu_number==1)
  4460.             the_per[count_c]=strtof(area[graph[count_c]])
  4461.         ifc(menu_number==2)
  4462.             the_per[count_c]=strtof(pop[graph[count_c]])
  4463.         ifc(menu_number==3)
  4464.             the_per[count_c]=strtof(prod[graph[count_c]])
  4465.     }
  4466.     forc(count_c=0;count_c<4;count_c++)
  4467.     {
  4468.         ifc(the_per[count_c]>max)
  4469.             max=the_per[count_c]
  4470.     }
  4471.     form=280/max
  4472.     forc(count_c=0;count_c<4;count_c++)
  4473.     {
  4474.         bar1[count_c]=810.0-(the_per[count_c]*form)    
  4475.     }
  4476.     ifc(menu_number==1)
  4477.     {
  4478.         PENCOLOR 255,0,255
  4479.         fillmask3 jpg,server_local+`graph1`+load_ext
  4480.     }
  4481.     ifc(menu_number==2)
  4482.     {
  4483.         PENCOLOR 0,167,252
  4484.         fillmask3 jpg,server_local+`graph3`+load_ext
  4485.     }
  4486.     ifc(menu_number==3)
  4487.     {
  4488.         PENCOLOR 255,117,0
  4489.         fillmask3 jpg,server_local+`graph5`+load_ext
  4490.     }
  4491.  
  4492.     ifc(new_bar_line==0)
  4493.     {
  4494.         bar_map1=getnextobjectid()
  4495.         RECTANGLE  102,int(bar1[0]),72,810-int(bar1[0])
  4496.         bar_map2=getnextobjectid()
  4497.         RECTANGLE  412,int(bar1[1]),72,810-int(bar1[1])
  4498.         bar_map3=getnextobjectid()
  4499.         RECTANGLE  722,int(bar1[2]),72,810-int(bar1[2])
  4500.         bar_map4=getnextobjectid()
  4501.         RECTANGLE  1032,int(bar1[3]),72,810-int(bar1[3])
  4502.         PENCOLOR 255,255,255
  4503.         display_text(38,(int(bar1[0])-45),0,menu_number)
  4504.         display_text(348,(int(bar1[1])-45),1,menu_number)
  4505.         display_text(658,(int(bar1[2])-45),2,menu_number)
  4506.         display_text(968,(int(bar1[3])-45),3,menu_number)
  4507.         activepage 0
  4508.         clearscreen 0,400,1280,450,pushup,1,15
  4509.  
  4510.     }
  4511.     else
  4512.     {
  4513.         ifc(new_bar_line==1)
  4514.         {
  4515.             bar_map1=getnextobjectid()
  4516.             RECTANGLE  102,int(bar1[0]),72,810-int(bar1[0])
  4517.             PENCOLOR 255,255,255
  4518.             display_text(38,(int(bar1[0])-45),0,menu_number)
  4519.         }
  4520.         ifc(new_bar_line==2)
  4521.         {
  4522.             bar_map2=getnextobjectid()
  4523.             RECTANGLE  412,int(bar1[1]),72,810-int(bar1[1])
  4524.             PENCOLOR 255,255,255
  4525.             display_text(348,(int(bar1[1])-45),1,menu_number)
  4526.         }
  4527.         ifc(new_bar_line==3)
  4528.         {
  4529.             bar_map3=getnextobjectid()
  4530.             RECTANGLE  722,int(bar1[2]),72,810-int(bar1[2])
  4531.             PENCOLOR 255,255,255
  4532.             display_text(658,(int(bar1[2])-45),2,menu_number)
  4533.         }
  4534.         ifc(new_bar_line==4)
  4535.         {
  4536.             bar_map4=getnextobjectid()
  4537.             RECTANGLE  1032,int(bar1[3]),72,810-int(bar1[3])
  4538.             PENCOLOR 255,255,255
  4539.             display_text(968,(int(bar1[3])-45),3,menu_number)
  4540.         }
  4541.     }
  4542.  
  4543. end sub
  4544.  
  4545.  
  4546. sub sort_list1()
  4547. local
  4548.  
  4549.     int    sort_count1,sort_count2
  4550.     int    sorted_out
  4551.     current_lowest as string
  4552.     spare_string as string
  4553.     int    spare_number
  4554.  
  4555. end local
  4556.  
  4557.  
  4558.  
  4559.     sorted_out=0
  4560.     forc(sort_count1=0;sort_count1<265;sort_count1++)
  4561.     {
  4562.         current_lowest=list_1[sort_count1]
  4563.         sorted_out=sort_count1
  4564.         forc(sort_count2=sort_count1;sort_count2<265;sort_count2++)
  4565.         {
  4566.             ifc(list_1[sort_count2]<current_lowest)
  4567.             {
  4568.                 current_lowest=list_1[sort_count2]
  4569.                 sorted_out=sort_count2
  4570.             }
  4571.             
  4572.         }
  4573.  
  4574.         spare_string=list_1[sort_count1]
  4575.         list_1[sort_count1]=current_lowest
  4576.         list_1[sorted_out]=spare_string
  4577.  
  4578.         spare_number=new_index[sort_count1]
  4579.         new_index[sort_count1]=new_index[sorted_out]
  4580.         new_index[sorted_out]=spare_number
  4581.  
  4582.         print sort_count1,"\\t",list_1[sort_count1],`\\t`,"Ref",`\\t`,new_index[sort_count1], "\n"
  4583.  
  4584.     }
  4585.  
  4586.  
  4587. end sub
  4588.  
  4589. sub set_list()
  4590. local 
  4591.     list_counter as int
  4592.     new_index_number as int
  4593.     read_in_line as string
  4594. end local
  4595.  
  4596.     restoredata names
  4597.     restoredata desc
  4598.  
  4599.     forc(list_counter=0;list_counter<265;list_counter++)
  4600.     {
  4601.         input data names,read_in_line
  4602.         addelement list_1,read_in_line
  4603.  
  4604. //        new_index[list_counter]=list_counter
  4605.  
  4606.         input data names,new_index_number
  4607.         addelement new_index,new_index_number
  4608.         
  4609.         old_index[new_index_number]=list_counter
  4610.  
  4611.  
  4612.     }
  4613.  
  4614.  
  4615. //    sort_list1()
  4616.  
  4617.     forc(list_counter=0;list_counter<265;list_counter++)
  4618.     {
  4619.         input data desc,read_in_line
  4620.         addelement list_2,read_in_line
  4621.  
  4622.  
  4623.  
  4624. //        input data desc,list_2[list_counter]
  4625.     }
  4626.  
  4627.  
  4628. end sub
  4629.  
  4630.  
  4631. sub load_map(check_name as int,pos_map as int)
  4632.             
  4633.     check_file=filename(itostr(check_name))
  4634.     
  4635.  
  4636.     activepage 1
  4637.     LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  4638.     activepage 0
  4639.  
  4640.  
  4641.     FONT "HELVETICA.BOLD",13,26
  4642.     pencolor  241,230,119
  4643.     ifc(pos_map==1)
  4644.     {
  4645.  
  4646.         activepage 1
  4647.         saveimage 40,200,265,198,jpg, server+check_file+`/map132`+load_ext3 , ``, dummy, { flag_hold = 1 }
  4648.         while not flag_hold loop
  4649.             hold
  4650.         endwhile
  4651.         id=800
  4652.         label id, 40,155, 265, 68, centre, graph_name[0]
  4653.         activepage 0
  4654.         clearscreen 40,100,265,298,standard,1,255
  4655.  
  4656.  
  4657.     }
  4658.     ifc(pos_map==2)
  4659.     {
  4660.         activepage 1
  4661.         saveimage 352,200,265,198,jpg, server+check_file+`/map132`+load_ext3 , ``, dummy, { flag_hold = 1 }
  4662.         while not flag_hold loop
  4663.             hold
  4664.         endwhile
  4665.         id=801
  4666.         label id, 352,155, 265, 68, centre, graph_name[1]
  4667.         activepage 0
  4668.         clearscreen 352,100,265,298,standard,1,255
  4669.  
  4670.  
  4671.     }
  4672.     ifc(pos_map==3)
  4673.     {
  4674.         activepage 1
  4675.         saveimage 664,200,265,198,jpg, server+check_file+`/map132`+load_ext3 , ``, dummy, { flag_hold = 1 }
  4676.         while not flag_hold loop
  4677.             hold
  4678.         endwhile
  4679.         id=802
  4680.         label id, 664,155, 265, 68, centre, graph_name[2]
  4681.         activepage 0
  4682.         clearscreen 664,100,265,298,standard,1,255
  4683.  
  4684.     }
  4685.     ifc(pos_map==4)
  4686.     {
  4687.         activepage 1
  4688.         saveimage 970,200,265,198,jpg, server+check_file+`/map132`+load_ext3 , ``, dummy, { flag_hold = 1 }
  4689.         while not flag_hold loop
  4690.             hold
  4691.         endwhile
  4692.         id=803
  4693.         label id, 970,155, 265, 68, centre, graph_name[3]
  4694.         activepage 0
  4695.         clearscreen 970,100,265,298,standard,1,255
  4696.  
  4697.  
  4698.     }
  4699.     ifc(busy_mover==yes)
  4700.         delsprite 233
  4701.  
  4702.     
  4703. end sub
  4704.  
  4705. sub set_gph()
  4706.  
  4707.     load_image_to_screen(0 ,0,1280,960,1,255,server_menu+`stats`+load_ext)
  4708.     load_image_to_screen(0 ,840,1280,120,1,255,server_menu+`none`+load_ext)
  4709.  
  4710.     ACTIVEPAGE 1
  4711. //    LOADIMAGE 0,0,1280,960,JPG,server_menu+`stats`+load_ext
  4712. //    LOADIMAGE 0,840,1280,120,JPG,server_menu+`none`+load_ext
  4713.     FONT "HELVETICA",24,48
  4714.     pencolor  255,255,255
  4715.     id=888
  4716.     label id, 180,40, 550, 60, left, "Statistik"
  4717.     activepage 0
  4718.     clearscreen 0,0,1280,960,standard,1,255
  4719.  
  4720.     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  4721.     SpriteFlags2 233, enabled|visible, UNBOUND
  4722.  
  4723.     busy_mover=no
  4724.     load_map(graph[0],1)
  4725.     load_map(graph[1],2)
  4726.     load_map(graph[2],3)
  4727.     busy_mover=yes
  4728.     load_map(graph[3],4)
  4729.  
  4730.  
  4731. end sub
  4732.  
  4733. sub show_key()
  4734. local
  4735.     int r,g,b,key_count,des_count
  4736. end local
  4737.  
  4738.     des_count=1
  4739.     FONT "HELVETICA.BOLD",12,24
  4740. //    FONT "HELVETICA.BOLD",13,26
  4741.     forc(key_count=48;key_count<1010;key_count+=320)
  4742.     {
  4743.         ifc(des_count>max_des_key)
  4744.             breakc
  4745.         pencolor  red[des_count],green[des_count],blue[des_count]
  4746.         cir_cir[des_count]=getnextobjectid()
  4747.         circle key_count+13,725+13,16
  4748.         cir_cir_fill[des_count]=getnextobjectid()
  4749.         floodfill key_count+13,725+13
  4750.         pencolor  255, 255, 255
  4751.         cir_key[des_count]=getnextobjectid()
  4752.         text Key_count+45,720,des_key[des_count]
  4753.         des_count++
  4754.     }
  4755.  
  4756.     forc(key_count=48;key_count<1010;key_count+=320)
  4757.     {
  4758.         ifc(des_count>max_des_key)
  4759.             breakc
  4760.         pencolor  red[des_count],green[des_count],blue[des_count]
  4761.         cir_cir[des_count]=getnextobjectid()
  4762.         circle key_count+13,770+13,16
  4763.         cir_cir_fill[des_count]=getnextobjectid()
  4764.         floodfill key_count+13,770+13
  4765.         pencolor  255, 255, 255
  4766.         cir_key[des_count]=getnextobjectid()
  4767.         text Key_count+45,765,des_key[des_count]
  4768.         des_count++
  4769.     }
  4770.  
  4771.     forc(key_count=48;key_count<1010;key_count+=320)
  4772.     {
  4773.         ifc(des_count>max_des_key)
  4774.             breakc
  4775.         pencolor  red[des_count],green[des_count],blue[des_count]
  4776.         cir_cir[des_count]=getnextobjectid()
  4777.         cir_cir_fill[des_count]=getnextobjectid()
  4778.         circle key_count+13,815+13,16
  4779.         floodfill key_count+13,815+13
  4780.         pencolor  255, 255, 255
  4781.         cir_key[des_count]=getnextobjectid()
  4782.         text Key_count+45,810,des_key[des_count]
  4783.         des_count++
  4784.     }
  4785.  
  4786.  
  4787. end sub
  4788.  
  4789.  
  4790. sub read_pies()
  4791. local
  4792.     int    pie_counter
  4793. end local
  4794.  
  4795.     restoredata pie_land
  4796.     restoredata pie_labor
  4797.  
  4798.     forc(pie_counter=1;pie_counter<266;pie_counter++)
  4799.     {
  4800.         input data pie_land, land_name[pie_counter][1],land_number[pie_counter][1],
  4801.                         land_name[pie_counter][2],land_number[pie_counter][2],
  4802.                     land_name[pie_counter][3],land_number[pie_counter][3],
  4803.                     land_name[pie_counter][4],land_number[pie_counter][4],
  4804.                     land_name[pie_counter][5],land_number[pie_counter][5]
  4805.  
  4806.  
  4807.         input data pie_labor, labor_name[pie_counter][1],labor_number[pie_counter][1],
  4808.                           labor_number[pie_counter][2],
  4809.                       labor_number[pie_counter][3],
  4810.                       labor_number[pie_counter][4],
  4811.                       labor_number[pie_counter][5],
  4812.                       labor_number[pie_counter][6],
  4813.                       labor_number[pie_counter][7],
  4814.                       labor_number[pie_counter][8]
  4815.  
  4816.  
  4817.     input data pie_rel, rel_name[pie_counter][1],rel_number[pie_counter][1],
  4818.                               rel_number[pie_counter][2],
  4819.                           rel_number[pie_counter][3],
  4820.                           rel_number[pie_counter][4],
  4821.                           rel_number[pie_counter][5],
  4822.                     rel_number[pie_counter][6],
  4823.                            rel_number[pie_counter][7],
  4824.                            rel_number[pie_counter][8],
  4825.                            rel_number[pie_counter][9]
  4826.  
  4827.  
  4828.         
  4829.         labor_name[pie_counter][1]=1
  4830.         labor_name[pie_counter][2]=2
  4831.         labor_name[pie_counter][3]=3
  4832.         labor_name[pie_counter][4]=4
  4833.         labor_name[pie_counter][5]=5
  4834.         labor_name[pie_counter][6]=6
  4835.         labor_name[pie_counter][7]=7
  4836.         labor_name[pie_counter][8]=8
  4837.  
  4838.         rel_name[pie_counter][1]=1
  4839.         rel_name[pie_counter][2]=2
  4840.         rel_name[pie_counter][3]=3
  4841.         rel_name[pie_counter][4]=4
  4842.         rel_name[pie_counter][5]=5
  4843.         rel_name[pie_counter][6]=6
  4844.         rel_name[pie_counter][7]=7
  4845.         rel_name[pie_counter][8]=8
  4846.         rel_name[pie_counter][9]=9
  4847.     }
  4848.  
  4849.  
  4850. end sub
  4851.  
  4852. sub set_key_code(the_pie_type as int)
  4853. local 
  4854.     int cl_count
  4855. end local
  4856.  
  4857.     FONT "HELVETICA.BOLD",12,40
  4858.  
  4859.     ifc(the_pie_type==1)
  4860.     {
  4861.         restoredata colour_land
  4862.         restoredata describe_land
  4863.         forc(cl_count=1;cl_count<6;cl_count++)
  4864.         {
  4865.             input data colour_land, red[cl_count],green[cl_count],blue[cl_count]
  4866.             input data describe_land, des_key[cl_count]
  4867.         }
  4868.         max_des_key=5
  4869.     }
  4870.     ifc(the_pie_type==2)
  4871.     {
  4872.         restoredata colour_labor
  4873.         restoredata describe_labor
  4874.         forc(cl_count=1;cl_count<9;cl_count++)
  4875.         {
  4876.             input data colour_labor, red[cl_count],green[cl_count],blue[cl_count]
  4877.             input data describe_labor, des_key[cl_count]
  4878.         }
  4879.         max_des_key=8
  4880.     }
  4881.  
  4882.     ifc(the_pie_type==3)
  4883.     {
  4884.         restoredata colour_rel
  4885.         restoredata describe_rel
  4886.         forc(cl_count=1;cl_count<10;cl_count++)
  4887.         {
  4888.             input data colour_rel, red[cl_count],green[cl_count],blue[cl_count]
  4889.             input data describe_rel, des_key[cl_count]
  4890.         }
  4891.         max_des_key=9
  4892.     }
  4893.  
  4894.  
  4895. end sub
  4896.  
  4897. sub new_country(the_direction as int,show_map as int)
  4898. local
  4899.  
  4900.     caps_count as int
  4901.     check_cap as string
  4902.  
  4903. end local
  4904.  
  4905.     ifc(show_map==yes)
  4906.     {
  4907.         load_image_to_screen(0,0,1280,960,1,255,server_local+`main`+load_ext)
  4908.         interface_on_screen=yes
  4909.     }
  4910.     busy_mover=yes
  4911.     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  4912.     SpriteFlags2 233, enabled|visible, UNBOUND
  4913.  
  4914.  
  4915. print "new_number=",new_number,"\n"
  4916.     new_number=old_index[new_number-1]
  4917.  
  4918. print "now new_number=",new_number,"\n"
  4919.  
  4920.     ifc(the_direction==down)
  4921.     {
  4922.         new_number--
  4923.         ifc(new_number<0)
  4924.             new_number=264
  4925.     }
  4926.     else
  4927.     {
  4928.         new_number++
  4929.         ifc(new_number>264)
  4930.             new_number=0
  4931.     }
  4932.  
  4933.     new_number=new_index[new_number]
  4934.  
  4935. print "final new_number=",new_number,"\n"
  4936.  
  4937. new_number++
  4938.  
  4939.     graph[0]=new_number
  4940.     graph_name[0]=list_2[new_number-1]
  4941.     header_top=list_2[new_number-1]
  4942.     header_text=list_1[new_number-1]
  4943.     country=filename(itostr(new_number))
  4944.  
  4945. //    graph[0]=new_number
  4946. //    graph_name[0]=list_2[new_number-1]
  4947. //    header_top=list_2[new_number-1]
  4948. //    header_text=list_1[new_number-1]
  4949. //    country=filename(itostr(new_number))
  4950.  
  4951.  
  4952.  
  4953.     pop_up_big=yes
  4954.     pop_up_small=yes
  4955.     read_overview(server + country +`/`+country+`.ovw`)
  4956.     ifc(total_slides[new_number]>0)
  4957.     {
  4958.         ifc(last_cap_count>0)
  4959.         {
  4960.             deleteelements small_cap,last_cap_count
  4961.             deleteelements large_cap,last_cap_count
  4962.         }
  4963.         open server + country +`/`+country+`.cap` for read as #1
  4964.         addelement small_cap,"MAP"
  4965.         addelement large_cap,"MAP"
  4966.         forc(caps_count=1;caps_count<total_slides[new_number]+1;caps_count++)
  4967.         {
  4968.             check_cap=inputline$(#1)    
  4969.             check_cap=inputline$(#1)    
  4970.             addelement small_cap,check_cap
  4971.             check_cap=inputline$(#1)    
  4972.             addelement large_cap,check_cap
  4973.  
  4974.         }
  4975.         close #1
  4976.         last_cap_count=total_slides[new_number]+1
  4977.     }
  4978.     ifc(show_map==yes)
  4979.         show_country(yes)
  4980.  
  4981.  
  4982.         
  4983. end sub
  4984.  
  4985. sub    store_names(count_map as int,show_map as int)
  4986. local
  4987.  
  4988.     caps_count as int
  4989.     check_cap as string
  4990.  
  4991. end local
  4992.     ifc(show_map==yes)
  4993.     {
  4994.         load_image_to_screen(0,0,1280,960,1,255,server_local+`main`+load_ext)
  4995.         interface_on_screen=yes
  4996.         busy_mover=yes
  4997.     }
  4998.     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  4999.     SpriteFlags2 233, enabled|visible, UNBOUND
  5000.  
  5001.  
  5002.  
  5003.     new_number=count_map+1
  5004.     country=filename(itostr(new_number))
  5005.     header_top=list_2[new_number-1]
  5006.     header_text=list_1[new_number-1]
  5007.  
  5008.     graph[0]=new_number
  5009.     graph_name[0]=list_2[new_number-1]
  5010.     pop_up_big=yes
  5011.     pop_up_small=yes
  5012.  
  5013.  
  5014.  
  5015. //    new_number=count_map
  5016. //    country=filename(itostr(new_number))
  5017. //    header_top=list_2[new_number-1]
  5018. //    header_text=list_1[new_number-1]
  5019. //    graph[0]=new_number
  5020. //    graph_name[0]=list_2[new_number-1]
  5021. //    pop_up_big=yes
  5022. //    pop_up_small=yes
  5023.  
  5024.  
  5025.     read_overview(server + country +`/`+country+`.ovw`)
  5026.     ifc(total_slides[new_number]>0)
  5027.     {
  5028.         ifc(last_cap_count>0)
  5029.         {
  5030.             deleteelements small_cap,last_cap_count
  5031.             deleteelements large_cap,last_cap_count
  5032.         }
  5033.  
  5034.         open server + country +`/`+country+`.cap` for read as #1
  5035.         addelement small_cap,"MAP"
  5036.         addelement large_cap,"MAP"
  5037.  
  5038.         forc(caps_count=1;caps_count<total_slides[new_number]+1;caps_count++)
  5039.         {
  5040.             check_cap=inputline$(#1)    
  5041.  
  5042.             check_cap=inputline$(#1)    
  5043.             addelement small_cap,check_cap
  5044.             check_cap=inputline$(#1)    
  5045.             addelement large_cap,check_cap
  5046.  
  5047.         }
  5048.         close #1
  5049.         last_cap_count=total_slides[new_number]+1
  5050.     }
  5051.     ifc(show_map==yes)
  5052.         show_country(yes)
  5053.     count=0
  5054. end sub
  5055.  
  5056. sub set_gph_name(index as int,gph_no as int)
  5057.  
  5058.     graph[gph_no]=index+1
  5059.     graph_name[gph_no]=list_2[index]
  5060.  
  5061. end sub
  5062.  
  5063. sub    check_gph_names()
  5064. local
  5065. int check_gpg_cnt
  5066.  
  5067. end local
  5068.  
  5069.     forc(check_gpg_cnt=1;check_gpg_cnt<4;check_gpg_cnt++)
  5070.     {
  5071.         ifc(graph[check_gpg_cnt]==51)
  5072.         {
  5073.             ifc(check_gpg_cnt==1)
  5074.             {
  5075.                 graph[1]=249
  5076.                 graph_name[1]="Vereinigte Staaten"
  5077.             }
  5078.             ifc(check_gpg_cnt==2)
  5079.             {
  5080.                 graph[2]=90
  5081.                 graph_name[2]="Deutschland"
  5082.             }
  5083.             ifc(check_gpg_cnt==3)
  5084.             {
  5085.                 graph[3]=122
  5086.                 graph_name[3]="Japan"
  5087.             }
  5088.         }
  5089.     }
  5090.  
  5091.  
  5092.     forc(check_gpg_cnt=1;check_gpg_cnt<4;check_gpg_cnt++)
  5093.     {
  5094.         ifc(graph[check_gpg_cnt]==new_number)
  5095.         {
  5096.             graph[check_gpg_cnt]=51
  5097.             graph_name[check_gpg_cnt]=list_2[50]
  5098.         }
  5099.     }
  5100.  
  5101.  
  5102.  
  5103. end sub
  5104.  
  5105.  
  5106. sub change_images(the_direction as int,image_size as int)
  5107.  
  5108.     ifc(the_direction==up)
  5109.     {
  5110.         count++
  5111.         next_image++
  5112.         ifc(next_image>total_slides[new_number])
  5113.             next_image=1
  5114.         ifc(count>total_slides[new_number])
  5115.             count=0
  5116.     }
  5117.     else
  5118.     {
  5119.         count--
  5120.         next_image--
  5121.         ifc(next_image<0)
  5122.             next_image=total_slides[new_number]-1
  5123.         ifc(count<0)
  5124.             count=total_slides[new_number]    
  5125.     }
  5126.     ifc(image_size==small)
  5127.         show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  5128.     else
  5129.         show_pic(filename(itostr(count)),count,big,filename(itostr(next_image)))
  5130.  
  5131.  
  5132. end sub
  5133.  
  5134.  
  5135. sub delete_current_settings()
  5136. local
  5137.  
  5138.     int loop_del
  5139.  
  5140. end local 
  5141.  
  5142.  
  5143.     ifc(current_bar_c<4 && current_bar_c>0)
  5144.     {
  5145.         deleteobject bar_map1
  5146.         deleteobject bar_text_map1
  5147.         deleteobject bar_map2
  5148.         deleteobject bar_text_map2
  5149.         deleteobject bar_map3
  5150.         deleteobject bar_text_map3
  5151.         deleteobject bar_map4
  5152.         deleteobject bar_text_map4
  5153.         deleteobject bar_text_map_lable
  5154.     }
  5155.     else
  5156.     {
  5157.         deleteobject circle_id[1]
  5158.         deleteobject circle_id[2]
  5159.         deleteobject circle_id[3]
  5160.         deleteobject circle_id[4]
  5161.         deleteobject not_avail1[1]
  5162.         deleteobject not_avail1[2]
  5163.         deleteobject not_avail1[3]
  5164.         deleteobject not_avail1[4]
  5165.  
  5166.         deleteobject not_avail2[1]
  5167.         deleteobject not_avail2[2]
  5168.         deleteobject not_avail2[3]
  5169.         deleteobject not_avail2[4]
  5170.  
  5171.         forc(loop_del=1;loop_del<10;loop_del++)
  5172.         {    
  5173.             deleteobject flood_id[1][loop_del]
  5174.             deleteobject flood_id[2][loop_del]
  5175.             deleteobject flood_id[3][loop_del]
  5176.             deleteobject flood_id[4][loop_del]
  5177.  
  5178.             deleteobject lable_id[1][loop_del]
  5179.             deleteobject lable_id[2][loop_del]
  5180.             deleteobject lable_id[3][loop_del]
  5181.             deleteobject lable_id[4][loop_del]
  5182.  
  5183.             deleteobject line_id[1][loop_del]
  5184.             deleteobject line_id[2][loop_del]
  5185.             deleteobject line_id[3][loop_del]
  5186.             deleteobject line_id[4][loop_del]
  5187.  
  5188.             deleteobject cir_key[loop_del]
  5189.             deleteobject cir_cir_fill[loop_del]
  5190.             deleteobject cir_cir[loop_del]
  5191.  
  5192.         }
  5193.  
  5194.     }
  5195.  
  5196. end sub
  5197.  
  5198.  
  5199.  
  5200.  
  5201. sub read_dates()
  5202.  
  5203.  
  5204.     total=30
  5205.     count_key_facts=0
  5206.     main=""
  5207.     open key_facts+country+`/da`+country+`.txt` for read as #1        
  5208.     whilec(!feof(#1))
  5209.     {
  5210.         total_lines[count_key_facts]=""
  5211.         total_lines[count_key_facts]=inputline$(#1)    
  5212.         ifc(count_key_facts<20)
  5213.             main+="\n"        
  5214.         count_key_facts++
  5215.     }
  5216.     close #1
  5217.  
  5218.     total=count_key_facts
  5219.  
  5220. end sub
  5221.  
  5222.  
  5223. sub set_up_screen()
  5224.  
  5225.  
  5226.     load_image_to_screen(0 ,0,1280,960,1,255,key_facts_local+`keyd`+load_ext)
  5227.     wait 500
  5228. //    ACTIVEPAGE 1
  5229. //    LOADIMAGE 0,0,1280,960,JPG,key_facts_local+`keyd`+load_ext
  5230.     ifc(kf_pic_on[new_number]==1)
  5231.     {
  5232. //        load_image_to_screen(28 ,130,640,480,1,255,key_facts+country+`/kf`+country+load_ext2)
  5233.         ACTIVEPAGE 0
  5234.         LOADIMAGE 28,130,640,480,jpg,server_local  +`/bkgnd`+load_ext
  5235.         LOADIMAGE 28,130,640,480,jpg,key_facts+country+`/kf`+country+load_ext2
  5236.  
  5237.         pencolor  255,255,255
  5238.         FONT "HELVETICA",11,22
  5239.         id=1010
  5240.         label id,740,930,800,48,left,"Photo:"+photo_cr[new_number]
  5241.     }
  5242. //    ACTIVEPAGE 0
  5243. //    clearscreen 0,0,1279,959,standard,1,255
  5244.  
  5245.     transparentcolor 255,255,255
  5246.     fillmask0
  5247.     show_text_pic()
  5248.     SPRITEb 221,532,810,looped,1,255,2,[354,355]
  5249.     SpriteFlags2 221, enabled|visible, UNBOUND
  5250.     FILLMASK1 255,255,255
  5251.     TRANSPARENCY 0
  5252.     PENCOLOR 255,255,255
  5253.     LINESTYLE SOLID
  5254.     PENWIDTH 1
  5255.     id=555
  5256.     label id, 750,198, 428, 650, wrap|left," "
  5257.     PENCOLOR 255,0,0
  5258.     PENCOLOR 0,0,0
  5259.  
  5260. end sub
  5261.  
  5262. sub off_click_small()
  5263.  
  5264.     SetProperty combo_small, "SetFocus"
  5265.     on_event mouseclick,x,y
  5266.     {
  5267.         ifc( (x<30 || x>670) || (y<130 || y>610) )
  5268.         {
  5269.             deleteobject combo_small
  5270.             off_event mouseclick
  5271.         }
  5272.     }
  5273.  
  5274. end sub
  5275.  
  5276.  
  5277. sub off_click_big()
  5278.  
  5279.     PENWIDTH 3
  5280.     combo_big=getnextobjectid()
  5281.     pencolor  255,139,0
  5282.     rectangle 387,190,530,575
  5283.     SetProperty combo_small, "SetFocus"
  5284.     on_event mouseclick,x,y
  5285.     {
  5286.         ifc( (x<378 || x>917) || (y<190 || y>765) )
  5287.         {
  5288.             deleteobject combo_small
  5289.             deleteobject combo_big
  5290.             off_event mouseclick
  5291.             FONT "HELVETICA",24,48
  5292.         }
  5293.     }
  5294.     pencolor  255,255,255
  5295.  
  5296. end sub
  5297.  
  5298.  
  5299. sub scroll_text()
  5300. local
  5301. int button_press
  5302. end local
  5303.     PENCOLOR 255,255,255
  5304.  
  5305.     lines_shown=0
  5306.     stop_scroll=1
  5307.  
  5308.     button_press=GetnextobjectID()
  5309. //    iconbuttonid id,  722,854,462,82,enabled,none,1,222,222,222,
  5310.     on_event mouseclick,x,y
  5311.     {
  5312.         ifc(stop_scroll==33)
  5313.         {
  5314.             delsprite 221
  5315.         }
  5316.         ifc(count_key_facts<total)
  5317.         {
  5318.             ifc(stop_scroll==1)
  5319.             {
  5320.                 PENCOLOR 0,255,0
  5321.                 stop_scroll=0
  5322.                 PENCOLOR 255,255,255
  5323.                 SPRITEb 221,532,810,looped,1,255,2,[355]
  5324.                 print "stop the loop"
  5325.             }
  5326.             else
  5327.             {
  5328.                 stop_scroll=1
  5329.                 PENCOLOR 255,0,0
  5330.                 PENCOLOR 255,255,255
  5331.                 SPRITEb 221,532,810,looped,1,255,2,[354,355]
  5332.             }
  5333.         }
  5334.     }
  5335.     wait 20
  5336.     forc(count_key_facts=0;count_key_facts<total;count_key_facts++)
  5337.     {
  5338.         ifc(count_key_facts==99)
  5339.             breakc
  5340.         new_len=len(total_lines[count_key_facts])
  5341.         current_pos=len(main)
  5342.         print main
  5343.         forc(line_cnt=0;line_cnt<new_len+4;line_cnt=line_cnt)
  5344.         {
  5345.             ifc(count_key_facts==99)
  5346.                 breakc
  5347.             ifc(stop_scroll==1)
  5348.             {
  5349.                 FONT "MODERN",15,24
  5350.                 id=555
  5351.                 settext id, main
  5352.                 main+=mid$(total_lines[count_key_facts],line_cnt,4)
  5353.                 wait 1
  5354.                 line_cnt+=4
  5355.             }
  5356.             wait 20
  5357.         }
  5358.         main2=main
  5359.         current_pos=len(main)
  5360.         ifc(lines_shown>9)
  5361.         {
  5362.             ifc(count_key_facts==99)
  5363.                 breakc
  5364.             check=""
  5365.             forc(line_cnt=0;check!="\n";line_cnt++)
  5366.             {
  5367.                 check=mid$(main,line_cnt,1)
  5368.             }
  5369.         }
  5370.         else
  5371.             line_cnt=1
  5372.         main=""
  5373.         forc(line_cnt=line_cnt;line_cnt<current_pos+1;line_cnt++)
  5374.         {
  5375.             ifc(count_key_facts==99)
  5376.                 breakc
  5377.             main+=mid$(main2,line_cnt,1)
  5378.         }
  5379.         lines_shown++
  5380.         main+="\n"        
  5381.         wait 20
  5382.     }
  5383.     ifc(count_key_facts==total)
  5384.         SPRITEb 221,532,810,looped,1,255,2,[355]
  5385.  
  5386. end sub
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395. sub setup(hotspot_check as int)
  5396. local
  5397.     int    count_map,index,max_read,check_map,id_check,read_number
  5398.     int    hotxs[100],hotys[100],hotxe[100],hotye[100],store_country[100]
  5399.     string    map_name[30],map_pos_name
  5400.     string    ans
  5401.     filename new_file
  5402.     int    s23_count
  5403.     int    play_vid
  5404.     int    loop_del
  5405.     int    vobj
  5406.     int    flag_on
  5407.     boolean    paused
  5408.     int    del_sp_cnt
  5409.     int    state
  5410.     int     start_game_no
  5411.     int    count_map_mark
  5412.  
  5413.     int    wait_done1
  5414.     int    wait_done2
  5415.     int    wait_done3
  5416.     int    wait_done4
  5417.     int    wait_done5
  5418.  
  5419. endlocal
  5420.  
  5421.     loop_exit=0
  5422.  
  5423.     ifc(hotspot_check==world_map)
  5424.     {
  5425.         country_set=0
  5426.  
  5427.         ACTIVEPAGE 1
  5428.         LOADIMAGE 0,0,1280,960,JPG,server_maps+`wm`+load_ext
  5429.         LOADIMAGE 26-1,20+120,1230,804,JPG,server_maps+`mainm`+load_ext
  5430.         activepage 0 
  5431.         clearscreen 0,0,1280,960,explode,1,50
  5432.         restoredata world_map
  5433.         forc(count_map=0;count_map<10;count_map++)
  5434.         {
  5435.             input data world_map ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],map_name[count_map]
  5436.             iconbuttonid count_map,  hotxs[count_map]-1,hotys[count_map]+120,hotxe[count_map],hotye[count_map],enabled,none,1,222,222,222,
  5437.             {
  5438.                 click
  5439.                 destroyAllobjects
  5440.                 pencolor  255,255,255
  5441.                 FONT "HELVETICA",24,48
  5442.                 id=99
  5443.                 label id, 190,40, 550, 60, left, " "
  5444.                 ifc(count_map==0)
  5445.                 {
  5446.                     restoredata map1
  5447.                     max_read=5
  5448.                     check_map=1
  5449.                 }
  5450.                 ifc(count_map==1)
  5451.                 {
  5452.                     restoredata map2
  5453.                     check_map=2
  5454.                     max_read=24
  5455.                 }
  5456.                 ifc(count_map==2)
  5457.                 {
  5458.                     restoredata map3
  5459.                     max_read=74
  5460.                     check_map=3
  5461.  
  5462.                 }
  5463.                 ifc(count_map==3)
  5464.                 {
  5465.                     restoredata map4
  5466.                     check_map=4
  5467.                     max_read=56
  5468.                 }
  5469.                 ifc(count_map==4)
  5470.                 {
  5471.                     check_map=5
  5472.                     restoredata map5
  5473.                     max_read=33
  5474.                 }
  5475.                 ifc(count_map==5)
  5476.                 {
  5477.                     check_map=6
  5478.                     restoredata map6
  5479.                     max_read=13
  5480.                 }
  5481.                 ifc(count_map==6)
  5482.                 {
  5483.                     check_map=7
  5484.                     restoredata map7
  5485.                     max_read=9
  5486.                 }
  5487.                 ifc(count_map==7)
  5488.                 {
  5489.                     check_map=8
  5490.                     restoredata map8
  5491.                     max_read=25
  5492.                 }
  5493.                 ifc(count_map==8)
  5494.                 {
  5495.                     check_map=9
  5496.                     restoredata map9
  5497.                     max_read=20
  5498.                 }
  5499.                 ifc(count_map==9)
  5500.                 {
  5501.                     check_map=10
  5502.                     restoredata map10
  5503.                     max_read=9
  5504.                 }
  5505. //                activepage 1
  5506.                 new_file=filename(map_name[count_map])
  5507. //                LOADIMAGE 26-1,20+120,1230,804,gif,server_maps+`map`+new_file+load_ext
  5508.                 load_image_to_screen(26-1 ,20+120,1230,804,1,255,server_maps+`map`+new_file+load_ext)
  5509.  
  5510. //                activepage 0 
  5511. //                clearscreen 0,0,1280,960,standard,1,255
  5512.                 id=426 //EXIT
  5513.                 iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  5514.                 {
  5515.                     click
  5516.                     destroyAllobjects
  5517.                     loop_exit=1
  5518.                 }
  5519.                 id=401 //World MAP
  5520.                 iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  5521.                 {
  5522.                     click
  5523.                     destroyAllobjects
  5524.                     setup(world_map)
  5525.                 }
  5526.                 id=402 //print 
  5527.                 iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  5528.                 {
  5529.                     click
  5530.                     //printsetup header|footer,"","Regional Map","","","","","Regional Map"
  5531.                     wait 20
  5532.                     printscreen 0,0,1280,960, scaled|centred ,0
  5533.                 }
  5534.                 id=403 //help
  5535.                 iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  5536.                 {
  5537.                     click
  5538.                     null
  5539.                 }
  5540.                 id=400 //search
  5541.                 iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  5542.                 {
  5543.                     font "COURIER.BOLD", 20,36
  5544.                     deleteobject combo_small
  5545.                     combo_small=getnextobjectid()
  5546.                     combobox 390,196,520,564,list_1,enabled,ans,index,
  5547.                     {
  5548.                         ifc(index!=-1)
  5549.                         {
  5550.                             click
  5551.                             destroyAllobjects
  5552.                             browsersetcursorbusy true
  5553.                             store_names(new_index[index],yes)
  5554.                             setup(1)
  5555.                         }
  5556.                     }
  5557.                     off_click_big()
  5558.                 }
  5559.                 count_map_mark=0
  5560.                 forc(count_map=0;count_map<max_read;count_map++)
  5561.                 {
  5562.                     ifc(check_map==1)
  5563.                         input data map1 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5564.                     ifc(check_map==2)
  5565.                         input data map2 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5566.                     ifc(check_map==3)
  5567.                         input data map3 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5568.                     ifc(check_map==4)
  5569.                         input data map4 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5570.                     ifc(check_map==5)
  5571.                         input data map5 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5572.                     ifc(check_map==6)
  5573.                         input data map6 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5574.                     ifc(check_map==7)
  5575.                         input data map7 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5576.                     ifc(check_map==8)
  5577.                         input data map8 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5578.                     ifc(check_map==9)
  5579.                         input data map9 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5580.                     ifc(check_map==10)
  5581.                         input data map10 ,hotxs[count_map],hotys[count_map],hotxe[count_map],hotye[count_map],store_country[count_map]
  5582.             
  5583.  
  5584.  
  5585.                     hotregion count_map_mark,true ,   [hotxs[count_map]-1,hotys[count_map]+120,((hotxs[count_map]-1)+hotxe[count_map]),hotys[count_map]+120,
  5586.                             ((hotxs[count_map]-1)+hotxe[count_map]),((hotys[count_map]+120)+hotye[count_map]),
  5587.                             hotxs[count_map]-1,((hotys[count_map]+120)+hotye[count_map])],state,
  5588.                     {
  5589.                         ifc(state==1)
  5590.                         {
  5591.                             id=99
  5592.                             settext id, list_2[(store_country[count_map_mark])-1]
  5593.  
  5594.                         }
  5595.                         else
  5596.                         {
  5597.                             id=99
  5598.                             settext id, " "
  5599.                         }
  5600.                     }
  5601.                     ,
  5602.                     {
  5603.                         click
  5604.                         destroyAllobjects
  5605.                         browsersetcursorbusy true
  5606.  
  5607. print store_country[count_map_mark],"\n"
  5608. print new_index[store_country[count_map_mark]],"\n"
  5609.                         store_names(store_country[count_map_mark]-1,yes)
  5610.                         setup(1)
  5611.                     }
  5612.                     count_map_mark++
  5613.  
  5614.                 }                
  5615.             }
  5616.         }
  5617.         browsersetcursorbusy false
  5618.         id=426 //EXIT
  5619.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  5620.         {
  5621.             click
  5622.             destroyAllobjects
  5623.             loop_exit=1
  5624.         }
  5625.         id=401 //World MAP
  5626.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  5627.         {
  5628.             click
  5629.             destroyAllobjects
  5630.             setup(world_map)
  5631.         }
  5632.         id=402 //print 
  5633.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  5634.         {
  5635.             click
  5636.             //printsetup header|footer,"","World Map","","","","","World Map"
  5637.             wait 20
  5638.             printscreen 0,0,1280,960, scaled|centred ,0
  5639.         }
  5640.  
  5641.         id=403 //help
  5642.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  5643.         {
  5644.             click
  5645.             null
  5646.         }
  5647.  
  5648.         id=400 //search
  5649.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  5650.         {
  5651.             font "COURIER.BOLD", 20,36
  5652.             deleteobject combo_small
  5653.             combo_small=getnextobjectid()
  5654.             combobox 390,196,520,564,list_1,enabled,ans,index,
  5655.             {
  5656.                 ifc(index!=-1)
  5657.                 {
  5658.                     click
  5659.                     destroyAllobjects
  5660.                     browsersetcursorbusy true
  5661.                     store_names(new_index[index],yes)
  5662.                     setup(1)
  5663.                 }
  5664.             }
  5665.             off_click_big()
  5666.         }
  5667.     }
  5668.  
  5669.     ifc(hotspot_check==1)
  5670.     {
  5671.         id=400 //search
  5672.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  5673.         {
  5674.             ifc(on_3d==yes)
  5675.                 Kill_3d()
  5676.             country_set=1
  5677.             font "COURIER.BOLD", 20,36
  5678.             deleteobject combo_small
  5679.             combo_small=getnextobjectid()
  5680.             combobox 28,130,646,482,list_1,enabled,ans,index,
  5681.             {
  5682.                 ifc(index!=-1)
  5683.                 {
  5684.                     click
  5685.                     hold_buttons(1)
  5686.                     ifc(sprites_on==yes)
  5687.                     {
  5688.                         forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  5689.                             delsprite del_sp_cnt
  5690.                     }
  5691.                     browsersetcursorbusy true
  5692.                     deleteobject combo_small
  5693.                     off_event mouseclick
  5694.                     flag_on=no
  5695.                     id=98
  5696.                     settext id," "
  5697.                     store_names(new_index[index],yes)
  5698.                     setup(1)
  5699.                 }
  5700.             }
  5701.             SetProperty combo_small, "SetFocus"
  5702.             off_click_small()
  5703.         }
  5704.         ifc(total_slides[new_number]>0)
  5705.         {
  5706.                 country_set=1
  5707.                 id=480    //photo list
  5708.                 list_id_on_main=getnextobjectid()
  5709.                 ifc(on_3d==yes)
  5710.                 iconbuttonid id,  572,612,120,100,enabled,none,1,160,161,161,        
  5711.                 {
  5712.                     flag_on=yes
  5713.                     Kill_3d()
  5714.                     FONT "HELVETICA",11,22
  5715.                     deleteobject combo_small
  5716.                     combo_small=getnextobjectid()
  5717.                     combobox 28,130,646,482,show_3d_desc,enabled,ans,index,
  5718.                     {
  5719.                         ifc(index!=-1)
  5720.                         {
  5721.                             hold_buttons(1)
  5722.                             click
  5723.                             deleteobject combo_small
  5724.                             off_event mouseclick
  5725.                             pencolor  255,255,255
  5726.                             hit_3d=index
  5727.                             FONT "HELVETICA",11,22
  5728.                             id=998
  5729.                             settext id,show_3d_desc[hit_3d]
  5730.                             sound server_sounds+`longplay/`+filename(itostr(show_3d[hit_3d]))+`.mid sequencer`
  5731.                             display_object(show_3d[hit_3d])
  5732.                             on_3d=yes
  5733.                             setup(1)
  5734.                         }
  5735.                     }
  5736.                     SetProperty combo_small, "SetFocus"
  5737.                     off_click_small()
  5738.                 }
  5739.                 else
  5740.                 {
  5741.                     iconbuttonid id,  572,612,120,100,enabled,none,1,144,145,145,
  5742.                     {
  5743.                         flag_on=no
  5744.                         ifc(on_3d==yes)
  5745.                             Kill_3d()
  5746.                         FONT "HELVETICA",11,22
  5747.                         deleteobject combo_small
  5748.                         combo_small=getnextobjectid()
  5749.                         combobox 28,130,646,482,small_cap,enabled,ans,index,
  5750.                         {
  5751.                             ifc(index!=-1)
  5752.                             {
  5753.                                 click
  5754.                                 deleteobject combo_small
  5755.                                 hold_buttons(1)
  5756.                                 off_event mouseclick
  5757.                                 browsersetcursorbusy true
  5758.                                 count=index
  5759.                                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  5760.                                 setup(1)
  5761.                             }
  5762.                         }
  5763.                         SetProperty combo_small, "SetFocus"
  5764.                         off_click_small()
  5765.                     }
  5766.                 }
  5767.  
  5768.  
  5769.  
  5770.  
  5771.                 ifc(count>0)
  5772.                 {
  5773.                     id=415 //Image up
  5774.                     up_id_on_main=getnextobjectid()
  5775.                     iconbuttonid id,  670,620,56,68,enabled,none,2,308,309,310,
  5776.                     {
  5777.                         ifc(on_3d==yes)
  5778.                         {
  5779.                             click
  5780.                             hold_buttons(1)
  5781.                             flag_on=yes
  5782.                             Kill_3d()
  5783.                             hit_3d++
  5784.                             ifc(hit_3d>click3d-1)
  5785.                                 hit_3d=0
  5786.                             on_3d=yes
  5787.                             FONT "HELVETICA",11,22
  5788.                             id1=98
  5789.                             settext id1," "
  5790.                             id1=998
  5791.                             settext id1, show_3d_desc[hit_3d]
  5792.                             sound server_sounds+`longplay/`+filename(itostr(show_3d[hit_3d]))+`.mid sequencer`
  5793.                             display_object(show_3d[hit_3d])
  5794.                             setup(1)
  5795.                         }
  5796.                         else
  5797.                         {
  5798.     
  5799.                             click
  5800.                             hold_buttons(1)
  5801.                             flag_on=no
  5802.                             ifc(on_3d==yes)
  5803.                                 Kill_3d()
  5804.                             ifc(next_image+1<1)
  5805.                                 next_image=total_slides[new_number]
  5806.                             ifc(count<1)
  5807.                                 count=total_slides[new_number]+1
  5808.                             change_images(down,small)
  5809.                             setup(1)
  5810.                         }
  5811.                     }
  5812.                 }
  5813.                 ifc(count<total_slides[new_number])
  5814.                 {
  5815.                     id=416 //Image down
  5816.                     down_id_on_main=getnextobjectid()
  5817.                     iconbuttonid id,  724,620,56,68,enabled,none,2,312,313,314,
  5818.                     {
  5819.                         ifc(on_3d==yes)
  5820.                         {
  5821.                             click
  5822.                             hold_buttons(1)
  5823.                             flag_on=yes
  5824.                             Kill_3d()
  5825.                             hit_3d--
  5826.                             ifc(hit_3d<0)
  5827.                                 hit_3d=click3d-1
  5828.                             on_3d=yes
  5829.                             FONT "HELVETICA",11,22
  5830.                             id1=98
  5831.                             settext id1," "
  5832.                             id1=998
  5833.                             settext id1, show_3d_desc[hit_3d]
  5834.                             sound server_sounds+`longplay/`+filename(itostr(show_3d[hit_3d]))+`.mid sequencer`
  5835.                             display_object(show_3d[hit_3d])
  5836.                             setup(1)
  5837.                         }
  5838.                         else
  5839.                         {
  5840.     
  5841.                             click
  5842.                             hold_buttons(1)
  5843.                             flag_on=no
  5844.                             ifc(on_3d==yes)
  5845.                                 Kill_3d()
  5846.                             ifc(next_image+1>total_slides[new_number])
  5847.                                 next_image=0
  5848.                             ifc(count>total_slides[new_number])
  5849.                                 count=0
  5850.                             change_images(up,small)
  5851.                             setup(1)
  5852.                         }
  5853.                     }
  5854.                 }
  5855.                 country_set=1
  5856.                 deleteobject    up_id_on
  5857.                 deleteobject    down_id_on
  5858.                 deleteobject    list_id_on
  5859.         }
  5860.  
  5861.         ifc(flag_on=no)
  5862.         {
  5863.             deleteobject zoom_id_on
  5864.             id=423 //Large Image
  5865.             zoom_id_on=getnextobjectid()
  5866.             iconbuttonid id,  0,600,120,124,enabled,none,1,142,143,143,
  5867.             {
  5868.                 click
  5869.                 hold_buttons(1)
  5870.                 country_set=0
  5871.                 ifc(on_3d==yes)
  5872.                     Kill_3d()
  5873.                 destroyAllobjects
  5874.                 browsersetcursorbusy true
  5875.                 set_large()
  5876.                 setup(large_pic)
  5877.             }
  5878.         }
  5879.         id=422 //Large text
  5880.         iconbuttonid id,  0,716,120,104,enabled,none,1,138,139,139,
  5881.         {
  5882.             click
  5883.             change_text=1
  5884.             hold_buttons(1)
  5885.             country_set=0
  5886.             ifc(on_3d==yes)
  5887.                 Kill_3d()
  5888.             destroyAllobjects
  5889.             new_country_text=no
  5890.             large_text()
  5891.             setup(large_text_button)
  5892.         }
  5893.  
  5894.         id=408    //Stats
  5895.         iconbuttonid id,  936,584,150,140,enabled,none,1,118,119,119,
  5896.         {
  5897.             click
  5898.             hold_buttons(1)
  5899.             country_set=0
  5900.             ifc(on_3d==yes)
  5901.                 Kill_3d()
  5902.             destroyAllobjects
  5903.             check_gph_names()
  5904.             set_gph()
  5905.             current_bar_c=0
  5906.             setup(3)
  5907.         }
  5908.  
  5909.         id=426 //EXIT
  5910.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  5911.         {
  5912.             click
  5913.             hold_buttons(1)
  5914.             ifc(on_3d==yes)
  5915.                 Kill_3d()
  5916.             destroyAllobjects
  5917.             loop_exit=1
  5918.         }
  5919.         ifc(total_slides[new_number]>0)
  5920.         {
  5921.             flag_on=no
  5922.             id=406    //Photo
  5923.             photo_id_on_main=getnextobjectid()
  5924.             iconbuttonid id,  706,328,150,140,enabled,none,1,114,115,115,
  5925.             {
  5926.                 click
  5927.                 hold_buttons(1)
  5928.                 ifc(on_3d==yes)
  5929.                     Kill_3d()
  5930.                 ifc(next_image+1>total_slides[new_number])
  5931.                     next_image=0
  5932.                 ifc(count+1>total_slides[new_number])
  5933.                     count=0
  5934.                 change_images(up,small)
  5935.                 setup(1)
  5936.             }
  5937.             deleteobject    photo_id_on
  5938.         }
  5939.         id=404  //country map
  5940.         iconbuttonid id,  926,122,152,140,enabled,none,1,110,111,111,
  5941.         {
  5942.             click
  5943.             hold_buttons(1)
  5944.             flag_on=no
  5945.             ifc(on_3d==yes)
  5946.                 Kill_3d()
  5947.             count=0
  5948.             next_image=1
  5949.             show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  5950.             setup(1)
  5951.         }
  5952.         ifc(show_3d_interface>0)
  5953.         {
  5954.             id=410 //next 3d object fro demo only
  5955.             d3_id_on_main=getnextobjectid()
  5956.             iconbuttonid id,  1130,332,150,140,enabled,none,1,122,123,123,
  5957.             {
  5958.                 click
  5959.                 hold_buttons(1)
  5960.                 flag_on=yes
  5961.                 deleteobject zoom_id_on
  5962.                 ifc(new_number==261)
  5963.                 {
  5964.                     click3d=1
  5965.                     show_3d[0]=40
  5966.                 }
  5967.                 ifc(click3d>0)
  5968.                 {
  5969.                     ifc(sprites_on==yes)
  5970.                     {
  5971.                         forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  5972.                         delsprite del_sp_cnt
  5973.                     }
  5974.                     ifc(on_3d==yes)
  5975.                         Kill_3d()
  5976.                     hit_3d++
  5977.                     ifc(hit_3d>click3d-1)
  5978.                         hit_3d=0
  5979.                     on_3d=yes
  5980.                     id1=98
  5981.                     settext id1," "
  5982.                     FONT "HELVETICA",11,22
  5983.                     id1=998
  5984.                     settext id1, show_3d_desc[hit_3d]
  5985.                     sound server_sounds+`longplay/`+filename(itostr(show_3d[hit_3d]))+`.mid sequencer`
  5986.                     display_object(show_3d[hit_3d])
  5987.                     flag_hold=0
  5988.                     SetFilenameProperty loadphoto, "LoadImageNotify", server_local +`/bkgnd`+load_ext
  5989.                     while not flag_hold loop
  5990.                         hold
  5991.                     endwhile
  5992.  
  5993.                     setup(1)
  5994.                 }
  5995.             }
  5996.             deleteobject    d3_id_on
  5997.  
  5998.         }
  5999.         ifc(show_flag==0)
  6000.         {
  6001.             id=405    //flag
  6002.             flag_id_on_main=getnextobjectid()
  6003.             iconbuttonid id,  752,166,150,140,enabled,none,1,112,113,113,
  6004.             {
  6005.                 click
  6006.                 hold_buttons(1)
  6007.                 ifc(sprites_on==yes)
  6008.                 {
  6009.                     forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  6010.                         delsprite del_sp_cnt
  6011.                 }
  6012.                 deleteobject zoom_id_on
  6013.                 flag_on=yes
  6014.                 ifc(on_3d==yes)
  6015.                     Kill_3d()
  6016.                 id=98
  6017.                 settext id," "
  6018.                 flag_hold=0
  6019.                 SetFilenameProperty loadphoto, "LoadImageNotify", server + country +`/flag`+load_ext2
  6020.                 while not flag_hold loop
  6021.                     hold
  6022.                 endwhile
  6023.                 id=98
  6024.                 settext id," "
  6025.                 setup(1)
  6026.             }
  6027.             deleteobject    flag_id_on
  6028.  
  6029.         }
  6030.  
  6031.         id=401 //World MAP
  6032.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  6033.         {
  6034.             click
  6035.             hold_buttons(1)
  6036.             country_set=0
  6037.             flag_on_screen=no
  6038.             map_on_screen=no
  6039.             ifc(on_3d==yes)
  6040.                 Kill_3d()
  6041.             destroyAllobjects
  6042.             setup(world_map)
  6043.         }
  6044.         ifc(show_where==1)
  6045.         {
  6046.             id=411 //Where
  6047.             where_id_on_main=getnextobjectid()
  6048.             iconbuttonid id,  1086,184,150,140,enabled,none,1,124,125,125,
  6049.             {
  6050.                 click
  6051.                 hold_buttons(1)
  6052.                 country_set=0
  6053.                 flag_on_screen=no
  6054.                 map_on_screen=no
  6055.                 ifc(on_3d==yes)
  6056.                     Kill_3d()
  6057.                 destroyAllobjects
  6058.                 setup(where)
  6059.             }
  6060.             deleteobject    where_id_on
  6061.         }
  6062.         id=413 //country left
  6063.         country_left_id_main=getnextobjectid()
  6064.         iconbuttonid id,  30,30,58,72,enabled,none,2,300,301,302,
  6065.         {
  6066.             click
  6067.             hold_buttons(1)
  6068.             flag_on=no
  6069.             ifc(on_3d==yes)
  6070.                 Kill_3d()
  6071.             country_set=1
  6072.             browsersetcursorbusy true
  6073.             new_country(down,yes)
  6074.             setup(1)
  6075.         }
  6076.         deleteobject country_left_id
  6077.  
  6078.         id=412 //country right
  6079.         country_right_id_main=getnextobjectid()
  6080.         iconbuttonid id,  88,30,58,72,enabled,none,2,304,305,306,
  6081.         {
  6082.             click
  6083.             hold_buttons(1)
  6084.             flag_on=no
  6085.             ifc(on_3d==yes)
  6086.                 Kill_3d()
  6087.             country_set=1
  6088.             browsersetcursorbusy true
  6089.             new_country(up,yes)
  6090.             setup(1)
  6091.         }
  6092.         deleteobject country_right_id
  6093.  
  6094.         id=403 //help
  6095.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  6096.         {
  6097.                 click
  6098.         }
  6099.  
  6100.  
  6101.         ifc(fun_facts_on[new_number]==1)
  6102.         {
  6103.             id=407 //fun facts
  6104.             fun_id_on_main=getnextobjectid()
  6105.             iconbuttonid id,  754,488,150,140,enabled,none,1,116,117,117,
  6106.             {
  6107.                 click
  6108.                 hold_buttons(1)
  6109.                 country_set=0
  6110.                 flag_on_screen=no
  6111.                 map_on_screen=no
  6112.                 ifc(on_3d==yes)
  6113.                     Kill_3d()
  6114.                 destroyAllobjects
  6115.                 fun_screen()
  6116.                 setup(fun_facts)
  6117.             }
  6118.             deleteobject    fun_id_on
  6119.         }
  6120.  
  6121.         id=409 //games
  6122.         iconbuttonid id,  1098,492,150,140,enabled,none,1,120,121,121,
  6123.         {
  6124.  
  6125.             click
  6126.             hold_buttons(1)
  6127.             country_set=0
  6128.             flag_on_screen=no
  6129.             map_on_screen=no
  6130.             ifc(on_3d==yes)
  6131.                 Kill_3d()
  6132.             destroyAllobjects
  6133.             games_screen()
  6134.             setup(games)
  6135.         }
  6136.     }
  6137.  
  6138.     ifc(hotspot_check==games1)
  6139.     {
  6140.  
  6141.         iconbuttonid id,1166,750,86,80,enabled,none,3,421,421,422,
  6142.         {
  6143.             deleteobject help_id_on
  6144.             ifc(help_game1==0)
  6145.             {
  6146.                 transparentcolor 0,255,0
  6147.                 help_game1=1
  6148.                 help_id_on=getnextobjectid()
  6149.                 iconbuttonid id,  676,342,590,420,enabled,none,3,420,420,420,
  6150.                 {
  6151.                     deleteobject help_id_on
  6152.                     help_game1=0
  6153.                 }
  6154.             }
  6155.             else
  6156.             {
  6157.                 help_game1=0
  6158.             }
  6159.         }
  6160.         iconbuttonid id, 0,860,88,100,enabled,none,3,451,412,413,
  6161.         {
  6162.             total_moves=101
  6163.             exit_tile=1
  6164.             forc(cut_sprite_tile_game=0;cut_sprite_tile_game<12;cut_sprite_tile_game++)
  6165.             {
  6166.                 delsprite cut_sprite_tile_game+100
  6167.                 delsprite cut_sprite_tile_game
  6168.             }
  6169.             destroyAllobjects
  6170.             games_screen()
  6171.             setup(games)
  6172.         }
  6173.         id=426 //EXIT
  6174.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  6175.         {
  6176.             click
  6177.             destroyAllobjects
  6178.             loop_exit=1
  6179.         }
  6180.         id=401 //World MAP
  6181.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  6182.         {
  6183.             total_moves=101
  6184.             forc(cut_sprite_tile_game=0;cut_sprite_tile_game<12;cut_sprite_tile_game++)
  6185.             {
  6186.                 delsprite cut_sprite_tile_game+100
  6187.                 delsprite cut_sprite_tile_game
  6188.             }
  6189.  
  6190.             click
  6191.             destroyAllobjects
  6192.             setup(world_map)
  6193.         }    
  6194.  
  6195.         id=403 //help
  6196.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  6197.         {
  6198.             click
  6199.         }
  6200.         id=400 //search
  6201.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,            
  6202.         {
  6203.             font "COURIER.BOLD", 20,36
  6204.             deleteobject combo_small
  6205.             combo_small=getnextobjectid()
  6206.             combobox 390,196,520,564,list_1,enabled,ans,index,
  6207.             {
  6208.                 ifc(index!=-1)
  6209.                 {
  6210.                     total_moves=101
  6211.                     forc(cut_sprite_tile_game=0;cut_sprite_tile_game<12;cut_sprite_tile_game++)
  6212.                     {
  6213.                         delsprite cut_sprite_tile_game+100
  6214.                         delsprite cut_sprite_tile_game
  6215.                     }
  6216.                     click
  6217.                     destroyAllobjects
  6218.                     browsersetcursorbusy true
  6219.                     store_names(new_index[index],yes)
  6220.                     setup(1)
  6221.                 }
  6222.             }
  6223.             off_click_big()
  6224.         }
  6225.  
  6226.         ifc(dg_no_tile_game>1)
  6227.         {
  6228.             tile_game_left=getnextobjectid()
  6229.             iconbuttonid id, 1154,836,64,58,enabled,none,3,414,415,416,
  6230.             {
  6231.                 total_moves=random_moves
  6232.                 wait 10
  6233.                 dg_no_tile_game--
  6234.                 ifc(dg_no_tile_game==1)
  6235.                     deleteobject tile_game_left
  6236.                 current_n=filename(itostr(dg_no_tile_game))+`l`+load_ext4
  6237.                 blank_x=116
  6238.                 blank_y=166
  6239.     
  6240.                 destroyallobjects
  6241.                 setup(games1)
  6242.                 tile_game(dg_no_tile_game)
  6243.             }
  6244.         }
  6245.         ifc(dg_no_tile_game<total_slides[new_number])
  6246.         {        
  6247.             tile_game_right=getnextobjectid()
  6248.             iconbuttonid id, 1210,836,58,58,enabled,none,3,417,418,419,
  6249.             {
  6250.                 total_moves=random_moves
  6251.                 wait 10
  6252.                 dg_no_tile_game++
  6253.                 ifc(dg_no_tile_game>total_slides[new_number]-1)
  6254.                     deleteobject tile_game_right
  6255.                 current_n=filename(itostr(dg_no_tile_game))+`l`+load_ext4
  6256.                 blank_x=116
  6257.                 blank_y=166
  6258.  
  6259.                 destroyallobjects
  6260.                 setup(games1)
  6261.                 tile_game(dg_no_tile_game)
  6262.             }
  6263.         }
  6264.  
  6265.     }
  6266.  
  6267.     ifc(hotspot_check==games2)
  6268.     {
  6269.         read_number_sprites()
  6270.         iconbuttonid id,  12,870,64,60,enabled,none,3,211,212,213,//back
  6271.         {
  6272.             id1=0
  6273.             timer id1, time_delay, timer_off
  6274.             destroyAllobjects
  6275.             games_screen()
  6276.             setup(games)
  6277.         }
  6278.         id=426 //EXIT
  6279.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  6280.         {
  6281.             click
  6282.             destroyAllobjects
  6283.             loop_exit=1
  6284.         }
  6285.         id=401 //World MAP
  6286.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  6287.         {
  6288.             click
  6289.             id1=0
  6290.             timer id1, time_delay, timer_off
  6291.             destroyAllobjects
  6292.             setup(world_map)
  6293.         }    
  6294.  
  6295.         id=403 //help
  6296.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  6297.         {
  6298.             click
  6299.             id1=0
  6300.             timer id1, time_delay, timer_off
  6301.         }
  6302.         id=400 //search
  6303.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,            
  6304.         {
  6305.             font "COURIER.BOLD", 20,36
  6306.             deleteobject combo_small
  6307.             combo_small=getnextobjectid()
  6308.             combobox 390,196,520,564,list_1,enabled,ans,index,
  6309.             {
  6310.                 ifc(index!=-1)
  6311.                 {
  6312.                     id1=0
  6313.                     timer id1, time_delay, timer_off
  6314.                     click
  6315.                     destroyAllobjects
  6316.                     browsersetcursorbusy true
  6317.                     store_names(index+1,yes)
  6318.                     setup(1)
  6319.                 }
  6320.             }
  6321.             off_click_big()
  6322.         }
  6323.  
  6324.         tile_game_left=getnextobjectid()
  6325.         iconbuttonid id,  1078,870,64,60,enabled,none,3,214,215,216,//left
  6326.         {
  6327.             wait 10
  6328.             destroyallobjects
  6329.             setup(games2)
  6330.             wait 500
  6331.             forc(del_s_count=0;del_s_count<quick_count;del_s_count++)
  6332.             {    
  6333.                 quick_fited[del_s_count]=0
  6334.             }
  6335.             time_delay=work_out_speed
  6336.             quick_s_t=0
  6337.             show_score()
  6338.             start_game_no=rnd(rnd_pic_cnt)
  6339.             start_game_no+=1
  6340.             quick_fit(rnd_pic_check[start_game_no])
  6341.         }
  6342.         ifc(dg_no_tile_game<total_slides[new_number])
  6343.         {        
  6344.             tile_game_right=getnextobjectid()
  6345.             iconbuttonid id,  1144,870,60,60,enabled,none,3,217,218,219,//right
  6346.             {
  6347.                 wait 10
  6348.                 destroyallobjects
  6349.                 setup(games2)
  6350.                 wait 500
  6351.                 forc(del_s_count=0;del_s_count<quick_count;del_s_count++)
  6352.                 {    
  6353.                     quick_fited[del_s_count]=0
  6354.                 }
  6355.                 time_delay=work_out_speed
  6356.                 quick_s_t=0
  6357.                 show_score()
  6358.                 start_game_no=rnd(rnd_pic_cnt)
  6359.                 start_game_no+=1
  6360.                 quick_fit(rnd_pic_check[start_game_no])
  6361.             }
  6362.         }
  6363.  
  6364.     }
  6365.     ifc(hotspot_check==games)
  6366.     {
  6367.             forc(cut_sprite_tile_game=0;cut_sprite_tile_game<12;cut_sprite_tile_game++)
  6368.             {
  6369.                 delsprite cut_sprite_tile_game+100
  6370.                 delsprite cut_sprite_tile_game
  6371.             }
  6372.         start_game_no=count
  6373.         ifc(start_game_no==0)
  6374.             start_game_no=1
  6375.         deleteobject popups_are_on
  6376.         dg_no_tile_game=start_game_no
  6377.  
  6378.         iconbuttonid id,  20,598,66,66,enabled,none,4,222,400,400,
  6379.         {
  6380.             start_game_no=count
  6381.             ifc(start_game_no==0)
  6382.                 start_game_no=1
  6383.             exit_tile=0
  6384.             destroyAllobjects
  6385.             games_screen1()
  6386.             setup(games1)
  6387.             random_moves=5
  6388.             tile_speed=20
  6389.             tile_game(start_game_no)
  6390.         }
  6391.         iconbuttonid id,  22,686,66,66,enabled,none,4,222,400,400,
  6392.         {
  6393.             start_game_no=count
  6394.             ifc(start_game_no==0)
  6395.                 start_game_no=1
  6396.             exit_tile=0
  6397.             destroyAllobjects
  6398.             games_screen1()
  6399.             setup(games1)
  6400.             random_moves=10
  6401.             tile_speed=10
  6402.             tile_game(start_game_no)
  6403.         }
  6404.  
  6405.         iconbuttonid id,  24,770,66,66,enabled,none,4,222,400,400,
  6406.         {
  6407.             start_game_no=count
  6408.             ifc(start_game_no==0)
  6409.                 start_game_no=1
  6410.             exit_tile=0
  6411.             destroyAllobjects
  6412.             games_screen1()
  6413.             setup(games1)
  6414.             random_moves=80
  6415.             tile_speed=10
  6416.             tile_game(start_game_no)
  6417.         }
  6418.  
  6419.  
  6420.         gettime hr,m,s,c
  6421.         randomise(s)
  6422.         start_game_no=rnd(rnd_pic_cnt)
  6423.  
  6424.         iconbuttonid id,  652,654,66,66,enabled,none,4,222,402,402,//quick fit
  6425.         {
  6426.             destroyallobjects
  6427.             click
  6428.             games_screen2()
  6429.             read_number_sprites()
  6430.             easy_level=3
  6431.             time_delay=3000
  6432.             setup(games2)
  6433.             start_game_no=rnd(rnd_pic_cnt)
  6434.             start_game_no+=1
  6435.             quick_fit(rnd_pic_check[start_game_no])
  6436.         }
  6437.         iconbuttonid id,  654,742,66,66,enabled,none,4,222,402,402,//quick fit    
  6438.         {
  6439.             destroyallobjects
  6440.             click
  6441.             games_screen2()
  6442.             read_number_sprites()
  6443.             easy_level=4
  6444.             time_delay=2000
  6445.             setup(games2)
  6446.             start_game_no=rnd(rnd_pic_cnt)
  6447.             start_game_no+=1
  6448.             quick_fit(rnd_pic_check[start_game_no])
  6449.         }
  6450.  
  6451.         iconbuttonid id,  656,826,66,66,enabled,none,4,222,402,402,//quick fit
  6452.         {
  6453.             destroyallobjects
  6454.             click
  6455.             games_screen2()
  6456.             read_number_sprites()
  6457.             easy_level=5
  6458.             time_delay=1400
  6459.             setup(games2)
  6460.             start_game_no=rnd(rnd_pic_cnt)
  6461.             start_game_no+=1
  6462.             quick_fit(rnd_pic_check[start_game_no])
  6463.         }
  6464.  
  6465.  
  6466.  
  6467.         iconbuttonid id,  0,860,108,96,enabled,none,2,316,317,318,
  6468.         {
  6469.             small_start=1
  6470.             click
  6471.             destroyAllobjects
  6472.             ifc(count>0)
  6473.             {
  6474.                 show_country(no)
  6475.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  6476.             }
  6477.             else
  6478.                 show_country(yes)
  6479.             SETUP(1)
  6480.         }
  6481.         id=426 //EXIT
  6482.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  6483.         {
  6484.             click
  6485.             destroyAllobjects
  6486.             loop_exit=1
  6487.         }
  6488.         id=401 //World MAP
  6489.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  6490.         {
  6491.             click
  6492.             destroyAllobjects
  6493.             setup(world_map)
  6494.         }    
  6495.         id=403 //help
  6496.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  6497.         {
  6498.             click
  6499.             null
  6500.         }
  6501.         id=400 //search
  6502.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,            
  6503.         {
  6504.             font "COURIER.BOLD", 20,36
  6505.             deleteobject combo_small
  6506.             combo_small=getnextobjectid()
  6507.             combobox 390,196,520,564,list_1,enabled,ans,index,
  6508.             {
  6509.                 ifc(index!=-1)
  6510.                 {
  6511.                     click
  6512.                     destroyAllobjects
  6513.                     browsersetcursorbusy true
  6514.                     store_names(new_index[index],yes)
  6515.                     setup(1)
  6516.                 }
  6517.             }
  6518.             off_click_big()
  6519.         }
  6520.  
  6521.  
  6522.  
  6523.     }
  6524.     ifc(hotspot_check==large_pic)
  6525.     {
  6526.         ifc(total_slides[new_number]>0)
  6527.         {
  6528.             ifc(count>0)
  6529.             {
  6530.                 id=515 //Image up
  6531.                 deleteobject up_id_on
  6532.                 up_id_on=getnextobjectid()
  6533.                 iconbuttonid id,  1150,830,62,68,enabled,none,2,334,335,336,
  6534.                 {
  6535.                     click
  6536.                     ifc(sprites_on==yes)
  6537.                     {
  6538.                         forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  6539.                             delsprite del_sp_cnt
  6540.                     }
  6541.  
  6542.  
  6543.  
  6544.         id=426 //EXIT
  6545.         deleteobject wait_done1
  6546.         wait_done1=getnextobjectid()
  6547.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,108,108,
  6548.         {null}
  6549.  
  6550.         id=401 //World MAP
  6551.         deleteobject wait_done2
  6552.         wait_done2=getnextobjectid()
  6553.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,102,102,
  6554.         {null}
  6555.  
  6556.         id=402 //print 
  6557.         deleteobject wait_done3
  6558.         wait_done3=getnextobjectid()
  6559.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,104,104,
  6560.         {null}
  6561.  
  6562.         id=403 //help
  6563.         deleteobject wait_done4
  6564.         wait_done4=getnextobjectid()
  6565.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,106,106,    
  6566.         {null}
  6567.  
  6568.         id=400 //search
  6569.         deleteobject wait_done5
  6570.         wait_done5=getnextobjectid()
  6571.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,100,100,
  6572.         {null}
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.                     deleteobject up_id_on
  6579.                     up_id_on=getnextobjectid()
  6580.                     iconbuttonid id,  1150,830,62,68,enabled,none,2,334,334,334,
  6581.                     {null}
  6582.                     deleteobject down_id_on
  6583.                     down_id_on=getnextobjectid()
  6584.                     iconbuttonid id,  1212,830,58,68,enabled,none,2,338,338,338,
  6585.                     {null}
  6586.                     deleteobject list_id_on
  6587.                     list_id_on=getnextobjectid()
  6588.                     iconbuttonid id,  1154,734,112,102,enabled,none,2,331,331,331,
  6589.                     {null}
  6590.                     deleteobject country_right_id
  6591.                     deleteobject country_left_id
  6592.                     deleteobject back_button_id
  6593.                     ifc(next_image+1<1)
  6594.                         next_image=total_slides[new_number]
  6595.                     ifc(count<1)
  6596.                         count=total_slides[new_number]+1
  6597.                     change_images(down,big)
  6598.                     setup(large_pic)
  6599.  
  6600.                 }
  6601.             }
  6602.             else
  6603.             {
  6604.                 deleteobject up_id_on
  6605.             }
  6606.             ifc(count<total_slides[new_number])
  6607.             {
  6608.                 id=516 //Image down
  6609.                 deleteobject down_id_on
  6610.                 down_id_on=getnextobjectid()
  6611.                 iconbuttonid id,  1212,830,58,68,enabled,none,2,338,339,340,
  6612.                 {
  6613.                     click
  6614.                     ifc(sprites_on==yes)
  6615.                     {
  6616.                         forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  6617.                             delsprite del_sp_cnt
  6618.                     }
  6619.  
  6620.  
  6621.         id=426 //EXIT
  6622.         deleteobject wait_done1
  6623.         wait_done1=getnextobjectid()
  6624.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,108,108,
  6625.         {null}
  6626.  
  6627.         id=401 //World MAP
  6628.         deleteobject wait_done2
  6629.         wait_done2=getnextobjectid()
  6630.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,102,102,
  6631.         {null}
  6632.  
  6633.         id=402 //print 
  6634.         deleteobject wait_done3
  6635.         wait_done3=getnextobjectid()
  6636.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,104,104,
  6637.         {null}
  6638.  
  6639.         id=403 //help
  6640.         deleteobject wait_done4
  6641.         wait_done4=getnextobjectid()
  6642.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,106,106,    
  6643.         {null}
  6644.  
  6645.         id=400 //search
  6646.         deleteobject wait_done5
  6647.         wait_done5=getnextobjectid()
  6648.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,100,100,
  6649.         {null}
  6650.  
  6651.  
  6652.                     deleteobject up_id_on
  6653.                     up_id_on=getnextobjectid()
  6654.                     iconbuttonid id,  1150,830,62,68,enabled,none,2,334,334,334,
  6655.                     {null}
  6656.                     deleteobject down_id_on
  6657.                     down_id_on=getnextobjectid()
  6658.                     iconbuttonid id,  1212,830,58,68,enabled,none,2,338,338,338,
  6659.                     {null}
  6660.                     deleteobject list_id_on
  6661.                     list_id_on=getnextobjectid()
  6662.                     iconbuttonid id,  1154,734,112,102,enabled,none,2,331,331,331,
  6663.                     {null}
  6664.                     deleteobject country_right_id
  6665.                     deleteobject country_left_id
  6666.                     deleteobject back_button_id
  6667.                     ifc(next_image+1>total_slides[new_number])
  6668.                         next_image=0
  6669.                     ifc(count>total_slides[new_number])
  6670.                         count=0
  6671.                     change_images(up,big)
  6672.                     setup(large_pic)
  6673.                 }
  6674.             }
  6675.             else
  6676.             {
  6677.                 deleteobject down_id_on
  6678.             }
  6679.             id=517 //Image list
  6680.             deleteobject list_id_on
  6681.             list_id_on=getnextobjectid()
  6682.             iconbuttonid id,  1154,734,112,102,enabled,none,2,331,332,332,
  6683.             {
  6684.                 deleteobject combo_big
  6685.                 deleteobject combo_small
  6686.                 wait 20
  6687.                 combo_small=getnextobjectid()
  6688.                 combobox 390,196,520,564,small_cap,enabled,ans,index,
  6689.                 {
  6690.                     ifc(index!=-1)
  6691.                     {
  6692.                         click
  6693.                         ifc(sprites_on==yes)
  6694.                         {
  6695.                             forc(del_sp_cnt=1;del_sp_cnt<total_images+1;del_sp_cnt++)
  6696.                                 delsprite del_sp_cnt
  6697.                         }
  6698.  
  6699.  
  6700.         id=426 //EXIT
  6701.         deleteobject wait_done1
  6702.         wait_done1=getnextobjectid()
  6703.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,108,108,
  6704.         {null}
  6705.  
  6706.         id=401 //World MAP
  6707.         deleteobject wait_done2
  6708.         wait_done2=getnextobjectid()
  6709.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,102,102,
  6710.         {null}
  6711.  
  6712.         id=402 //print 
  6713.         deleteobject wait_done3
  6714.         wait_done3=getnextobjectid()
  6715.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,104,104,
  6716.         {null}
  6717.  
  6718.         id=403 //help
  6719.         deleteobject wait_done4
  6720.         wait_done4=getnextobjectid()
  6721.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,106,106,    
  6722.         {null}
  6723.  
  6724.         id=400 //search
  6725.         deleteobject wait_done5
  6726.         wait_done5=getnextobjectid()
  6727.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,100,100,
  6728.         {null}
  6729.  
  6730.  
  6731.  
  6732.                         deleteobject list_id_on
  6733.                         list_id_on=getnextobjectid()
  6734.                         iconbuttonid id,  1154,734,112,102,enabled,none,2,331,331,331,
  6735.                         {null}
  6736.                         id1=997
  6737.                         settext id1, " "
  6738.  
  6739.                         deleteobject country_right_id
  6740.                         deleteobject country_left_id
  6741.                         deleteobject back_button_id
  6742.                         deleteobject combo_small
  6743.                         deleteobject combo_big
  6744.                         browsersetcursorbusy true
  6745.                         off_event mouseclick
  6746.                         count=index
  6747.                         show_pic(filename(itostr(count)),count,big,filename(itostr(next_image)))
  6748.                         setup(large_pic)
  6749.                     }
  6750.  
  6751.                 }
  6752.                 off_click_big()
  6753.             }
  6754.         }
  6755.  
  6756.         id=424 //reduce image
  6757.         deleteobject back_button_id
  6758.         back_button_id=getnextobjectid()
  6759.         iconbuttonid id,  0,861,114,92,enabled,none,2,328,329,330,
  6760.         {
  6761.             destroyAllobjects
  6762.             small_start=1
  6763.             click
  6764.             ifc(count>0)
  6765.             {
  6766.                 show_country(no)
  6767.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  6768.             }
  6769.             else
  6770.                 show_country(yes)
  6771.             SETUP(1)
  6772.         }
  6773.  
  6774.  
  6775.         id=426 //EXIT
  6776.         deleteobject wait_done1
  6777.         wait_done1=getnextobjectid()
  6778.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  6779.         {
  6780.             click
  6781.             loop_exit=1
  6782.             destroyAllobjects
  6783.         }
  6784.         id=401 //World MAP
  6785.         deleteobject wait_done2
  6786.         wait_done2=getnextobjectid()
  6787.  
  6788.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  6789.         {
  6790.             click
  6791.             destroyAllobjects
  6792.             setup(world_map)
  6793.         }
  6794.         deleteobject wait_done3
  6795.         wait_done3=getnextobjectid()
  6796.  
  6797.         id=402 //print 
  6798.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  6799.         {
  6800.             click
  6801.             //printsetup header|footer,"",header_top,"","","","",header_top
  6802.             wait 20
  6803.             printscreen 0,0,1280,960, scaled|centred ,0
  6804.         }
  6805.  
  6806.         deleteobject wait_done4
  6807.         wait_done4=getnextobjectid()
  6808.  
  6809.         id=403 //help
  6810.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  6811.         {
  6812.             click
  6813.         }
  6814.         deleteobject wait_done5
  6815.         wait_done5=getnextobjectid()
  6816.  
  6817.         id=400 //search
  6818.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  6819.         {
  6820.  
  6821.             deleteobject combo_big
  6822.             deleteobject combo_small
  6823.             wait 20
  6824.             font "COURIER.BOLD", 20,36
  6825.             combo_small=getnextobjectid()
  6826.             combobox 390,196,520,564,list_1,enabled,ans,index,
  6827.             {
  6828.                 ifc(index!=-1)
  6829.                 {
  6830.                     click
  6831.                     destroyAllobjects
  6832.                     browsersetcursorbusy true
  6833.                     store_names(new_index[index],yes)
  6834.                     setup(1)
  6835.                 }
  6836.             }
  6837.             off_click_big()
  6838.         }
  6839.  
  6840.         id=413 //country left
  6841.         deleteobject country_left_id
  6842.         country_left_id=getnextobjectid()
  6843.         iconbuttonid id,  30,30,58,72,enabled,none,2,300,301,302,
  6844.         {
  6845.             click
  6846.             deleteobject up_id_on
  6847.             up_id_on=getnextobjectid()
  6848.             iconbuttonid id,  1150,830,62,68,enabled,none,2,334,334,334,
  6849.             {null}
  6850.             deleteobject down_id_on
  6851.             down_id_on=getnextobjectid()
  6852.             iconbuttonid id,  1212,830,58,68,enabled,none,2,338,338,338,
  6853.             {null}
  6854.             deleteobject list_id_on
  6855.             list_id_on=getnextobjectid()
  6856.             iconbuttonid id,  1154,734,112,102,enabled,none,2,331,331,331,
  6857.             {null}
  6858.             browsersetcursorbusy true
  6859.             new_country(down,no)
  6860.             FONT "HELVETICA",24,48
  6861.             pencolor  255,255,255
  6862.             id=99
  6863.             settext id ,header_top
  6864.             count=0
  6865.             add_sprites()
  6866.             show_pic(filename(itostr(count)),count,big,filename(itostr(next_image)))
  6867.             setup(large_pic)
  6868.         }
  6869.  
  6870.         id=412 //country right
  6871.         deleteobject country_right_id
  6872.         country_right_id=getnextobjectid()
  6873.         iconbuttonid id,  88,30,58,72,enabled,none,2,304,305,306,
  6874.         {
  6875.             click
  6876.             deleteobject up_id_on
  6877.             up_id_on=getnextobjectid()
  6878.             iconbuttonid id,  1150,830,62,68,enabled,none,2,334,334,334,
  6879.             {null}
  6880.             deleteobject down_id_on
  6881.             down_id_on=getnextobjectid()
  6882.             iconbuttonid id,  1212,830,58,68,enabled,none,2,338,338,338,
  6883.             {null}
  6884.             deleteobject list_id_on
  6885.             list_id_on=getnextobjectid()
  6886.             iconbuttonid id,  1154,734,112,102,enabled,none,2,331,331,331,
  6887.             {null}
  6888.             browsersetcursorbusy true
  6889.             new_country(up,no)
  6890.             FONT "HELVETICA",24,48
  6891.             pencolor  255,255,255
  6892.             id=99
  6893.             settext id ,header_top
  6894.             count=0
  6895.             add_sprites()
  6896.             show_pic(filename(itostr(count)),count,big,filename(itostr(next_image)))
  6897.             setup(large_pic)
  6898.         }
  6899.     }
  6900.     ifc(hotspot_check==3)
  6901.     {
  6902.         //check_gph_names()
  6903.         FONT "HELVETICA",24,48
  6904.         pencolor  255,255,255
  6905.         pencolor  241,230,119
  6906.  
  6907.         id=426 //EXIT
  6908.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  6909.         {
  6910.             loop_exit=1
  6911.         }
  6912.         id=401 //World MAP
  6913.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  6914.         {
  6915.             click
  6916.             destroyAllobjects
  6917.             setup(world_map)
  6918.         }
  6919.         id=402 //print 
  6920.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  6921.         {
  6922.             click
  6923.             //printsetup header|footer,"","Statistics","","","","","Statistics"
  6924.             wait 20
  6925.             printscreen 0,0,1280,960, scaled|centred ,0
  6926.         }
  6927.         id=403 //help
  6928.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  6929.         {
  6930.             null
  6931.         }
  6932.         id=400 //search
  6933.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  6934.         {
  6935.             deleteobject combo_small
  6936.             off_event mouseclick
  6937.             font "COURIER.BOLD", 20,36
  6938. //            deleteobject combo_small
  6939.             combo_small=getnextobjectid()
  6940.             combobox 390,196,520,564,list_1,enabled,ans,index,
  6941.             {
  6942.                 ifc(index!=-1)
  6943.                 {
  6944.                     destroyAllobjects
  6945.                     off_event mouseclick
  6946.                     store_names(new_index[index],yes)
  6947.                     setup(1)
  6948.                 }
  6949.             }
  6950.             off_click_big()
  6951.  
  6952.         }
  6953.  
  6954.         FONT "HELVETICA.BOLD",13,26
  6955.         pencolor  241,230,119
  6956.         iconbuttonid id,  40,135,265,268,enabled,none,1,222,222,222,
  6957.         {
  6958.             deleteobject combo_small
  6959.             off_event mouseclick
  6960.             font "COURIER.BOLD", 2,4
  6961. //            deleteobject combo_small
  6962. //            deleteobject combo_small
  6963.             combo_small=getnextobjectid()
  6964.             combobox 40,200,265,198,list_2,enabled,ans,index,
  6965.             {
  6966.                 ifc(index!=-1)
  6967.                 {
  6968.                     click
  6969.                     browsersetcursorbusy true
  6970.                     off_event mouseclick
  6971.                     browsersetcursorbusy true
  6972. //                    deleteobject small_map1
  6973.                     deleteobject combo_small
  6974.                     set_gph_name(index,0)
  6975.                     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  6976.                     SpriteFlags2 233, enabled|visible, UNBOUND
  6977.                     load_map(graph[0],1)
  6978.                     ifc(current_bar_c>0)
  6979.                     {
  6980.                         ifc(current_bar_c<4)
  6981.                         {
  6982.                             activepage 1
  6983.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  6984.                             bar(current_bar_c,0)
  6985.                         }
  6986.                         else
  6987.                         {
  6988.                             activepage 1
  6989.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  6990.                             set_key_code(current_bar_c-3)
  6991.                             pie_bar(current_bar_c-3)
  6992.                             show_key()
  6993.                             activepage 0
  6994.                             clearscreen 0,400,1280,450,pushright,1,25
  6995.                         }
  6996.                     }
  6997.                     delsprite 233
  6998.                     browsersetcursorbusy false
  6999.                     setup(3)
  7000.                 }
  7001.  
  7002.                 
  7003.             }
  7004.             SetProperty combo_small, "SetFocus"
  7005.             on_event mouseclick,x,y
  7006.             {
  7007.                 ifc( (x<40 || x>305) || (y<265 || y>463) )
  7008.                 {
  7009.                     deleteobject combo_small
  7010.                     off_event mouseclick
  7011.                 }
  7012.             }
  7013.         }
  7014.         iconbuttonid id,  350,135,265,268,enabled,none,1,222,222,222,
  7015.         {
  7016.             deleteobject combo_small
  7017.             off_event mouseclick
  7018.             font "COURIER.BOLD", 8,36
  7019. //            deleteobject combo_small
  7020.             combo_small=getnextobjectid()
  7021.             combobox 350,200,265,198,list_2,enabled,ans,index,
  7022.             {
  7023.                 ifc(index!=-1)
  7024.                 {
  7025.                     click
  7026.                     off_event mouseclick
  7027.                     browsersetcursorbusy true
  7028. //                    deleteobject small_map2
  7029.                     deleteobject combo_small
  7030.                     set_gph_name(index,1)
  7031.                     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  7032.                     SpriteFlags2 233, enabled|visible, UNBOUND
  7033.                     load_map(graph[1],2)
  7034.                     ifc(current_bar_c>0)
  7035.                     {
  7036.                         ifc(current_bar_c<4)
  7037.                         {
  7038.                             activepage 1
  7039.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7040.                             bar(current_bar_c,0)
  7041.                         }
  7042.                         else
  7043.                         {
  7044.                             activepage 1
  7045.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7046.                             set_key_code(current_bar_c-3)
  7047.                             show_key()
  7048.                             pie_bar(current_bar_c-3)
  7049.                             activepage 0
  7050.                             clearscreen 0,400,1280,450,pushright,1,25
  7051.                         }
  7052.                     }
  7053.                     delsprite 233
  7054.                     browsersetcursorbusy false
  7055.                     setup(3)
  7056.                 }
  7057.             }
  7058.             SetProperty combo_small, "SetFocus"
  7059.             on_event mouseclick,x,y
  7060.             {
  7061.                 ifc( (x<350 || x>615) || (y<265 || y>463) )
  7062.                 {
  7063.                     deleteobject combo_small
  7064.                     off_event mouseclick
  7065.                 }
  7066.             }
  7067.  
  7068.         }
  7069.         iconbuttonid id,  665,135,265,268,enabled,none,1,222,222,222,
  7070.         {
  7071.             deleteobject combo_small
  7072.             off_event mouseclick
  7073.             font "COURIER.BOLD", 8,36
  7074.             combo_small=getnextobjectid()
  7075.             combobox 665,200,265,198,list_2,enabled,ans,index,
  7076.             {
  7077.                 ifc(index!=-1)
  7078.                 {
  7079.                     click
  7080.                     off_event mouseclick
  7081.                     browsersetcursorbusy true
  7082.                     id=802
  7083.                     settext id, " "
  7084. //                    deleteobject small_map3
  7085.                     deleteobject combo_small
  7086.                     set_gph_name(index,2)
  7087.                     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  7088.                     SpriteFlags2 233, enabled|visible, UNBOUND
  7089.                     load_map(graph[2],3)
  7090.                     ifc(current_bar_c>0)
  7091.                     {
  7092.                         ifc(current_bar_c<4)
  7093.                         {
  7094.                             activepage 1
  7095.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7096.                             bar(current_bar_c,0)
  7097.                         }
  7098.                         else
  7099.                         {
  7100.                             activepage 1
  7101.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7102.                             set_key_code(current_bar_c-3)
  7103.                             show_key()
  7104.                             pie_bar(current_bar_c-3)
  7105.                             activepage 0
  7106.                             clearscreen 0,400,1280,450,pushright,1,25
  7107.                         }
  7108.  
  7109.                     }
  7110.                     delsprite 233
  7111.                     browsersetcursorbusy false
  7112.                     setup(3)
  7113.                 }
  7114.             }
  7115.             SetProperty combo_small, "SetFocus"
  7116.             on_event mouseclick,x,y
  7117.             {
  7118.                 ifc( (x<665 || x>930) || (y<265 || y>463) )
  7119.                 {
  7120.                     deleteobject combo_small
  7121.                     off_event mouseclick
  7122.                 }
  7123.             }
  7124.  
  7125.         }
  7126.         iconbuttonid id,  970,135,265,268,enabled,none,1,222,222,222,
  7127.         {
  7128.             deleteobject combo_small
  7129.             off_event mouseclick
  7130.             font "COURIER.BOLD", 8,36
  7131.             combo_small=getnextobjectid()
  7132.             combobox 970,200,265,198,list_2,enabled,ans,index,
  7133.             {
  7134.                 ifc(index!=-1)
  7135.                 {
  7136.                     click
  7137.                     off_event mouseclick
  7138.                     browsersetcursorbusy true
  7139.                     id=803
  7140.                     settext id, " "
  7141. //                    deleteobject small_map4
  7142.                     deleteobject combo_small
  7143.  
  7144.                     set_gph_name(index,3)
  7145.                     SPRITEb 233,570,10,looped,1,100,7,[700,701,702,703,704,705,706,707]
  7146.                     SpriteFlags2 233, enabled|visible, UNBOUND
  7147.                     load_map(graph[3],4)
  7148.                     ifc(current_bar_c>0)
  7149.                     {
  7150.                         ifc(current_bar_c<4)
  7151.                         {
  7152.                             activepage 1
  7153.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7154.                             bar(current_bar_c,0)
  7155.                         }
  7156.                         else
  7157.                         {
  7158.                             activepage 1
  7159.                             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7160.                             set_key_code(current_bar_c-3)
  7161.                             show_key()
  7162.                             pie_bar(current_bar_c-3)
  7163.                             activepage 0
  7164.                             clearscreen 0,400,1280,450,pushright,1,25
  7165.                         }
  7166.  
  7167.                     }
  7168.                     delsprite 233
  7169.                     browsersetcursorbusy false
  7170.                     setup(3)
  7171.                 }
  7172.             }
  7173.             SetProperty combo_small, "SetFocus"
  7174.             on_event mouseclick,x,y
  7175.             {
  7176.                 ifc( (x<975 || x>1240) || (y<265 || y>463) )
  7177.                 {
  7178.                     deleteobject combo_small
  7179.                     off_event mouseclick
  7180.                 }
  7181.             }
  7182.  
  7183.         }
  7184.  
  7185.         iconbuttonid id,  106,864,118,66,enabled,none,1,222,222,222,
  7186.         {
  7187.             click
  7188.             //delete_current_settings()
  7189.             destroyallobjects
  7190.             menu_bar(1)
  7191.             activepage 1
  7192.             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7193.             current_bar_c=1
  7194.             bar(1,0)
  7195.             setup(3)
  7196.         }
  7197.  
  7198.         iconbuttonid id,  234,864,198,66,enabled,none,1,222,222,222,
  7199.         {
  7200.             click
  7201. //            delete_current_settings()
  7202.             destroyallobjects
  7203.             menu_bar(2)
  7204.             activepage 1
  7205.             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7206.             bar(2,0)
  7207.             current_bar_c=2
  7208.             setup(3)
  7209.         }
  7210.  
  7211.         iconbuttonid id,  444,864,194,66,enabled,none,1,222,222,222,
  7212.         {
  7213.             click
  7214.             //delete_current_settings()
  7215.             destroyallobjects
  7216.             menu_bar(3)
  7217.             activepage 1
  7218.             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7219.             bar(3,0)
  7220.             current_bar_c=3
  7221.             setup(3)
  7222.         }
  7223.         iconbuttonid id,  650,864,188,66,enabled,none,1,222,222,222,
  7224.         {
  7225.             click
  7226.             //delete_current_settings()
  7227.             destroyallobjects
  7228.             current_bar_c=4
  7229.             menu_bar(4)
  7230.             activepage 1
  7231.             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7232.             set_key_code(1)
  7233.             pie_bar(1)
  7234.             show_key()
  7235.             activepage 0
  7236.             clearscreen 0,400,1280,450,pushright,1,25
  7237.             setup(3)
  7238.         }
  7239.         iconbuttonid id,  852,864,240,66,enabled,none,1,222,222,222,
  7240.         {
  7241.             click
  7242.             destroyallobjects
  7243.             //delete_current_settings()
  7244.             activepage 1
  7245.             current_bar_c=5
  7246.             menu_bar(5)
  7247.             activepage 1
  7248.             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7249.             set_key_code(2)
  7250.             pie_bar(2)
  7251.             show_key()
  7252.             activepage 0
  7253.             clearscreen 0,400,1280,450,pushright,1,25
  7254.             setup(3)
  7255.         }
  7256.         iconbuttonid id,  1100,864,170,66,enabled,none,1,222,222,222,
  7257.         {
  7258.             click
  7259.             destroyallobjects
  7260.             //delete_current_settings()
  7261.             activepage 1
  7262.             current_bar_c=6
  7263.             hold_buttons(2)
  7264.             menu_bar(6)
  7265.             activepage 1
  7266.             LOADIMAGE 0,0,1279,960,JPG,server_menu+`stats`+load_ext
  7267.             set_key_code(3)
  7268.             pie_bar(3)
  7269.             show_key()
  7270.             activepage 0
  7271.             clearscreen 0,400,1280,450,pushright,1,25
  7272.             setup(3)
  7273.         }
  7274.  
  7275.  
  7276.         id=413 //return to main screen
  7277. //        iconbuttonid id,  2,866,74,60,enabled,none,1,222,222,222,
  7278.         iconbuttonid id,  6,864,98,88,enabled,none,2,342,343,344,
  7279.         {
  7280.             click
  7281.             destroyAllobjects
  7282.             small_start=1
  7283.             show_country(no)
  7284.             show_pic(filename(itostr(count)),count,1,filename(itostr(next_image)))
  7285.             setup(1)
  7286.         }
  7287.  
  7288.     }
  7289.  
  7290.     ifc(hotspot_check==large_text_button)
  7291.     {
  7292.  
  7293.         id=426 //EXIT
  7294.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  7295.         {
  7296.             click
  7297.             destroyAllobjects
  7298.             loop_exit=1
  7299.         }
  7300.         id=401 //World MAP
  7301.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  7302.         {
  7303.             click
  7304.             destroyAllobjects
  7305.             setup(world_map)
  7306.         }
  7307.         id=402 //print text 
  7308.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  7309.         {
  7310.             click
  7311.             //printsetup header|footer,"",header_top,"","","","",header_top
  7312.             wait 20
  7313.             SetProperty objHTMLBox2 "Print"
  7314.         }
  7315.  
  7316.         id=403 //help
  7317.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  7318.         {
  7319.             click
  7320.             null
  7321.         }
  7322.  
  7323.  
  7324.         id=400 //search
  7325.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  7326.         {
  7327.             font "COURIER.BOLD", 20,36
  7328.             deleteobject combo_small
  7329.             combo_small=getnextobjectid()
  7330.             combobox 390,196,520,564,list_1,enabled,ans,index,
  7331.             {
  7332.                 ifc(index!=-1)
  7333.                 {
  7334.                     change_text=2
  7335.                     deleteobject combo_small
  7336.                     deleteobject combo_big
  7337.                     deleteobject   text_down_id 
  7338.                     deleteobject   text_up_id 
  7339.  
  7340.                     deleteobject objHTMLBox2
  7341.  
  7342.                     off_event mouseclick
  7343.                     store_names(new_index[index],no)
  7344.                     add_text_to_screen()
  7345. //                    add_sprites()
  7346.                     setup(large_text_button)
  7347.                 }
  7348.             }
  7349.             off_click_big()
  7350.  
  7351.         }
  7352.  
  7353.  
  7354.         id=413 //country left
  7355.         deleteobject country_left_id
  7356.         country_left_id=getnextobjectid()
  7357.         iconbuttonid id,  30,30,58,72,enabled,none,2,300,301,302,
  7358.         {
  7359.             click
  7360.             change_text=2
  7361.             deleteobject   text_down_id 
  7362.             deleteobject   text_up_id 
  7363.  
  7364.             deleteobject objHTMLBox2
  7365.             hold_buttons(0)
  7366.             count=0    
  7367.             new_country_text=yes
  7368.             new_country(down,no)
  7369.             add_text_to_screen()
  7370.             setup(large_text_button)
  7371.         }
  7372.  
  7373.         id=412 //country right
  7374.         deleteobject country_right_id
  7375.         country_right_id=getnextobjectid()
  7376.         iconbuttonid id,  88,30,58,72,enabled,none,2,304,305,306,
  7377.         {
  7378.             click
  7379.             change_text=2
  7380.             deleteobject   text_down_id 
  7381.             deleteobject   text_up_id 
  7382.  
  7383.             deleteobject objHTMLBox2
  7384.             hold_buttons(0)
  7385.             count=0    
  7386.             new_country_text=yes
  7387.             new_country(up,no)
  7388.             add_text_to_screen()
  7389.             setup(large_text_button)
  7390.         }
  7391.         id=424 //reduce text
  7392.         iconbuttonid id,  0,860,108,96,enabled,none,2,316,317,318,
  7393.         {
  7394.             click
  7395.             destroyAllobjects
  7396.             small_start=1
  7397.             ifc(new_country_text==yes)
  7398.             {
  7399.                 show_country(yes)
  7400.             }            
  7401.             else
  7402.             {
  7403.                 new_country_text=no
  7404.                 show_country(no)
  7405.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  7406.             }
  7407.             setup(1)
  7408.         }
  7409.     }
  7410.     ifc(hotspot_check==show_dates)
  7411.     {
  7412.         read_dates()
  7413.         set_up_screen()
  7414.         FONT "HELVETICA",24,48
  7415.         pencolor  255,255,255
  7416.         id=99
  7417.         label id, 190,40, 550, 60, left, header_top
  7418.  
  7419.         ifc(af_txt_on[new_number]==1 | af_pic_on[new_number]==1)
  7420.         {
  7421.             id=801
  7422.             iconbuttonid id,  260,790,262,142,enabled,none,2,410,410,410,
  7423.             {
  7424.                 count_key_facts=99
  7425.                 click
  7426.                 deleteobject set_up_film
  7427.                 destroyAllobjects
  7428.                 show_am()
  7429.                 delsprite 221
  7430.                 setup(show_amasing)
  7431.             }
  7432.         }
  7433.         id=802
  7434.         //iconbuttonid id,  754,122,86,82,enabled,none,1,222,222,222,
  7435.         iconbuttonid id,  1104,128,78,64,enabled,none,2,356,357,358,
  7436.         {
  7437.             click
  7438.             count_key_facts=99
  7439.             destroyAllobjects
  7440.             fun_screen()
  7441.             delsprite 221
  7442.             setup(fun_facts)
  7443.         }
  7444.  
  7445.         iconbuttonid id,  0,834,120,120,enabled,none,2,350,351,352,
  7446.         {
  7447.             click
  7448.             destroyAllobjects
  7449.             count_key_facts=99
  7450.             small_start=1
  7451.             ifc(count>0)
  7452.             {
  7453.                 show_country(no)
  7454.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  7455.             }
  7456.             else
  7457.                 show_country(yes)
  7458.             SETUP(1)
  7459.         }
  7460.  
  7461.         id=426 //EXIT
  7462.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  7463.         {
  7464.             count_key_facts=99
  7465.             click
  7466.             destroyAllobjects
  7467.             loop_exit=1
  7468.             loop
  7469.                 if not TimerActive then
  7470.                     wait 100
  7471.                 endif
  7472.                 wait 20
  7473.             until loop_exit=1 or destroyed
  7474.             Kill_3d()
  7475.             winclose
  7476.             browserexit
  7477.         }
  7478.         id=401 //World MAP
  7479.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  7480.         {
  7481.             click
  7482.             destroyAllobjects
  7483.             setup(world_map)
  7484.         }    
  7485.         id=402 //print 
  7486.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  7487.         {
  7488.             click
  7489.             //printsetup header|footer,"","Key Dates","","","","","Key Dates"
  7490.             wait 20
  7491.             objHTMLBox3=getnextobjectid()
  7492.             customtextwindow 0,0,0,0,key_facts+country+`/da`+country+`.txt`,222,222
  7493.             SetProperty objHTMLBox3 "Print"
  7494.             wait 20000
  7495.             deleteobject objHTMLBox3
  7496.         }
  7497.         id=403 //help
  7498.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  7499.         {
  7500.             click
  7501.             null
  7502.         }
  7503.  
  7504.         id=400 //search
  7505.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  7506.         {
  7507.             click
  7508.             font "COURIER.BOLD", 20,36
  7509.             deleteobject combo_small
  7510.             combo_small=getnextobjectid()
  7511.             combobox 390,196,520,564,list_1,enabled,ans,index,
  7512.             {
  7513.                 ifc(index!=-1)
  7514.                 {
  7515.                     count_key_facts=99
  7516.                     destroyAllobjects
  7517.                     off_event mouseclick
  7518.                     store_names(new_index[index],yes)
  7519.                     setup(1)
  7520.                 }
  7521.             }
  7522.             off_click_big()
  7523.  
  7524.         }
  7525.         wait 5
  7526.         scroll_text()
  7527.     }
  7528.  
  7529.     ifc(hotspot_check==show_amasing)
  7530.     {
  7531.         FONT "HELVETICA",24,48
  7532.         pencolor  255,255,255
  7533.         id=99
  7534.         label id, 190,40, 550, 60, left, header_top
  7535.  
  7536.         id=800
  7537.         iconbuttonid id,  0,834,120,120,enabled,none,2,346,347,348,
  7538.         {
  7539.             click
  7540.             destroyAllobjects
  7541.             fun_screen()
  7542.             setup(fun_facts)
  7543.         }
  7544.  
  7545.         id=426 //EXIT
  7546.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  7547.         {
  7548.             click
  7549.             destroyAllobjects
  7550.             loop_exit=1
  7551.         }
  7552.  
  7553.         id=401 //World MAP
  7554.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  7555.         {
  7556.             click
  7557.             destroyAllobjects
  7558.             setup(world_map)
  7559.         }    
  7560.         id=402 //print 
  7561.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  7562.         {
  7563.             click
  7564.             //printsetup header|footer,"","Amazing Facts","","","","","Amazing Facts"
  7565.             wait 20
  7566.             printscreen 0,0,1280,960, scaled|centred ,0
  7567.         }
  7568.         id=403 //help
  7569.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  7570.         {
  7571.             click
  7572.             null
  7573.         }
  7574.         id=400 //search
  7575.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  7576.         {
  7577.             click
  7578.             font "COURIER.BOLD", 20,36
  7579.             deleteobject combo_small
  7580.             combo_small=getnextobjectid()
  7581.             combobox 390,196,520,564,list_1,enabled,ans,index,
  7582.             {
  7583.                 ifc(index!=-1)
  7584.                 {
  7585.                     destroyAllobjects
  7586.                     off_event mouseclick
  7587.                     store_names(new_index[index],yes)
  7588.                     setup(1)
  7589.                 }
  7590.             }
  7591.             off_click_big()
  7592.  
  7593.         }
  7594.     }
  7595.     ifc(hotspot_check==show_film)
  7596.     {
  7597.  
  7598. //        load_image_to_screen(0,0,1280,960,1,255,server_local+`main`+load_ext)
  7599. //
  7600. //        ACTIVEPAGE 1
  7601. //        LOADIMAGE 0,0,1280,960,JPG,`apps/world/key/key5`+load_ext
  7602. //        ACTIVEPAGE 0
  7603. //        clearscreen 0,0,1279,959,standard,1,255
  7604.         fillmask0
  7605.  
  7606.         play_vid=no
  7607.         FONT "HELVETICA",24,48
  7608.         pencolor  255,255,255
  7609.         id=99
  7610.         label id, 190,40, 550, 60, left, header_top
  7611.         show_text_kf()
  7612.         wait 100
  7613.         vobj=GetnextobjectID()
  7614.         VIDEO 28,130,640,480,avi,key_facts_vid+`clip.avi`
  7615.  
  7616.         ifc(da_txt_on[new_number]==1)
  7617.         {
  7618.  
  7619.             id=798 //dates
  7620.             iconbuttonid id,  530,820,660,110,enabled,none,2,411,411,411,
  7621.             {
  7622.                 click
  7623.                 destroyAllobjects
  7624.                 setup(show_dates)
  7625.             }
  7626.         }
  7627.  
  7628.         ifc(af_txt_on[new_number]==1 | af_pic_on[new_number]==1)
  7629.         {
  7630.             id=799 //amazing
  7631.             iconbuttonid id,  260,790,262,142,enabled,none,2,410,410,410,
  7632.             {
  7633.                 click
  7634.                 destroyAllobjects
  7635.                 show_am()
  7636.                 setup(show_amasing)
  7637.             }
  7638.         }
  7639.         id=810 //play
  7640.         iconbuttonid id,  126,620,130,42,enabled,none,1,222,222,222,
  7641.         {
  7642.             ifc(play_vid==no)
  7643.             {
  7644.                 print "play",vobj,"\n"
  7645.                 SetProperty vobj,"Play" paused=false
  7646.                 play_vid=yes
  7647.             }
  7648.         }
  7649.  
  7650.         id=811 //pause
  7651.         iconbuttonid id,  288,620,130,42,enabled,none,1,222,222,222,
  7652.         {
  7653.             if paused then
  7654.                 SetProperty vobj, "Continue"
  7655.             else
  7656.                 SetProperty vobj, "Stop"
  7657.             endif
  7658.             paused = not paused
  7659.         }
  7660.  
  7661.  
  7662.         id=812 //stop
  7663.         iconbuttonid id,  442,620,130,42,enabled,none,1,222,222,222,
  7664.         {
  7665.             SetProperty vobj, "Rewind" 
  7666.             SetProperty vobj, "Stop"
  7667.             play_vid=no
  7668.         }
  7669.  
  7670.  
  7671.         id=803
  7672.         iconbuttonid id,  1158,810,120,120,enabled,none,1,222,222,222,
  7673.         {
  7674.             click
  7675.             destroyAllobjects
  7676.             small_start=1
  7677.             ifc(count>0)
  7678.             {
  7679.                 show_country(no)
  7680.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  7681.             }
  7682.             else
  7683.                 show_country(yes)
  7684.             SETUP(1)
  7685.         }
  7686.  
  7687.  
  7688.         id=803 //funfacts
  7689.         iconbuttonid id,  736,144,442,58,enabled,none,1,222,222,222,
  7690.         {
  7691.             click
  7692.             destroyAllobjects
  7693.             fun_screen()
  7694.             setup(fun_facts)
  7695.         }
  7696.         id=426 //EXIT
  7697.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  7698.         {
  7699.             click
  7700.             destroyAllobjects
  7701.             loop_exit=1
  7702.             loop
  7703.                 if not TimerActive then
  7704.                     wait 100
  7705.                 endif
  7706.                 wait 20
  7707.             until loop_exit=1 or destroyed
  7708.             Kill_3d()
  7709.             winclose
  7710.             browserexit
  7711.         }
  7712.         id=401 //World MAP
  7713.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  7714.         {
  7715.             click
  7716.             destroyAllobjects
  7717.             setup(world_map)
  7718.         }    
  7719.         id=403 //help
  7720.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  7721.         {
  7722.             click
  7723.             null
  7724.         }
  7725.  
  7726.  
  7727.         id=400 //search
  7728.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  7729.         {
  7730.             click
  7731.             font "COURIER.BOLD", 20,36
  7732.             deleteobject combo_small
  7733.             combo_small=getnextobjectid()
  7734.             combobox 690,196,520,564,list_1,enabled,ans,index,
  7735.             {
  7736.                 ifc(index!=-1)
  7737.                 {
  7738.                     click
  7739.                     destroyAllobjects
  7740.                     off_event mouseclick
  7741.                     store_names(new_index[index],yes)
  7742.                     setup(1)
  7743.                 }
  7744.             }
  7745.             PENWIDTH 3
  7746.             combo_big=getnextobjectid()
  7747.             pencolor  255,139,0
  7748.             rectangle 687,190,530,575
  7749.             SetProperty combo_small, "SetFocus"
  7750.             on_event mouseclick,x,y
  7751.             {
  7752.                 ifc( (x<678 || x>1217) || (y<190 || y>765) )
  7753.                 {
  7754.                     deleteobject combo_small
  7755.                     deleteobject combo_big
  7756.                     off_event mouseclick
  7757.                 }
  7758.             }
  7759.         }
  7760.     }
  7761.  
  7762.     ifc(hotspot_check==fun_facts)
  7763.     {
  7764.         FONT "HELVETICA",24,48
  7765.         pencolor  255,255,255
  7766.         id=99
  7767.         label id, 190,40, 550, 60, left, header_top
  7768.         id=800
  7769.         small_start=1
  7770.  
  7771.         ifc(af_txt_on[new_number]==1 | af_pic_on[new_number]==1)
  7772.         {
  7773.  
  7774.             id=801
  7775.             iconbuttonid id,  260,790,262,142,enabled,none,2,410,410,410,
  7776.             {
  7777.                 click
  7778.                 destroyAllobjects
  7779.                 show_am()
  7780.                 setup(show_amasing)
  7781.             }
  7782.         }
  7783.         ifc(da_txt_on[new_number]==1)
  7784.         {
  7785.             id=802
  7786.             iconbuttonid id,  530,820,660,110,enabled,none,2,411,411,411,
  7787.             {
  7788.                 click
  7789.                 destroyAllobjects
  7790.                 setup(show_dates)
  7791.             }
  7792.         }
  7793.         show_text_pic()
  7794.         show_text_kf()
  7795.  
  7796.  
  7797.  
  7798.         id=803
  7799.         //iconbuttonid id,  1158,810,120,120,enabled,none,1,222,222,222,
  7800.  
  7801.         iconbuttonid id,  0,834,120,120,enabled,none,2,350,351,352,
  7802.         {
  7803.             click
  7804.             destroyAllobjects
  7805.             small_start=1
  7806.             ifc(count>0)
  7807.             {
  7808.                 show_country(no)
  7809.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  7810.             }
  7811.             else
  7812.                 show_country(yes)
  7813.             SETUP(1)
  7814.         }
  7815.         id=426 //EXIT
  7816.         iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  7817.         {
  7818.             click
  7819.             destroyAllobjects
  7820.             loop_exit=1
  7821.         }
  7822.         id=401 //World MAP
  7823.         iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  7824.         {
  7825.             click
  7826.             destroyAllobjects
  7827.             setup(world_map)
  7828.         }    
  7829.         id=402 //print 
  7830.         iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  7831.         {
  7832.             click
  7833.             //printsetup header|footer,"","Key Facts","","","","","Key Facts"
  7834.             wait 20
  7835.             objHTMLBox3=getnextobjectid()
  7836.             customtextwindow 0,0,0,0,key_facts+country+`/kf`+country+`.txt`,222,222
  7837.             SetProperty objHTMLBox3 "Print"
  7838.             wait 20000
  7839.             deleteobject objHTMLBox3
  7840.  
  7841.         }
  7842.         id=403 //help
  7843.         iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  7844.         {
  7845.             click
  7846.             null
  7847.         }
  7848.  
  7849.         id=400 //search
  7850.         iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  7851.         {
  7852.             click
  7853.             font "COURIER.BOLD", 20,36
  7854.             deleteobject combo_small
  7855.             combo_small=getnextobjectid()
  7856.             combobox 390,196,520,564,list_1,enabled,ans,index,
  7857.             {
  7858.                 ifc(index!=-1)
  7859.                 {
  7860.                     destroyAllobjects
  7861.                     off_event mouseclick
  7862.                     store_names(new_index[index],yes)
  7863.                     setup(1)
  7864.                 }
  7865.             }
  7866.             off_click_big()
  7867.  
  7868.         }
  7869.  
  7870.     }
  7871.     ifc(hotspot_check==where)
  7872.     {
  7873.         small_start=1
  7874.         restoredata highlight_map
  7875.         read_number=new_number-1
  7876.         read_number*=6
  7877.         input data highlight_map[read_number],id_check,hotxs[0],hotys[0],hotxe[0],hotye[0],map_name[0]
  7878.  
  7879.         ifc(strtoi(map_name[0])==0)
  7880.         {
  7881.             setup(1)
  7882.         }
  7883.         else
  7884.         {
  7885.             activepage 1
  7886.             new_file=filename(map_name[0])
  7887.             LOADIMAGE 0,0,1280,960,JPG,server_maps+`wm`+load_ext
  7888.             LOADIMAGE 26-1,20+120,1230,804,gif,server_maps+`map`+new_file+load_ext
  7889.             activepage 0 
  7890.             clearscreen 0,0,1280,960,standard,1,255
  7891.             FONT "ARIAL.BOLD",21,50
  7892.             pencolor  255,255,255
  7893.             FONT "HELVETICA",24,48
  7894.             pencolor  255,255,255
  7895.             id=99
  7896.             label id, 190,40, 550, 60, left, header_top
  7897.             LINESTYLE SOLID
  7898.             FILLMASK0
  7899.             PENCOLOR 255,0,0
  7900.             PENWIDTH 3
  7901.             RECTANGLE hotxs[0]-1,hotys[0]+120,hotxe[0],hotye[0]
  7902.             count_map=0
  7903. //            hotspotid count_map,0,106,1280,854,enabled,
  7904.             iconbuttonid count_map,  0,106,1280,854,enabled,none,2,222,222,222,
  7905.             {
  7906.                 click
  7907.                 destroyAllobjects
  7908.                 small_start=1
  7909.                 show_country(no)
  7910.                 show_pic(filename(itostr(count)),count,small,filename(itostr(next_image)))
  7911.                 setup(1)
  7912.             }
  7913.         
  7914.  
  7915.             id=426 //EXIT
  7916.             iconbuttonid id,  1130,0,146,124,enabled,none,1,108,109,109,
  7917.             {
  7918.                 click
  7919.                 destroyAllobjects
  7920.                 loop_exit=1
  7921.             }
  7922.             id=401 //World MAP
  7923.             iconbuttonid id,  792,0,120,124,enabled,none,1,102,103,103,
  7924.             {
  7925.                 click
  7926.                 destroyAllobjects
  7927.                 setup(world_map)
  7928.             }    
  7929.             id=402 //print 
  7930.             iconbuttonid id,  1028,0,108,124,enabled,none,1,104,105,105,
  7931.             {
  7932.                 printsetup header|footer,"","Regional Map","","","","","Regional Map"
  7933.                 //wait 20
  7934.                 printscreen 0,0,1280,960, centred ,0
  7935.             }
  7936.  
  7937.             id=403 //help
  7938.             iconbuttonid id,  912,0,112,124,enabled,none,1,106,107,107,
  7939.             {
  7940.                 click
  7941.                 null
  7942.             }
  7943.  
  7944.             id=400 //search
  7945.             iconbuttonid id,  672,0,116,124,enabled,none,1,100,101,101,
  7946.             {
  7947.                 font "COURIER.BOLD", 20,36
  7948.                 deleteobject combo_small
  7949.                 combo_small=getnextobjectid()
  7950.                 combobox 390,196,520,564,list_1,enabled,ans,index,
  7951.                 {
  7952.                     ifc(index!=-1)
  7953.                     {
  7954.                         destroyAllobjects
  7955.                         off_event mouseclick
  7956.                         store_names(new_index[index],yes)
  7957.                         setup(1)
  7958.                     }
  7959.                 }
  7960.                 off_click_big()
  7961.  
  7962.             }
  7963.         }
  7964.     }
  7965. end sub
  7966.  
  7967. end local
  7968.  
  7969.  
  7970.     hilight false    
  7971.     browsersetcursorbusy true
  7972.  
  7973.     combo_small_start=1
  7974.     combo_big_start=1
  7975.  
  7976.     bit_type=strtoi(getinfo(displaydepth))
  7977.  
  7978.     ifc(bit_type==16)
  7979.     {
  7980.         load_ext=`6g.gif`
  7981.         load_ext2=`6g.jjj` //jjj
  7982.         load_ext3=`6g.jjj` //jjj
  7983.         load_ext4=`8g.gif`
  7984.     }
  7985.     else
  7986.     {
  7987.         load_ext=`8g.gif`
  7988.         load_ext2=`8g.gif`
  7989.         load_ext3=`8g.gif`
  7990.         load_ext4=`8g.gif`
  7991.     }
  7992.  
  7993.     browsersetimagecache enabled,512,8000
  7994.     set_server_info()
  7995.     title()
  7996.  
  7997.     InitClick server_local+`55.wav`
  7998.  
  7999.     spritebank 1
  8000.     transparentcolor 0,255,0
  8001.  
  8002.     ifc(bit_type==16)
  8003.         SPRITEFILE gif,server_local+`icons16g.gif`
  8004.     else
  8005.         SPRITEFILE gif,server_local+`icons18g.gif`
  8006.  
  8007.  
  8008.     DEFSPRITE 100, 32,0,116,124            //MENU BAR ICONS
  8009.     DEFSPRITE 101, 32+640,0,116,124
  8010.     DEFSPRITE 102, 152,0,120,124
  8011.     DEFSPRITE 103, 152+640,0,120,124
  8012.     DEFSPRITE 106, 272,0,112,124
  8013.     DEFSPRITE 107, 272+640,0,112,124
  8014.     DEFSPRITE 104, 388,0,110,124
  8015.     DEFSPRITE 105, 388+640,0,108,124
  8016.     DEFSPRITE 108, 490,0,146,124
  8017.     DEFSPRITE 109, 490+640,0,146,124
  8018.     DEFSPRITE 110, 286,122,152,140            //'COMPASS' ICONS
  8019.     DEFSPRITE 111, 286+640,122,152,140
  8020.     DEFSPRITE 112, 112,166,150,140            
  8021.     DEFSPRITE 113, 112+640,166,150,140
  8022.     DEFSPRITE 114, 66,328,150,140            
  8023.     DEFSPRITE 115, 66+640,328,150,140
  8024.     DEFSPRITE 116, 114,488,150,140            
  8025.     DEFSPRITE 117, 114+640,488,150,140
  8026.     DEFSPRITE 118, 296,584,150,140            
  8027.     DEFSPRITE 119, 296+640,584,150,140
  8028.     DEFSPRITE 120, 458,492,150,140            
  8029.     DEFSPRITE 121, 458+640,492,150,140
  8030.     DEFSPRITE 122, 490,332,150,140            
  8031.     DEFSPRITE 123, 490+640,332,150,140
  8032.     DEFSPRITE 124, 446,184,150,140            
  8033.     DEFSPRITE 125, 446+640,184,150,140
  8034.     DEFSPRITE 142, 480,720,120,124            //OTHER ICONS        
  8035.     DEFSPRITE 143, 480+640,720,120,124
  8036.     DEFSPRITE 138, 480,856,120,104            
  8037.     DEFSPRITE 139, 480+640,856,120,104
  8038.     DEFSPRITE 144, 60,746,120,100            
  8039.     DEFSPRITE 145, 60+640,746,120,100
  8040.     DEFSPRITE 160, 260,746,120,100            
  8041.     DEFSPRITE 161, 260+640,746,120,100
  8042.  
  8043.  
  8044.  
  8045.  
  8046.     transparency 0
  8047.     spritebank 0
  8048.  
  8049.  
  8050.     spritebank 2
  8051.     ifc(bit_type==16)
  8052.     {
  8053.         transparentcolor 0,255,0
  8054.         SPRITEFILE gif,server_local+`icons26g.gif`
  8055.     }
  8056.     else
  8057.     {
  8058.         transparentcolor 0,255,0
  8059.         SPRITEFILE gif,server_local+`icons28g.gif`
  8060.     }
  8061.  
  8062.     DEFSPRITE 300, 30,30,58,72            //BUTTONS
  8063.     DEFSPRITE 301, 430,30,58,72
  8064.     DEFSPRITE 302, 830,30,58,72                        
  8065.     DEFSPRITE 304, 288,30,58,72
  8066.     DEFSPRITE 305, 688,30,58,72
  8067.     DEFSPRITE 306, 1088,30,58,72
  8068.     DEFSPRITE 308, 30,980,56,68
  8069.     DEFSPRITE 309, 430,980,56,68
  8070.     DEFSPRITE 310, 830,980,56,68
  8071.     DEFSPRITE 312, 280,980,58,68
  8072.     DEFSPRITE 313, 680,980,58,68
  8073.     DEFSPRITE 314, 1080,980,58,68
  8074.     DEFSPRITE 316, 0,680,108,96
  8075.     DEFSPRITE 317, 400,680,108,96
  8076.     DEFSPRITE 318, 800,680,108,96
  8077.     DEFSPRITE 320, 94,814,62,60            //TEXT UP
  8078.     DEFSPRITE 321, 494,814,62,60
  8079.     DEFSPRITE 322, 894,814,62,60
  8080.     DEFSPRITE 324, 294,814,62,58            //TEXT DOWN
  8081.     DEFSPRITE 325, 694,814,62,58
  8082.     DEFSPRITE 326, 1094,814,62,58
  8083.     DEFSPRITE 328, 0,200,114,92
  8084.     DEFSPRITE 329, 400,200,114,92
  8085.     DEFSPRITE 330, 800,200,114,92
  8086.     DEFSPRITE 331, 264,174,112,102            //photo pic
  8087.     DEFSPRITE 332, 664,174,112,102
  8088.     DEFSPRITE 334, 60,330,62,68            
  8089.     DEFSPRITE 335, 460,330,62,68
  8090.     DEFSPRITE 336, 860,330,62,68                        
  8091.     DEFSPRITE 338, 312,330,58,68
  8092.     DEFSPRITE 339, 712,330,58,68
  8093.     DEFSPRITE 340, 1112,330,58,68
  8094.     DEFSPRITE 342, 206,662,98,88
  8095.     DEFSPRITE 343, 606,662,98,88
  8096.     DEFSPRITE 344, 1006,662,98,88
  8097.  
  8098.     DEFSPRITE 346, 0,1120,120,120            //AMAZING FACTS
  8099.     DEFSPRITE 347, 400,1120,120,120
  8100.     DEFSPRITE 348, 800,1120,120,120
  8101.     DEFSPRITE 350, 0,1280,120,120            //KEY DATES
  8102.     DEFSPRITE 351, 400,1280,120,120
  8103.     DEFSPRITE 352, 800,1280,120,120
  8104.     DEFSPRITE 354, 200,1120,190,150            
  8105.     DEFSPRITE 355, 600,1120,190,150
  8106.     DEFSPRITE 356, 200,1280,78,64        
  8107.     DEFSPRITE 357, 600,1280,78,64
  8108.     DEFSPRITE 358, 1000,1280,78,64
  8109.     
  8110.     DEFSPRITE 410, 0,1440,262,140
  8111.     DEFSPRITE 411, 400,1440,660,110
  8112.  
  8113.  
  8114.     transparency 0
  8115.     spritebank 0
  8116.  
  8117.  
  8118.  
  8119.  
  8120.     spritebank 4
  8121.     ifc(bit_type==16)
  8122.     {
  8123.         transparentcolor 0,255,0
  8124.         SPRITEFILE gif,server_local+`gambut6g.gif`
  8125.     }
  8126.     else
  8127.     {
  8128.         transparentcolor 0,255,0
  8129.         SPRITEFILE gif,server_local+`gambut8g.gif`
  8130.     }
  8131.     DEFSPRITE 400, 200,0,66,66        //tile game
  8132.     DEFSPRITE 401, 100,0,66,66        //hi fliers
  8133.     DEFSPRITE 402, 300,0,66,66        //quick fit
  8134.  
  8135.     spritebank 0
  8136.  
  8137.  
  8138.     spritebank 3
  8139.     ifc(bit_type==16)
  8140.     {
  8141.         transparentcolor 0,255,0
  8142.         SPRITEFILE gif,server_local+`help16g.gif`
  8143.     }
  8144.     else
  8145.     {
  8146.         transparentcolor 0,255,0
  8147.         SPRITEFILE gif,server_local+`help18g.gif`
  8148.     }
  8149.  
  8150.  
  8151.     DEFSPRITE 451, 0,480,88,100    //back
  8152.     DEFSPRITE 412, 200,480,88,100
  8153.     DEFSPRITE 413, 400,480,88,100
  8154.  
  8155.     DEFSPRITE 414, 0,720,64,58    //left
  8156.     DEFSPRITE 415, 200,720,64,58
  8157.     DEFSPRITE 416, 400,720,64,58
  8158.  
  8159.  
  8160.     DEFSPRITE 417, 0,840,58,58    //right
  8161.     DEFSPRITE 418, 200,840,58,58
  8162.     DEFSPRITE 419, 400,840,58,58
  8163.  
  8164.     
  8165.     
  8166.     DEFSPRITE 420, 0,0,590,420    //help box and button
  8167.     DEFSPRITE 421, 0,600,86,80
  8168.     DEFSPRITE 422, 400,600,86,80
  8169.  
  8170.  
  8171.     transparency 0
  8172.     spritebank 0
  8173.  
  8174.  
  8175.     spritebank 7
  8176.     transparentcolor 255,140,0
  8177.     ifc(bit_type==16)
  8178.     {
  8179.         transparentcolor 255,140,0
  8180.         SPRITEFILE gif,server_local+`globe16.gif`
  8181.     }
  8182.     else
  8183.     {
  8184.         transparentcolor 255,139,0
  8185.         SPRITEFILE gif,server_local+`globe8.gif`
  8186.     }
  8187.  
  8188.  
  8189.  
  8190.     DEFSPRITE 700, 0,0,120,120
  8191.     DEFSPRITE 701, 120,0,120,120
  8192.     DEFSPRITE 702, 240,0,120,120
  8193.     DEFSPRITE 703, 360,0,120,120
  8194.  
  8195.     DEFSPRITE 704, 480,0,120,120
  8196.     DEFSPRITE 705, 600,0,120,120
  8197.     DEFSPRITE 706, 720,0,120,120
  8198.     DEFSPRITE 707, 840,0,120,120
  8199.     spritebank 0
  8200.  
  8201.  
  8202.  
  8203.  
  8204.     spritebank 8
  8205.     transparentcolor 0,0,0
  8206.     ifc(bit_type==16)
  8207.     {
  8208.         transparentcolor 0,0,0
  8209.         SPRITEFILE gif,server_local+`bigstrip.gif`
  8210.     }
  8211.     else
  8212.     {
  8213.         transparentcolor 0,0,0
  8214.         SPRITEFILE gif,server_local+`big8.gif`
  8215.     }
  8216.  
  8217.  
  8218.  
  8219.     DEFSPRITE 800, 0,0,240,240
  8220.     DEFSPRITE 801, 240,0,240,240
  8221.     DEFSPRITE 802, 480,0,240,240
  8222.     DEFSPRITE 803, 720,0,240,240
  8223.  
  8224.     DEFSPRITE 804, 960,0,240,240
  8225.     DEFSPRITE 805, 1200,0,240,240
  8226.     DEFSPRITE 806, 1440,0,240,240
  8227.     DEFSPRITE 807, 1680,0,240,240
  8228.  
  8229.     spritebank 0
  8230.  
  8231.     SPRITEb 239,510,648,looped,1,100,8,[800,801,802,803,804,805,806,807]
  8232.     SpriteFlags2 239, enabled|visible, UNBOUND
  8233.  
  8234.     count=0
  8235.     read_pies()
  8236.     set_list()
  8237.     browsersetcursorbusy false
  8238.     HOTSPOT 496,638,318,292,1,
  8239.     {
  8240.         browsersetcursorbusy true
  8241.     }
  8242.  
  8243.     HOTSPOT 0,448,360,482,1,
  8244.     {
  8245.         sound server_local+`no1.wav wave`
  8246.         wait 60000
  8247.     }
  8248.     HOTSPOT 36,62,378,328,1,
  8249.     {
  8250.         sound server_local+`no2.wav wave`
  8251.         wait 60000
  8252.     }
  8253.     HOTSPOT 902,72,348,328,1,
  8254.     {
  8255.         sound server_local+`no3.wav wave`
  8256.         wait 60000
  8257.     }
  8258.     HOTSPOT 910,470,346,280,1,
  8259.     {
  8260.         sound server_local+`no4.wav wave`
  8261.         wait 60000
  8262.     }
  8263.     HOTSPOT 970,788,304,140,1,
  8264.     {
  8265.         browserexit
  8266.     }
  8267.  
  8268.     wait 60000
  8269.     start_screen()
  8270.     click
  8271.     destroyAllobjects
  8272.  
  8273.     setup(world_map)
  8274.     loop
  8275.         if not TimerActive then
  8276.             wait 100
  8277.         endif
  8278.         wait 20
  8279.     until loop_exit=1 or destroyed
  8280.     Kill_3d()
  8281.     winclose
  8282.     browserexit
  8283.  
  8284.  
  8285.  
  8286.