Naum
2009-12-31 09:26:10
However, since the SRL_PlayerForm does not work, the whole saving of the player's (INI) loading (INI) and other stuff needs to be added.
One problem.
What do I add to it, and how do I lay it out. I have a blank template:

For example:

This is the script btw, it's really messy. I ripped most of the stuff off Coh3n's form, so all credits to him. (Image (form) moving functions are from one of my old scripts).
program New;
Const
BitmapCount = 2;
mainBackground = 0;
x_Norm = 1;
var
// MSIForm variables.
Form_MSI : TForm;
FormBitmaps: array [0..BitmapCount - 1] of Integer;
Images : Array[0..1] of TImage;
b, w, h, i, fx2, fy2 : Integer;
StartPos, StartMousePos : TPoint;
AreMoving : Boolean;
Procedure GetPos(Sender1: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Begin
GetMousePos(fX2, fY2);
StartPos := Point(Form_MSI.left, Form_MSI.top);
StartMousePos := Point(fx2, fy2);
Aremoving := True;
End;
Procedure GetPosX(Sender2: TObject; Shift: TShiftState; X, Y: Integer);
Begin
if AreMoving then
begin
GetMousePos(fX2, fY2);
Form_MSI.Left := StartPos.x + (fx2 - StartMousePos.x);
Form_MSI.Top := StartPos.y + (fy2 - StartMousePos.y);
end;
End;
Procedure GetPosY(Sender3: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Begin
GetMousePos(fX2, fy2);
Form_MSI.Left := StartPos.x + (fx2 - StartMousePos.x);
Form_MSI.Top := StartPos.y + (fy2 - StartMousePos.y);
AreMoving := False;
End;
Procedure Close(Sender : TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Begin
WriteLn('Closed Form');
Form_MSI.Close;
End;
Procedure OkiClick(Sender: TObject);
Begin
Case Sender Of
Images[0] : Form_MSI.ModalResult:= mrOk;
End;
End;
// This form was parsed using DFM Form Parser v.26c Beta by Ron.
// Generated from olol.dfm.
procedure MSIForm;
begin
FormBitmaps[mainBackGround] := LoadBitmap(ScriptPath + 'MSI_FormBackGround.bmp');
FormBitmaps[x_Norm] := LoadBitmap(ScriptPath + 'RS X.png');
Form_MSI := CreateForm;
Form_MSI.Left := 250;
Form_MSI.Top := 114;
Form_MSI.Width := 498;
Form_MSI.Height := 490;
Form_MSI.Caption := 'frmDesign';
Form_MSI.BorderStyle := NSNone;
Form_MSI.Color := clBtnFace;
Form_MSI.Font.Color := clWindowText;
Form_MSI.Font.Height := -11;
Form_MSI.Font.Name := 'MS Sans Serif';
Form_MSI.Font.Style := [];
Form_MSI.PixelsPerInch := 96;
Images[1] := TImage.Create(Form_MSI);
Images[1].Parent := Form_MSI;
Images[1].Width := 498;
Images[1].Height := 490;
b := FormBitmaps[mainBackGround];
GetBitmapSize(b, w, h);
CopyCanvas(GetBitmapCanvas(b), Images[1].Canvas, 0, 0, w, h, 0, 0, w, h);
Images[1].OnMouseDown := @GetPos;
Images[1].OnMouseMove := @GetPosX;
Images[1].OnMouseUp := @GetPosY;
Images[0] := TImage.Create(Form_MSI);
Images[0].Parent := Form_MSI;
Images[0].Width := 28;
Images[0].Height := 34;
Images[0].Top := 6;
Images[0].Left := 465;
b := FormBitmaps[x_Norm];
GetBitmapSize(b, w, h);
SafeDrawBitmap(b, Images[1].Canvas, 465, 6);
Images[0].OnClick := @OkiClick;
end;
procedure SafeMSIForm;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('MSIForm', v);
end;
procedure ShowMSIFormModal;
begin
Form_MSI.ShowModal;
end;
procedure SafeShowMSIFormModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowMSIFormModal', v);
end;
procedure MainMSIForm;
begin
SafeMSIForm;
SafeShowMSIFormModal;
FreeForm(Form_MSI);
end;
begin
ClearDebug;
MainMSIForm;
end.
I need ideas, Thanks!
But the Add player / Delete player don't work. So the form is 90% done, all it needs is AddPlayer; DeletePlayer; and images. :) Already has saving to .ini
Flopped it up in 5 mins can be much better but just a breif outline :).
