Downloads containing unit1.pas

Downloads
Name Author Game Mode Rating
Jazz2 macro maker HelloTibi Utility 6.6 Download file

File preview

unit Unit1; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, EditBtn,
  StdCtrls, ExtCtrls, ComCtrls,  Buttons, windows;

type

  { TForm1 }

  TForm1 = class(TForm)
    jazz2path:TFileNameEdit;
    jazz2label:TLabel;
    Jazz:TRadioButton;
    Spaz:TRadioButton;
    Lori:TRadioButton;
    Battle:TRadioButton;
    Treasure:TRadioButton;
    Race:TRadioButton;
    Coop:TRadioButton;
    levellabel:TLabel;
    levelpath:TFileNameEdit;
    Pages:TPageControl;
    Paths:TTabSheet;
    Player:TTabSheet;
    Gametype:TTabSheet;
    About:TTabSheet;
    closebutton:TBitBtn;
    runj2button:TBitBtn;
    Label1:TLabel;
    Label2:TLabel;
    Label3:TLabel;
    Label4:TLabel;
    Label5:TLabel;
    Player1:TTabSheet;
    Label6:TLabel;
    Easy:TRadioButton;
    Medium:TRadioButton;
    Hard:TRadioButton;
    Label7:TLabel;
    procedure runj2buttonClick(Sender:TObject);
    procedure Label7Click(Sender:TObject);

  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  Form1: TForm1; 




implementation

{ TForm1 }

function runprocess(prog,params:string):boolean;
  var
    si: TStartupInfo;
    pi: TProcessInformation;
    s: string;
  begin
    FillChar(si, SizeOf(TStartupInfo), 0);
    with si do begin
      cb:=SizeOf(TStartupInfo);
      dwFlags:=STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
      wShowWindow:=SW_SHOWNORMAL;
    end;
    s:=prog;
    if params<>'' then begin
      s:=s+' '+params;
    end;
    runprocess:=CreateProcess(nil,PChar(ansistring(s)),nil,nil,false,NORMAL_PRIORITY_CLASS,nil,nil,si,pi);
  end;


{ TForm1 }

procedure TForm1.runj2buttonClick(Sender:TObject);
var p:string;
begin


  if jazz2path.Text='' then begin
    MessageDlg('Jazz2 exe path is empty.',mtError,[mbOK],0);
    exit;
  end;
  if levelpath.Text='' then begin
    MessageDlg('Level path is empty.',mtError,[mbOK],0);
    exit;
  end;


  p:='';
  p:=p+string(levelpath.Text)+' ';
  
  p:=p+'-record ';
  if spaz.Checked=true then p:=p+'-spaz ';
  if lori.Checked=true then p:=p+'-lori ';

  if battle.Checked=true then p:=p+'-battle ';
  if treasure.Checked=true then p:=p+'-treasure ';
  if race.Checked=true then p:=p+'-race ';
  if coop.Checked=true then p:=p+'-coop ';

  if easy.Checked=true then p:=p+'-easy ';
  if medium.Checked=true then p:=p+'-medium ';
  if hard.Checked=true then p:=p+'-hard ';
  
  
  if runprocess(string(jazz2path.Text),p)=false then  MessageDlg('Wrong Jazz2 path.',mtError,[mbOK],0);

end;


procedure TForm1.Label7Click(Sender:TObject);
begin
  MessageDlg('Some question?'+#13+'Write for me.'+#13+'Sorry for my bad English.',mtInformation,[mbOK],0);
end;


initialization
  {$I unit1.lrs}

end.