home *** CD-ROM | disk | FTP | other *** search
/ Knowledge Land / KNOWLEDGELA.ISO / pc / support / macsetup / v01 / profile.ace < prev   
Encoding:
Text File  |  1996-08-29  |  10.7 KB  |  278 lines

  1. [==========================================================================
  2.     PROFILE.ACE
  3.     ------------
  4.  
  5.     The Knowledge Land main navigation interface.
  6.  
  7.     Requires:
  8.         FRAMEWRK.ACE.
  9.  
  10. ==========================================================================]
  11.  
  12. Refer to ..\..\LIB\CNET.ACE.
  13.  
  14. To activate profile interface,
  15.     If profileentry does not exist in mainScreen,
  16.         In mainScreen,
  17.             Make profileentry.
  18.     Set mainScreen's profileentry to a profileEntryModule from 0,0 to 640,480.
  19.     Record that mainScreen's module is inEntryMode.
  20.     In mainScreen's profileentry,
  21.         Set editIndex to 1.
  22.         Give editControl # 1 keyboard focus.
  23.     Load the user profile in mainScreen's profileentry.
  24.     Fade in.
  25.     Wait until the next cycle.
  26.     If system is firstTime,
  27.         Play voice over "NARRATE\\IDINTR2.SND".
  28.         Wait until mediaPlayer is not running.
  29.         If system is TTS,
  30.             Play voice over "NARRATE\\IDVOICE.SND".
  31.             Wait until mediaPlayer is not running.
  32.         Play voice over "NARRATE\\IDCHANG.SND".
  33.         Wait until mediaPlayer is not running.
  34.  
  35. In system,
  36.     Make userProfile.  In it,
  37.         Add "".
  38.         Add "".
  39.         Add "".
  40.         Add "".
  41.         Add "".
  42.         Add "".
  43.         Add "".
  44.         Add "".
  45.         Add "".
  46.         Add "".
  47.         Add "".
  48.         Add "".
  49.         Add "".
  50.         Add "".
  51.         Add "".
  52.  
  53. A profileEntryModule is a kind of module which has:
  54.  
  55.     A way for anyone to get
  56.         a profileEntryModule from an xynumber 'a' to an xynumber 'b',
  57.  
  58.         Make new.  Set it to a module from a to b.
  59.         Make it into a profileEntryModule.
  60.         In new,
  61.             Make editIndex.  Set it to 1.
  62.             Make profileEntryData.  Set it to an array of the data "PROFILE\\PROENTRY.DAT".
  63.             For each controlarray 'a' in profileEntryData,
  64.                 In new,
  65.                     Make a control of a.
  66.                     If it is an editcontrol,
  67.                         In it,
  68.                             Make editIndex.  Set it to new's editIndex.
  69.                             new's editIndex += 1.
  70.             Make avatarData.  Set it to an array of the data (avatarList's string #
  71.             (theUser's playerAvatar)).
  72.             Make avatarArray.  Set it to the HD file (avatarData's walk_'s string).
  73.             In new's control # 3,
  74.                 Make a picture named avatarPic of avatarArray's bitmap from 0,0 to size.
  75.             Change the text of new's stringcontrol to theUser's id.
  76.             Make new's dialogcontrol into a modaldialog.
  77.             Hide it.
  78.         Detach it.  Return it.
  79.  
  80.     A way to handle a keyevent 'e' in an editcontrol 'c' in a profileEntryModule 'm',
  81.  
  82.         If e's key is the enter key,
  83.             m's editIndex += 1.
  84.             If m's editIndex > the number of editcontrols in m,
  85.                 m's editIndex = 1.
  86.             give m's editcontrol # (m's editIndex) keyboard focus.
  87.  
  88.     A way to handle a downclickevent 'e' in a control 'c' in a profileEntryModule 'm',
  89.  
  90.         If c's id is "boy",
  91.             Show c's picture.
  92.             Hide m's control # 9's picture.
  93.         Otherwise if c's id is "girl",
  94.             Show c's picture.
  95.             Hide m's control # 8's picture.
  96.  
  97.     A way to handle an upclickevent 'e' in a control 'c' in a profileEntryModule 'm',
  98.         //Turn tracing on.
  99.         If c's id is "okbutton",
  100.             Save the user profile in m.
  101.             Enter module "main".
  102.         Otherwise if c's id is "change",
  103.             Save the user profile in m.
  104.             Enter module "avatar" from module "profile".
  105.         Otherwise if c's id is "exit",
  106.             Save the user profile in m.
  107.             Enter module "login".
  108.         Otherwise if c's id is "voice",
  109.             Put up m's modaldialog in m.
  110.             //Save the user profile in m.
  111.         Otherwise if c's id is "help",
  112.             Launch "helpme".
  113.         Otherwise if c's id is "d_ok",
  114.             Clear modal dialog in m.
  115.  
  116.     A way to remove keyboard focus from an editcontrol 'c' in a ProfileEntryModule 'm',
  117.         Set userProfile's string # (c's editIndex) to c's buffer.
  118.         // Set m's editIndex to c's editIndex.
  119.  
  120.     A way to load the user profile in a ProfileEntryModule 'm',
  121.         Make s.  Set it to "PROF".
  122.         For each number 'n' from 5 to the number of characters in theUser's fileName,
  123.             Append theUser's filename's character # n to s.
  124.         Make a.  Set it to an array of the data s.
  125.         If the number of strings in a > 0,
  126.             For each number 'n' from 1 to the number of strings in userProfile,
  127.                 Set userProfile's string # n to a's string # n.
  128.                 If n <= the number of editcontrols in m,
  129.                     Call m's editcontrol # n ec.
  130.                     Change the text of ec to a's string # n.
  131.                     if n = m's editIndex,
  132.                         Give ec keyboard focus.
  133.         If sex_ exists in a,
  134.             If the number of characters in a's sex_ = 2,
  135.                 Show m's control # 8's picture.
  136.                 Hide m's control # 9's picture.
  137.             Otherwise,
  138.                 Show m's control # 9's picture.
  139.                 Hide m's control # 8's picture.
  140.         Otherwise,
  141.             Hide m's control # 8's picture.
  142.             Hide m's control # 9's picture.
  143.  
  144.     A way to save the user profile in a ProfileEntryModule 'm',
  145.         If m's keyfocus's target is an editcontrol,
  146.             Hide cursor in m's keyfocus's target.
  147.         Set userProfile's string # (m's keyfocus's target's editIndex) to
  148.             m's keyfocus's target's buffer.
  149.         Make s.  Set it to "PROF".
  150.         For each number 'n' from 5 to the number of characters in theUser's fileName,
  151.             Append theUser's filename's character # n to s.
  152.         Make a.  Set it to an array.
  153.         For each string 's' in userProfile,
  154.             Add s to a.
  155.         In a,
  156.             Make sex_.
  157.         If m's control # 8's picture is visible,
  158.             Set a's sex_ to "xx".
  159.         Otherwise,
  160.             Set a's sex_ to "x".
  161.         Save a to the data s.
  162.  
  163. To create profile display interface of a number 'idx',
  164.     If profiledisplay does not exist in mainScreen,
  165.         In mainScreen,
  166.             Make profiledisplay.
  167.     Set mainScreen's profiledisplay to a profileDisplayModule from 0,0 to 640,480 with idx.
  168.     //In mainScreen's profiledisplay,
  169.     //    Set stringIndex to 1.
  170.     // Record that mainScreen's module is inEntryMode.
  171.  
  172.  
  173. A profileDisplayModule is a kind of module which has:
  174.  
  175.     A way for anyone to get
  176.         a profileDisplayModule from an xynumber 'a' to an xynumber 'b'
  177.         with a number 'idx',
  178.  
  179.         Make new.  Set it to a module from a to b.
  180.         Make it into a profileDisplayModule.
  181.         Make na. Set it to a netarray.
  182.         In new,
  183.             Make a netControl of na.
  184.             Make stringIndex.  Set it to 1.
  185.         Make profileDisplayData.  Set it to an array of the data "PROFILE\\PROFSHOW.DAT".
  186.         For each controlarray 'a' in profileDisplayData,
  187.             In new,
  188.                 Make a control of a.
  189.                 If it is a stringControl,
  190.                     In it,
  191.                         Make stringIndex.  Set it to new's stringIndex.
  192.                         new's stringIndex += 1.
  193.         Subscribe new's picturecontrol to new's NetControl.
  194.         Make avatarData.  Set it to an array of the data (avatarList's string #
  195.         (theUser's playerAvatar)).
  196.         Make avatarArray.  Set it to the HD file (avatarData's walk_'s string).
  197.         In new's control # 2,
  198.             Make a picture named avatarPic of avatarArray's bitmap from 0,0 to size.
  199.         Change the text of new's stringcontrol to theUser's id.
  200.         Make new's dialogcontrol into a modaldialog.
  201.         Hide it.
  202.         Detach new.  Return it.
  203.  
  204.  
  205.     A way to handle a downclickevent 'e' in a control 'c' in a profileDisplayModule 'm',
  206.  
  207.         If c's id is "okbutton",
  208.             Detach mainScreen's profileDisplay.
  209.  
  210.     A way to receive a NetWhisperEvent 'e' in a picturecontrol 'c' in a ProfileDisplayModule 'm',
  211.  
  212.         log e.
  213.         Make sp.  Set it to " ".
  214.         Make ns.  Set it to 0.
  215.         Make commandNumber.  Set it to "".
  216.         Make fieldstring.  Set it to "".
  217.         Make fieldnumber.  Set it to "".
  218.         For each character 'ch' in e's str,
  219.             If ns = 1,
  220.                 Append ch to commandNumber.
  221.             If ns = 3,
  222.                 Append ch to fieldNumber.
  223.             Otherwise if ns > 3,
  224.                 Append ch to fieldstring.
  225.             If ch = sp's character,
  226.                 ns += 1.
  227.         log fieldstring.
  228.         Make cn.  Set it to atoi(commandNumber).
  229.         log cn.
  230.         If cn = 400,
  231.             If fieldstring is "xx",
  232.                 Show m's control # 8's picture.
  233.                 Hide m's control # 9's picture.
  234.             Otherwise if fieldstring is "x",
  235.                 Show m's control # 9's picture.
  236.                 Hide m's control # 8's picture.
  237.             Otherwise,
  238.                 Make fn.  Set it to atoi(fieldnumber).
  239.                 log fn.
  240.                 Call c's container's stringcontrol # fn sb.
  241.                 Change the text of sb to fieldstring.
  242.  
  243.     A way to handle an upclickevent 'e' in a control 'c' in a profileDisplayModule 'm',
  244.         //Turn tracing on.
  245.         If c's id is "okbutton",
  246.             Save the user profile in m.
  247.             Enter module "main".
  248.         Otherwise if c's id is "change",
  249.             Save the user profile in m.
  250.             Enter module "avatar" from module "profile".
  251.         Otherwise if c's id is "exit",
  252.             If profileDisplay exists in mainScreen,
  253.                 Detach mainScreen's profileDisplay.
  254.         Otherwise if c's id is "voice",
  255.             Put up m's modaldialog in m.
  256.             //Save the user profile in m.
  257.         Otherwise if c's id is "help",
  258.             Launch "helpme".
  259.  
  260. // $Log: PROFILE.ACE $
  261. // Revision 1.15  1996/08/26 09:27:59  Quoc
  262. // Revision 1.14  1996/08/15 18:23:27  Quoc
  263. // Revision 1.13  1996/08/15 15:29:52  Quoc
  264. // Revision 1.12  1996/08/12 13:57:31  Quoc
  265. // Revision 1.11  1996/08/05 18:11:43  Quoc
  266. // Revision 1.10  1996/08/02 20:56:46  Quoc
  267. // Revision 1.9  1996/07/27 18:22:02  Quoc
  268. // Revision 1.8  1996/07/22 02:02:19  Quoc
  269. // Revision 1.7  1996/07/19 08:13:17  Quoc
  270. // Revision 1.6  1996/07/13 05:12:17  Quoc
  271. // Revision 1.5  1996/07/11 02:35:09  Quoc
  272. // Trade interface and profile screens working.
  273. // Revision 1.4  1996/07/08 17:36:21  Quoc
  274. // Revision 1.3  1996/07/08 10:10:49  Quoc
  275. // Profile sent to server
  276. // Revision 1.2  1996/07/06 05:16:05  Quoc
  277. // Revision 1.1  1996/07/04 02:59:24  Quoc
  278.