several bug fixes in the auto-update system, bumped version to 1.4.3 final and improved code snippets feature (can now append or insert snippet into new line)

This commit is contained in:
Christian Hammacher 2006-10-22 18:56:39 +00:00
parent ed43b8a5ac
commit 7b82bc7b76
11 changed files with 98 additions and 28 deletions

View File

@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=4 MinorVer=4
Release=3 Release=3
Build=0 Build=1
Debug=0 Debug=0
PreRelease=0 PreRelease=0
Special=0 Special=0
@ -126,11 +126,11 @@ CodePage=1252
[Version Info Keys] [Version Info Keys]
CompanyName=AMX Mod X Dev Team CompanyName=AMX Mod X Dev Team
FileDescription= FileDescription=
FileVersion=1.4.3.0 FileVersion=1.4.3.1
InternalName= InternalName=
LegalCopyright=AMX Mod X Dev Team LegalCopyright=AMX Mod X Dev Team
LegalTrademarks= LegalTrademarks=
OriginalFilename= OriginalFilename=
ProductName=AMXX-Studio ProductName=AMXX-Studio
ProductVersion=1.4.3.0 ProductVersion=1.4.3 final
Comments= Comments=

Binary file not shown.

Binary file not shown.

View File

@ -800,6 +800,8 @@ begin
eCurrLine := Between(eCurrLine, '(', ')', True); eCurrLine := Between(eCurrLine, '(', ')', True);
HideBracesAndStrings(eCurrLine, True); HideBracesAndStrings(eCurrLine, True);
eStr2.Text := StringReplace(eCurrLine, ',', #13, [rfReplaceAll]); eStr2.Text := StringReplace(eCurrLine, ',', #13, [rfReplaceAll]);
if (Trim(eStr2.Text) = ')') then
eStr2.Clear;
CreateCategory('Function Call'); CreateCategory('Function Call');
AddField('Function', 'Function Call', eVarName); AddField('Function', 'Function Call', eVarName);

View File

@ -751,6 +751,8 @@ begin
else else
eCPUSpeed := 1; // otherwise the program would hang up eCPUSpeed := 1; // otherwise the program would hang up
frmSettings.txtLangDir.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('Misc', 'LangDir', '')); frmSettings.txtLangDir.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('Misc', 'LangDir', ''));
if (frmSettings.txtLangDir.Text = '\') then
frmSettings.txtLangDir.Text := '';
frmSettings.chkShowStatusbar.Checked := eConfig.ReadBool('Misc', 'ShowStatusbar', True); frmSettings.chkShowStatusbar.Checked := eConfig.ReadBool('Misc', 'ShowStatusbar', True);
frmMain.sbStatus.Visible := frmSettings.chkShowStatusbar.Checked; frmMain.sbStatus.Visible := frmSettings.chkShowStatusbar.Checked;
end; end;

View File

@ -116,6 +116,11 @@ begin
if (Trim(eStr[k]) <> '') and (eStr[k] <> '}') then begin if (Trim(eStr[k]) <> '') and (eStr[k] <> '}') then begin
eTemp := Trim(RemoveSemicolon(eStr[k])); eTemp := Trim(RemoveSemicolon(eStr[k]));
if (IsAtStart('const', eTemp, False)) then begin
Delete(eTemp, 1, 5);
eTemp := Trim(eTemp);
end;
if Pos(':', eTemp) <> 0 then if Pos(':', eTemp) <> 0 then
eTemp := Copy(eTemp, Pos(':', eTemp) + 1, Length(eTemp)); eTemp := Copy(eTemp, Pos(':', eTemp) + 1, Length(eTemp));

Binary file not shown.

View File

@ -1,7 +1,7 @@
object frmMain: TfrmMain object frmMain: TfrmMain
Left = 189 Left = 184
Top = 114 Top = 77
Width = 888 Width = 893
Height = 648 Height = 648
Caption = 'AMXX-Studio' Caption = 'AMXX-Studio'
Color = clBtnFace Color = clBtnFace
@ -45,13 +45,13 @@ object frmMain: TfrmMain
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
object splRight: TSplitter object splRight: TSplitter
Left = 669 Left = 674
Top = 95 Top = 95
Height = 501 Height = 501
Align = alRight Align = alRight
end end
object spcRight1: TImage object spcRight1: TImage
Left = 877 Left = 882
Top = 95 Top = 95
Width = 3 Width = 3
Height = 501 Height = 501
@ -67,7 +67,7 @@ object frmMain: TfrmMain
object tbxTopDock: TSpTBXDock object tbxTopDock: TSpTBXDock
Left = 0 Left = 0
Top = 0 Top = 0
Width = 880 Width = 885
Height = 72 Height = 72
object tbxMenu: TSpTBXToolbar object tbxMenu: TSpTBXToolbar
Left = 0 Left = 0
@ -680,11 +680,11 @@ object frmMain: TfrmMain
object sbStatus: TSpTBXStatusBar object sbStatus: TSpTBXStatusBar
Left = 0 Left = 0
Top = 596 Top = 596
Width = 880 Width = 885
Height = 25 Height = 25
object mnuFilename: TSpTBXRightAlignSpacerItem object mnuFilename: TSpTBXRightAlignSpacerItem
Caption = 'Untitled.sma' Caption = 'Untitled.sma'
CustomWidth = 542 CustomWidth = 547
end end
object sepStatus0: TSpTBXSeparatorItem object sepStatus0: TSpTBXSeparatorItem
end end
@ -728,7 +728,7 @@ object frmMain: TfrmMain
object tbDocs: TJvTabBar object tbDocs: TJvTabBar
Left = 0 Left = 0
Top = 72 Top = 72
Width = 880 Width = 885
RightClickSelect = False RightClickSelect = False
Tabs = < Tabs = <
item item
@ -740,7 +740,7 @@ object frmMain: TfrmMain
OnMouseDown = tbDocsMouseDown OnMouseDown = tbDocsMouseDown
end end
object tcTools: TSpTBXTabControl object tcTools: TSpTBXTabControl
Left = 672 Left = 677
Top = 95 Top = 95
Width = 205 Width = 205
Height = 501 Height = 501
@ -950,7 +950,7 @@ object frmMain: TfrmMain
object pnlParent: TPanel object pnlParent: TPanel
Left = 3 Left = 3
Top = 95 Top = 95
Width = 666 Width = 671
Height = 501 Height = 501
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
@ -958,7 +958,7 @@ object frmMain: TfrmMain
object splOutput: TSplitter object splOutput: TSplitter
Left = 0 Left = 0
Top = 416 Top = 416
Width = 666 Width = 671
Height = 3 Height = 3
Cursor = crVSplit Cursor = crVSplit
Align = alBottom Align = alBottom
@ -967,7 +967,7 @@ object frmMain: TfrmMain
object sciEditor: TScintilla object sciEditor: TScintilla
Left = 0 Left = 0
Top = 0 Top = 0
Width = 666 Width = 671
Height = 416 Height = 416
Color = clWhite Color = clWhite
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
@ -4493,7 +4493,7 @@ object frmMain: TfrmMain
object lstOutput: TListBox object lstOutput: TListBox
Left = 0 Left = 0
Top = 419 Top = 419
Width = 666 Width = 671
Height = 82 Height = 82
Align = alBottom Align = alBottom
ItemHeight = 13 ItemHeight = 13

View File

@ -1071,9 +1071,30 @@ begin
end; end;
procedure TfrmMain.OnCodeSnippetClick(Sender: TObject); procedure TfrmMain.OnCodeSnippetClick(Sender: TObject);
var Snippet, Indentation: String;
Line: Integer;
begin begin
if Plugin_CodeSnippetClick(TSpTBXItem(Sender).Caption, GetCat, GetSnippet(GetCat, (Sender as TSpTBXItem).Caption)) then if Plugin_CodeSnippetClick(TSpTBXItem(Sender).Caption, GetCat, GetSnippet(GetCat, (Sender as TSpTBXItem).Caption)) then begin
sciEditor.SelText := GetSnippet(GetCat, (Sender as TSpTBXItem).Caption); Snippet := GetSnippet(GetCat, (Sender as TSpTBXItem).Caption);
if (Pos('!APPEND!' + #13, Snippet) = 1) then begin
Snippet := Copy(Snippet, Pos(#10, Snippet)+1, Length(Snippet));
Line := sciEditor.Lines.Add(Snippet);
end
else if (Pos('!INSERT!' + #13, Snippet) = 1) then begin
Indentation := sciEditor.Lines[sciEditor.GetCurrentLineNumber];
if (Trim(Indentation) <> '') then
Indentation := Copy(Indentation, 1, Pos(Copy(TrimLeft(Indentation), 1, 1), Indentation)-1);
Snippet := StringReplace(Snippet, #10, #10 + Indentation, [rfReplaceAll]);
Line := sciEditor.GetCurrentLineNumber;
sciEditor.Lines.Insert(Line, Copy(Snippet, Pos(#10, Snippet)+1, Length(Snippet)));
end
else begin
sciEditor.SelText := Snippet;
Line := sciEditor.GetCurrentLineNumber;
end;
sciEditor.GoToLine(Line);
end;
end; end;
procedure TfrmMain.mnuCopyMessageClick(Sender: TObject); procedure TfrmMain.mnuCopyMessageClick(Sender: TObject);

View File

@ -64,7 +64,7 @@ object frmSettings: TfrmSettings
Top = 0 Top = 0
Width = 351 Width = 351
Height = 260 Height = 260
ActivePage = jspCTSettings ActivePage = jspCodeSnippets
PropagateEnable = False PropagateEnable = False
Align = alClient Align = alClient
OnChange = jplSettingsChange OnChange = jplSettingsChange
@ -760,6 +760,9 @@ object frmSettings: TfrmSettings
ScrollBars = ssBoth ScrollBars = ssBoth
TabOrder = 1 TabOrder = 1
WantTabs = True WantTabs = True
OnChange = txtCodeSnippetChange
OnEnter = txtCodeSnippetEnter
OnExit = txtCodeSnippetExit
OnKeyUp = txtCodeSnippetKeyUp OnKeyUp = txtCodeSnippetKeyUp
end end
object cmdCSAdd: TFlatButton object cmdCSAdd: TFlatButton

View File

@ -277,6 +277,9 @@ type
procedure lvParamsDblClick(Sender: TObject); procedure lvParamsDblClick(Sender: TObject);
procedure cmdAddFunctionClick(Sender: TObject); procedure cmdAddFunctionClick(Sender: TObject);
procedure lstFunctionsClick(Sender: TObject); procedure lstFunctionsClick(Sender: TObject);
procedure txtCodeSnippetEnter(Sender: TObject);
procedure txtCodeSnippetExit(Sender: TObject);
procedure txtCodeSnippetChange(Sender: TObject);
public public
Foreground, Background: TColor; Foreground, Background: TColor;
CaretFore, CaretBack: TColor; CaretFore, CaretBack: TColor;
@ -339,9 +342,14 @@ begin
eReg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', False); eReg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', False);
{ AMXX } { AMXX }
AMXXDir := eReg.ReadString('ProgramFilesDir') + '\AMX Mod X\'; AMXXDir := eReg.ReadString('ProgramFilesDir') + '\AMX Mod X\';
if not DirectoryExists(AMXXDir) then if DirectoryExists(AMXXDir) then
AMXXDir := IncludeTrailingPathDelimiter(AMXXDir)
else
AMXXDir := ''; AMXXDir := '';
eReg.CloseKey; eReg.CloseKey;
{ Language Files }
if (DirectoryExists(AMXXDir + 'files\base\data\lang')) then
txtLangDir.Text := AMXXDir + 'files\base\data\lang';
{ Steam } { Steam }
if eReg.KeyExists('SOFTWARE\Valve\Steam') then begin if eReg.KeyExists('SOFTWARE\Valve\Steam') then begin
eReg.OpenKey('SOFTWARE\Valve\Steam', False); eReg.OpenKey('SOFTWARE\Valve\Steam', False);
@ -421,7 +429,7 @@ begin
eConfig.WriteString('Misc', 'DefaultPluginAuthor', GetUser); eConfig.WriteString('Misc', 'DefaultPluginAuthor', GetUser);
eConfig.WriteInteger('Misc', 'SaveNotesTo', 0); eConfig.WriteInteger('Misc', 'SaveNotesTo', 0);
eConfig.WriteInteger('Misc', 'CPUSpeed', 5); eConfig.WriteInteger('Misc', 'CPUSpeed', 5);
eConfig.WriteString('Misc', 'LangDir', ''); eConfig.WriteString('Misc', 'LangDir', txtLangDir.Text);
eConfig.WriteInteger('Misc', 'ShowStatusbar', 1); eConfig.WriteInteger('Misc', 'ShowStatusbar', 1);
eConfig.WriteInteger('Misc', 'WindowState', 0); eConfig.WriteInteger('Misc', 'WindowState', 0);
end; end;
@ -434,6 +442,8 @@ begin
2: frmMain.WindowState := wsMinimized; 2: frmMain.WindowState := wsMinimized;
end; end;
txtCodeSnippetExit(Sender);
PaintForeground(clBlack); PaintForeground(clBlack);
PaintBackground(clBlack); PaintBackground(clBlack);
PaintCaretFore(clBlack); PaintCaretFore(clBlack);
@ -778,6 +788,7 @@ begin
lstCodeSnippets.ItemIndex := lstCodeSnippets.Items.Add(eStr); lstCodeSnippets.ItemIndex := lstCodeSnippets.Items.Add(eStr);
AddSnippet(ftcCodeSnippets.Tabs[ftcCodeSnippets.ActiveTab], eStr, ''); AddSnippet(ftcCodeSnippets.Tabs[ftcCodeSnippets.ActiveTab], eStr, '');
txtCodeSnippet.Enabled := True; txtCodeSnippet.Enabled := True;
lstCodeSnippets.SetFocus;
lstCodeSnippetsClick(Sender); lstCodeSnippetsClick(Sender);
end end
else else
@ -805,7 +816,9 @@ procedure TfrmSettings.lstCodeSnippetsClick(Sender: TObject);
begin begin
cmdCSRemove.Enabled := lstCodeSnippets.ItemIndex <> -1; cmdCSRemove.Enabled := lstCodeSnippets.ItemIndex <> -1;
if cmdCSRemove.Enabled then if cmdCSRemove.Enabled then
txtCodeSnippet.Lines.Text := GetSnippet(ftcCodeSnippets.Tabs[ftcCodeSnippets.ActiveTab], lstCodeSnippets.Items[lstCodeSnippets.ItemIndex]); txtCodeSnippet.Lines.Text := GetSnippet(ftcCodeSnippets.Tabs[ftcCodeSnippets.ActiveTab], lstCodeSnippets.Items[lstCodeSnippets.ItemIndex])
else
txtCodeSnippetExit(Sender);
end; end;
procedure TfrmSettings.ftcCodeSnippetsTabChanged(Sender: TObject); procedure TfrmSettings.ftcCodeSnippetsTabChanged(Sender: TObject);
@ -815,8 +828,8 @@ begin
lstCodeSnippets.ItemIndex := 0 lstCodeSnippets.ItemIndex := 0
else else
txtCodeSnippet.Clear; txtCodeSnippet.Clear;
lstCodeSnippetsClick(Sender);
txtCodeSnippet.Enabled := lstCodeSnippets.Items.Count > 0; txtCodeSnippet.Enabled := lstCodeSnippets.Items.Count > 0;
lstCodeSnippetsClick(Sender);
cmdCSRemove.Enabled := lstCodeSnippets.ItemIndex <> -1; cmdCSRemove.Enabled := lstCodeSnippets.ItemIndex <> -1;
end; end;
@ -1250,4 +1263,28 @@ begin
end; end;
end; end;
procedure TfrmSettings.txtCodeSnippetEnter(Sender: TObject);
begin
if (txtCodeSnippet.Font.Color = $008396A0) and ((ActiveControl = txtCodeSnippet) or (txtCodeSnippet.Enabled)) then begin
txtCodeSnippet.Font.Color := clWindowText;
txtCodeSnippet.Text := '';
end;
end;
procedure TfrmSettings.txtCodeSnippetExit(Sender: TObject);
begin
if (txtCodeSnippet.Text = '') then begin
txtCodeSnippet.Lines.Text := 'Use "!APPEND!" to append or'#13'"!INSERT!" to insert the code'#13'snippet into a new line on click...';
txtCodeSnippet.Font.Color := $008396A0;
end;
end;
procedure TfrmSettings.txtCodeSnippetChange(Sender: TObject);
begin
if (txtCodeSnippet.Font.Color = $008396A0) then
txtCodeSnippet.Font.Color := clWindowText
else if (txtCodeSnippet.Text = '') and (ActiveControl <> txtCodeSnippet) then
txtCodeSnippetExit(Sender);
end;
end. end.