Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Procedure ServisScreen;
Var C: LongInt;
    I: Byte;
Begin
  ClearPage(Buffer[3]);
 
  Ramecek(0,0,319,199,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,222,5,'tab  esc=exit',Buffer[3]);
  Ramecek(5,7,200,62,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,12,'vklady    =',Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,22,'vyplaceno =',Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,32,'gambler   =',Buffer[3]);
  WriteNumber(Buffer[1],160,15,5,5,1,78,12,DatRec.Pub.Vklady,Buffer[3]);
  WriteNumber(Buffer[1],160,15,5,5,1,78,22,DatRec.Pub.Vyplaceno,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,42,'e = reset historie her',Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,52,'r = reset vklady/vyplaceno',Buffer[3]);
 
  Ramecek(5,67,200,92,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,72,'prodleva',Buffer[3]);
  WriteSprite(60,72,0,195,4,199,Buffer[1],Buffer[3]);
  For C:=1 to 50 do WritePixel(66+C,74,ColorGreenBright,Buffer[3]);
  WriteSprite(119,72,5,195,9,199,Buffer[1],Buffer[3]);
  WriteSprite(66+DatRec.fpsProdleva,72,10,195,12,199,Buffer[1],Buffer[3]);
  WriteNumber(Buffer[1],160,15,5,5,1,127,72,DatRec.fpsProdleva,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,82,'l = rychlost =',Buffer[3]);
  WriteNumber(Buffer[1],160,15,5,5,1,97,82,DatRec.RollSpeed+1,Buffer[3]);
 
  Ramecek(5,97,200,122,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,102,'p = zvuky raw =',Buffer[3]);
  If DatRec.RawEnable=True then WriteText(Buffer[1],160,0,5,5,1,105,102,'povoleno',Buffer[3])
                           else WriteText(Buffer[1],160,0,5,5,1,105,102,'zakazano',Buffer[3]);
 
  WriteText(Buffer[1],160,0,5,5,1,10,112,'b = sound blaster =',Buffer[3]);
  If DatRec.SBEnable=True then WriteText(Buffer[1],160,0,5,5,1,127,112,'povoleno',Buffer[3])
                          else WriteText(Buffer[1],160,0,5,5,1,127,112,'zakazano',Buffer[3]);
 
  Ramecek(5,127,200,142,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,132,'s = cpu speed up =',Buffer[3]);
  If DatRec.PS3=True then WriteText(Buffer[1],160,0,5,5,1,122,132,'povoleno',Buffer[3])
                     else WriteText(Buffer[1],160,0,5,5,1,122,132,'zakazano',Buffer[3]);
 
  Ramecek(5,147,200,162,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,152,'n = reset majetku',Buffer[3]);
 
  Zisky(78,32,255);
 
  For I:=0 to 8 do
  Begin
    Ramecek(210,(I*20)+15,317,(I*20)+30,ColorGreenBright,Buffer[3]);
    OutNumber(280,(I*20)+19,DatRec.Nahoda[I],False,Buffer[3]);
  End;
  Ramecek(212,(VyhernostKurzor*20)+17,315,(VyhernostKurzor*20)+28,ColorRedBright,Buffer[3]);
  OutText(214,18,'2kc vyhry',Buffer[3]);
  OutText(214,38,'4kc vyhry',Buffer[3]);
  OutText(214,58,'5kc vyhry',Buffer[3]);
  OutText(214,78,'2kc jokerA',Buffer[3]);
  OutText(214,98,'2kc jokerB',Buffer[3]);
  OutText(214,118,'4kc jokerA',Buffer[3]);
  OutText(214,138,'4kc jokerB',Buffer[3]);
  OutText(214,158,'5kc joker',Buffer[3]);
  OutText(214,178,'riskovani',Buffer[3]);
 
  Ramecek(5,167,200,182,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,172,'h = hlava orel =',Buffer[3]);
  If DatRec.NahodnyRisk=True then WriteText(Buffer[1],160,0,5,5,1,110,172,'nahoda',Buffer[3])
                             else WriteText(Buffer[1],160,0,5,5,1,110,172,'postreh',Buffer[3]);
 
  Ramecek(5,186,200,196,ColorGreenBright,Buffer[3]);
  WriteText(Buffer[1],160,0,5,5,1,10,189,'m = reset vyhernosti',Buffer[3]);
 
  HideMouse;
  WaitRetrace;
  FlipPage(Buffer[3],Buffer[4]);
  ShowMouse;
End;
 
 
Procedure Servis;
Var Ending: Boolean;
    I: Byte;
Begin
  Ending:=False;
  VyhernostKurzor:=0;
  ServisScreen;
 
  Repeat
    ServisScreen;
    Wait(DatRec.fpsProdleva);
 
{TAB}   If Key[15]=True then
        Begin
          While Key[15]=True do WaitButton(15);
          If VyhernostKurzor<8 then Inc(VyhernostKurzor)
                               else VyhernostKurzor:=0;
        End;
 
{Up}  If Key[72]=True then
        Begin
          While Key[72]=True do WaitButton(72);
          If DatRec.Nahoda[VyhernostKurzor]<65000
          then Inc(DatRec.Nahoda[VyhernostKurzor],1000)
          else DatRec.Nahoda[VyhernostKurzor]:=65000;
        End;
 
{Down} If Key[80]=True then
        Begin
          While Key[80]=True do WaitButton(80);
          If DatRec.Nahoda[VyhernostKurzor]>0
          then Dec(DatRec.Nahoda[VyhernostKurzor],1000)
          else DatRec.Nahoda[VyhernostKurzor]:=0;
        End;
 
{Left}  If Key[75]=True then
        Begin
          While Key[75]=True do WaitButton(75);
          If DatRec.fpsProdleva>1 then Dec(DatRec.fpsProdleva)
        End;
 
{Right} If Key[77]=True then
        Begin
          While Key[77]=True do WaitButton(77);
          If DatRec.fpsProdleva<48 then Inc(DatRec.fpsProdleva)
        End;
 
{R}     If Key[19]=True then
        Begin
          While Key[19]=True do Begin End;
          DatRec.Pub.Vklady:=0;
          DatRec.Pub.Vyplaceno:=0;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{E}     If Key[18]=True then
        Begin
          While Key[18]=True do Begin End;
          For I:=0 to 24 do Begin
                              DatRec2.Vklad[I]:=0;
                              DatRec2.Vyplaceno[I]:=0;
                            End;
          SaveLoadHistorie(True); {SAVE}
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{L}     If Key[38]=True then
        Begin
          While Key[38]=True do Begin End;
          If DatRec.RollSpeed<4 then Inc(DatRec.RollSpeed)
                                else DatRec.RollSpeed:=0;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{P}     If Key[25]=True then
        Begin
          While Key[25]=True do Begin End;
          If DatRec.RawEnable=True then DatRec.RawEnable:=False
                                   else DatRec.RawEnable:=True;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{B}     If Key[48]=True then
        Begin
          While Key[48]=True do Begin End;
          If DatRec.SBEnable=True then Begin
                                         DatRec.SBEnable:=False;
                                       End
                                  else Begin
                                         DatRec.SBEnable:=True;
                                       End;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{S}     If Key[31]=True then
        Begin
          While Key[31]=True do Begin End;
          If DatRec.PS3=True then DatRec.PS3:=False
                             else DatRec.PS3:=True;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{N}     If Key[49]=True then
        Begin
          While Key[49]=True do Begin End;
          DatRec.Hotovost:=0;
          For I:=0 to 13 do Begin
                              DatRec.vec[I]:=True;
                              VecProdata[I]:=False;
                            End;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{M}     If Key[50]=True then
        Begin
          While Key[50]=True do Begin End;
          ResetVyhernosti;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{H}     If Key[35]=True then
        Begin
          While Key[35]=True do Begin End;
          If DatRec.NahodnyRisk=True then DatRec.NahodnyRisk:=False
                                     else DatRec.NahodnyRisk:=True;
          If DatRec.SBEnable=True then SBPlayRaw(11)
                                  else PlaySound(1);
        End;
 
{Esc} If ((Key[1]=True) or (GetButton2=1)) then
      Begin
        While Key[1]=True do Begin End;
        While GetButton2=1 do Begin End;
        Ending:=True;
      End;
 
  Until Ending=True;
  SaveLoad(True); {SAVE}
End;