diff --git a/editor/studio/AMXX_Studio.dof b/editor/studio/AMXX_Studio.dof index 96e0cfd0..0f0a3fdf 100755 --- a/editor/studio/AMXX_Studio.dof +++ b/editor/studio/AMXX_Studio.dof @@ -115,7 +115,7 @@ AutoIncBuild=1 MajorVer=1 MinorVer=4 Release=0 -Build=8 +Build=12 Debug=0 PreRelease=0 Special=0 @@ -126,7 +126,7 @@ CodePage=1252 [Version Info Keys] CompanyName=AMX Mod X Dev Team FileDescription= -FileVersion=1.4.0.8 +FileVersion=1.4.0.12 InternalName=gaben LegalCopyright=AMX Mod X Dev Team LegalTrademarks= diff --git a/editor/studio/AMXX_Studio.dpr b/editor/studio/AMXX_Studio.dpr index c386100f..36660faa 100755 --- a/editor/studio/AMXX_Studio.dpr +++ b/editor/studio/AMXX_Studio.dpr @@ -1,6 +1,11 @@ program AMXX_Studio; uses + madExcept, + madLinkDisAsm, + madListHardware, + madListProcesses, + madListModules, Forms, Windows, Classes, diff --git a/editor/studio/AMXX_Studio.exe b/editor/studio/AMXX_Studio.exe index 4d066059..2c588996 100755 Binary files a/editor/studio/AMXX_Studio.exe and b/editor/studio/AMXX_Studio.exe differ diff --git a/editor/studio/AMXX_Studio.res b/editor/studio/AMXX_Studio.res index 1acd167a..8277c7a2 100755 Binary files a/editor/studio/AMXX_Studio.res and b/editor/studio/AMXX_Studio.res differ diff --git a/editor/studio/UnitCodeUtils.pas b/editor/studio/UnitCodeUtils.pas index 9538eb75..50e13838 100755 --- a/editor/studio/UnitCodeUtils.pas +++ b/editor/studio/UnitCodeUtils.pas @@ -455,26 +455,69 @@ var eStr: String; i: integer; begin Result := 0; - eStr := StringReplace(frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]); eStr := Copy(eStr, 1, frmMain.sciEditor.GetCaretInLine); + eStr := StringReplace(frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]); + if (Length(eStr) = 0) then exit; + 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 + for i := Length(eStr) -1 downto 1 do begin if eStr[i] = ',' then - Result := Result +1; + Result := Result +1 + else if eStr[i] = '(' then + exit; end; end; function GetCurrFunc: String; var eStr: String; + i: integer; + eStart, eEnd: integer; + eInString, eInArray: Boolean; begin + Result := ''; + eStart := 1; + eEnd := -1; + eInString := False; + eInArray := False; eStr := frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber]; - if Pos('(', eStr) = 0 then - Result := '' + eStr := StringReplace(eStr, '^"', 'AB', [rfReplaceAll]); // we don't need those + + if (Length(eStr) = 0) then exit; + + for i := frmMain.sciEditor.GetCaretInLine downto 1 do begin + if eStr[i] = '"' then + eInString := not eInString + else if (eStr[i] = '{') and (not eInString) then + eInArray := True + else if (eStr[i] = '}') and (not eInString) then + eInArray := False + else if (not eInArray) and (not eInString) and (eStr[i] = '(') then begin + eEnd := i-1; + break; + end; + end; + + if eEnd <> -1 then begin + for i := eEnd downto 1 do begin + if eStr[i] = '"' then + eInString := not eInString + else if (eStr[i] = '{') and (not eInString) then + eInArray := True + else if (eStr[i] = '}') and (not eInString) then + eInArray := False + else if (not eInArray) and (not eInString) and (eStr[i] = '(') then begin + eStart := i+1; + break; + end; + end; + end else - Result := Trim(Copy(eStr, 1, Pos('(', eStr) -1)); + exit; + + Result := Trim(Copy(eStr, eStart, eEnd - eStart + 1)); end; end. diff --git a/editor/studio/UnitMainTools.pas b/editor/studio/UnitMainTools.pas index 89d4d069..26d0c4ea 100755 --- a/editor/studio/UnitMainTools.pas +++ b/editor/studio/UnitMainTools.pas @@ -1010,6 +1010,12 @@ begin frmMain.sciEditor.SelLength := Document.SelLength; frmMain.sciEditor.LineScroll(0, (0 - frmMain.sciEditor.GetFirstVisibleLine) + Document.TopLine); end; + if frmMain.sciEditor.Caret.LineVisible <> frmSettings.chkShowCaret.Checked then + frmMain.sciEditor.Caret.LineVisible := frmSettings.chkShowCaret.Checked; + if frmMain.sciEditor.Caret.LineBackColor <> frmSettings.CaretBack then begin + frmMain.sciEditor.Caret.LineBackColor := frmSettings.CaretBack; + frmMain.sciEditor.Colors.SelBack := clHighlight; + end; frmMain.mnuRestoreBackup.Enabled := (FileExists(Document.FileName + '.bak')) and (not Document.Untitled); Screen.Cursor := crDefault; Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, False); diff --git a/editor/studio/UnitfrmAutoIndent.dfm b/editor/studio/UnitfrmAutoIndent.dfm index fa542a7e..ba11c685 100755 Binary files a/editor/studio/UnitfrmAutoIndent.dfm and b/editor/studio/UnitfrmAutoIndent.dfm differ diff --git a/editor/studio/UnitfrmAutoIndent.pas b/editor/studio/UnitfrmAutoIndent.pas index 0c2d8086..ebc26786 100755 --- a/editor/studio/UnitfrmAutoIndent.pas +++ b/editor/studio/UnitfrmAutoIndent.pas @@ -8,10 +8,11 @@ uses type TfrmAutoIndent = class(TForm) + cmdClose: TFlatButton; + pnlCheckboxes: TPanel; chkUnindentPressingClosingBrace: TFlatCheckBox; chkUnindentLine: TFlatCheckBox; chkIndentOpeningBrace: TFlatCheckBox; - cmdClose: TFlatButton; end; var diff --git a/editor/studio/UnitfrmMain.dfm b/editor/studio/UnitfrmMain.dfm index b5736665..22fecbd5 100755 --- a/editor/studio/UnitfrmMain.dfm +++ b/editor/studio/UnitfrmMain.dfm @@ -37,7 +37,7 @@ object frmMain: TfrmMain 000000000000000380000000000000000000000000000000000000000000} KeyPreview = True OldCreateOrder = False - Position = poDesktopCenter + Position = poScreenCenter OnClose = FormClose OnConstrainedResize = FormConstrainedResize OnCreate = FormCreate @@ -668,9 +668,9 @@ object frmMain: TfrmMain ThemeType = tttTBX OnActiveTabChange = tsMainActiveTabChange HiddenItems = <> - object tiPAWN: TSpTBXTabItem + object tiPawn: TSpTBXTabItem Checked = True - OnClick = tiPAWNClick + OnClick = tiPawnClick TabPosition = ttpBottom ThemeType = tttTBX CaptionW = 'Pawn Projects' @@ -756,7 +756,6 @@ object frmMain: TfrmMain Align = alClient OnModified = sciEditorModified OnDblClick = sciEditorDblClick - OnCallTipClick = sciEditorCallTipClick OnKeyUp = sciEditorKeyUp OnKeyDown = sciEditorKeyDown OnKeyPress = sciEditorKeyPress diff --git a/editor/studio/UnitfrmMain.pas b/editor/studio/UnitfrmMain.pas index 837646b9..5d9e86e8 100755 --- a/editor/studio/UnitfrmMain.pas +++ b/editor/studio/UnitfrmMain.pas @@ -1975,9 +1975,50 @@ end; procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject; const Position: Integer; ListToDisplay: TStrings; var CancelDisplay: Boolean); +function Matchstrings(Source, pattern: string): Boolean; +var pSource: array [0..255] of Char; + pPattern: array [0..255] of Char; + +function MatchPattern(element, pattern: PChar): Boolean; + function IsPatternWild(pattern: PChar): Boolean; + begin + Result := StrScan(pattern, '*') <> nil; + if not Result then Result := StrScan(pattern, '?') <> nil; + end; +begin + if 0 = StrComp(pattern, '*') then + Result := True + else if (element^ = Chr(0)) and (pattern^ <> Chr(0)) then + Result := False + else if element^ = Chr(0) then + Result := True + else + begin + case pattern^ of + '*': if MatchPattern(element, @pattern[1]) then + Result := True + else + Result := MatchPattern(@element[1], pattern); + '?': Result := MatchPattern(@element[1], @pattern[1]); + else + if element^ = pattern^ then + Result := MatchPattern(@element[1], @pattern[1]) + else + Result := False; + end; + end; +end; + +begin + StrPCopy(pSource, Source); + StrPCopy(pPattern, pattern); + Result := MatchPattern(pSource, pPattern); +end; + var eCurrStyle: Integer; eFunction: String; - i: integer; + eCmpList: TStringList; + i, k, j: integer; begin if not Plugin_AutoCompleteShow(ListToDisplay.GetText) then begin CancelDisplay := True; @@ -1987,15 +2028,35 @@ begin if (Started) and (Assigned(GetStyleAt(sciEditor.SelStart))) then begin eCurrStyle := GetStyleAt(sciEditor.SelStart).StyleNumber; - if (ActiveDoc.Highlighter = 'Pawn') or (ActiveDoc.Highlighter = 'C++') then begin - eFunction := GetCurrFunc; + if (ActiveDoc.Highlighter = 'Pawn') then begin + eFunction := LowerCase(GetCurrFunc); if eFunction <> '' then begin - eFunction := LowerCase(eFunction); for i := 0 to eACList.Count -1 do begin if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin - if Trim(TACFunction(eACList.Items[i]).Items[GetFunctionPos]) <> '' then - ListToDisplay.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll]); + if (Trim(TACFunction(eACList.Items[i]).Items[GetFunctionPos]) <> '') then begin + if (Pos('*', TACFunction(eACList.Items[i]).Items[GetFunctionPos]) = 0) and (Pos('?', TACFunction(eACList.Items[i]).Items[GetFunctionPos]) = 0) then + ListToDisplay.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll]) + else begin + eCmpList := TStringList.Create; + eCmpList.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll]); + for k := eCmpList.Count -1 downto 0 do begin + if (Pos('*', eCmpList[k]) <> 0) or (Pos('?', eCmpList[k]) <> 0) then begin + for j := 0 to ListToDisplay.Count -1 do begin + if Trim(ListToDisplay[j]) <> '' then begin + if (LowerCase(ListToDisplay[j][1]) = LowerCase(eCmpList[k][1])) then begin + if (MatchStrings(LowerCase(ListToDisplay[j]), LowerCase(eCmpList[k]))) then + eCmpList.Add(ListToDisplay[j]); + end; + end; + end; + eCmpList.Delete(k); + end; + end; + ListToDisplay.Assign(eCmpList); + eCmpList.Free; + end; + end; break; end; end; diff --git a/editor/studio/UnitfrmParamEdit.dfm b/editor/studio/UnitfrmParamEdit.dfm index f6efa8fa..028dcd26 100644 Binary files a/editor/studio/UnitfrmParamEdit.dfm and b/editor/studio/UnitfrmParamEdit.dfm differ diff --git a/editor/studio/UnitfrmParamEdit.pas b/editor/studio/UnitfrmParamEdit.pas index 333cb7c2..86fa9c37 100644 --- a/editor/studio/UnitfrmParamEdit.pas +++ b/editor/studio/UnitfrmParamEdit.pas @@ -15,6 +15,7 @@ type lblFunction: TLabel; txtFunction: TSpTBXEdit; lblItems: TLabel; + Label1: TLabel; end; var diff --git a/editor/studio/UnitfrmSettings.dfm b/editor/studio/UnitfrmSettings.dfm index 890cb938..2e745c8e 100755 --- a/editor/studio/UnitfrmSettings.dfm +++ b/editor/studio/UnitfrmSettings.dfm @@ -64,7 +64,7 @@ object frmSettings: TfrmSettings Top = 0 Width = 351 Height = 260 - ActivePage = jspCompiler + ActivePage = jspAutocompleteCheck PropagateEnable = False Align = alClient OnChange = jplSettingsChange @@ -1855,6 +1855,14 @@ object frmSettings: TfrmSettings Align = alTop Shape = bsTopLine end + object lblACHint: TLabel + Left = 2 + Top = 16 + Width = 312 + Height = 13 + Caption = 'This feature allows you to set your Autocomplete-Items manually' + Visible = False + end object cmdOK: TFlatButton Left = 416 Top = 7 diff --git a/editor/studio/UnitfrmSettings.pas b/editor/studio/UnitfrmSettings.pas index 0701d72a..49c8ab3e 100755 --- a/editor/studio/UnitfrmSettings.pas +++ b/editor/studio/UnitfrmSettings.pas @@ -206,6 +206,7 @@ type cmdAddFunction: TFlatButton; cmdRemFunction: TFlatButton; chkAutoHideCT: TFlatCheckBox; + lblACHint: TLabel; procedure jplSettingsChange(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -308,6 +309,7 @@ begin else lblCurrSetting.Caption := (jplSettings.ActivePage as TJvStandardPage).Caption; + lblACHint.Visible := jplSettings.ActivePage = jspAutocompleteCheck; txtPAWNOutputExit(Sender); txtCPPOutputChange(Sender); end; @@ -711,6 +713,8 @@ var eDir: String; begin if SelectDirectory(lSelectOutputPAWN, txtPAWNOutput.Text, eDir) then txtPAWNOutput.Text := eDir; + txtPAWNOutput.OnEnter(Self); + txtCPPOutput.OnEnter(Self); end; procedure TfrmSettings.cmdBrowseOutputCPPClick(Sender: TObject); @@ -718,6 +722,8 @@ var eDir: String; begin if SelectDirectory(lSelectOutputCPP, txtCPPOutput.Text, eDir) then txtCPPOutput.Text := eDir; + txtPAWNOutput.OnEnter(Self); + txtCPPOutput.OnEnter(Self); end; procedure TfrmSettings.txtPAWNOutputExit(Sender: TObject);