Default installation path for windows is C:\\Program Files (x86)\\Steam\\steamapps\\common\\SlayTheSpire
The folder in which the save files are contained is named saves
and then considering these possibilities:
Game installation path may be customized on user's behalf, so the default installation path wont always work. We also have player with different OS that doesn't necessarily has the same path pattern.
Future version of the game might change/rename the saves folder inside the game installation. Probably would never happen, but if it does then this package will simply break
In this PR, I would like to separate the full path of the save folder to installation_path and save_folder_name. Both with the currently working value as the default value, but entirely customizable as needed.
Example 1: Windows user with default installation
from spireslayer.save_editor import SaveEditor
# this should work out of the box without any configuration needed
save_editor = SaveEditor()
Example 2: Windows user (or Linux user, for example) with custom installation path
from spireslayer.save_editor import SaveEditor
# installation_path can be configured as needed
save_editor = SaveEditor(
installation_path="D:\\MyGames\\SlayTheSpire",
)
# or
save_editor = SaveEditor(
installation_path="/home/rahmat/.steam/debian-installation/steamapps/common/SlayTheSpire",
)
Example 3: Custom save folder name
from spireslayer.save_editor import SaveEditor
# case that probably will never happen (e.g. due to version change)
# but if it happened then only small change from the user is needed instead of bumping the package version
save_editor = SaveEditor(
save_folder_name="savestates",
)
Other than that, small changes are also included in several files to adhere with PEP styling.
Known facts:
C:\\Program Files (x86)\\Steam\\steamapps\\common\\SlayTheSpire
saves
and then considering these possibilities:
saves
folder inside the game installation. Probably would never happen, but if it does then this package will simply breakIn this PR, I would like to separate the full path of the save folder to
installation_path
andsave_folder_name
. Both with the currently working value as the default value, but entirely customizable as needed.Example 1: Windows user with default installation
Example 2: Windows user (or Linux user, for example) with custom installation path
Example 3: Custom save folder name
Other than that, small changes are also included in several files to adhere with PEP styling.