Updated plugin system

This commit is contained in:
Christian Hammacher 2005-08-27 01:47:15 +00:00
parent 270d898f82
commit e15761b79a
4 changed files with 15 additions and 10 deletions

View File

@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=0 MinorVer=0
Release=0 Release=0
Build=9 Build=10
Debug=0 Debug=0
PreRelease=1 PreRelease=1
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.0.0.9 FileVersion=1.0.0.10
InternalName= InternalName=
LegalCopyright= LegalCopyright=
LegalTrademarks= LegalTrademarks=

Binary file not shown.

Binary file not shown.

View File

@ -34,7 +34,7 @@ type TCodeSnippetClick = function (pTitle, pCategory: PChar; pCode: PChar): Inte
type TIntegerArray = array of Integer; type TIntegerArray = array of Integer;
type TLoadInfo = record type TLoadInfo = record
{ Plugin Values } { Plugin values }
sPluginName: PChar; sPluginName: PChar;
sPluginDescription: PChar; sPluginDescription: PChar;
{ Form Handles } { Form Handles }
@ -66,7 +66,7 @@ type TLoadInfo = record
end; end;
type PLoadInfo = ^TLoadInfo; type PLoadInfo = ^TLoadInfo;
TLoadPlugin = procedure (var LoadInfo: PLoadInfo); cdecl; TLoadPlugin = procedure (LoadInfo: PLoadInfo); cdecl;
TUnloadPlugin = procedure; cdecl; TUnloadPlugin = procedure; cdecl;
procedure SendToMainApp(eData: String); procedure SendToMainApp(eData: String);
@ -188,12 +188,17 @@ begin
if @eFunc2 <> nil then begin if @eFunc2 <> nil then begin
if @eFunc <> nil then begin if @eFunc <> nil then begin
ListItem.Data := Pointer(eHandle); try
ListItem.SubItems[2] := 'Loaded'; LoadInfo := @eLoadInfo;
LoadInfo := @eLoadInfo; eFunc(LoadInfo);
eFunc(LoadInfo); ListItem.Data := Pointer(eHandle);
ListItem.Caption := eLoadInfo.sPluginName; ListItem.Caption := eLoadInfo.sPluginName;
ListItem.SubItems[1] := eLoadInfo.sPluginDescription; ListItem.SubItems[1] := eLoadInfo.sPluginDescription;
ListItem.SubItems[2] := 'Loaded';
except
on E: Exception do
Application.MessageBox(PChar(E.Message), PChar(Application.Title), MB_ICONERROR);
end;
end end
else else
MessageBox(Application.Handle, PChar('Error loading plugin:' + #13 + 'pftPluginLoad function not found.'), PChar(ExtractFileName(ExtractFilePath(ParamStr(0)) + 'plugins\' + ListItem.SubItems[0])), MB_ICONERROR); MessageBox(Application.Handle, PChar('Error loading plugin:' + #13 + 'pftPluginLoad function not found.'), PChar(ExtractFileName(ExtractFilePath(ParamStr(0)) + 'plugins\' + ListItem.SubItems[0])), MB_ICONERROR);