Changeset 3 for trunk/Forms


Ignore:
Timestamp:
Jan 27, 2016, 10:32:48 PM (9 years ago)
Author:
chronos
Message:
  • Added: Classes for decoding MAP, CPS, SHP and ENG file formats.
Location:
trunk/Forms
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r2 r3  
    11object FormMain: TFormMain
    2   Left = 578
    3   Height = 646
    4   Top = 309
    5   Width = 985
     2  Left = 333
     3  Height = 1074
     4  Top = 151
     5  Width = 1420
    66  Caption = 'Dune 2'
    7   ClientHeight = 646
    8   ClientWidth = 985
     7  ClientHeight = 1074
     8  ClientWidth = 1420
    99  OnActivate = FormActivate
     10  OnKeyPress = FormKeyPress
    1011  LCLVersion = '1.7'
     12  WindowState = wsMaximized
    1113  object PaintBox1: TPaintBox
    1214    Left = 0
    13     Height = 646
     15    Height = 1074
    1416    Top = 0
    15     Width = 985
     17    Width = 1420
    1618    Align = alClient
    1719    OnClick = PaintBox1Click
     20    OnPaint = PaintBox1Paint
    1821  end
    1922end
  • trunk/Forms/UFormMain.pas

    r2 r3  
    1616    PaintBox1: TPaintBox;
    1717    procedure FormActivate(Sender: TObject);
     18    procedure FormKeyPress(Sender: TObject; var Key: char);
    1819    procedure PaintBox1Click(Sender: TObject);
     20    procedure PaintBox1Paint(Sender: TObject);
    1921  private
    2022    Initialized: Boolean;
     
    4042end;
    4143
     44procedure TFormMain.PaintBox1Paint(Sender: TObject);
     45begin
     46  Core.Game.Paint(PaintBox1.Canvas);
     47end;
     48
    4249procedure TFormMain.FormActivate(Sender: TObject);
    4350begin
     
    4552    Initialized := True;
    4653    Core.Init;
     54  end;
     55end;
     56
     57procedure TFormMain.FormKeyPress(Sender: TObject; var Key: char);
     58begin
     59  Caption := IntToStr(Ord(Key));
     60  if Key = #63 then begin
     61    Inc(Core.Game.IW);
     62    core.Game.LoadData;
     63    PaintBox1.Repaint;
     64  end;
     65  if Key = #41 then begin
     66    Dec(Core.Game.IW);
     67    core.Game.LoadData;
     68    PaintBox1.Repaint;
    4769  end;
    4870end;
Note: See TracChangeset for help on using the changeset viewer.