Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- Filtering by papyrus script name.
- }
- unit ApplyFilterForPapyrusScript;
- var
- sScriptName: string;
- bSkipSection: Boolean;
- function HasScript(e: IInterface; aScript: string): Boolean;
- var
- i: integer;
- begin
- if Name(e) = 'scriptName' then begin
- Result := SameText(GetEditValue(e), aScript);
- bSkipSection := True;
- end else
- for i := 0 to Pred(ElementCount(e)) do begin
- Result := HasScript(ElementByIndex(e, i), aScript);
- if bSkipSection then begin
- bSkipSection := False;
- Exit;
- end;
- if Result then Exit;
- end;
- end;
- function Filter(e: IInterface): Boolean;
- begin
- if ElementExists(e, 'VMAD') then
- Result := HasScript(ElementBySignature(e, 'VMAD'), sScriptName);
- end;
- function Initialize: Integer;
- begin
- if wbGameMode <> gmTES5 then begin
- AddMessage('Filtering by papyrus script works only for Skyrim.');
- Result := 1;
- Exit;
- end;
- if not InputQuery('Filter By', 'Papyrus script name (case insensitive)', sScriptName) then begin
- Result := 1;
- Exit;
- end;
- if sScriptName = '' then begin
- Result := 1;
- Exit;
- end;
- FilterConflictAll := False;
- FilterConflictThis := False;
- FilterByInjectStatus := False;
- FilterInjectStatus := False;
- FilterByNotReachableStatus := False;
- FilterNotReachableStatus := False;
- FilterByReferencesInjectedStatus := False;
- FilterReferencesInjectedStatus := False;
- FilterByEditorID := False;
- FilterEditorID := '';
- FilterByName := False;
- FilterName := '';
- FilterByBaseEditorID := False;
- FilterBaseEditorID := '';
- FilterByBaseName := False;
- FilterBaseName := '';
- FilterScaledActors := False;
- FilterByPersistent := False;
- FilterPersistent := False;
- FilterUnnecessaryPersistent := False;
- FilterMasterIsTemporary := False;
- FilterIsMaster := False;
- FilterPersistentPosChanged := False;
- FilterDeleted := False;
- FilterByVWD := False;
- FilterVWD := False;
- FilterByHasVWDMesh := False;
- FilterHasVWDMesh := False;
- FilterBySignature := False;
- FilterSignatures := '';
- FilterByBaseSignature := False;
- FilterBaseSignatures := '';
- FlattenBlocks := False;
- FlattenCellChilds := False;
- AssignPersWrldChild := False;
- InheritConflictByParent := False;
- FilterScripted := True; // use custom Filter() function
- ApplyFilter;
- Result := 1;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement