home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Pascal / Games / Showwit! 1.0 / source code / Source / CShBestPlayDirector.p < prev    next >
Encoding:
Text File  |  1996-01-04  |  1.8 KB  |  77 lines  |  [TEXT/PJMM]

  1. {****************************************************}
  2. {}
  3. {        CShBestPlayDirector.p                                                                                                                                                                        }
  4. {}
  5. {        DLOGDirector class for the director which gets the name of a best player.                }
  6. {}
  7. {****************************************************}
  8.  
  9.  
  10. unit CShBestPlayDirector;
  11.  
  12. interface
  13.  
  14.     uses
  15.         TCL, ShIntf;
  16.  
  17. implementation
  18.  
  19.     const
  20.         VuIDName = 2;
  21.         VuIDPicture = 3;
  22.  
  23. {****************************************************}
  24. {}
  25. {        IShBestPlayDirector                                                                                                                                                                                }
  26. {}
  27. {        Construct the director and dialog.                                                                                                                                         }
  28. {}
  29. {****************************************************}
  30.  
  31.     procedure CShBestPlayDirector.IShBestPlayDirector (aSupervisor: CShGameDirector);
  32.  
  33.     begin { IBestPlayDirector }
  34.         IDLOGDirector(DLOGNewBest, aSupervisor);
  35.  
  36.         if gSystem.hasColorQD then begin
  37.             CPicture(FindViewByID(VuIDPicture)).UsePICT(PICTNewBestPlayerColour);
  38.         end { if }
  39.         else begin
  40.             CPicture(FindViewByID(VuIDPicture)).UsePICT(PICTNewBestPlayerBW);
  41.         end; { else }
  42.     end; { IBestPlayDirector }
  43.  
  44.  
  45. {****************************************************}
  46. {}
  47. {        GetPlayerName                                                                                                                                                                                                }
  48. {}
  49. {     Use a modal dialog to get the name of the best player.                                                                             }
  50. {}
  51. {****************************************************}
  52.  
  53.     procedure CShBestPlayDirector.GetPlayerName (var aName: Str15);
  54.  
  55.         var
  56.             theDismissCmd: LongInt;
  57.             theDialogText: CDialogText;
  58.             theNameStr: Str255;
  59.  
  60.     begin { GetPlayerName }
  61.         BeginDialog;
  62.  
  63.         { Play the new best player sound. }
  64.         SATSoundPlay(gSoundNewBestPlayer, 9, TRUE);
  65.         SATSoundEvents;
  66.  
  67.         theDismissCmd := DoModalDialog(cmdOK);
  68.  
  69.         { Ignore the dismiss command. }
  70.  
  71.         theDialogText := CDialogText(FindViewByID(VuIDName));
  72.         theDialogText.GetTextString(theNameStr);
  73.         aName := Copy(theNameStr, 1, 15);
  74.     end; { GetPlayerName }
  75.  
  76.  
  77. end. { CShBestPlayDirector }