Skip to content

Commit

Permalink
Rename e to el
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Dec 17, 2020
1 parent 903ce5d commit e867e58
Show file tree
Hide file tree
Showing 26 changed files with 187 additions and 162 deletions.
4 changes: 2 additions & 2 deletions Edit scripts/ExportAll.fo76pas
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ begin
ExportAll.initialize();
end;

function process(e: IInterface): Integer;
function process(el: IInterface): Integer;
begin
ExportAll.process(e);
ExportAll.process(el);
end;

function finalize(): Integer;
Expand Down
25 changes: 25 additions & 0 deletions Edit scripts/ExportAll.fo76ptspas
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(**
* Exposes `ExportAll` to be run by double-clicking it.
*)
unit ExportAllX;

uses ExportAll;


function initialize(): Integer;
begin
ExportAll.initialize();
end;

function process(el: IInterface): Integer;
begin
ExportAll.process(el);
end;

function finalize(): Integer;
begin
ExportAll.finalize();
end;


end.
82 changes: 41 additions & 41 deletions Edit scripts/ExportAll.pas
Original file line number Diff line number Diff line change
Expand Up @@ -165,67 +165,67 @@ function initialize(): Integer;
end;
end;

function process(e: IInterface): Integer;
function process(el: IInterface): Integer;
begin
if _hasSelectedDump('ARMO.csv') and ExportTabularARMO.canProcess(e) then begin
ExportTabularARMO.process(e);
if _hasSelectedDump('ARMO.csv') and ExportTabularARMO.canProcess(el) then begin
ExportTabularARMO.process(el);
end;
if _hasSelectedDump('CLAS.csv') and ExportTabularCLAS.canProcess(e) then begin
ExportTabularCLAS.process(e);
if _hasSelectedDump('CLAS.csv') and ExportTabularCLAS.canProcess(el) then begin
ExportTabularCLAS.process(el);
end;
if _hasSelectedDump('COBJ.csv') and ExportTabularCOBJ.canProcess(e) then begin
ExportTabularCOBJ.process(e);
if _hasSelectedDump('COBJ.csv') and ExportTabularCOBJ.canProcess(el) then begin
ExportTabularCOBJ.process(el);
end;
if _hasSelectedDump('ENTM.csv') and ExportTabularENTM.canProcess(e) then begin
ExportTabularENTM.process(e);
if _hasSelectedDump('ENTM.csv') and ExportTabularENTM.canProcess(el) then begin
ExportTabularENTM.process(el);
end;
if _hasSelectedDump('FACT.csv') and ExportTabularFACT.canProcess(e) then begin
ExportTabularFACT.process(e);
if _hasSelectedDump('FACT.csv') and ExportTabularFACT.canProcess(el) then begin
ExportTabularFACT.process(el);
end;
if _hasSelectedDump('FLOR.csv') and ExportTabularFLOR.canProcess(e) then begin
ExportTabularFLOR.process(e);
if _hasSelectedDump('FLOR.csv') and ExportTabularFLOR.canProcess(el) then begin
ExportTabularFLOR.process(el);
end;
if _hasSelectedDump('GLOB.csv') and ExportTabularGLOB.canProcess(e) then begin
ExportTabularGLOB.process(e);
if _hasSelectedDump('GLOB.csv') and ExportTabularGLOB.canProcess(el) then begin
ExportTabularGLOB.process(el);
end;
if _hasSelectedDump('GMST.csv') and ExportTabularGMST.canProcess(e) then begin
ExportTabularGMST.process(e);
if _hasSelectedDump('GMST.csv') and ExportTabularGMST.canProcess(el) then begin
ExportTabularGMST.process(el);
end;
if _hasSelectedDump('IDs.csv') and ExportTabularIDs.canProcess(e) then begin
ExportTabularIDs.process(e);
if _hasSelectedDump('IDs.csv') and ExportTabularIDs.canProcess(el) then begin
ExportTabularIDs.process(el);
end;
if _hasSelectedDump('LVLI.csv') and ExportTabularLVLI.canProcess(e) then begin
ExportTabularLVLI.process(e);
if _hasSelectedDump('LVLI.csv') and ExportTabularLVLI.canProcess(el) then begin
ExportTabularLVLI.process(el);
end;
if _hasSelectedDump('MISC.csv') and ExportTabularMISC.canProcess(e) then begin
ExportTabularMISC.process(e);
if _hasSelectedDump('MISC.csv') and ExportTabularMISC.canProcess(el) then begin
ExportTabularMISC.process(el);
end;
if _hasSelectedDump('NPC_.csv') and ExportTabularNPC_.canProcess(e) then begin
ExportTabularNPC_.process(e);
if _hasSelectedDump('NPC_.csv') and ExportTabularNPC_.canProcess(el) then begin
ExportTabularNPC_.process(el);
end;
if _hasSelectedDump('OMOD.csv') and ExportTabularOMOD.canProcess(e) then begin
ExportTabularOMOD.process(e);
if _hasSelectedDump('OMOD.csv') and ExportTabularOMOD.canProcess(el) then begin
ExportTabularOMOD.process(el);
end;
if _hasSelectedDump('OTFT.csv') and ExportTabularOTFT.canProcess(e) then begin
ExportTabularOTFT.process(e);
if _hasSelectedDump('OTFT.csv') and ExportTabularOTFT.canProcess(el) then begin
ExportTabularOTFT.process(el);
end;
if _hasSelectedDump('RACE.csv') and ExportTabularRACE.canProcess(e) then begin
ExportTabularRACE.process(e);
if _hasSelectedDump('RACE.csv') and ExportTabularRACE.canProcess(el) then begin
ExportTabularRACE.process(el);
end;
if _hasSelectedDump('WEAP.csv') and ExportTabularWEAP.canProcess(e) then begin
ExportTabularWEAP.process(e);
if _hasSelectedDump('WEAP.csv') and ExportTabularWEAP.canProcess(el) then begin
ExportTabularWEAP.process(el);
end;
if _hasSelectedDump('BOOK.wiki') and ExportWikiBOOK.canProcess(e) then begin
ExportWikiBOOK.process(e);
if _hasSelectedDump('BOOK.wiki') and ExportWikiBOOK.canProcess(el) then begin
ExportWikiBOOK.process(el);
end;
if _hasSelectedDump('DIAL.wiki') and ExportWikiDIAL.canProcess(e) then begin
ExportWikiDIAL.process(e);
if _hasSelectedDump('DIAL.wiki') and ExportWikiDIAL.canProcess(el) then begin
ExportWikiDIAL.process(el);
end;
if _hasSelectedDump('NOTE.wiki') and ExportWikiNOTE.canProcess(e) then begin
ExportWikiNOTE.process(e);
if _hasSelectedDump('NOTE.wiki') and ExportWikiNOTE.canProcess(el) then begin
ExportWikiNOTE.process(el);
end;
if _hasSelectedDump('TERM.wiki') and ExportWikiTERM.canProcess(e) then begin
ExportWikiTERM.process(e);
if _hasSelectedDump('TERM.wiki') and ExportWikiTERM.canProcess(el) then begin
ExportWikiTERM.process(el);
end;
end;

Expand Down
78 changes: 39 additions & 39 deletions Edit scripts/ExportCore.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,125 +14,125 @@
(**
* Shorthand for [getEditValue].
*)
function gev(e: IwbElement): String;
function gev(el: IwbElement): String;
begin
result := getEditValue(e);
result := getEditValue(el);
end;

(**
* Shorthand for [elementBySignature].
*)
function eBySign(e: IwbContainer; sig: String): IwbElement;
function eBySign(el: IwbContainer; sig: String): IwbElement;
begin
result := elementBySignature(e, sig);
result := elementBySignature(el, sig);
end;

(**
* Shorthand for [elementByPath].
*)
function eByPath(e: IwbContainer; path: String): IwbElement;
function eByPath(el: IwbContainer; path: String): IwbElement;
begin
result := elementByPath(e, path);
result := elementByPath(el, path);
end;

(**
* Shorthand for [elementByName].
*)
function eByName(e: IwbContainer; nam: String): IwbElement;
function eByName(el: IwbContainer; nam: String): IwbElement;
begin
result := elementByName(e, nam);
result := elementByName(el, nam);
end;

(**
* Shorthand for [elementCount].
*)
function eCount(e: IwbContainer): Integer;
function eCount(el: IwbContainer): Integer;
begin
result := elementCount(e);
result := elementCount(el);
end;

(**
* Shorthand for [elementByIndex].
*)
function eByIndex(e: IwbContainer; i: Integer): IwbElement;
function eByIndex(el: IwbContainer; i: Integer): IwbElement;
begin
result := elementByIndex(e, i);
result := elementByIndex(el, i);
end;

(**
* Shorthand for calling [getEditValue] and [elementBySignature].
*)
function evBySign(e: IInterface; sig: String): String;
function evBySign(el: IInterface; sig: String): String;
begin
result := gev(eBySign(e, sig));
result := gev(eBySign(el, sig));
end;

(**
* Shorthand for calling [getEditValue] and [elementByPath].
*)
function evByPath(e: IInterface; path: String): String;
function evByPath(el: IInterface; path: String): String;
begin
result := gev(eByPath(e, path));
result := gev(eByPath(el, path));
end;

(**
* Shorthand for calling [getEditValue] and [elementByName].
*)
function evByName(e: IInterface; nam: String): String;
function evByName(el: IInterface; nam: String): String;
begin
result := gev(eByName(e, nam));
result := gev(eByName(el, nam));
end;

(**
* Shorthand for calling [getEditValue] and [elementByIndex].
*)
function evByIndex(e: IInterface; i: Integer): String;
function evByIndex(el: IInterface; i: Integer): String;
begin
result := gev(eByIndex(e, i));
result := gev(eByIndex(el, i));
end;

(**
* Shorthand for calling [linksTo] and [elementBySignature].
*)
function linkBySign(e: IInterface; sig: String): IInterface;
function linkBySign(el: IInterface; sig: String): IInterface;
begin
result := linksTo(eBySign(e, sig));
result := linksTo(eBySign(el, sig));
end;

(**
* Shorthand for calling [linksTo] and [elementByPath].
*)
function linkByPath(e: IInterface; path: String): IInterface;
function linkByPath(el: IInterface; path: String): IInterface;
begin
result := linksTo(eByPath(e, path));
result := linksTo(eByPath(el, path));
end;

(**
* Shorthand for calling [linksTo] and [elementByName].
*)
function linkByName(e: IInterface; nam: String): IInterface;
function linkByName(el: IInterface; nam: String): IInterface;
begin
result := linksTo(eByName(e, nam));
result := linksTo(eByName(el, nam));
end;

(**
* Shorthand for calling [linksTo] and [elementByIndex].
*)
function linkByIndex(e: IInterface; i: Integer): IInterface;
function linkByIndex(el: IInterface; i: Integer): IInterface;
begin
result := linksTo(eByIndex(e, i));
result := linksTo(eByIndex(el, i));
end;


(**
* Returns a lowercase string representation of [e]'s form ID.
* Returns a lowercase string representation of [el]'s form ID.
*
* @param e the record to return the form ID of
* @return a lowercase string representation of [e]'s form ID
* @param el the record to return the form ID of
* @return a lowercase string representation of [el]'s form ID
*)
function stringFormID(e: IInterface): String;
function stringFormID(el: IInterface): String;
begin
result := lowerCase(intToHex(formID(e), 8));
result := lowerCase(intToHex(formID(el), 8));
end;


Expand All @@ -144,19 +144,19 @@ function stringFormID(e: IInterface): String;
**)

(**
* Returns `true` iff [e] is referenced by a record with signature [sig].
* Returns `true` iff [el] is referenced by a record with signature [sig].
*
* @param e the element to check for references
* @param el the element to check for references
* @param sig the signature to check
* @return `true` iff [e] is referenced by a record with signature [sig]
* @return `true` iff [el] is referenced by a record with signature [sig]
*)
function isReferencedBy(e: IInterface; sig: String): Boolean;
function isReferencedBy(el: IInterface; sig: String): Boolean;
var i: Integer;
begin
result := false;

for i := 0 to referencedByCount(e) - 1 do begin
if signature(referencedByIndex(e, i)) = sig then begin
for i := 0 to referencedByCount(el) - 1 do begin
if signature(referencedByIndex(el, i)) = sig then begin
result := true;
exit;
end;
Expand Down
10 changes: 5 additions & 5 deletions Edit scripts/ExportJson.pas
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ function stringListToJsonArray(list: TStringList): String;
**)

(**
* Returns the properties of [e] as a serialized JSON object.
* Returns the properties of [el] as a serialized JSON object.
*
* Each property is expressed using the property's editor ID as the key and either the property's value or the
* property's curve table's editor ID as the value.
*
* @param e the element to return the properties of
* @return the properties of [e] as a serialized JSON object
* @param el the element to return the properties of
* @return the properties of [el] as a serialized JSON object
*)
function getJsonPropertyObject(e: IInterface): String;
function getJsonPropertyObject(el: IInterface): String;
var i: Integer;
props: IInterface;
prop: IInterface;
Expand All @@ -92,7 +92,7 @@ function getJsonPropertyObject(e: IInterface): String;
begin
result := '';

props := eBySign(e, 'PRPS');
props := eBySign(el, 'PRPS');
for i := 0 to eCount(props) - 1 do begin
prop := eByIndex(props, i);
avEdid := evBySign(linkByPath(prop, 'Actor Value'), 'EDID');
Expand Down
4 changes: 2 additions & 2 deletions Edit scripts/ExportTabularARMO.pas
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ function initialize(): Integer;
ExportTabularARMO_LOC_outputLines := initLocList();
end;

function canProcess(e: IInterface): Boolean;
function canProcess(el: IInterface): Boolean;
begin
result := signature(e) = 'ARMO';
result := signature(el) = 'ARMO';
end;

function process(armo: IInterface): Integer;
Expand Down
4 changes: 2 additions & 2 deletions Edit scripts/ExportTabularCLAS.pas
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function initialize(): Integer;
);
end;

function canProcess(e: IInterface): Boolean;
function canProcess(el: IInterface): Boolean;
begin
result := signature(e) = 'CLAS';
result := signature(el) = 'CLAS';
end;

function process(clas: IInterface): Integer;
Expand Down
4 changes: 2 additions & 2 deletions Edit scripts/ExportTabularCOBJ.pas
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function initialize(): Integer;
);
end;

function canProcess(e: IInterface): Boolean;
function canProcess(el: IInterface): Boolean;
begin
result := signature(e) = 'COBJ';
result := signature(el) = 'COBJ';
end;

function process(cobj: IInterface): Integer;
Expand Down
Loading

0 comments on commit e867e58

Please sign in to comment.