core.graphics module

Graphics pack management.

core.graphics.add_tilesets()[source]

Copies missing tilesets from LNP/Tilesets to the data/art folder.

core.graphics.can_rebuild(log_file, strict=True)[source]

Test if user can exactly rebuild a raw folder, returning a bool.

core.graphics.current_pack()[source]

Returns the currently installed graphics pack. If the pack cannot be identified, returns “FONT/GRAPHICS_FONT”.

core.graphics.current_tilesets()[source]

Returns the current tilesets as a tuple (FONT, GRAPHICS_FONT).

core.graphics.get_folder_prefix(pack)[source]

Returns the pack folder_prefix; either per manifest or from dirname.

core.graphics.get_title(pack)[source]

Returns the pack title; either per manifest or from dirname.

core.graphics.get_tooltip(pack)[source]

Returns the tooltip for the given graphics pack.

core.graphics.install_graphics(pack)[source]

Installs the graphics pack located in LNP/Graphics/<pack>.

Parameters:

pack – the name of the pack to install.

Returns:

True if successful, False if an exception occurred None if baseline vanilla raws are missing

core.graphics.install_tilesets(font, graphicsfont)[source]

Installs the provided tilesets as [FULL]FONT and GRAPHICS_[FULL]FONT. To skip either option, use None as the parameter.

core.graphics.logged_graphics(logfile, start='graphics/')[source]

Returns the graphics pack from an ‘installed_raws.txt’ file

core.graphics.open_graphics()[source]

Opens the graphics pack folder.

core.graphics.open_tilesets()[source]

Opens the tilesets folder.

core.graphics.patch_inits(gfx_dir)[source]

Installs init files from a graphics pack by selectively changing specific fields. All settings but the mentioned fields are preserved.

core.graphics.read_graphics()[source]

Returns a list of tuples of (graphics dir, FONT, GRAPHICS_FONT).

core.graphics.read_tilesets()[source]

Returns a tuple of available tileset files. Also copies missing tilesets from LNP/Tilesets to data/art.

core.graphics.savegames_to_update()[source]

Returns a list of savegames that will be updated.

core.graphics.simplify_graphics()[source]

Removes unnecessary files from all graphics packs.

core.graphics.simplify_pack(pack)[source]

Removes unnecessary files from one graphics pack.

core.graphics.update_graphics_raws(raw_dir, pack)[source]

Updates raws in place for a new graphics pack.

Parameters:
  • raw_dir – full path to the dir to update

  • pack – the name of the graphics pack to add (eg ‘Phoebus’)

Returns:

True if successful, False if aborted

core.graphics.update_savegames()[source]

Update save games with current raws.

core.graphics.validate_pack(pack, df_version=None)[source]

Checks for presence of all required files for a pack install.