Struct themelios::lookup::ED6Lookup

source ·
pub struct ED6Lookup { /* private fields */ }
Expand description

Lookup for ED6: Trails in the Sky FC, SC, and the 3rd.

For the PC versions, file ids tell which file archive the file is located in, and the index inside these archives. For the PSVita versions, the file ids still follow this scheme, but instead uses a number of .txt files with lists of filenames for resolving the numbers to filenames.

Implementations§

source§

impl ED6Lookup

source

pub fn new(name: [Vec<String, Global>; 64]) -> ED6Lookup

Creates a lookup resolving to the given names.

The reason for the 64 size is that that’s how many archives the games load. Any indices above that would just segfault, so they are not supported.

source

pub fn names(&self) -> &[Vec<String, Global>; 64]

Get the lists of names.

source§

impl ED6Lookup

source

pub fn for_pc(dir: impl AsRef<Path>) -> Result<ED6Lookup, Error>

Loads the indexes for the PC versions of the games.

dir should be a directory containing the ED6_DTxx.dir/.dat files, normally located at C:\Program Files (x86)\Steam\steamapps\common\Trails in the Sky {FC/SC/the 3rd}.

The filenames used in the .dir files are uppercase 8.3 format. Later games, as well as filenames given as strings, use lowercase variable-length format, so the index filenames are normalized to the latter format.

For ch/cp files, a prefix is added to denote which archive they are in; names are taken from the Vita’s index files.

source

pub fn for_vita(dir: impl AsRef<Path>) -> Result<ED6Lookup, Error>

Loads the indexes for the PSVita (Evolution) versions of the games.

dir should be the data directory extracted from data.psarc, normally named data, data_sc, or data_3rd.

The index files do not include file extensions, so these are added. Note that the inferred exensions are made to resemble the PC version, not the files actually used by the Vita version.

For ch/cp files, a prefix is added to denote which index file they are in.

source§

impl ED6Lookup

.ed6i reading and writing.

.ed6i is a simple format that encodes an ED6Lookup. You probably won’t have much need for these functions, they’re mainly intended for use by themelios’ indexes feature.

source

pub fn read_ed6i(data: &[u8]) -> Result<ED6Lookup, Error>

source

pub fn write_ed6i(&self) -> Result<Vec<u8, Global>, Error>

Trait Implementations§

source§

impl Clone for ED6Lookup

source§

fn clone(&self) -> ED6Lookup

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ED6Lookup

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Lookup for ED6Lookup

source§

fn name(&self, index: u32) -> Option<String>

Given a file id, return the corresponding filename, if any.
source§

fn index(&self, name: &str) -> Option<u32>

Given a filename, return the corresponding file id, if any.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.