Changeset 44


Ignore:
Timestamp:
Apr 19, 2019, 12:02:27 PM (6 years ago)
Author:
chronos
Message:
  • Added: About dialog.
Location:
trunk
Files:
4 added
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.lfm

    r38 r44  
    11object MainForm: TMainForm
    22  Left = 486
    3   Height = 515
     3  Height = 618
    44  Top = 258
    5   Width = 642
     5  Width = 770
    66  Caption = 'Tunneler'
    7   ClientHeight = 490
    8   ClientWidth = 642
    9   DesignTimePPI = 120
     7  ClientHeight = 584
     8  ClientWidth = 770
     9  DesignTimePPI = 144
    1010  Menu = MainMenu1
    1111  OnClose = FormClose
     
    2020    Left = 0
    2121    Height = 28
    22     Top = 462
    23     Width = 642
     22    Top = 556
     23    Width = 770
    2424    Panels = <   
    2525      item
    26         Width = 62
     26        Width = 74
    2727      end   
    2828      item
    29         Width = 62
     29        Width = 74
    3030      end   
    3131      item
    32         Width = 62
     32        Width = 74
    3333      end   
    3434      item
    35         Width = 62
     35        Width = 74
    3636      end   
    3737      item
    38         Width = 62
     38        Width = 74
    3939      end   
    4040      item
    41         Width = 62
     41        Width = 74
    4242      end   
    4343      item
    44         Width = 62
     44        Width = 74
    4545      end>
    4646    ParentFont = False
     
    4949  object Image1: TImage
    5050    Left = 0
    51     Height = 462
     51    Height = 556
    5252    Top = 0
    53     Width = 642
     53    Width = 770
    5454    Align = alClient
    5555    OnMouseLeave = Image1MouseLeave
     
    5959    Interval = 50
    6060    OnTimer = TimerDrawTimer
    61     left = 124
    62     top = 63
     61    left = 149
     62    top = 76
    6363  end
    6464  object MainMenu1: TMainMenu
    65     left = 230
    66     top = 20
     65    left = 276
     66    top = 24
    6767    object MenuItem1: TMenuItem
    6868      Caption = 'Game'
     
    9393    Interval = 20
    9494    OnTimer = TimerEngineTickTimer
    95     left = 120
    96     top = 130
     95    left = 144
     96    top = 156
    9797  end
    9898  object ActionList1: TActionList
    99     left = 360
    100     top = 40
     99    left = 432
     100    top = 48
    101101    object AFullScreen: TAction
    102102      Caption = 'Fullscreen mode'
     
    121121    object AAbout: TAction
    122122      Caption = 'About'
     123      OnExecute = AAboutExecute
    123124    end
    124125    object AShowRawImageDesc: TAction
     
    127128    end
    128129  end
    129   object CoolTranslator1: TCoolTranslator
    130     POFilesFolder = 'Languages'
    131     left = 360
    132     top = 130
    133   end
    134   object ApplicationInfo1: TApplicationInfo
    135     Identification = 1
    136     VersionMajor = 1
    137     VersionMinor = 0
    138     VersionBugFix = 0
    139     VersionSuffix = 'alfa'
    140     CompanyName = 'Chronosoft'
    141     HomePage = 'https://app.zdechov.net/Tunneler/'
    142     AuthorsName = 'Chronos'
    143     EmailContact = 'robie@centrum.cz'
    144     AppName = 'Tunneler'
    145     ReleaseDate = 43573
    146     RegistryKey = '\Software\Chronosoft\Tunneler'
    147     RegistryRoot = rrKeyCurrentUser
    148     License = 'CC0'
    149     left = 124
    150     top = 220
    151   end
    152130  object XMLConfig1: TXMLConfig
    153131    StartEmpty = False
    154132    RootName = 'CONFIG'
    155133    ReadOnly = False
    156     left = 124
    157     top = 300
     134    left = 149
     135    top = 360
    158136  end
    159137end
  • trunk/Forms/UMainForm.pas

    r43 r44  
    77uses
    88  XMLConf, Classes, SysUtils, FileUtil, Forms, Controls, Graphics,
    9   Dialogs, ExtCtrls, ComCtrls, Menus, ActnList, UCore, UPlatform, Math,
     9  Dialogs, ExtCtrls, ComCtrls, Menus, ActnList, UEngine, UPlatform, Math,
    1010  DateUtils, GraphType, UPersistentForm, UApplicationInfo, UCoolTranslator,
    1111  LCLType, URegistry;
     
    1717  TMainForm = class(TForm)
    1818    AAbout: TAction;
    19     ApplicationInfo1: TApplicationInfo;
    2019    AShowRawImageDesc: TAction;
    2120    AShowMap: TAction;
     
    2423    AFullScreen: TAction;
    2524    ActionList1: TActionList;
    26     CoolTranslator1: TCoolTranslator;
    2725    Image1: TImage;
    2826    MainMenu1: TMainMenu;
     
    3937    TimerEngineTick: TTimer;
    4038    XMLConfig1: TXMLConfig;
     39    procedure AAboutExecute(Sender: TObject);
    4140    procedure AExitExecute(Sender: TObject);
    4241    procedure AFullScreenExecute(Sender: TObject);
     
    7776
    7877uses
    79   UMapForm, UNewGameForm;
     78  UCore, UMapForm, UNewGameForm, UFormAbout;
    8079
    8180resourcestring
     
    136135
    137136  PersistentForm := TPersistentForm.Create(nil);
    138   PersistentForm.RegistryContext := TRegistryContext.Create(ApplicationInfo1.RegistryRoot,
    139     ApplicationInfo1.RegistryKey);
     137  PersistentForm.RegistryContext := TRegistryContext.Create(Core.ApplicationInfo.RegistryRoot,
     138    Core.ApplicationInfo.RegistryKey);
    140139
    141140  Application.OnDeactivate := FormDeactivate;
     
    144143  Engine := TEngine.Create;
    145144  Engine.Bitmap := Image1.Picture.Bitmap;
    146   CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('cs');
     145  Core.CoolTranslator1.Language := Core.CoolTranslator1.Languages.SearchByCode('cs');
    147146  LoadConfig;
    148147  Engine.NewGame;
     
    220219end;
    221220
     221procedure TMainForm.AAboutExecute(Sender: TObject);
     222begin
     223  FormAbout := TFormAbout.Create(nil);
     224  FormAbout.ShowModal;
     225  FreeAndNil(FormAbout);
     226end;
     227
    222228procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;
    223229  Shift: TShiftState);
  • trunk/Forms/UNewGameForm.pas

    r43 r44  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, UCore;
     9  ComCtrls, UEngine;
    1010
    1111type
     
    8181
    8282uses
    83   UMainForm;
     83  UCore;
    8484
    8585{ TNewGameForm }
     
    275275procedure TNewGameForm.FormCreate(Sender: TObject);
    276276begin
    277   MainForm.CoolTranslator1.TranslateComponentRecursive(Self);
     277  Core.CoolTranslator1.TranslateComponentRecursive(Self);
    278278  Players := TPlayers.Create;
    279279end;
  • trunk/Languages/Tunneler.cs.po

    r43 r44  
    1717msgstr "Ladění"
    1818
     19#: tformabout.buttonclose.caption
     20msgid "Close"
     21msgstr "Zavřít"
     22
     23#: tformabout.buttonhomepage.caption
     24msgid "Home page"
     25msgstr "Domovská stránka"
     26
     27#: tformabout.caption
     28msgctxt "tformabout.caption"
     29msgid "About"
     30msgstr "O aplikaci"
     31
     32#: tformabout.labelappname.caption
     33msgctxt "tformabout.labelappname.caption"
     34msgid "Tunneler"
     35msgstr "Tunneler"
     36
     37#: tformabout.labelcontent.caption
     38msgid "   "
     39msgstr "   "
     40
     41#: tformabout.labeldescription.caption
     42msgid "Real-time digging tank battle game. This is recreation of legend MS-DOS game written in Pascal."
     43msgstr "Kopací tanková bojová ha v reálném čase. Jedná se o znovu vytvoření legendární MS-DOS hry napsané v Pascale."
     44
    1945#: tgameresultform.caption
    2046msgid "Game result"
     
    2248
    2349#: tmainform.aabout.caption
     50msgctxt "tmainform.aabout.caption"
    2451msgid "About"
    2552msgstr "O aplikaci"
     
    4774
    4875#: tmainform.caption
     76msgctxt "tmainform.caption"
    4977msgid "Tunneler"
    5078msgstr "Tunneler"
     
    127155msgstr "Ovládání"
    128156
    129 #: ucore.splayer
    130 msgctxt "ucore.splayer"
     157#: uengine.splayer
     158msgctxt "uengine.splayer"
    131159msgid "Player"
    132160msgstr "Hráč"
     161
     162#: uformabout.slicense
     163msgid "License"
     164msgstr "Licence"
     165
     166#: uformabout.sreleasedate
     167msgid "Release date"
     168msgstr "Datum uvolnění"
     169
     170#: uformabout.sversion
     171msgid "Version"
     172msgstr "Verze"
    133173
    134174#: umainform.sround
  • trunk/Languages/Tunneler.po

    r43 r44  
    66msgstr ""
    77
     8#: tformabout.buttonclose.caption
     9msgid "Close"
     10msgstr ""
     11
     12#: tformabout.buttonhomepage.caption
     13msgid "Home page"
     14msgstr ""
     15
     16#: tformabout.caption
     17msgctxt "tformabout.caption"
     18msgid "About"
     19msgstr ""
     20
     21#: tformabout.labelappname.caption
     22msgctxt "tformabout.labelappname.caption"
     23msgid "Tunneler"
     24msgstr ""
     25
     26#: tformabout.labelcontent.caption
     27msgid "   "
     28msgstr ""
     29
     30#: tformabout.labeldescription.caption
     31msgid "Real-time digging tank battle game. This is recreation of legend MS-DOS game written in Pascal."
     32msgstr ""
     33
    834#: tgameresultform.caption
    935msgid "Game result"
     
    1137
    1238#: tmainform.aabout.caption
     39msgctxt "tmainform.aabout.caption"
    1340msgid "About"
    1441msgstr ""
     
    3663
    3764#: tmainform.caption
     65msgctxt "tmainform.caption"
    3866msgid "Tunneler"
    3967msgstr ""
     
    116144msgstr ""
    117145
    118 #: ucore.splayer
    119 msgctxt "ucore.splayer"
     146#: uengine.splayer
     147msgctxt "uengine.splayer"
    120148msgid "Player"
     149msgstr ""
     150
     151#: uformabout.slicense
     152msgid "License"
     153msgstr ""
     154
     155#: uformabout.sreleasedate
     156msgid "Release date"
     157msgstr ""
     158
     159#: uformabout.sversion
     160msgid "Version"
    121161msgstr ""
    122162
  • trunk/UEngine.pas

    r43 r44  
    1 unit UCore;
     1unit UEngine;
    22
    33{$mode delphi}{$H+}
     
    427427
    428428procedure TWorld.InitMatter;
     429var
     430  I: Integer;
    429431begin
    430432  // Space
     
    474476  end;
    475477
    476   // Player 1 cannon
    477   with Matters.AddNew do begin
    478     Kind := mkTankBody;
    479     Color := clYellow;
    480     Player := 0;
    481     Blocking := True;
    482   end;
    483   // Player 1 home
    484   with Matters.AddNew do begin
    485     Kind := mkHome;
    486     Color := TColor($00ff00);
    487     Player := 0;
    488     Blocking := True;
    489   end;
    490   // Player 1 body1
    491   with Matters.AddNew do begin
    492     Kind := mkTankBody;
    493     Color := TColor($00ff00);
    494     Player := 0;
    495     Blocking := True;
    496   end;
    497   // Player 1 body2
    498   with Matters.AddNew do begin
    499     Kind := mkTankBody;
    500     Color := TColor($00a000);
    501     Player := 0;
    502     Blocking := True;
    503   end;
    504 
    505   // Player 2 cannon
    506   with Matters.AddNew do begin
    507     Kind := mkTankBody;
    508     Color := clYellow;
    509     Player := 1;
    510     Blocking := True;
    511   end;
    512   // Player 2 home
    513   with Matters.AddNew do begin
    514     Kind := mkHome;
    515     Color :=  TColor($ff2c2c);
    516     Player := 1;
    517     Blocking := True;
    518   end;
    519   // Player 2 body1
    520   with Matters.AddNew do begin
    521     Kind := mkTankBody;
    522     Color := TColor($ff2c2c);
    523     Player := 1;
    524     Blocking := True;
    525   end;
    526   // Player 2 body2
    527   with Matters.AddNew do begin
    528     Kind := mkTankBody;
    529     Color := TColor($b60000);
    530     Player := 1;
    531     Blocking := True;
    532   end;
    533 
    534   // Player 3 cannon
    535   with Matters.AddNew do begin
    536     Kind := mkTankBody;
    537     Color := clYellow;
    538     Player := 2;
    539     Blocking := True;
    540   end;
    541   // Player 3 home
    542   with Matters.AddNew do begin
    543     Kind := mkHome;
    544     Color :=  TColor($0000ff);
    545     Player := 2;
    546     Blocking := True;
    547   end;
    548   // Player 3 body1
    549   with Matters.AddNew do begin
    550     Kind := mkTankBody;
    551     Color := TColor($0000ff);
    552     Player := 2;
    553     Blocking := True;
    554   end;
    555   // Player 3 body2
    556   with Matters.AddNew do begin
    557     Kind := mkTankBody;
    558     Color := TColor($0000a0);
    559     Player := 2;
    560     Blocking := True;
    561   end;
    562 
    563   // Player 4 cannon
    564   with Matters.AddNew do begin
    565     Kind := mkTankBody;
    566     Color := clYellow;
    567     Player := 3;
    568     Blocking := True;
    569   end;
    570   // Player 4 home
    571   with Matters.AddNew do begin
    572     Kind := mkHome;
    573     Color :=  TColor($ff2cff);
    574     Player := 3;
    575     Blocking := True;
    576   end;
    577   // Player 4 body1
    578   with Matters.AddNew do begin
    579     Kind := mkTankBody;
    580     Color := TColor($ff2cff);
    581     Player := 3;
    582     Blocking := True;
    583   end;
    584   // Player 4 body2
    585   with Matters.AddNew do begin
    586     Kind := mkTankBody;
    587     Color := TColor($b600b6);
    588     Player := 3;
    589     Blocking := True;
    590   end;
    591 
    592   // Player 5 cannon
    593   with Matters.AddNew do begin
    594     Kind := mkTankBody;
    595     Color := clYellow;
    596     Player := 4;
    597     Blocking := True;
    598   end;
    599   // Player 5 home
    600   with Matters.AddNew do begin
    601     Kind := mkHome;
    602     Color := TColor($ffff2c);
    603     Player := 4;
    604     Blocking := True;
    605   end;
    606   // Player 5 body1
    607   with Matters.AddNew do begin
    608     Kind := mkTankBody;
    609     Color := TColor($ffff2c);
    610     Player := 4;
    611     Blocking := True;
    612   end;
    613   // Player 5 body2
    614   with Matters.AddNew do begin
    615     Kind := mkTankBody;
    616     Color := TColor($b6b600);
    617     Player := 4;
    618     Blocking := True;
    619   end;
    620 
    621   // Player 6 cannon
    622   with Matters.AddNew do begin
    623     Kind := mkTankBody;
    624     Color := clYellow;
    625     Player := 5;
    626     Blocking := True;
    627   end;
    628   // Player 6 home
    629   with Matters.AddNew do begin
    630     Kind := mkHome;
    631     Color :=  TColor($2cffff);
    632     Player := 5;
    633     Blocking := True;
    634   end;
    635   // Player 6 body1
    636   with Matters.AddNew do begin
    637     Kind := mkTankBody;
    638     Color := TColor($2cffff);
    639     Player := 5;
    640     Blocking := True;
    641   end;
    642   // Player 6 body2
    643   with Matters.AddNew do begin
    644     Kind := mkTankBody;
    645     Color := TColor($00b6b6);
    646     Player := 5;
    647     Blocking := True;
    648   end;
    649 
    650   // Player 7 cannon
    651   with Matters.AddNew do begin
    652     Kind := mkTankBody;
    653     Color := clYellow;
    654     Player := 6;
    655     Blocking := True;
    656   end;
    657   // Player 7 home
    658   with Matters.AddNew do begin
    659     Kind := mkHome;
    660     Color :=  TColor($008cff);
    661     Player := 6;
    662     Blocking := True;
    663   end;
    664   // Player 7 body1
    665   with Matters.AddNew do begin
    666     Kind := mkTankBody;
    667     Color := TColor($008cff);
    668     Player := 6;
    669     Blocking := True;
    670   end;
    671   // Player 7 body2
    672   with Matters.AddNew do begin
    673     Kind := mkTankBody;
    674     Color := TColor($002da0);
    675     Player := 6;
    676     Blocking := True;
    677   end;
    678 
    679   // Player 8 cannon
    680   with Matters.AddNew do begin
    681     Kind := mkTankBody;
    682     Color := clYellow;
    683     Player := 7;
    684     Blocking := True;
    685   end;
    686   // Player 8 home
    687   with Matters.AddNew do begin
    688     Kind := mkHome;
    689     Color :=  TColor($d0d0d0);
    690     Player := 7;
    691     Blocking := True;
    692   end;
    693   // Player 8 body1
    694   with Matters.AddNew do begin
    695     Kind := mkTankBody;
    696     Color := TColor($d0d0d0);
    697     Player := 7;
    698     Blocking := True;
    699   end;
    700   // Player 8 body2
    701   with Matters.AddNew do begin
    702     Kind := mkTankBody;
    703     Color := TColor($707070);
    704     Player := 7;
    705     Blocking := True;
     478  for I := 0 to 7 do begin
     479    // Player cannon
     480    with Matters.AddNew do begin
     481      Kind := mkTankBody;
     482      Player := I;
     483      Blocking := True;
     484    end;
     485    // Player home
     486    with Matters.AddNew do begin
     487      Kind := mkHome;
     488      Player := I;
     489      Blocking := True;
     490    end;
     491    // Player body1
     492    with Matters.AddNew do begin
     493      Kind := mkTankBody;
     494      Player := I;
     495      Blocking := True;
     496    end;
     497    // Player body2
     498    with Matters.AddNew do begin
     499      Kind := mkTankBody;
     500      Player := I;
     501      Blocking := True;
     502    end;
    706503  end;
    707504end;
     
    16651462    Players.Add(NewPlayer);
    16661463    Score := 0;
     1464    World.Matters[Integer(miPlayer1Cannon) + I * 4].Color := clYellow;
    16671465    World.Matters[Integer(miPlayer1Home) + I * 4].Color := Color1;
    16681466    World.Matters[Integer(miPlayer1TankBody) + I * 4].Color := Color1;
  • trunk/tunneler.lpi

    r39 r44  
    7878      </Modes>
    7979    </RunParams>
    80     <RequiredPackages Count="5">
     80    <RequiredPackages Count="6">
    8181      <Item1>
     82        <PackageName Value="FCL"/>
     83      </Item1>
     84      <Item2>
    8285        <PackageName Value="CoolAudio"/>
    8386        <DefaultFilename Value="Components/CoolAudio/CoolAudio.lpk" Prefer="True"/>
    84       </Item1>
    85       <Item2>
     87      </Item2>
     88      <Item3>
    8689        <PackageName Value="Common"/>
    8790        <DefaultFilename Value="Components/Common/Common.lpk" Prefer="True"/>
    88       </Item2>
    89       <Item3>
     91      </Item3>
     92      <Item4>
    9093        <PackageName Value="CoolTranslator"/>
    9194        <DefaultFilename Value="Components/CoolTranslator/CoolTranslator.lpk" Prefer="True"/>
    92       </Item3>
    93       <Item4>
     95      </Item4>
     96      <Item5>
    9497        <PackageName Value="TemplateGenerics"/>
    9598        <DefaultFilename Value="Components/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/>
    96       </Item4>
    97       <Item5>
     99      </Item5>
     100      <Item6>
    98101        <PackageName Value="LCL"/>
    99       </Item5>
     102      </Item6>
    100103    </RequiredPackages>
    101     <Units Count="9">
     104    <Units Count="11">
    102105      <Unit0>
    103106        <Filename Value="tunneler.lpr"/>
     
    105108      </Unit0>
    106109      <Unit1>
    107         <Filename Value="UCore.pas"/>
     110        <Filename Value="UEngine.pas"/>
    108111        <IsPartOfProject Value="True"/>
    109112      </Unit1>
     
    151154        <ResourceBaseClass Value="Form"/>
    152155      </Unit8>
     156      <Unit9>
     157        <Filename Value="Forms/UFormAbout.pas"/>
     158        <IsPartOfProject Value="True"/>
     159        <ComponentName Value="FormAbout"/>
     160        <HasResources Value="True"/>
     161        <ResourceBaseClass Value="Form"/>
     162      </Unit9>
     163      <Unit10>
     164        <Filename Value="UCore.pas"/>
     165        <IsPartOfProject Value="True"/>
     166        <ComponentName Value="Core"/>
     167        <HasResources Value="True"/>
     168        <ResourceBaseClass Value="DataModule"/>
     169      </Unit10>
    153170    </Units>
    154171  </ProjectOptions>
  • trunk/tunneler.lpr

    r41 r44  
    66  {$DEFINE UseCThreads}
    77  {$IFDEF UNIX}{$IFDEF UseCThreads}
    8   cthreads,
     8  cthreads, clocale,
    99  {$ENDIF}{$ENDIF}
    1010  Interfaces, // this includes the LCL widgetset
    1111  Forms, TemplateGenerics, CoolTranslator, UPlatform, FileUtil, SysUtils,
    1212  Common,
    13   UNewGameForm, UMainForm, UMapForm, UGameResultForm
     13  UNewGameForm, UMainForm, UMapForm, UGameResultForm, UCore
    1414  { you can add units after this };
    1515
     
    3030  Application.Scaled:=True;
    3131  Application.Initialize;
     32  Application.CreateForm(TCore, Core);
    3233  Application.CreateForm(TMainForm, MainForm);
    3334  Application.CreateForm(TMapForm, MapForm);
Note: See TracChangeset for help on using the changeset viewer.