Successfully added fully working catch counters.

This commit is contained in:
TheGreenTie
2020-02-29 05:51:05 -06:00
parent 0d8aa1e448
commit ee28f8b4df
32 changed files with 220 additions and 76 deletions

View File

@@ -2326,6 +2326,14 @@
"resourceType": "GMIncludedFile"
}
},
{
"Key": "18704ffc-a564-c635-1f87-c3fbc7a7c1c0",
"Value": {
"id": "e1b2c995-e384-adaf-6687-4485ba3a78ec",
"resourcePath": "scripts\\savedata_write\\savedata_write.yy",
"resourceType": "GMScript"
}
},
{
"Key": "18748a79-8170-4405-bfb6-d97d8fc6e384",
"Value": {
@@ -3486,6 +3494,14 @@
"resourceType": "GMIncludedFile"
}
},
{
"Key": "2370f9cd-bc43-8204-019c-9bc13fa8d58f",
"Value": {
"id": "c425125a-1227-1c70-0cd2-de77e82e829a",
"resourcePath": "scripts\\button_do\\button_do.yy",
"resourceType": "GMScript"
}
},
{
"Key": "23776d1c-3052-4a99-bdaf-eec1ef53e13f",
"Value": {
@@ -7086,6 +7102,14 @@
"resourceType": "GMIncludedFile"
}
},
{
"Key": "46940c02-accc-0a61-a238-03c213c44822",
"Value": {
"id": "7b7f5a6d-de5b-595e-b05d-a4d01ea188f9",
"resourcePath": "scripts\\align_x\\align_x.yy",
"resourceType": "GMScript"
}
},
{
"Key": "4696070b-52a0-4908-92d4-9b8282ead354",
"Value": {
@@ -8146,7 +8170,7 @@
"Key": "51d00fa8-eb85-4086-a732-a161d9d217d8",
"Value": {
"id": "85207e30-7cc0-3776-b034-06e06a4b170a",
"resourcePath": "scripts\/button_set\/button_set.yy",
"resourcePath": "scripts/button_set/button_set.yy",
"resourceType": "GMScript"
}
},
@@ -11098,7 +11122,7 @@
"Key": "6ee30c99-62bc-bcf5-3853-e159533ab6d0",
"Value": {
"id": "c2bb0f39-a2d2-3f48-0435-8f8ddcd09621",
"resourcePath": "scripts\/align_x\/align_x.yy",
"resourcePath": "scripts/button_align_x/button_align_x.yy",
"resourceType": "GMScript"
}
},
@@ -14634,7 +14658,7 @@
"Key": "9081971b-e1be-521f-34be-38fcfa32f684",
"Value": {
"id": "5556752a-d72e-8013-c6ef-9fc461634e8e",
"resourcePath": "scripts\/align_y\/align_y.yy",
"resourcePath": "scripts/button_align_y/button_align_y.yy",
"resourceType": "GMScript"
}
},
@@ -15170,7 +15194,7 @@
"Key": "961739d9-bcef-9d3d-a9a7-6d0487191e8e",
"Value": {
"id": "cf68e563-92be-d148-9a63-2bb86baa8cc2",
"resourcePath": "scripts\/icon_path_get\/icon_path_get.yy",
"resourcePath": "scripts/icon_path_get/icon_path_get.yy",
"resourceType": "GMScript"
}
},
@@ -22662,6 +22686,14 @@
"resourceType": "GMIncludedFile"
}
},
{
"Key": "e10f4338-d865-41ce-6c7c-ffe8b9302bc2",
"Value": {
"id": "bc9ef1b6-6c89-650e-c291-a4ffb4d4cd96",
"resourcePath": "scripts/savedata_read_real/savedata_read_real.yy",
"resourceType": "GMScript"
}
},
{
"Key": "e1581742-a5b0-420c-8765-fdae29a5a95a",
"Value": {
@@ -23182,6 +23214,14 @@
"resourceType": "GMIncludedFile"
}
},
{
"Key": "e5c6bbdd-36db-453b-9a43-7cd0c52b31ba",
"Value": {
"id": "998324dd-e146-83c7-2194-3b374253f224",
"resourcePath": "scripts\\align_y\\align_y.yy",
"resourceType": "GMScript"
}
},
{
"Key": "e5d4bfbb-c4f2-46bc-b5c8-c88fbfd6eee3",
"Value": {
@@ -25611,12 +25651,17 @@
"c07397b8-105a-cf00-f119-47f5091762ab",
"51d00fa8-eb85-4086-a732-a161d9d217d8",
"5c7fb6ce-864a-a30e-f665-d51d74835878",
"46940c02-accc-0a61-a238-03c213c44822",
"e5c6bbdd-36db-453b-9a43-7cd0c52b31ba",
"6ee30c99-62bc-bcf5-3853-e159533ab6d0",
"9081971b-e1be-521f-34be-38fcfa32f684",
"1087bf1b-acd2-8101-2f92-1c8433c77a66",
"73ea69de-6c0e-9d8b-6da5-41f465a27cce",
"1c861d7a-eed5-61b7-02f5-201672b6f730",
"5e879a22-94f8-a47e-fee7-5e134971dd7f"
"5e879a22-94f8-a47e-fee7-5e134971dd7f",
"2370f9cd-bc43-8204-019c-9bc13fa8d58f",
"18704ffc-a564-c635-1f87-c3fbc7a7c1c0",
"e10f4338-d865-41ce-6c7c-ffe8b9302bc2"
],
"tutorial": ""
}

View File

@@ -1,5 +1,4 @@
//draw_sprite_stretched(sprite_index, image_index, x, y, width, -height);
if (!pressed)
{
var plus = 0;

View File

@@ -16,9 +16,7 @@ else
if (mouse_check_button_released(mb_left))
{
if (hover)
{
}
button_do(type);
pressed = false;
}

View File

@@ -14,16 +14,6 @@
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
},
{
"id": "ddca3561-dcbc-dafb-84b1-31652612218a",
"modelName": "GMEvent",
"mvc": "1.0",
"IsDnD": false,
"eventtype": 8,
"enumb": 0,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
},
{
"id": "fbf149ae-484d-1ba1-7dd1-2cdd91c6acc5",
"modelName": "GMEvent",
@@ -33,6 +23,16 @@
"enumb": 0,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
},
{
"id": "ddca3561-dcbc-dafb-84b1-31652612218a",
"modelName": "GMEvent",
"mvc": "1.0",
"IsDnD": false,
"eventtype": 8,
"enumb": 0,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"m_owner": "b97fbe91-98d6-26ce-4811-7421bc2b6bb3"
}
],
"maskSpriteId": "00000000-0000-0000-0000-000000000000",

View File

@@ -7,7 +7,4 @@ boxes_spawn();
selected_set();
scr_window_resize();
button_create(0, 0, but.plus);
button_create(0, 0, but.minus);
button_update_all();

View File

@@ -12,5 +12,19 @@ draw_text_hud(global.selected[dex.form], 1.5, 3, color);
draw_type_hud(global.selected[dex.type1], global.selected[dex.type2], 4.5);
// The famous counter
if (instance_exists(obj_lock) || global.counter>0)
{
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_set_color(c_white);
draw_text_transformed(align_x(region.mid_right, 0), align_y(region.mid_right, 0), global.counter, global.icon_scale*3, global.icon_scale*3, image_angle);
}
// Debug
draw_guidelines(true);
// Reset
draw_set_halign(fa_left);
draw_set_valign(fa_top);
draw_set_color(c_white);

View File

@@ -54,16 +54,6 @@
"eventtype": 8,
"m_owner": "b5a21a9b-6e2e-40d3-9039-73cd19a7b959"
},
{
"id": "51a7ddf9-eba2-44e7-a452-be93317ca256",
"modelName": "GMEvent",
"mvc": "1.0",
"IsDnD": false,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"enumb": 83,
"eventtype": 9,
"m_owner": "b5a21a9b-6e2e-40d3-9039-73cd19a7b959"
},
{
"id": "4207fe9e-44b3-4d50-9129-e785efdd45f5",
"modelName": "GMEvent",
@@ -83,6 +73,16 @@
"enumb": 73,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"m_owner": "b5a21a9b-6e2e-40d3-9039-73cd19a7b959"
},
{
"id": "51a7ddf9-eba2-44e7-a452-be93317ca256",
"modelName": "GMEvent",
"mvc": "1.0",
"IsDnD": false,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"enumb": 83,
"eventtype": 9,
"m_owner": "b5a21a9b-6e2e-40d3-9039-73cd19a7b959"
}
],
"maskSpriteId": "00000000-0000-0000-0000-000000000000",

View File

@@ -12,4 +12,4 @@ switch(zone)
var deplacement = global.unit * percent;
return x_start + deplacement - (sprite_get_width(sprite_index) * scale * length)/2;
return x_start + deplacement;

View File

@@ -1,5 +1,5 @@
{
"id": "6ee30c99-62bc-bcf5-3853-e159533ab6d0",
"id": "46940c02-accc-0a61-a238-03c213c44822",
"modelName": "GMScript",
"mvc": "1.0",
"name": "align_x",

View File

@@ -1,4 +1,4 @@
///align_y(region, unit%)
///button_align_y(region, unit%)
var zone = argument0;
var percent = argument1;
@@ -12,4 +12,4 @@ switch(zone)
var deplacement = global.unit * percent;
return y_start + deplacement - (sprite_get_height(sprite_index) * scale)/2;
return y_start + deplacement + __view_get(e__VW.YView, 0);

View File

@@ -1,5 +1,5 @@
{
"id": "9081971b-e1be-521f-34be-38fcfa32f684",
"id": "e5c6bbdd-36db-453b-9a43-7cd0c52b31ba",
"modelName": "GMScript",
"mvc": "1.0",
"name": "align_y",

View File

@@ -0,0 +1,3 @@
///button_align_x(region, unit%)
return align_x(argument0, argument1) - (sprite_get_width(sprite_index) * scale * length)/2;

View File

@@ -0,0 +1,8 @@
{
"id": "6ee30c99-62bc-bcf5-3853-e159533ab6d0",
"modelName": "GMScript",
"mvc": "1.0",
"name": "button_align_x",
"IsCompatibility": false,
"IsDnD": false
}

View File

@@ -0,0 +1,3 @@
///button_align_y(region, unit%)
return align_y(argument0, argument1) - (sprite_get_height(sprite_index) * scale)/2;

View File

@@ -0,0 +1,8 @@
{
"id": "9081971b-e1be-521f-34be-38fcfa32f684",
"modelName": "GMScript",
"mvc": "1.0",
"name": "button_align_y",
"IsCompatibility": false,
"IsDnD": false
}

View File

@@ -1,4 +1,8 @@
///button_create(x, y, type)
with (instance_create_depth(0, 0, depth-1, obj_button))
button_set(argument0, argument1, argument2);
var hold = instance_create_depth(0, 0, depth-1, obj_button);
with (hold)
button_set(argument0, argument1, argument2);
return hold;

View File

@@ -0,0 +1,17 @@
///button_do(type)
switch(argument0)
{
case but.plus:
global.counter++;
savedata_write(savedata_section_get(global.show_shiny)+" Count", global.selecting.idno, global.counter);
break;
case but.minus:
if (global.counter > 0)
global.counter--;
savedata_write(savedata_section_get(global.show_shiny)+" Count", global.selecting.idno, global.counter);
break;
}

View File

@@ -0,0 +1,8 @@
{
"id": "2370f9cd-bc43-8204-019c-9bc13fa8d58f",
"modelName": "GMScript",
"mvc": "1.0",
"name": "button_do",
"IsCompatibility": false,
"IsDnD": false
}

View File

@@ -19,21 +19,21 @@ switch(type)
image_index = 4;
scale = global.icon_scale * 1.5;
x_ = align_x(region.mid_right, 1.75);
y_ = align_y(region.mid_right, 0);
x_ = button_align_x(region.mid_right, 1.5);
y_ = button_align_y(region.mid_right, 0);
break;
case but.minus:
text = "-";
image_index = 4;
x_ = align_x(region.mid_right, -2);
y_ = align_y(region.mid_right, 0);
x_ = button_align_x(region.mid_right, -1.5);
y_ = button_align_y(region.mid_right, 0);
break;
};
x = x_;
y = __view_get(e__VW.YView, 0) + y_;
y = y_;
width = sprite_get_width(sprite_index) * scale * length;
height = sprite_get_height(sprite_index) * scale;

View File

@@ -11,15 +11,7 @@ global.selected[dex.own] = own;
global.savedata[idno] = own;
// Auto-Saves
if (file_exists("save.ini"))
{
ini_open("save.ini");
var section = savedata_section_get(global.show_shiny);
ini_write_real(section, string(idno), own)
//ini_write_real("Progress","count",global.count)
show_debug_message("Saved "+pokemon+" as "+string(own)+".");
ini_close();
}
if (savedata_write(savedata_section_get(global.show_shiny), string(idno), own))
show_debug_message("Saved "+pokemon+" as "+string(own)+".");
else
show_debug_message("ERROR: Save file somehow went missing.");

View File

@@ -24,5 +24,6 @@ global.various = false;
global.various_to = 0;
global.selecting = noone;
global.counter = 9999;
enum region { boxes, top, mid_left, mid_right, bottom }

View File

@@ -5,4 +5,10 @@ global.selecting = argument0;
selected_set(argument0);
if (!instance_exists(obj_lock))
instance_create_depth(x, y, depth-1, obj_lock)
with (instance_create_depth(x, y, depth-1, obj_lock))
{
plus = button_create(0, 0, but.plus);
minus = button_create(0, 0, but.minus);
}
button_update_all();

View File

@@ -2,6 +2,9 @@
global.selecting = noone;
with (obj_lock.plus) { instance_destroy() };
with (obj_lock.minus) { instance_destroy() };
if (instance_exists(obj_lock))
with (obj_lock)
instance_destroy();

View File

@@ -0,0 +1,13 @@
///savedata_read_real(section, key, default)
if (file_exists("save.ini"))
{
ini_open("save.ini");
var temp = ini_read_real(argument0, argument1, argument2);
ini_close();
return temp;
}
show_debug_message("ERROR: Missing save file.");
return argument2;

View File

@@ -0,0 +1,8 @@
{
"id": "e10f4338-d865-41ce-6c7c-ffe8b9302bc2",
"modelName": "GMScript",
"mvc": "1.0",
"name": "savedata_read_real",
"IsCompatibility": false,
"IsDnD": false
}

View File

@@ -0,0 +1,16 @@
///savedata_write(section, key, value)
if (file_exists("save.ini"))
{
ini_open("save.ini");
if (typeof(argument2) == "string")
ini_write_string(argument0, argument1, argument2);
else
ini_write_real(argument0, argument1, argument2);
ini_close();
return true;
}
show_debug_message("ERROR: Missing save file.");
return false;

View File

@@ -0,0 +1,8 @@
{
"id": "18704ffc-a564-c635-1f87-c3fbc7a7c1c0",
"modelName": "GMScript",
"mvc": "1.0",
"name": "savedata_write",
"IsCompatibility": false,
"IsDnD": false
}

View File

@@ -1,12 +1,6 @@
// Saving
if (file_exists("save.ini"))
{
ini_open("save.ini")
ini_write_real("Navigation", "Current Box", global.current_box);
ini_close();
}
else
if (!savedata_write("Navigation", "Current Box", global.current_box))
show_debug_message("ERROR: Can't save scrolling. Save file somehow went missing.");
// Warp

View File

@@ -1,3 +1,5 @@
/// @param hold
/// @param ...
///selected_set(_id)
if (argument_count < 1)
@@ -11,4 +13,6 @@ global.selected[dex.form] = hold.form;
global.selected[dex.type1] = hold.type1;
global.selected[dex.type2] = hold.type2;
global.selected[dex.sprite] = hold.spr;
global.selected[dex.own] = hold.own;
global.selected[dex.own] = hold.own;
global.counter = savedata_read_real(savedata_section_get(global.show_shiny)+" Count", hold.idno, 0);

View File

@@ -1,10 +1,5 @@
global.show_galar = !global.show_galar
if (file_exists("save.ini"))
{
ini_open("save.ini")
ini_write_real("Display", "Galar Dex", global.show_galar);
ini_close();
}
savedata_write("Display", "Galar Dex", global.show_galar);
room_restart();

View File

@@ -2,11 +2,6 @@
global.show_shiny = !global.show_shiny
if (file_exists("save.ini"))
{
ini_open("save.ini")
ini_write_real("Display", "Shiny Mode", global.show_shiny);
ini_close();
}
savedata_write("Display", "Shiny Mode", global.show_shiny);
room_restart();

View File

@@ -48,12 +48,17 @@
"c07397b8-105a-cf00-f119-47f5091762ab",
"51d00fa8-eb85-4086-a732-a161d9d217d8",
"5c7fb6ce-864a-a30e-f665-d51d74835878",
"46940c02-accc-0a61-a238-03c213c44822",
"e5c6bbdd-36db-453b-9a43-7cd0c52b31ba",
"6ee30c99-62bc-bcf5-3853-e159533ab6d0",
"9081971b-e1be-521f-34be-38fcfa32f684",
"1087bf1b-acd2-8101-2f92-1c8433c77a66",
"73ea69de-6c0e-9d8b-6da5-41f465a27cce",
"1c861d7a-eed5-61b7-02f5-201672b6f730",
"5e879a22-94f8-a47e-fee7-5e134971dd7f"
"5e879a22-94f8-a47e-fee7-5e134971dd7f",
"2370f9cd-bc43-8204-019c-9bc13fa8d58f",
"18704ffc-a564-c635-1f87-c3fbc7a7c1c0",
"e10f4338-d865-41ce-6c7c-ffe8b9302bc2"
],
"filterType": "GMScript",
"folderName": "scripts",