Skip to content

Commit

Permalink
Happy Halloween
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroNick2020 committed Oct 31, 2024
1 parent cc1fc5d commit e26a13a
Show file tree
Hide file tree
Showing 22 changed files with 1,040 additions and 166 deletions.
77 changes: 77 additions & 0 deletions animationexport.lfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
object AnimationExportForm: TAnimationExportForm
Left = 1398
Height = 222
Top = 243
Width = 388
Caption = 'Animation Export Properties'
ClientHeight = 222
ClientWidth = 388
LCLVersion = '3.4.0.0'
object EditName: TEdit
Left = 120
Height = 23
Top = 24
Width = 211
MaxLength = 20
ParentFont = False
TabOrder = 0
end
object AnimationName: TLabel
Left = 75
Height = 15
Top = 32
Width = 32
Caption = 'Name'
ParentColor = False
ParentFont = False
end
object AnimationType: TLabel
Left = 24
Height = 15
Top = 102
Width = 83
Caption = 'Animation Type'
ParentColor = False
ParentFont = False
end
object ComboMap: TComboBox
Left = 120
Height = 23
Top = 102
Width = 211
ItemHeight = 15
ParentFont = False
Style = csDropDownList
TabOrder = 1
end
object CompilerType: TLabel
Left = 58
Height = 15
Top = 64
Width = 49
Caption = 'Compiler'
ParentColor = False
ParentFont = False
end
object ComboCompiler: TComboBox
Left = 120
Height = 23
Top = 64
Width = 211
ItemHeight = 15
ParentFont = False
Style = csDropDownList
TabOrder = 2
OnChange = ComboCompilerChange
end
object OKButton: TButton
Left = 280
Height = 25
Top = 176
Width = 75
Caption = 'OK'
ParentFont = False
TabOrder = 3
OnClick = OKButtonClick
end
end
150 changes: 150 additions & 0 deletions animationexport.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
unit animationexport;

{$mode ObjFPC}{$H+}

interface

uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,AnimBase,rwxgf,rmcodegen;

type

{ TAnimationExportForm }

TAnimationExportForm = class(TForm)
ComboCompiler: TComboBox;
ComboMap: TComboBox;
CompilerType: TLabel;
EditName: TEdit;
AnimationName: TLabel;
AnimationType: TLabel;
OKButton: TButton;
procedure ComboCompilerChange(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
private

public
EO : AnimExportFormatRec;
procedure SetExportProps(props : AnimExportFormatRec);
procedure GetExportProps(var props : AnimExportFormatRec);
procedure InitComboBoxes;
procedure UpdateComboBoxes(compiler : integer);

end;

var
AnimationExportForm: TAnimationExportForm;

implementation

{$R *.lfm}

procedure TAnimationExportForm.ComboCompilerChange(Sender: TObject);
begin
UpdateComboBoxes(ComboCompiler.ItemIndex);
end;

procedure TAnimationExportForm.OKButtonClick(Sender: TObject);
begin
modalresult:= mrOk;
end;

procedure TAnimationExportForm.SetExportProps(props : AnimExportFormatRec);
begin
EO:=props;
EditName.caption:=EO.Name;
ComboCompiler.ItemIndex:=EO.Lan;
ComboMap.ItemIndex:=EO.AnimateFormat;
UpdateComboBoxes(ComboCompiler.ItemIndex);
end;

procedure TAnimationExportForm.GetExportProps(var props : AnimExportFormatRec);
begin
props.Name:=EditName.caption;
props.Lan:=ComboCompiler.ItemIndex;
props.AnimateFormat:=ComboMap.ItemIndex;
end;

procedure TAnimationExportForm.InitComboBoxes;
begin
EditName.caption:='';
Combocompiler.Items.Clear;
ComboCompiler.Items.Add('None');
ComboCompiler.Items.Add('Basic');
ComboCompiler.Items.Add('Basic (Line#)');
ComboCompiler.Items.Add('C');
ComboCompiler.Items.Add('Pascal');
ComboCompiler.Items.Add('FreeBASIC');
ComboCompiler.Items.Add('QB64');
ComboCompiler.Items.Add('Amiga QuickBasic AQB');
ComboCompiler.Items.Add('BAM Basic');
ComboCompiler.ItemIndex:=0;

ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.ItemIndex:=0;

end;

procedure TAnimationExportForm.UpdateComboBoxes(compiler : integer);
begin
case compiler of NoLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.ItemIndex:=0;
end;
BasicLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
BasicLNLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
PascalLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
CLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
FBBasicLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
QB64BasicLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
AQBBasicLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;
BAMBasicLan:begin
ComboMap.Items.Clear;
ComboMap.Items.Add('None');
ComboMap.Items.Add('Simple');
ComboMap.ItemIndex:=EO.AnimateFormat;
end;

end;
end;


end.

11 changes: 9 additions & 2 deletions mapcore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,16 @@ procedure TMapCoreBase.ClearMap(index, value : integer);
procedure TMapCoreBase.SetMapTileSize(index, twidth,theight : integer);
var
zsize : integer;
nzwidth,nzheight : integer;
begin
Map[index].Props.TileWidth:=twidth;
Map[index].Props.TileHeight:=theight;
zsize:=GetZoomTileSize(Map[index].Props.ZoomSize);
SetZoomMapTileSize(index,zsize,zsize);

zsize:=GetZoomSize(index);
nzwidth:=5*zsize+twidth;
nzheight:=5*zsize+theight;

SetZoomMapTileSize(index,nzwidth,nzheight);
end;

procedure TMapCoreBase.SetZoomMapTileSize(index, twidth,theight : integer);
Expand All @@ -635,6 +640,8 @@ procedure TMapCoreBase.SetZoomMapTileSize(index, twidth,theight : integer);
end;



//not using this function - will remove in future versions
//returns how big the tile will be when zoom is applied
function TMapCoreBase.GetZoomTileSize(ZoomSize : integer) : integer;
var
Expand Down
38 changes: 21 additions & 17 deletions mapeditor.lfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object MapEdit: TMapEdit
Left = 97
Left = 105
Height = 860
Top = 366
Top = 217
Width = 1491
Caption = 'Map Editor'
ClientHeight = 860
Expand Down Expand Up @@ -240,7 +240,6 @@ object MapEdit: TMapEdit
Hint = 'Zoom Level'
Top = 13
Width = 25
Max = 6
Min = 1
OnChange = TileZoomChange
Orientation = trVertical
Expand Down Expand Up @@ -534,7 +533,7 @@ object MapEdit: TMapEdit
end
end
object MainMenu1: TMainMenu
Left = 72
Left = 80
Top = 304
object FileMenuItem: TMenuItem
Caption = 'File'
Expand Down Expand Up @@ -590,14 +589,15 @@ object MapEdit: TMapEdit
end
end
end
object MenuItem4: TMenuItem
object MenuItem17: TMenuItem
Caption = 'Edit'
object Clear: TMenuItem
Caption = 'Clear'
OnClick = ClearMapClick
end
object Undo: TMenuItem
Caption = 'Undo'
OnClick = ToolUndoIconClick
end
object CloneMap: TMenuItem
Caption = 'Clone'
Expand All @@ -611,6 +611,13 @@ object MapEdit: TMapEdit
Caption = 'Paste'
OnClick = PasteFromClipBoardClick
end
object Properties: TMenuItem
Caption = 'Properties'
OnClick = MenuMapPropsClick
end
end
object MenuItem4: TMenuItem
Caption = 'View'
object MenuItem5: TMenuItem
Caption = 'Resize Map To'
object ReSizeMap8x8: TMenuItem
Expand Down Expand Up @@ -641,9 +648,9 @@ object MapEdit: TMapEdit
Enabled = False
OnClick = ReSizeMapClick
end
object SetCustomSize: TMenuItem
object SetMapCustomSize: TMenuItem
Caption = 'Set Custom Size'
OnClick = SetCustomSizeClick
OnClick = SetMapCustomSizeClick
end
end
object MenuItem9: TMenuItem
Expand Down Expand Up @@ -672,16 +679,13 @@ object MapEdit: TMapEdit
Caption = '256 X 256'
OnClick = ReSizeTiles
end
end
object Properties: TMenuItem
Caption = 'Properties'
OnClick = MenuMapPropsClick
end
end
object MenuItem17: TMenuItem
Caption = 'View'
object MenuItem18: TMenuItem
Caption = 'Refresh'
object ShowTileCustomSize: TMenuItem
Enabled = False
end
object SetTileCustomSize: TMenuItem
Caption = 'Set Custom Size'
OnClick = SetTileCustomSizeClick
end
end
end
object MenuItem19: TMenuItem
Expand Down
Loading

0 comments on commit e26a13a

Please sign in to comment.