mirror of
https://github.com/moparisthebest/Simba
synced 2024-10-31 23:45:13 -04:00
Merge branch 'ScriptText' of https://github.com/Dgby714/Simba into Dgby714-ScriptText
This commit is contained in:
commit
29082f6a9f
@ -192,6 +192,7 @@ begin
|
|||||||
AddFunction(@ext_MessageDlg,'function MessageDlg(const aCaption, aMsg: string; DlgType: TMsgDlgType;Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;');
|
AddFunction(@ext_MessageDlg,'function MessageDlg(const aCaption, aMsg: string; DlgType: TMsgDlgType;Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;');
|
||||||
AddFunction(@ext_InputQuery,'function InputQuery(const ACaption, APrompt : String; var Value : String) : Boolean;');
|
AddFunction(@ext_InputQuery,'function InputQuery(const ACaption, APrompt : String; var Value : String) : Boolean;');
|
||||||
AddFunction(@ext_ScriptText,'function ScriptText: string;');
|
AddFunction(@ext_ScriptText,'function ScriptText: string;');
|
||||||
|
AddFunction(@ext_GetSelectedText, 'function GetSelectedText: string;');
|
||||||
AddFunction(@ext_OpenScript,'procedure OpenScript(Name, Data: string; Run: boolean);');
|
AddFunction(@ext_OpenScript,'procedure OpenScript(Name, Data: string; Run: boolean);');
|
||||||
AddFunction(@ext_OpenScriptEx,'procedure OpenScriptEx(FileName: string; Run: boolean);');
|
AddFunction(@ext_OpenScriptEx,'procedure OpenScriptEx(FileName: string; Run: boolean);');
|
||||||
AddRegisteredPTRVariable('Settings','TMMLSettingsSandbox');
|
AddRegisteredPTRVariable('Settings','TMMLSettingsSandbox');
|
||||||
|
@ -126,7 +126,23 @@ end;
|
|||||||
function ext_ScriptText: string;
|
function ext_ScriptText: string;
|
||||||
begin
|
begin
|
||||||
Result := SimbaForm.CurrScript.SynEdit.Lines.Text;
|
Result := SimbaForm.CurrScript.SynEdit.Lines.Text;
|
||||||
Result := ReplaceRegExpr('([N|n][A|a][M|m][E|e]|[P|p][A|a][S|s]{2}|[P|p][I|i][N|n])\s*\:\=\s*\''.*?\'';', Result, '$1 := ''*********'';', True);
|
end;
|
||||||
|
|
||||||
|
function ext_GetSelectedText: string;
|
||||||
|
var
|
||||||
|
I: integer;
|
||||||
|
begin
|
||||||
|
with SimbaForm.CurrScript.SynEdit do
|
||||||
|
begin
|
||||||
|
if (not (BlockBegin.Y = BlockEnd.Y)) then
|
||||||
|
begin
|
||||||
|
Result := Copy(Lines[BlockBegin.Y - 1], BlockBegin.X, Length(Lines[BlockBegin.Y - 1])) + MEOL;
|
||||||
|
for I := BlockBegin.Y + 1 to BlockEnd.Y - 1 do
|
||||||
|
Result := Result + Lines[I - 1] + MEOL;
|
||||||
|
Result := Result + Copy(Lines[BlockEnd.Y - 1], 1, BlockEnd.X - 1);
|
||||||
|
end else
|
||||||
|
Result := Copy(Lines[BlockBegin.Y - 1], BlockBegin.X, BlockEnd.X - BlockBegin.X);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ext_OpenScript(vName, Data: string; Run: boolean);
|
procedure ext_OpenScript(vName, Data: string; Run: boolean);
|
||||||
|
Loading…
Reference in New Issue
Block a user