mirror of
https://github.com/moparisthebest/Simba
synced 2025-03-03 10:51:49 -05:00
Added Disguise+Status+ClearDebugImg..
Redesigned the way form-interactions are done.
This commit is contained in:
parent
4810850ad1
commit
807905c896
@ -42,13 +42,10 @@ type
|
|||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
DispSize : TPoint;
|
|
||||||
ToDrawBmp: TMufasaBitmap;//The bitmap we should draw!
|
|
||||||
GetDbgBmp : TMufasaBitmap;
|
|
||||||
procedure BlackDebugImage;
|
procedure BlackDebugImage;
|
||||||
procedure DrawBitmap;
|
procedure DrawBitmap(ToDrawBmp: TMufasaBitmap);
|
||||||
procedure GetDebugImage;
|
procedure GetDebugImage(GetDbgBmp : TMufasaBitmap);
|
||||||
procedure ShowDebugImgForm; //Uses the global var for w/h
|
procedure ShowDebugImgForm(DispSize : TPoint);
|
||||||
{ public declarations }
|
{ public declarations }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -87,7 +84,7 @@ begin
|
|||||||
DrawImage.Repaint;
|
DrawImage.Repaint;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebugImgForm.DrawBitmap;
|
procedure TDebugImgForm.DrawBitmap(ToDrawBmp : TMufasaBitmap);
|
||||||
var
|
var
|
||||||
Bitmap : Graphics.TBitmap;
|
Bitmap : Graphics.TBitmap;
|
||||||
begin
|
begin
|
||||||
@ -99,12 +96,12 @@ begin
|
|||||||
Bitmap.Free;
|
Bitmap.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebugImgForm.GetDebugImage;
|
procedure TDebugImgForm.GetDebugImage(GetDbgBmp : TMufasaBitmap);
|
||||||
begin;
|
begin;
|
||||||
GetDbgBmp.LoadFromRawImage(DrawImage.Picture.Bitmap.RawImage);
|
GetDbgBmp.LoadFromRawImage(DrawImage.Picture.Bitmap.RawImage);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebugImgForm.ShowDebugImgForm;
|
procedure TDebugImgForm.ShowDebugImgForm(DispSize : TPoint);
|
||||||
begin
|
begin
|
||||||
if not Visible then
|
if not Visible then
|
||||||
show;
|
show;
|
||||||
|
@ -162,8 +162,7 @@ begin
|
|||||||
if not ScriptChanged then
|
if not ScriptChanged then
|
||||||
begin;
|
begin;
|
||||||
ScriptChanged:= True;
|
ScriptChanged:= True;
|
||||||
SimbaForm.Caption:= Format(WindowTitle,[ScriptName + '*']);
|
SimbaForm.UpdateTitle;
|
||||||
OwnerSheet.Caption:=ScriptName + '*';
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -520,8 +519,7 @@ begin
|
|||||||
if ScriptChanged then
|
if ScriptChanged then
|
||||||
if SynEdit.Lines.Text = StartText then
|
if SynEdit.Lines.Text = StartText then
|
||||||
begin;
|
begin;
|
||||||
SimbaForm.Caption:= format(WindowTitle,[ScriptName]);
|
SimbaForm.UpdateTitle;
|
||||||
OwnerSheet.Caption:= ScriptName;
|
|
||||||
ScriptChanged := false;
|
ScriptChanged := false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -532,8 +530,7 @@ begin
|
|||||||
if ScriptChanged then
|
if ScriptChanged then
|
||||||
if SynEdit.Lines.Text = StartText then
|
if SynEdit.Lines.Text = StartText then
|
||||||
begin;
|
begin;
|
||||||
SimbaForm.Caption:= format(WindowTitle,[ScriptName]);
|
SimbaForm.UpdateTitle;
|
||||||
OwnerSheet.Caption := ScriptName;
|
|
||||||
ScriptChanged := false;
|
ScriptChanged := false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
object SimbaForm: TSimbaForm
|
object SimbaForm: TSimbaForm
|
||||||
Left = 602
|
Left = 674
|
||||||
Height = 623
|
Height = 623
|
||||||
Top = 75
|
Top = 308
|
||||||
Width = 660
|
Width = 660
|
||||||
AllowDropFiles = True
|
AllowDropFiles = True
|
||||||
Caption = 'THA FUKING Simba'
|
Caption = 'THA FUKING Simba'
|
||||||
@ -1260,7 +1260,6 @@ object SimbaForm: TSimbaForm
|
|||||||
end
|
end
|
||||||
object MenuItemExtensions: TMenuItem
|
object MenuItemExtensions: TMenuItem
|
||||||
Action = ActionExtensions
|
Action = ActionExtensions
|
||||||
OnClick = MenuItemExtensionsClick
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object MenuTools: TMenuItem
|
object MenuTools: TMenuItem
|
||||||
|
@ -20,9 +20,6 @@
|
|||||||
|
|
||||||
Simba/GUI for the Mufasa Macro Library
|
Simba/GUI for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
{TODO: Implement Disguise and Status bars}
|
|
||||||
|
|
||||||
unit SimbaUnit;
|
unit SimbaUnit;
|
||||||
|
|
||||||
{$undef EditButtons}
|
{$undef EditButtons}
|
||||||
@ -404,16 +401,18 @@ type
|
|||||||
Picker: TMColorPicker;
|
Picker: TMColorPicker;
|
||||||
Selector: TMWindowSelector;
|
Selector: TMWindowSelector;
|
||||||
OnScriptStart : TScriptStartEvent;
|
OnScriptStart : TScriptStartEvent;
|
||||||
|
FormCallBackData : TCallBackData;
|
||||||
{$ifdef mswindows}
|
{$ifdef mswindows}
|
||||||
ConsoleVisible : boolean;
|
ConsoleVisible : boolean;
|
||||||
procedure ShowConsole( ShowIt : boolean);
|
procedure ShowConsole( ShowIt : boolean);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
procedure FormCallBack;
|
||||||
function LoadSettingDef(const Key, Def : string) : string;
|
function LoadSettingDef(const Key, Def : string) : string;
|
||||||
|
|
||||||
procedure FunctionListShown( ShowIt : boolean);
|
procedure FunctionListShown( ShowIt : boolean);
|
||||||
property ScriptState : TScriptState read GetScriptState write SetScriptState;
|
property ScriptState : TScriptState read GetScriptState write SetScriptState;
|
||||||
procedure SafeCallThread;
|
procedure SafeCallThread;
|
||||||
|
procedure UpdateTitle;
|
||||||
function OpenScript : boolean;
|
function OpenScript : boolean;
|
||||||
function LoadScriptFile(filename : string; AlwaysOpenInNewTab : boolean = false; CheckOtherTabs : boolean = true) : boolean;
|
function LoadScriptFile(filename : string; AlwaysOpenInNewTab : boolean = false; CheckOtherTabs : boolean = true) : boolean;
|
||||||
function SaveCurrentScript : boolean;
|
function SaveCurrentScript : boolean;
|
||||||
@ -464,6 +463,7 @@ const
|
|||||||
Panel_Coords = 1;
|
Panel_Coords = 1;
|
||||||
Panel_ScriptName = 2;
|
Panel_ScriptName = 2;
|
||||||
Panel_ScriptPath = 3;
|
Panel_ScriptPath = 3;
|
||||||
|
Panel_General = 3;
|
||||||
|
|
||||||
|
|
||||||
Image_Stop = 7;
|
Image_Stop = 7;
|
||||||
@ -484,6 +484,7 @@ uses
|
|||||||
files,
|
files,
|
||||||
InterfaceBase,
|
InterfaceBase,
|
||||||
bitmapconv,
|
bitmapconv,
|
||||||
|
bitmaps,
|
||||||
extensionmanagergui,
|
extensionmanagergui,
|
||||||
colourhistory,
|
colourhistory,
|
||||||
math;
|
math;
|
||||||
@ -1139,17 +1140,6 @@ begin
|
|||||||
Script := Tab.ScriptFrame;
|
Script := Tab.ScriptFrame;
|
||||||
Self.CurrScript := Script;
|
Self.CurrScript := Script;
|
||||||
Self.CurrTab := Tab;
|
Self.CurrTab := Tab;
|
||||||
if Script.ScriptChanged then
|
|
||||||
begin;
|
|
||||||
Tab.TabSheet.Caption:= Script.ScriptName + '*';
|
|
||||||
Self.Caption := Format(WindowTitle,[Script.ScriptName + '*'])
|
|
||||||
end else
|
|
||||||
begin;
|
|
||||||
Tab.TabSheet.Caption:= Script.ScriptName;
|
|
||||||
Self.Caption := Format(WindowTitle,[Script.ScriptName]);
|
|
||||||
end;
|
|
||||||
StatusBar.Panels[Panel_ScriptName].Text:= Script.ScriptName;
|
|
||||||
StatusBar.Panels[Panel_ScriptPath].text:= Script.ScriptFile;
|
|
||||||
SetScriptState(Tab.ScriptFrame.FScriptState);//To set the buttons right
|
SetScriptState(Tab.ScriptFrame.FScriptState);//To set the buttons right
|
||||||
if Self.Showing then
|
if Self.Showing then
|
||||||
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
|
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
|
||||||
@ -1410,7 +1400,6 @@ end;
|
|||||||
|
|
||||||
procedure TSimbaForm.InitalizeTMThread(var Thread: TMThread);
|
procedure TSimbaForm.InitalizeTMThread(var Thread: TMThread);
|
||||||
var
|
var
|
||||||
DbgImgInfo : TDbgImgInfo;
|
|
||||||
AppPath : string;
|
AppPath : string;
|
||||||
ScriptPath : string;
|
ScriptPath : string;
|
||||||
UseCPascal: String;
|
UseCPascal: String;
|
||||||
@ -1442,18 +1431,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$IFNDEF TERMINALWRITELN}
|
{$IFNDEF TERMINALWRITELN}
|
||||||
Thread.SetDebug(@formWriteln);
|
Thread.SetDebug(@formWriteln);
|
||||||
Thread.SetDebugClear(@ClearDebug);
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Thread.SetScript(Script);
|
Thread.SetScript(Script);
|
||||||
DbgImgInfo.DispSize := @DebugImgForm.DispSize;
|
|
||||||
DbgImgInfo.ShowForm := @DebugImgForm.ShowDebugImgForm;
|
|
||||||
DbgImgInfo.ToDrawBitmap:= @DebugImgForm.ToDrawBmp;
|
|
||||||
DbgImgInfo.DrawBitmap:= @DebugImgForm.DrawBitmap;
|
|
||||||
DbgImgInfo.GetDebugBitmap:= @DebugImgForm.GetDbgBmp;
|
|
||||||
DbgImgInfo.GetBitmap:= @DebugImgForm.GetDebugImage;
|
|
||||||
Thread.SetDbgImg(DbgImgInfo);
|
|
||||||
Thread.ErrorData:= @CurrScript.ErrorData;
|
Thread.ErrorData:= @CurrScript.ErrorData;
|
||||||
Thread.OnError:= @CurrScript.HandleErrorData;
|
Thread.OnError:= @CurrScript.HandleErrorData;
|
||||||
|
FormCallBackData.FormCallBack:= @self.FormCallBack;
|
||||||
|
Thread.CallBackData:=@FormCallBackData;
|
||||||
|
|
||||||
if CurrScript.ScriptFile <> '' then
|
if CurrScript.ScriptFile <> '' then
|
||||||
ScriptPath := IncludeTrailingPathDelimiter(ExtractFileDir(CurrScript.ScriptFile));
|
ScriptPath := IncludeTrailingPathDelimiter(ExtractFileDir(CurrScript.ScriptFile));
|
||||||
@ -1546,11 +1529,9 @@ begin
|
|||||||
StartText:= SynEdit.Lines.Text;
|
StartText:= SynEdit.Lines.Text;
|
||||||
ScriptChanged := false;
|
ScriptChanged := false;
|
||||||
SynEdit.MarkTextAsSaved;
|
SynEdit.MarkTextAsSaved;
|
||||||
Self.Caption:= Format(WindowTitle,[ScriptName]);
|
|
||||||
CurrTab.TabSheet.Caption:= ScriptName;
|
CurrTab.TabSheet.Caption:= ScriptName;
|
||||||
Self.AddRecentFile(ScriptFile);
|
Self.AddRecentFile(ScriptFile);
|
||||||
StatusBar.Panels[Panel_ScriptName].Text:= ScriptName;
|
UpdateTitle;
|
||||||
StatusBar.Panels[Panel_ScriptPath].text:= ScriptFile;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1965,11 +1946,11 @@ begin
|
|||||||
if node = nil then
|
if node = nil then
|
||||||
exit;
|
exit;
|
||||||
if Node.level = 0 then
|
if Node.level = 0 then
|
||||||
StatusBar.Panels[Panel_ScriptPath].Text := 'Section: ' + Node.Text;
|
StatusBar.Panels[Panel_General].Text := 'Section: ' + Node.Text;
|
||||||
if (Node.Level > 0) and (Node.Data <> nil) then
|
if (Node.Level > 0) and (Node.Data <> nil) then
|
||||||
begin
|
begin
|
||||||
MethodInfo := PMethodInfo(node.Data)^;
|
MethodInfo := PMethodInfo(node.Data)^;
|
||||||
StatusBar.Panels[Panel_ScriptPath].Text := MethodInfo.MethodStr;
|
StatusBar.Panels[Panel_General].Text := MethodInfo.MethodStr;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2211,6 +2192,7 @@ begin
|
|||||||
FillThread.Resume;
|
FillThread.Resume;
|
||||||
//Load the extensions
|
//Load the extensions
|
||||||
LoadExtensions;
|
LoadExtensions;
|
||||||
|
UpdateTitle;
|
||||||
self.EndFormUpdate;
|
self.EndFormUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2565,6 +2547,7 @@ end;
|
|||||||
procedure TSimbaForm.PageControl1Change(Sender: TObject);
|
procedure TSimbaForm.PageControl1Change(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
RefreshTab();
|
RefreshTab();
|
||||||
|
UpdateTitle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSimbaForm.ButtonTrayClick(Sender: TObject);
|
procedure TSimbaForm.ButtonTrayClick(Sender: TObject);
|
||||||
@ -2869,8 +2852,23 @@ begin
|
|||||||
end else
|
end else
|
||||||
Writeln('You cannot hide the window, since its not created by Simba');
|
Writeln('You cannot hide the window, since its not created by Simba');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
procedure TSimbaForm.FormCallBack;
|
||||||
|
begin
|
||||||
|
with FormCallBackData do
|
||||||
|
case Cmd of
|
||||||
|
m_Status: StatusBar.Panels[Panel_General].Text:= PChar(data);
|
||||||
|
m_Disguise: Self.Caption:= Pchar(Data);
|
||||||
|
m_DisplayDebugImgWindow: DebugImgForm.ShowDebugImgForm(ppoint(data)^);
|
||||||
|
m_DrawBitmapDebugImg: DebugImgForm.DrawBitmap(TMufasaBitmap(data));
|
||||||
|
m_GetDebugBitmap : DebugImgForm.GetDebugImage(TMufasaBitmap(data));
|
||||||
|
m_ClearDebugImg : DebugImgForm.BlackDebugImage;
|
||||||
|
m_ClearDebug : Self.memo1.clear;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSimbaForm.FunctionListShown(ShowIt: boolean);
|
procedure TSimbaForm.FunctionListShown(ShowIt: boolean);
|
||||||
begin
|
begin
|
||||||
with MenuItemFunctionList, frmFunctionList do
|
with MenuItemFunctionList, frmFunctionList do
|
||||||
@ -2930,6 +2928,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSimbaForm.UpdateTitle;
|
||||||
|
begin
|
||||||
|
if CurrScript.ScriptChanged then
|
||||||
|
begin;
|
||||||
|
CurrTab.TabSheet.Caption:= CurrScript.ScriptName + '*';
|
||||||
|
Self.Caption := Format(WindowTitle,[CurrScript.ScriptName + '*'])
|
||||||
|
end else
|
||||||
|
begin;
|
||||||
|
CurrTab.TabSheet.Caption:= CurrScript.ScriptName;
|
||||||
|
Self.Caption := Format(WindowTitle,[CurrScript.ScriptName]);
|
||||||
|
end;
|
||||||
|
StatusBar.Panels[Panel_ScriptName].Text:= CurrScript.ScriptName;
|
||||||
|
StatusBar.Panels[Panel_ScriptPath].text:= CurrScript.ScriptFile;
|
||||||
|
end;
|
||||||
|
|
||||||
function TSimbaForm.OpenScript: boolean;
|
function TSimbaForm.OpenScript: boolean;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -2962,6 +2975,8 @@ begin
|
|||||||
finally
|
finally
|
||||||
Free;
|
Free;
|
||||||
end;
|
end;
|
||||||
|
if result then
|
||||||
|
UpdateTitle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSimbaForm.LoadScriptFile(filename: string; AlwaysOpenInNewTab: boolean; CheckOtherTabs : boolean
|
function TSimbaForm.LoadScriptFile(filename: string; AlwaysOpenInNewTab: boolean; CheckOtherTabs : boolean
|
||||||
@ -3006,6 +3021,8 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
if Result then
|
||||||
|
UpdateTitle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSimbaForm.SaveCurrentScript: boolean;
|
function TSimbaForm.SaveCurrentScript: boolean;
|
||||||
|
@ -126,8 +126,7 @@ end;
|
|||||||
{$IFNDEF MML_EXPORT_THREADSAFE}
|
{$IFNDEF MML_EXPORT_THREADSAFE}
|
||||||
procedure ps_ClearDebug; extdecl;
|
procedure ps_ClearDebug; extdecl;
|
||||||
begin
|
begin
|
||||||
if Assigned(CurrThread.DebugClear) then
|
CurrThread.FormCallBack(m_ClearDebug,nil);
|
||||||
CurrThread.DebugClear();
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_SetSupressExceptions(Supress : boolean);extdecl;
|
procedure ps_SetSupressExceptions(Supress : boolean);extdecl;
|
||||||
@ -150,22 +149,49 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure ps_DisplayDebugImgWindow(w,h : integer); extdecl;
|
procedure ps_DisplayDebugImgWindow(w,h : integer); extdecl;
|
||||||
|
var
|
||||||
|
DispSize : TPoint;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.DebugImg.DispSize^ := Classes.Point(w,h);
|
DispSize := Classes.Point(w,h);
|
||||||
CurrThread.Synchronize( CurrThread.DebugImg.ShowForm);
|
Currthread.FormCallBack(m_DisplayDebugImgWindow,@DispSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_DrawBitmapDebugImg(bmp : integer); extdecl;
|
procedure ps_DrawBitmapDebugImg(bmp : integer); extdecl;
|
||||||
|
var
|
||||||
|
mbmp : TMufasaBitmap;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.DebugImg.ToDrawBitmap^ := CurrThread.Client.MBitmaps[bmp];
|
mbmp := CurrThread.Client.MBitmaps[bmp];
|
||||||
CurrThread.Synchronize(CurrThread.DebugImg.DrawBitmap);
|
CurrThread.FormCallBack(m_DrawBitmapDebugImg,Pointer(mbmp));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_GetDebugBitmap : integer; extdecl;
|
function ps_GetDebugBitmap : integer; extdecl;
|
||||||
|
var
|
||||||
|
mbmp : TMufasaBitmap;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
|
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
|
||||||
CurrThread.DebugImg.GetDebugBitmap^ := CurrThread.Client.MBitmaps[result];
|
mbmp := CurrThread.Client.MBitmaps[result];
|
||||||
CurrThread.Synchronize(CurrThread.DebugImg.GetBitmap);
|
CurrThread.FormCallBack(m_GetDebugBitmap,pointer(mbmp));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure ps_ClearDebugImg; extdecl;
|
||||||
|
begin
|
||||||
|
CurrThread.FormCallBack(m_ClearDebugImg,nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure ps_Status(Status : string); extdecl;
|
||||||
|
var
|
||||||
|
PStatus : PChar;
|
||||||
|
begin
|
||||||
|
PStatus:= PChar(Status);
|
||||||
|
CurrThread.FormCallBack(m_Status,PStatus);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure ps_Disguise(Caption : string); extdecl;
|
||||||
|
var
|
||||||
|
PCaption : PChar;
|
||||||
|
begin
|
||||||
|
PCaption := PChar(Caption);
|
||||||
|
CurrThread.FormCallBack(m_Disguise,PCaption);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_TerminateScript; extdecl;
|
procedure ps_TerminateScript; extdecl;
|
||||||
|
@ -181,7 +181,10 @@ AddFunction(@ps_StopSound,'procedure StopSound;');
|
|||||||
AddFunction(@ps_DisplayDebugImgWindow,'procedure DisplayDebugImgWindow(w, h: integer);');
|
AddFunction(@ps_DisplayDebugImgWindow,'procedure DisplayDebugImgWindow(w, h: integer);');
|
||||||
AddFunction(@ps_DrawBitmapDebugImg,'procedure DrawBitmapDebugImg(bmp: integer);');
|
AddFunction(@ps_DrawBitmapDebugImg,'procedure DrawBitmapDebugImg(bmp: integer);');
|
||||||
AddFunction(@ps_GetDebugBitmap,'function GetDebugBitmap: integer;');
|
AddFunction(@ps_GetDebugBitmap,'function GetDebugBitmap: integer;');
|
||||||
|
AddFunction(@ps_ClearDebugImg,'procedure ClearDebugImg;');
|
||||||
AddFunction(@ps_ClearDebug,'procedure ClearDebug;');
|
AddFunction(@ps_ClearDebug,'procedure ClearDebug;');
|
||||||
|
AddFunction(@ps_Status,'procedure Status(Status : string);');
|
||||||
|
AddFunction(@ps_Disguise,'procedure Disguise(Caption : string);');
|
||||||
AddFunction(@ps_SetScriptProp, 'function SetScriptProp(Prop : TSP_Property; Value: TVariantArray): boolean;');
|
AddFunction(@ps_SetScriptProp, 'function SetScriptProp(Prop : TSP_Property; Value: TVariantArray): boolean;');
|
||||||
AddFunction(@ps_GetScriptProp, 'function GetScriptProp(Prop : TSP_Property;var Value: TVariantArray): boolean;');
|
AddFunction(@ps_GetScriptProp, 'function GetScriptProp(Prop : TSP_Property;var Value: TVariantArray): boolean;');
|
||||||
AddFunction(@ps_InputQuery,'function InputQuery(const ACaption, APrompt : String; var Value : String) : Boolean;');
|
AddFunction(@ps_InputQuery,'function InputQuery(const ACaption, APrompt : String; var Value : String) : Boolean;');
|
||||||
|
@ -35,9 +35,22 @@ uses
|
|||||||
bitmaps, plugins, libloader, dynlibs,internets,scriptproperties,
|
bitmaps, plugins, libloader, dynlibs,internets,scriptproperties,
|
||||||
settings,settingssandbox;
|
settings,settingssandbox;
|
||||||
|
|
||||||
|
const
|
||||||
|
m_Status = 0; //Data = PChar to new status
|
||||||
|
m_Disguise = 1; //Data = PChar to new title
|
||||||
|
m_DisplayDebugImgWindow = 2; //Data = PPoint to window size
|
||||||
|
m_DrawBitmapDebugImg = 3; //Data = TMufasaBitmap
|
||||||
|
m_GetDebugBitmap = 4; //Data = TMufasaBitmap
|
||||||
|
m_ClearDebugImg = 5; //Data = nil
|
||||||
|
m_ClearDebug = 6; //Data = nil
|
||||||
type
|
type
|
||||||
{ TMMLPSThread }
|
{ TMMLPSThread }
|
||||||
|
TCallBackData = record
|
||||||
|
FormCallBack : procedure of object;
|
||||||
|
cmd : integer;
|
||||||
|
data : pointer;
|
||||||
|
end;
|
||||||
|
PCallBackData = ^TCallBackData;
|
||||||
TSyncInfo = record
|
TSyncInfo = record
|
||||||
V : MufasaTypes.PVariantArray;
|
V : MufasaTypes.PVariantArray;
|
||||||
MethodName : string;
|
MethodName : string;
|
||||||
@ -46,15 +59,6 @@ type
|
|||||||
OldThread : TThread;
|
OldThread : TThread;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TClearDebugProc = procedure;
|
|
||||||
TDbgImgInfo = record
|
|
||||||
DispSize : ^TPoint;
|
|
||||||
ShowForm : procedure of object;
|
|
||||||
ToDrawBitmap : ^TMufasaBitmap;
|
|
||||||
DrawBitmap : procedure of object;
|
|
||||||
GetDebugBitmap : ^TMufasaBitmap;
|
|
||||||
GetBitmap : procedure of object;
|
|
||||||
end;
|
|
||||||
PSyncInfo = ^TSyncInfo;
|
PSyncInfo = ^TSyncInfo;
|
||||||
TErrorType = (errRuntime,errCompile);
|
TErrorType = (errRuntime,errCompile);
|
||||||
TOnError = procedure of object;
|
TOnError = procedure of object;
|
||||||
@ -86,8 +90,6 @@ type
|
|||||||
protected
|
protected
|
||||||
ScriptPath, AppPath, IncludePath, PluginPath, FontPath: string;
|
ScriptPath, AppPath, IncludePath, PluginPath, FontPath: string;
|
||||||
DebugTo: TWritelnProc;
|
DebugTo: TWritelnProc;
|
||||||
FDebugClear : TClearDebugProc;
|
|
||||||
FDebugImg : TDbgImgInfo;
|
|
||||||
ExportedMethods : TExpMethodArr;
|
ExportedMethods : TExpMethodArr;
|
||||||
Includes : TStringList;
|
Includes : TStringList;
|
||||||
FOpenConnectionEvent : TOpenConnectionEvent;
|
FOpenConnectionEvent : TOpenConnectionEvent;
|
||||||
@ -104,6 +106,7 @@ type
|
|||||||
SimbaSettingsFile: String;
|
SimbaSettingsFile: String;
|
||||||
Sett: TMMLSettingsSandbox;
|
Sett: TMMLSettingsSandbox;
|
||||||
|
|
||||||
|
CallBackData : PCallBackData; //Handles general callback functions for threadsafety
|
||||||
InputQueryData : TInputQueryData;//We need this for InputQuery
|
InputQueryData : TInputQueryData;//We need this for InputQuery
|
||||||
SyncInfo : PSyncInfo; //We need this for callthreadsafe
|
SyncInfo : PSyncInfo; //We need this for callthreadsafe
|
||||||
ErrorData : PErrorData; //We need this for thread-safety etc
|
ErrorData : PErrorData; //We need this for thread-safety etc
|
||||||
@ -111,6 +114,8 @@ type
|
|||||||
|
|
||||||
CompileOnly : boolean;
|
CompileOnly : boolean;
|
||||||
|
|
||||||
|
procedure FormCallBackEx(cmd : integer; var data : pointer);
|
||||||
|
procedure FormCallBack(cmd : integer; data : pointer);
|
||||||
procedure mInputQuery;
|
procedure mInputQuery;
|
||||||
procedure HandleError(ErrorRow,ErrorCol,ErrorPosition : integer; ErrorStr : string; ErrorType : TErrorType; ErrorModule : string);
|
procedure HandleError(ErrorRow,ErrorCol,ErrorPosition : integer; ErrorStr : string; ErrorType : TErrorType; ErrorModule : string);
|
||||||
function ProcessDirective(DirectiveName, DirectiveArgs: string): boolean;
|
function ProcessDirective(DirectiveName, DirectiveArgs: string): boolean;
|
||||||
@ -118,8 +123,6 @@ type
|
|||||||
procedure AddMethod(meth: TExpMethod); virtual;
|
procedure AddMethod(meth: TExpMethod); virtual;
|
||||||
|
|
||||||
procedure SetDebug( writelnProc : TWritelnProc );
|
procedure SetDebug( writelnProc : TWritelnProc );
|
||||||
procedure SetDebugClear( clearProc : TClearDebugProc );
|
|
||||||
procedure SetDbgImg( DebugImageInfo : TDbgImgInfo);
|
|
||||||
procedure SetPaths(ScriptP,AppP,IncludeP,PluginP,FontP : string);
|
procedure SetPaths(ScriptP,AppP,IncludeP,PluginP,FontP : string);
|
||||||
procedure SetSettings(S: TMMLSettings; SimbaSetFile: String);
|
procedure SetSettings(S: TMMLSettings; SimbaSetFile: String);
|
||||||
|
|
||||||
@ -136,8 +139,6 @@ type
|
|||||||
property OpenConnectionEvent : TOpenConnectionEvent read FOpenConnectionEvent write SetOpenConnectionEvent;
|
property OpenConnectionEvent : TOpenConnectionEvent read FOpenConnectionEvent write SetOpenConnectionEvent;
|
||||||
property WriteFileEvent : TWriteFileEvent read FWriteFileEvent write SetWriteFileEvent;
|
property WriteFileEvent : TWriteFileEvent read FWriteFileEvent write SetWriteFileEvent;
|
||||||
property OpenFileEvent : TOpenFileEvent read FOpenFileEvent write SetOpenFileEvent;
|
property OpenFileEvent : TOpenFileEvent read FOpenFileEvent write SetOpenFileEvent;
|
||||||
property DebugClear : TClearDebugProc read FDebugClear write SetDebugClear;
|
|
||||||
property DebugImg : TDbgImgInfo read FDebugImg write SetDbgImg;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPSThread }
|
{ TPSThread }
|
||||||
@ -318,6 +319,25 @@ begin
|
|||||||
self.Client.MFiles.WriteFileEvent := AValue;;
|
self.Client.MFiles.WriteFileEvent := AValue;;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMThread.FormCallBackEx(cmd: integer; var data: pointer);
|
||||||
|
begin
|
||||||
|
if (CallBackData = nil) or not Assigned(CallBackData^.FormCallBack) then
|
||||||
|
exit;
|
||||||
|
CallBackData^.cmd:= cmd;
|
||||||
|
CallBackData^.data:= data;
|
||||||
|
Synchronize(CallBackData^.FormCallBack);
|
||||||
|
data := CallBackData^.data;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMThread.FormCallBack(cmd: integer; data: pointer);
|
||||||
|
begin
|
||||||
|
if (CallBackData = nil) or (not Assigned(CallBackData^.FormCallBack)) then
|
||||||
|
exit;
|
||||||
|
CallBackData^.cmd:= cmd;
|
||||||
|
CallBackData^.data:= data;
|
||||||
|
Synchronize(CallBackData^.FormCallBack);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMThread.mInputQuery;
|
procedure TMThread.mInputQuery;
|
||||||
begin
|
begin
|
||||||
InputQueryData.Res:= InputQuery(InputQueryData.ACaption,InputQueryData.APrompt,
|
InputQueryData.Res:= InputQuery(InputQueryData.ACaption,InputQueryData.APrompt,
|
||||||
@ -419,16 +439,6 @@ begin
|
|||||||
Client.WritelnProc:= writelnProc;
|
Client.WritelnProc:= writelnProc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMThread.SetDebugClear(clearProc: TClearDebugProc);
|
|
||||||
begin
|
|
||||||
FDebugClear:= clearProc;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMThread.SetDbgImg(DebugImageInfo: TDbgImgInfo);
|
|
||||||
begin
|
|
||||||
FDebugImg := DebugImageInfo;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMThread.SetSettings(S: TMMLSettings; SimbaSetFile: String);
|
procedure TMThread.SetSettings(S: TMMLSettings; SimbaSetFile: String);
|
||||||
begin
|
begin
|
||||||
Self.SimbaSettingsFile := SimbaSetFile;
|
Self.SimbaSettingsFile := SimbaSetFile;
|
||||||
|
@ -96,7 +96,7 @@ type
|
|||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy;override;
|
destructor Destroy;override;
|
||||||
end;
|
end;
|
||||||
|
PMufasaBitmap = ^TMufasaBitmap;
|
||||||
TMufasaBmpArray = Array of TMufasaBitmap;
|
TMufasaBmpArray = Array of TMufasaBitmap;
|
||||||
{ TMBitmaps }
|
{ TMBitmaps }
|
||||||
TMBitmaps = class(TObject)
|
TMBitmaps = class(TObject)
|
||||||
|
@ -44,6 +44,7 @@ type
|
|||||||
Name : string;
|
Name : string;
|
||||||
Index : integer;
|
Index : integer;
|
||||||
function ToString : string;
|
function ToString : string;
|
||||||
|
function SaveToFile(const FileName : string) : boolean;
|
||||||
function LoadFromString(const s : string) : boolean;
|
function LoadFromString(const s : string) : boolean;
|
||||||
procedure Normalize;
|
procedure Normalize;
|
||||||
function Valid : boolean;
|
function Valid : boolean;
|
||||||
@ -285,6 +286,11 @@ begin
|
|||||||
Freemem(start,len);
|
Freemem(start,len);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMDTM.SaveToFile(const FileName: string): boolean;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
function TMDTM.LoadFromString(const s: string): boolean;
|
function TMDTM.LoadFromString(const s: string): boolean;
|
||||||
var
|
var
|
||||||
MDTM : TMDTM;
|
MDTM : TMDTM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user