-- FIND ENTRY IN ARCHIVE -- SLADE -- ----------------------------------------------------------------------------- -- Made by Star "Guy Who Names Scripts After Him" ManiaKG. -- ----------------------------------------------------------------------------- --- \file STAR_FindEntryInArchive.lua --- \brief Easily allows users to find their given file name in an entry. -- ------------------------ -- -- Variables -- ------------------------ -- local search = UI.PromptString("Find Entry in Archive", "Enter text to find the given entry in the current archive", ""); if (search == nil) then -- The entered search term doesn't exist... UI.MessageBox("Search text not inputted!", "You must input search text to continue!", ""); return; end -- ------------------------ -- -- Functions -- ------------------------ -- -- -- function Execute() -- ipairs(ArchiveEntry[] *App.CurrentArchive().entries) -- -- Iterates through all enteries in the currently open archive, -- and attempts to find the given entry. -- -- (Does it need to be in the Execute() function? No.) -- (Do I want it here anyways? Yes.) -- function Execute() for i, entry in ipairs(App.CurrentArchive().entries) do if (string.find(string.upper(entry.name), string.upper(search))) then local openEntryPrompt = UI.PromptYesNo(string.format("Found entry %s!", search), string.format("Located in: %s\n\n%s", entry.path, "Now all you have to do is scroll there yourself!\n...Unless you want to open the entry?")); if (openEntryPrompt) then App.ShowEntry(entry); end return; end App.LogMessage(string.format("STAR_FindEntryInArchive: iteration %d, entry %s", i, entry.name)); end UI.MessageBox("Didn't find the entry :(", "Did you type it in correctly?"); end