Added new function to calltips: opens include file on click
Fixed some bugs in the menu generator
This commit is contained in:
parent
429798ae35
commit
db0dd03128
|
@ -115,7 +115,7 @@ AutoIncBuild=1
|
||||||
MajorVer=1
|
MajorVer=1
|
||||||
MinorVer=3
|
MinorVer=3
|
||||||
Release=0
|
Release=0
|
||||||
Build=31
|
Build=32
|
||||||
Debug=0
|
Debug=0
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
|
@ -126,7 +126,7 @@ CodePage=1252
|
||||||
[Version Info Keys]
|
[Version Info Keys]
|
||||||
CompanyName=AMX Mod X Dev Team
|
CompanyName=AMX Mod X Dev Team
|
||||||
FileDescription=
|
FileDescription=
|
||||||
FileVersion=1.3.0.31
|
FileVersion=1.3.0.32
|
||||||
InternalName=
|
InternalName=
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -19,6 +19,8 @@ function CountChars(eIn: String; eChar: Char): Integer;
|
||||||
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean; eRemoveComments: Boolean): String;
|
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean; eRemoveComments: Boolean): String;
|
||||||
function GetMatchingBrace(eString: String): Integer;
|
function GetMatchingBrace(eString: String): Integer;
|
||||||
function GetColoredLine(eLine: Integer): String;
|
function GetColoredLine(eLine: Integer): String;
|
||||||
|
function GetFunctionPos: Integer;
|
||||||
|
function GetCurrFunc: String;
|
||||||
|
|
||||||
function GetRTFText(ARichEdit: TRichedit): string;
|
function GetRTFText(ARichEdit: TRichedit): string;
|
||||||
procedure SetRTFText(ARichEdit: TRichedit; ARTFText: String);
|
procedure SetRTFText(ARichEdit: TRichedit; ARTFText: String);
|
||||||
|
@ -448,4 +450,30 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetFunctionPos: Integer;
|
||||||
|
var eStr: String;
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
eStr := StringReplace(frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
|
||||||
|
while Between(eStr, '"', '"') <> '' do
|
||||||
|
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
||||||
|
while Between(eStr, '{', '}') <> '' do
|
||||||
|
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
||||||
|
for i := 0 to Length(eStr) -1 do begin
|
||||||
|
if eStr[i] = ',' then
|
||||||
|
Result := Result +1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetCurrFunc: String;
|
||||||
|
var eStr: String;
|
||||||
|
begin
|
||||||
|
eStr := frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber];
|
||||||
|
if Pos('(', eStr) = 0 then
|
||||||
|
Result := ''
|
||||||
|
else
|
||||||
|
Result := Trim(Copy(eStr, 1, Pos('(', eStr)));
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -6,8 +6,8 @@ uses SysUtils, Classes, Windows, Forms, Graphics;
|
||||||
|
|
||||||
procedure GenerateSimpleMenu;
|
procedure GenerateSimpleMenu;
|
||||||
|
|
||||||
{ Yes, this is from AMXX-Edit v2. I'm too lazy to rewrite it... }
|
{ Yes, a part is copied from AMXX-Edit v2. I'm too lazy to rewrite everything... }
|
||||||
{ >:( }
|
{ gaben }
|
||||||
|
|
||||||
function AddOldMenu: Boolean;
|
function AddOldMenu: Boolean;
|
||||||
function AddOldPlayerMenu: Boolean;
|
function AddOldPlayerMenu: Boolean;
|
||||||
|
@ -20,7 +20,8 @@ function PluginInitLine: Integer;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses UnitCodeUtils, UnitfrmMain, UnitfrmMenuGenerator, UnitLanguages;
|
uses UnitCodeUtils, UnitfrmMain, UnitfrmMenuGenerator, UnitLanguages,
|
||||||
|
UnitMainTools;
|
||||||
|
|
||||||
function GetLine(eExpression: String; eAllowFunction, eBreak: Boolean): Integer;
|
function GetLine(eExpression: String; eAllowFunction, eBreak: Boolean): Integer;
|
||||||
var i: integer;
|
var i: integer;
|
||||||
|
@ -99,6 +100,9 @@ begin
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
MessageBox(frmMenuGenerator.Handle, PChar(lInvalidPlugin), PChar(Application.Title), MB_ICONERROR);
|
MessageBox(frmMenuGenerator.Handle, PChar(lInvalidPlugin), PChar(Application.Title), MB_ICONERROR);
|
||||||
|
|
||||||
|
ActiveDoc.Modified := True;
|
||||||
|
frmMain.mnuModified.Caption := lModified;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Normal Menu }
|
{ Normal Menu }
|
||||||
|
@ -159,11 +163,9 @@ begin
|
||||||
eStr.Add('}');
|
eStr.Add('}');
|
||||||
// Insert
|
// Insert
|
||||||
AddIfDoesntExist('amxmodx');
|
AddIfDoesntExist('amxmodx');
|
||||||
i := GetFirst('#define', True) +2;
|
i := GetLast('#define', True) +1;
|
||||||
if i = 1 then
|
if i = 0 then
|
||||||
i := GetFirst('#include', True) +2;
|
i := GetLast('#include', True) +1;
|
||||||
if i = 1 then
|
|
||||||
i := 0;
|
|
||||||
|
|
||||||
frmMain.sciEditor.Lines.Insert(i, Format('#define Keys%s %s', [frmMenuGenerator.txtMenuName.Text, DefinedKeys]));
|
frmMain.sciEditor.Lines.Insert(i, Format('#define Keys%s %s', [frmMenuGenerator.txtMenuName.Text, DefinedKeys]));
|
||||||
frmMain.sciEditor.Lines.Text := frmMain.sciEditor.Lines.Text + #13 + eStr.Text;
|
frmMain.sciEditor.Lines.Text := frmMain.sciEditor.Lines.Text + #13 + eStr.Text;
|
||||||
|
@ -183,6 +185,8 @@ begin
|
||||||
frmMain.sciEditor.Lines.Insert(i, ' register_menucmd(register_menuid("' + frmMenuGenerator.txtMenuName.Text + '"), Keys' + frmMenuGenerator.txtMenuName.Text + ', "Pressed' + frmMenuGenerator.txtMenuName.Text + '")');
|
frmMain.sciEditor.Lines.Insert(i, ' register_menucmd(register_menuid("' + frmMenuGenerator.txtMenuName.Text + '"), Keys' + frmMenuGenerator.txtMenuName.Text + ', "Pressed' + frmMenuGenerator.txtMenuName.Text + '")');
|
||||||
end;
|
end;
|
||||||
eStr.Free;
|
eStr.Free;
|
||||||
|
ActiveDoc.Modified := True;
|
||||||
|
frmMain.mnuModified.Caption := lModified;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Player Menu }
|
{ Player Menu }
|
||||||
|
@ -312,14 +316,14 @@ begin
|
||||||
end;
|
end;
|
||||||
Delete(DefinedKeys, 1, 1);
|
Delete(DefinedKeys, 1, 1);
|
||||||
end;
|
end;
|
||||||
i := GetLast('#define', True) +2;
|
i := GetLast('#define', True) +1;
|
||||||
if i = 1 then
|
if i = 0 then
|
||||||
i := GetLast('#include', True) +2;
|
i := GetLast('#include', True) +1;
|
||||||
if i = 1 then
|
|
||||||
i := 0;
|
|
||||||
frmMain.sciEditor.Lines.Insert(i, Format('#define Keys%s %s', [frmMenuGenerator.txtMenuName.Text, DefinedKeys]));
|
frmMain.sciEditor.Lines.Insert(i, Format('#define Keys%s %s', [frmMenuGenerator.txtMenuName.Text, DefinedKeys]));
|
||||||
frmMain.sciEditor.Lines.Insert(i +1, 'new MenuPos' + frmMenuGenerator.txtMenuName.Text);
|
frmMain.sciEditor.Lines.Insert(i +1, '');
|
||||||
frmMain.sciEditor.Lines.Insert(i +2, 'new MenuPlayers' + frmMenuGenerator.txtMenuName.Text + '[32]');
|
frmMain.sciEditor.Lines.Insert(i +2, 'new MenuPos' + frmMenuGenerator.txtMenuName.Text);
|
||||||
|
frmMain.sciEditor.Lines.Insert(i +3, 'new MenuPlayers' + frmMenuGenerator.txtMenuName.Text + '[32]');
|
||||||
{ Register }
|
{ Register }
|
||||||
i := GetFirst('register_plugin', True) +2;
|
i := GetFirst('register_plugin', True) +2;
|
||||||
if i = 1 then
|
if i = 1 then
|
||||||
|
@ -344,7 +348,7 @@ begin
|
||||||
eStr.Add('public ShowMenu' + frmMenuGenerator.txtMenuName.Text + '(id, position) {');
|
eStr.Add('public ShowMenu' + frmMenuGenerator.txtMenuName.Text + '(id, position) {');
|
||||||
if frmMenuGenerator.chkAddComment.Checked then
|
if frmMenuGenerator.chkAddComment.Checked then
|
||||||
eStr.Add(' // Menu stuff //');
|
eStr.Add(' // Menu stuff //');
|
||||||
eStr.Add(' if (position < 0) { return 0 }-/*');
|
eStr.Add(' if (position < 0) { return 0; }');
|
||||||
eStr.Add(' ');
|
eStr.Add(' ');
|
||||||
eStr.Add(' new i, k');
|
eStr.Add(' new i, k');
|
||||||
eStr.Add(' new MenuBody[255]');
|
eStr.Add(' new MenuBody[255]');
|
||||||
|
@ -356,8 +360,8 @@ begin
|
||||||
eStr.Add(' get_players(MenuPlayers' + frmMenuGenerator.txtMenuName.Text + ', Num)');
|
eStr.Add(' get_players(MenuPlayers' + frmMenuGenerator.txtMenuName.Text + ', Num)');
|
||||||
eStr.Add(' if (Start >= Num) { Start = position = MenuPos' + frmMenuGenerator.txtMenuName.Text + ' = 0; }');
|
eStr.Add(' if (Start >= Num) { Start = position = MenuPos' + frmMenuGenerator.txtMenuName.Text + ' = 0; }');
|
||||||
eCurLine := GetColoredMenu;
|
eCurLine := GetColoredMenu;
|
||||||
eCurLine := Copy(eCurLine, 1, Pos('$players', eCurLine) -3);
|
eCurLine := Copy(eCurLine, 1, Pos('$players', eCurLine) -5);
|
||||||
Insert('\R%d/%d^n\w', eCurLine, Pos('^n', eCurLine));
|
Insert('\R%d/%d', eCurLine, Pos('^n', eCurLine));
|
||||||
eStr.Add(' new Len = format(MenuBody, 255, "' + eCurLine + '", position+1, (Num / ' + IntToStr(ePlayersTo - ePlayersFrom) + ' + ((Num % ' + IntToStr(ePlayersTo - ePlayersFrom) + ') ? 1 : 0 )) )');
|
eStr.Add(' new Len = format(MenuBody, 255, "' + eCurLine + '", position+1, (Num / ' + IntToStr(ePlayersTo - ePlayersFrom) + ' + ((Num % ' + IntToStr(ePlayersTo - ePlayersFrom) + ') ? 1 : 0 )) )');
|
||||||
eStr.Add(' new End = Start + ' + IntToStr(ePlayersTo - ePlayersFrom));
|
eStr.Add(' new End = Start + ' + IntToStr(ePlayersTo - ePlayersFrom));
|
||||||
if eExit = 0 then
|
if eExit = 0 then
|
||||||
|
@ -386,7 +390,7 @@ begin
|
||||||
// eStr.Add(' }');
|
// eStr.Add(' }');
|
||||||
// end
|
// end
|
||||||
// else begin
|
// else begin
|
||||||
eStr.Add(' Keys |= (i<<CurrentKey++)');
|
eStr.Add(' Keys |= (1<<CurrentKey++)');
|
||||||
eStr.Add(' Len += format(MenuBody[Len], (255-Len), "' + PrepareItem(ePlayerFormat, False) + '", CurrentKey, UserName)');
|
eStr.Add(' Len += format(MenuBody[Len], (255-Len), "' + PrepareItem(ePlayerFormat, False) + '", CurrentKey, UserName)');
|
||||||
// end;
|
// end;
|
||||||
eStr.Add(' }');
|
eStr.Add(' }');
|
||||||
|
@ -443,6 +447,8 @@ begin
|
||||||
MessageBox(frmMenuGenerator.Handle, PChar('An error occured while inserting code!'), 'Warning', MB_ICONWARNING);
|
MessageBox(frmMenuGenerator.Handle, PChar('An error occured while inserting code!'), 'Warning', MB_ICONWARNING);
|
||||||
end;
|
end;
|
||||||
eStr.Free;
|
eStr.Free;
|
||||||
|
frmMain.mnuModified.Caption := lModified;
|
||||||
|
ActiveDoc.Modified := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Functions }
|
{ Functions }
|
||||||
|
|
|
@ -40,12 +40,15 @@ var eLookedUpIncluded: TStringList;
|
||||||
function UpdateIncPath(eInput: string): string;
|
function UpdateIncPath(eInput: string): string;
|
||||||
begin
|
begin
|
||||||
eInput := StringReplace(Trim(eInput), '/', '\', [rfReplaceAll]);
|
eInput := StringReplace(Trim(eInput), '/', '\', [rfReplaceAll]);
|
||||||
if FileExists(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + eInput + '.inc') then
|
if ExtractFileExt(eInput) = '' then
|
||||||
Result := ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + eInput + '.inc'
|
eInput := eInput + '.inc';
|
||||||
else if FileExists(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + 'include\' + eInput + '.inc') then
|
|
||||||
Result := ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + 'include\' + eInput + '.inc'
|
if FileExists(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + eInput) then
|
||||||
else if (FileExists(ExtractFilePath(ActiveDoc.FileName) + eInput + '.inc')) then
|
Result := ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + eInput
|
||||||
Result := ExtractFilePath(ActiveDoc.FileName) + eInput + '.inc'
|
else if FileExists(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + 'include\' + eInput) then
|
||||||
|
Result := ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + 'include\' + eInput
|
||||||
|
else if (FileExists(ExtractFilePath(ActiveDoc.FileName) + eInput)) then
|
||||||
|
Result := ExtractFilePath(ActiveDoc.FileName) + eInput
|
||||||
else
|
else
|
||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
@ -133,21 +136,10 @@ begin
|
||||||
{ Included }
|
{ Included }
|
||||||
if (IsAtStart('#include', eBackup)) then begin
|
if (IsAtStart('#include', eBackup)) then begin
|
||||||
eString := StringReplace(eBackup, '/', '\', [rfReplaceAll]);
|
eString := StringReplace(eBackup, '/', '\', [rfReplaceAll]);
|
||||||
if Between(eString, '<', '>') <> '' then begin
|
if Between(eString, '<', '>') <> '' then
|
||||||
eString := Between(eString, '<', '>');
|
eString := Between(eString, '<', '>')
|
||||||
if ExtractFileExt(eString) <> '' then
|
else if Between(eString, '"', '"') <> '' then
|
||||||
ChangeFileExt(eString, '');
|
|
||||||
end
|
|
||||||
else if Between(eString, '"', '"') <> '' then begin
|
|
||||||
eString := Between(eString, '"', '"');
|
eString := Between(eString, '"', '"');
|
||||||
if ExtractFileExt(eString) <> '' then
|
|
||||||
ChangeFileExt(eString, '');
|
|
||||||
end
|
|
||||||
else begin
|
|
||||||
eString := Trim(eString);
|
|
||||||
if ExtractFileExt(eString) <> '' then
|
|
||||||
ChangeFileExt(eString, '');
|
|
||||||
end;
|
|
||||||
eString := Trim(eString);
|
eString := Trim(eString);
|
||||||
Result.Included.AddObject(eString, TObject(i));
|
Result.Included.AddObject(eString, TObject(i));
|
||||||
|
|
||||||
|
@ -273,6 +265,7 @@ begin
|
||||||
if Pos('operator', eTemp) = 1 then
|
if Pos('operator', eTemp) = 1 then
|
||||||
k := 6;
|
k := 6;
|
||||||
|
|
||||||
|
eTemp := RemoveSemicolon(eTemp);
|
||||||
if k < 5 then begin
|
if k < 5 then begin
|
||||||
case k of
|
case k of
|
||||||
0: Result.CallTips.Add(eTemp + '-> ' + FileName + ', function');
|
0: Result.CallTips.Add(eTemp + '-> ' + FileName + ', function');
|
||||||
|
@ -360,6 +353,7 @@ begin
|
||||||
if (Pos(':', eTemp) <> 0) and (Pos(':', eTemp) < Pos('(', eTemp)) then
|
if (Pos(':', eTemp) <> 0) and (Pos(':', eTemp) < Pos('(', eTemp)) then
|
||||||
Delete(eTemp, 1, Pos(':', eTemp));
|
Delete(eTemp, 1, Pos(':', eTemp));
|
||||||
|
|
||||||
|
eTemp := RemoveSemicolon(eTemp);
|
||||||
if (Pos('enum', eTemp) = Pos('operator', eTemp)) and (Pos('enum', eTemp) = 0) then
|
if (Pos('enum', eTemp) = Pos('operator', eTemp)) and (Pos('enum', eTemp) = 0) then
|
||||||
Result.CallTips.Add(eTemp + '-> ' + FileName + ', ' + Trim(Copy(eString, 1, Pos(#32, eString) -1)));
|
Result.CallTips.Add(eTemp + '-> ' + FileName + ', ' + Trim(Copy(eString, 1, Pos(#32, eString) -1)));
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
object frmMain: TfrmMain
|
object frmMain: TfrmMain
|
||||||
Left = 257
|
Left = 257
|
||||||
Top = 302
|
Top = 297
|
||||||
Width = 888
|
Width = 888
|
||||||
Height = 646
|
Height = 646
|
||||||
Caption = 'AMXX-Studio'
|
Caption = 'AMXX-Studio'
|
||||||
|
@ -756,6 +756,7 @@ object frmMain: TfrmMain
|
||||||
Align = alClient
|
Align = alClient
|
||||||
OnModified = sciEditorModified
|
OnModified = sciEditorModified
|
||||||
OnDblClick = sciEditorDblClick
|
OnDblClick = sciEditorDblClick
|
||||||
|
OnCallTipClick = sciEditorCallTipClick
|
||||||
OnKeyUp = sciEditorKeyUp
|
OnKeyUp = sciEditorKeyUp
|
||||||
OnKeyDown = sciEditorKeyDown
|
OnKeyDown = sciEditorKeyDown
|
||||||
OnKeyPress = sciEditorKeyPress
|
OnKeyPress = sciEditorKeyPress
|
||||||
|
|
|
@ -1704,6 +1704,8 @@ begin
|
||||||
eStr := Format(GetIndents + 'set_hudmessage(%u, %u, %u, %s, %s, 0, 6.0, %s)', [GetRValue(frmHudMsgGenerator.CurrColor), GetGValue(frmHudMsgGenerator.CurrColor), GetBValue(frmHudMsgGenerator.CurrColor), Dot(frmHudMsgGenerator.txtXPos.Text), Dot(frmHudMsgGenerator.txtYPos.Text), Dot(frmHudMsgGenerator.txtTimeToShow.Text)]);
|
eStr := Format(GetIndents + 'set_hudmessage(%u, %u, %u, %s, %s, 0, 6.0, %s)', [GetRValue(frmHudMsgGenerator.CurrColor), GetGValue(frmHudMsgGenerator.CurrColor), GetBValue(frmHudMsgGenerator.CurrColor), Dot(frmHudMsgGenerator.txtXPos.Text), Dot(frmHudMsgGenerator.txtYPos.Text), Dot(frmHudMsgGenerator.txtTimeToShow.Text)]);
|
||||||
eStr := eStr + #13#10 + GetIndents + 'show_hudmessage(id, "' + frmHudMsgGenerator.txtText.Text + '")';
|
eStr := eStr + #13#10 + GetIndents + 'show_hudmessage(id, "' + frmHudMsgGenerator.txtText.Text + '")';
|
||||||
sciEditor.Lines.Insert(sciEditor.GetCurrentLineNumber, eStr);
|
sciEditor.Lines.Insert(sciEditor.GetCurrentLineNumber, eStr);
|
||||||
|
mnuModified.Caption := lModified;
|
||||||
|
ActiveDoc.Modified := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1968,22 +1970,6 @@ end;
|
||||||
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
|
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
|
||||||
const Position: Integer; ListToDisplay: TStrings;
|
const Position: Integer; ListToDisplay: TStrings;
|
||||||
var CancelDisplay: Boolean);
|
var CancelDisplay: Boolean);
|
||||||
function GetFunctionPos: Integer;
|
|
||||||
var eStr: String;
|
|
||||||
i: integer;
|
|
||||||
begin
|
|
||||||
Result := 0;
|
|
||||||
eStr := StringReplace(sciEditor.Lines[sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
|
|
||||||
while Between(eStr, '"', '"') <> '' do
|
|
||||||
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
|
||||||
while Between(eStr, '{', '}') <> '' do
|
|
||||||
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
|
||||||
for i := 0 to Length(eStr) -1 do begin
|
|
||||||
if eStr[i] = ',' then
|
|
||||||
Result := Result +1;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
var eCurrStyle: Integer;
|
var eCurrStyle: Integer;
|
||||||
eFunction: String;
|
eFunction: String;
|
||||||
i: integer;
|
i: integer;
|
||||||
|
@ -1997,15 +1983,9 @@ begin
|
||||||
eCurrStyle := GetStyleAt(sciEditor.SelStart).StyleNumber;
|
eCurrStyle := GetStyleAt(sciEditor.SelStart).StyleNumber;
|
||||||
|
|
||||||
if (ActiveDoc.Highlighter = 'Pawn') or (ActiveDoc.Highlighter = 'C++') then begin
|
if (ActiveDoc.Highlighter = 'Pawn') or (ActiveDoc.Highlighter = 'C++') then begin
|
||||||
eFunction := '';
|
eFunction := GetCurrFunc;
|
||||||
for i := 0 to jviCode.Root.Count -1 do begin
|
|
||||||
if jviCode.Root.Items[i].DisplayName = 'Function Call' then begin
|
|
||||||
eFunction := jviCode.Root.Items[i].Items[0].DisplayValue;
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
if eFunction <> '' then begin
|
if eFunction <> '' then begin
|
||||||
eFunction := LowerCase(Trim(eFunction));
|
eFunction := LowerCase(eFunction);
|
||||||
for i := 0 to eACList.Count -1 do begin
|
for i := 0 to eACList.Count -1 do begin
|
||||||
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
|
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
|
||||||
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
|
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
|
||||||
|
@ -2106,6 +2086,7 @@ end;
|
||||||
|
|
||||||
procedure TfrmMain.mnuMenuGeneratorClick(Sender: TObject);
|
procedure TfrmMain.mnuMenuGeneratorClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
frmMenuGenerator.jplMain.ActivePage := frmMenuGenerator.jspSelectType;
|
||||||
frmMenuGenerator.ShowModal;
|
frmMenuGenerator.ShowModal;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2153,36 +2134,14 @@ end;
|
||||||
procedure TfrmMain.sciCallTipsBeforeShow(Sender: TObject;
|
procedure TfrmMain.sciCallTipsBeforeShow(Sender: TObject;
|
||||||
const Position: Integer; ListToDisplay: TStrings;
|
const Position: Integer; ListToDisplay: TStrings;
|
||||||
var CancelDisplay: Boolean);
|
var CancelDisplay: Boolean);
|
||||||
function GetFunctionPos: Integer;
|
|
||||||
var eStr: String;
|
|
||||||
i: integer;
|
|
||||||
begin
|
|
||||||
Result := 0;
|
|
||||||
eStr := StringReplace(sciEditor.Lines[sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
|
|
||||||
while Between(eStr, '"', '"') <> '' do
|
|
||||||
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
|
||||||
while Between(eStr, '{', '}') <> '' do
|
|
||||||
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
|
||||||
for i := 0 to Length(eStr) -1 do begin
|
|
||||||
if eStr[i] = ',' then
|
|
||||||
Result := Result +1;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
var i: integer;
|
var i: integer;
|
||||||
eFunction: String;
|
eFunction: String;
|
||||||
begin
|
begin
|
||||||
CancelDisplay := not Plugin_CallTipShow(ListToDisplay.GetText);
|
CancelDisplay := not Plugin_CallTipShow(ListToDisplay.GetText);
|
||||||
if (frmSettings.chkAutoHideCT.Checked) and (jviCode.Root.Items[0].DisplayName = 'Function Call') then begin
|
if (frmSettings.chkAutoHideCT.Checked) and (jviCode.Root.Items[0].DisplayName = 'Function Call') then begin
|
||||||
for i := 0 to jviCode.Root.Count -1 do begin
|
eFunction := GetCurrFunc;
|
||||||
if jviCode.Root.Items[i].DisplayName = 'Function Call' then begin
|
|
||||||
eFunction := jviCode.Root.Items[i].Items[0].DisplayValue;
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if eFunction <> '' then begin
|
if eFunction <> '' then begin
|
||||||
eFunction := LowerCase(Trim(eFunction));
|
eFunction := LowerCase(eFunction);
|
||||||
for i := 0 to eACList.Count -1 do begin
|
for i := 0 to eACList.Count -1 do begin
|
||||||
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
|
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
|
||||||
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
|
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
|
||||||
|
@ -2197,9 +2156,26 @@ end;
|
||||||
|
|
||||||
procedure TfrmMain.sciEditorCallTipClick(Sender: TObject;
|
procedure TfrmMain.sciEditorCallTipClick(Sender: TObject;
|
||||||
const position: Integer);
|
const position: Integer);
|
||||||
|
var i: integer;
|
||||||
|
eFunc: String;
|
||||||
begin
|
begin
|
||||||
if not Plugin_CallTipClick(position) then
|
if not Plugin_CallTipClick(position) then begin
|
||||||
sciEditor.CallTipCancel;
|
sciEditor.CallTipCancel;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
eFunc := LowerCase(GetCurrFunc);
|
||||||
|
for i := 0 to sciCallTips.ApiStrings.Count -1 do begin
|
||||||
|
if Pos(eFunc, LowerCase(sciCallTips.ApiStrings[i])) = 1 then begin
|
||||||
|
eFunc := UpdateIncPath(Between(sciCallTips.ApiStrings[i], '-> ', ','));
|
||||||
|
if eFunc <> '' then begin
|
||||||
|
sciEditor.CallTipCancel;
|
||||||
|
PawnProjects.Open(eFunc);
|
||||||
|
end;
|
||||||
|
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.sciEditorAutoCSelection(Sender: TObject;
|
procedure TfrmMain.sciEditorAutoCSelection(Sender: TObject;
|
||||||
|
@ -2313,6 +2289,9 @@ begin
|
||||||
sciEditor.Lines.Add(#9 + 'return nIdx');
|
sciEditor.Lines.Add(#9 + 'return nIdx');
|
||||||
sciEditor.Lines.Add('}');
|
sciEditor.Lines.Add('}');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
mnuModified.Caption := lModified;
|
||||||
|
ActiveDoc.Modified := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2960,7 +2939,6 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.FormCreate(Sender: TObject);
|
procedure TfrmMain.FormCreate(Sender: TObject);
|
||||||
var i: integer;
|
|
||||||
begin
|
begin
|
||||||
sciEditor.StreamClass := TSciMyStream;
|
sciEditor.StreamClass := TSciMyStream;
|
||||||
eACList := TmxJsCollection.Create(TACFunction);
|
eACList := TmxJsCollection.Create(TACFunction);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user