Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 46 additions & 10 deletions all/GenerateWryeBashTags.pas
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
optionAddTags : Integer;
optionOutputLog : Integer;
bQuickExit : Boolean;
bFirstProcess : Boolean;
sGuiPlugin : String;


function wbIsOblivion: Boolean;
Expand Down Expand Up @@ -107,19 +109,15 @@ procedure LogError(s: String);


function Initialize: Integer;
var
kDescription : IInterface;
kHeader : IInterface;
sBashTags : String;
sDescription : String;
sMasterName : String;
r : IwbMainRecord;
i : Integer;
begin
sScriptName := 'GenerateWryeBashTags'; // working name
sScriptVersion := '1.6.3.0';
sScriptAuthor := 'fireundubh';
sScriptEmail := '[email protected]';
bFirstProcess := true;
sGuiPlugin := '';

Result := 0;

// clear
ClearMessages();
Expand All @@ -128,6 +126,28 @@ function Initialize: Integer;
AddMessage(#10);
LogInfo(sScriptName + ' v' + sScriptVersion + ' by ' + sScriptAuthor + ' <' + sScriptEmail + '>');
AddMessage(#10);
end;

function Process(e: IInterface): integer;
begin
if bFirstProcess then
begin
bFirstProcess := false;
sGuiPlugin := GetFileName(e);
Result := Work();
end
end;

function Work: Integer;
var
kDescription : IInterface;
kHeader : IInterface;
sBashTags : String;
sDescription : String;
sMasterName : String;
r : IwbMainRecord;
i : Integer;
begin

optionAddTags := mrNo;
optionOutputLog := mrYes;
Expand Down Expand Up @@ -1976,9 +1996,14 @@ function Configure(asCaption: String): IwbFile;
btnCancel : TButton;
btnOk : TButton;
i : Integer;
iGuiPlugin : Integer;

kFile : IwbFile;

sName : String;

begin

Result := nil;

frm := TForm.Create(TForm(frmMain));
Expand Down Expand Up @@ -2033,14 +2058,25 @@ function Configure(asCaption: String): IwbFile;
cbbPlugins.DoubleBuffered := True;
cbbPlugins.TabOrder := 2;

iGuiPlugin := -1;
for i := 0 to Pred(FileCount) do
begin
kFile := FileByIndex(i);
if IsEditable(kFile) then
cbbPlugins.Items.Add(GetFileName(kFile));
begin
sName := GetFileName(kFile);
cbbPlugins.Items.Add(sName);
if CompareText(sName, sGuiPlugin) = 0 then
iGuiPlugin := Pred(cbbPlugins.Items.Count);
end;
end;

cbbPlugins.ItemIndex := Pred(cbbPlugins.Items.Count);
if iGuiPlugin = -1 then
begin
cbbPlugins.ItemIndex := Pred(cbbPlugins.Items.Count);
end else begin
cbbPlugins.ItemIndex := iGuiPlugin;
end

btnOk := TButton.Create(frm);
btnOk.Parent := frm;
Expand Down