Skip to content

Commit

Permalink
Merge pull request #8 from stoozey/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
stoozey authored Aug 10, 2023
2 parents 59164b9 + 001240b commit d5c9275
Show file tree
Hide file tree
Showing 73 changed files with 794 additions and 583 deletions.
22 changes: 22 additions & 0 deletions SSave.resource_order
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"FolderOrderSettings": [
{"name":"Demo","order":1,"path":"folders/Demo.yy",},
],
"ResourceOrderSettings": [
{"name":"obj_ssave_demo_player","order":2,"path":"objects/obj_ssave_demo_player/obj_ssave_demo_player.yy",},
{"name":"__scr_ssave_header","order":5,"path":"scripts/__scr_ssave_header/__scr_ssave_header.yy",},
{"name":"__scr_ssave_value","order":1,"path":"scripts/__scr_ssave_value/__scr_ssave_value.yy",},
{"name":"spr_ssave_demo_player_left","order":6,"path":"sprites/spr_ssave_demo_player_left/spr_ssave_demo_player_left.yy",},
{"name":"obj_ssave_demo","order":3,"path":"objects/obj_ssave_demo/obj_ssave_demo.yy",},
{"name":"spr_ssave_demo_player_up","order":8,"path":"sprites/spr_ssave_demo_player_up/spr_ssave_demo_player_up.yy",},
{"name":"spr_ssave_demo_player_down","order":5,"path":"sprites/spr_ssave_demo_player_down/spr_ssave_demo_player_down.yy",},
{"name":"__scr_ssave_init","order":3,"path":"scripts/__scr_ssave_init/__scr_ssave_init.yy",},
{"name":"scr_ssave_config","order":2,"path":"scripts/scr_ssave_config/scr_ssave_config.yy",},
{"name":"spr_ssave_demo_player_right","order":7,"path":"sprites/spr_ssave_demo_player_right/spr_ssave_demo_player_right.yy",},
{"name":"__scr_ssave_util","order":2,"path":"scripts/__scr_ssave_util/__scr_ssave_util.yy",},
{"name":"DEMO CREDITS","order":4,"path":"notes/DEMO CREDITS/DEMO CREDITS.yy",},
{"name":"__scr_ssave_manager","order":6,"path":"scripts/__scr_ssave_manager/__scr_ssave_manager.yy",},
{"name":"rm_ssave_demo","order":1,"path":"rooms/rm_ssave_demo/rm_ssave_demo.yy",},
{"name":"scr_ssave_manager","order":3,"path":"scripts/scr_ssave_manager/scr_ssave_manager.yy",},
],
}
85 changes: 39 additions & 46 deletions SSave.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions notes/DEMO CREDITS/DEMO CREDITS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
player sprite: https://opengameart.org/content/tiny-characters-set
9 changes: 9 additions & 0 deletions notes/DEMO CREDITS/DEMO CREDITS.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions objects/obj_ssave_demo/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
// See scr_ssave_demo for ConfigFile/SaveFile implementation
Save = function()
{
with (obj_ssave_demo_player)
{
static config = ssave_get(ConfigFile);

ssave_get(SaveFile, config.get("saveIndex"))
.set("x", x)
.set("y", y)
.set("name", name)
.set("playtime", playtime)
.save();
}
}

show_message_async("Go to \"%localappdata%\\" + game_project_name + "\" to see the files that have been saved!");

instance_create_depth(0, 0, 0, ((SSAVE_USE_MANAGER) ? obj_ssave_demo_manager : obj_ssave_demo_no_manager))
instance_create_depth(0, 0, 0, obj_ssave_demo_player);
5 changes: 5 additions & 0 deletions objects/obj_ssave_demo/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var _saveIndex = ssave_get(ConfigFile).get("saveIndex");

draw_text(4, 4, "Press numbers 0-9 to select save file index");
draw_text(4, 20, "Current save index: " + string(_saveIndex));
draw_text(4, 36, "Go to %localappdata%/SSave to view your save files.");
1 change: 1 addition & 0 deletions objects/obj_ssave_demo/Other_3.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssave_save_all();
18 changes: 18 additions & 0 deletions objects/obj_ssave_demo/Step_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var i = 0;
repeat (10)
{
if (keyboard_check_pressed(ord(i)))
{
Save();

ssave_get(ConfigFile)
.set("saveIndex", i);

with (obj_ssave_demo_player)
Load();

break;
}

i++;
}
45 changes: 24 additions & 21 deletions objects/obj_ssave_demo/obj_ssave_demo.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions objects/obj_ssave_demo_manager/Create_0.gml

This file was deleted.

50 changes: 0 additions & 50 deletions objects/obj_ssave_demo_no_manager/Create_0.gml

This file was deleted.

33 changes: 0 additions & 33 deletions objects/obj_ssave_demo_no_manager/obj_ssave_demo_no_manager.yy

This file was deleted.

19 changes: 19 additions & 0 deletions objects/obj_ssave_demo_player/Create_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Load = function()
{
static config = ssave_get(ConfigFile);
var _save = ssave_get(SaveFile, config.get("saveIndex"));
x = _save.get("x");
y = _save.get("y");
playtime = _save.get("playtime");

var _name = _save.get("name");
while (_name == "")
_name = get_string("Enter name for this save file:", "Geoffrey");

name = _name;
}

name = "";
playtime = 0;

Load();
Loading

0 comments on commit d5c9275

Please sign in to comment.