Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: use Escoria plugin version from plugin.cfg in savegames #489

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ func save_game_crash():
# - p_savename: name of the savegame
func _do_save_game(p_savename: String) -> ESCSaveGame:
var save_game = ESCSaveGame.new()
save_game.escoria_version = escoria.ESCORIA_VERSION

var plugin_config = ConfigFile.new()
plugin_config.load("res://addons/escoria-core/plugin.cfg")
save_game.escoria_version = plugin_config.get_value("plugin", "version")

save_game.game_version = escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.GAME_VERSION
)
Expand Down Expand Up @@ -383,7 +387,10 @@ func load_game(id: int):
# Save the game settings in the settings file.
func save_settings():
var settings_res := ESCSaveSettings.new()
settings_res.escoria_version = escoria.ESCORIA_VERSION
var plugin_config = ConfigFile.new()
plugin_config.load("res://addons/escoria-core/plugin.cfg")

settings_res.escoria_version = plugin_config.get_value("plugin", "version")
settings_res.text_lang = escoria.settings.text_lang
settings_res.voice_lang = escoria.settings.voice_lang
settings_res.speech_enabled = escoria.settings.speech_enabled
Expand Down
3 changes: 0 additions & 3 deletions addons/escoria-core/game/escoria.gd
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ enum GAME_STATE {
}


# Escoria version number
const ESCORIA_VERSION = "0.1.0"

# Audio bus indices.
const BUS_MASTER = "Master"
const BUS_SFX = "SFX"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ func refresh_savegames():
$VBoxContainer/ScrollContainer/slots.remove_child(slot)

var saves_list = escoria.save_manager.get_saves_list()
for i in saves_list.size():
var save_data = saves_list[i+1]
var new_slot = slot_ui_scene.instance()
$VBoxContainer/ScrollContainer/slots.add_child(
new_slot
)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i+1])
for i in range(saves_list.keys().max() + 1):
if saves_list.has(i):
var save_data = saves_list[i]
var new_slot = slot_ui_scene.instance()
$VBoxContainer/ScrollContainer/slots.add_child(
new_slot
)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i])
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ func refresh_savegames():
_slots.remove_child(slot)

var saves_list = escoria.save_manager.get_saves_list()
for i in saves_list.size():
var save_data = saves_list[i+1]
var new_slot = slot_ui_scene.instance()
_slots.add_child(new_slot)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i+1])
for i in range(saves_list.keys().max() + 1):
if saves_list.has(i):
var save_data = saves_list[i]
var new_slot = slot_ui_scene.instance()
_slots.add_child(new_slot)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i])

var datetime = OS.get_datetime()
var datetime_string = "%02d/%02d/%02d %02d:%02d" % [
Expand Down
91 changes: 0 additions & 91 deletions saves/save_001.tres

This file was deleted.

86 changes: 0 additions & 86 deletions saves/save_002.tres

This file was deleted.

97 changes: 0 additions & 97 deletions saves/save_003.tres

This file was deleted.