Added a working progress bar.

This commit is contained in:
TheGreenTie 2020-03-01 23:14:08 -06:00
parent 680cb32028
commit 68f11d5307
10 changed files with 96 additions and 26 deletions

View File

@ -426,7 +426,7 @@
"Key": "0519f1e6-1b15-b8a7-bd8c-8489d767cf9a",
"Value": {
"id": "2234b66c-298f-f8fe-90d2-68bade16c73a",
"resourcePath": "scripts\/mouse_direction_update\/mouse_direction_update.yy",
"resourcePath": "scripts/mouse_direction_update/mouse_direction_update.yy",
"resourceType": "GMScript"
}
},
@ -6530,7 +6530,7 @@
"Key": "4a34078c-7fa4-d9ca-eb35-df0a0ce93667",
"Value": {
"id": "a4aed7b8-3569-686e-86ea-ff5c94787515",
"resourcePath": "scripts\/box_gen_jump\/box_gen_jump.yy",
"resourcePath": "scripts/box_gen_jump/box_gen_jump.yy",
"resourceType": "GMScript"
}
},
@ -7218,7 +7218,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"
}
},
@ -9618,7 +9618,7 @@
"Key": "6ee30c99-62bc-bcf5-3853-e159533ab6d0",
"Value": {
"id": "c2bb0f39-a2d2-3f48-0435-8f8ddcd09621",
"resourcePath": "scripts\/button_align_x\/button_align_x.yy",
"resourcePath": "scripts/button_align_x/button_align_x.yy",
"resourceType": "GMScript"
}
},
@ -12538,7 +12538,7 @@
"Key": "9081971b-e1be-521f-34be-38fcfa32f684",
"Value": {
"id": "5556752a-d72e-8013-c6ef-9fc461634e8e",
"resourcePath": "scripts\/button_align_y\/button_align_y.yy",
"resourcePath": "scripts/button_align_y/button_align_y.yy",
"resourceType": "GMScript"
}
},
@ -12970,7 +12970,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"
}
},
@ -15658,7 +15658,7 @@
"Key": "b08ce952-50a4-ff53-bc1b-0c28d2369b92",
"Value": {
"id": "898f740e-79e7-89e0-7a9e-c639201a4ae2",
"resourcePath": "scripts\/selected_output\/selected_output.yy",
"resourcePath": "scripts/selected_output/selected_output.yy",
"resourceType": "GMScript"
}
},
@ -18826,7 +18826,7 @@
"Key": "d7e04ba6-0e68-8245-0d3a-37da8d2292e4",
"Value": {
"id": "a4569deb-877c-b988-b976-8f8b03d6544e",
"resourcePath": "scripts\/mouse_previous_update\/mouse_previous_update.yy",
"resourcePath": "scripts/mouse_previous_update/mouse_previous_update.yy",
"resourceType": "GMScript"
}
},
@ -19666,7 +19666,7 @@
"Key": "e10f4338-d865-41ce-6c7c-ffe8b9302bc2",
"Value": {
"id": "bc9ef1b6-6c89-650e-c291-a4ffb4d4cd96",
"resourcePath": "scripts\/savedata_read_real\/savedata_read_real.yy",
"resourcePath": "scripts/savedata_read_real/savedata_read_real.yy",
"resourceType": "GMScript"
}
},
@ -22197,6 +22197,14 @@
"resourcePath": "datafiles_yy\\Icons\\Shiny\\BUNEARY.png.yy",
"resourceType": "GMIncludedFile"
}
},
{
"Key": "15f6da05-1158-20ed-dd4b-2fbf23fb3faf",
"Value": {
"id": "55734db8-a1f9-0ae4-5631-f594ee278154",
"resourcePath": "scripts\\progress_update\\progress_update.yy",
"resourceType": "GMScript"
}
}
],
"script_order": [

View File

@ -1,6 +1,10 @@
if (mouse_check_button(mb_right))
{
own_prev = own;
click_slot(global.various_to);
progress_update();
}
hover = true;
color = get_color3(own, true);

View File

@ -1,7 +1,11 @@
/// @description CLICKEDY CLICK
own_prev = own;
if (++own > 4)
own = 0;
progress_update();
global.various_to = own;

View File

@ -1,7 +1,9 @@
/// @description check_galar(id, _show?)
/// @param idee
/// @param ...
// Checks if the Pokémon can move to Sword/Shield.
var idee = argument[0];
var idee = argument[0];
// Sanity Check™
if (argument_count>1 && !argument[1])
@ -11,7 +13,7 @@ var nat = global.dexdata[idee, dex.dexno];
for (var i=1; i<array_height_2d(global.galardata); i++)
{
show_debug_message("Comparing "+nat+" to "+global.galardata[i, gdex.galarno]);
//show_debug_message("Comparing "+nat+" to "+global.galardata[i, gdex.galarno]);
if (nat == global.galardata[i, gdex.dexno])
return true;

View File

@ -1,18 +1,49 @@
///hud_draw_progress();
//var scale = global.icon_scale * 2;
var off = global.icon_scale * 4;
var x_s = align_x(region._50) + off;
var x_f = align_x(region._75) + off/2;
var w = align_x(region._25) - off;
var h = sprite_get_height(spr_source) * global.icon_scale / 1.75;
draw_sprite_stretched(spr_source, src.flip,
align_x(region._50), align_y(region.bot_left, 0),
align_x(region._25), h);
var percent = global.progress / global.progress_max * 100;
/*draw_sprite_ext(spr_source, src.white,
align_x(region.bot_left, 0),
align_y(region.bot_left, 0),
scale, -scale, image_angle, image_blend, image_alpha);
draw_sprite_ext(spr_source, src.green,
align_x(region.bot_left, 0),
align_y(region.bot_left, 0),
scale/2, scale, image_angle, image_blend, image_alpha);*/
draw_sprite_stretched(spr_source, src.flip,
x_s, align_y(region.bot_left, 0),
w, h);
draw_sprite_stretched(spr_source, src.green,
x_s, align_y(region.bot_left, 0),
w*percent/100, h);
// Text
if (!global.show_galar)
var mode = "NATIONAL";
else
var mode = "GALAR";
if (global.show_shiny)
mode = string_insert(" SHINY", mode, string_length(mode)+1);
var progress = string(global.progress)+"/"+string(global.progress_max);
var percent_t = string(percent)+"%";
var fh = sprite_get_height(spr_font);
draw_set_font(global.font);
draw_set_color(c_dkgray);
draw_set_halign(fa_right);
var sca = global.icon_scale;
draw_text_transformed(x_f-off, align_y(region.bot_left, 0.21875), progress, sca, sca, image_angle);
draw_set_color(c_white);
draw_set_valign(fa_top);
sca = global.icon_scale * 1.25;
draw_text_transformed(x_f, align_y(region.bot_left, -0.375), mode, sca, sca, image_angle);
draw_set_halign(fa_left);
sca = global.icon_scale * 1.75;
draw_text_transformed(x_s, align_y(region.bot_left, -0.5), percent_t, sca, sca, image_angle);

View File

@ -20,13 +20,16 @@ global.hud_pokemon_rate = 0.225;
global.mouse_x_prev = mouse_x;
global.mouse_y_prev = mouse_x;
global.various = false;
global.various = false;
global.various_to = 0;
global.selecting = noone;
global.counter = 9999;
global.counter = 9999;
global.change = false;
global.progress = 0;
global.progress_max = 0;
enum region { boxes, top, mid_left, mid_right, bot_left, bot_right,
_0, _25, _50, _75, _100 };

View File

@ -29,5 +29,10 @@ with instance_create(px, py, obj_slot)
plus_y = 0;
spr_plus = 1;
if (own)
global.progress++;
global.progress_max++;
//show_debug_message("Spawned #"+dexno+" "+pokemon+" "+form+".");
}

View File

@ -0,0 +1,4 @@
if (own_prev==0 && own!=0)
global.progress++;
else if (own_prev!=0 && own==0)
global.progress--;

View File

@ -0,0 +1,8 @@
{
"id": "15f6da05-1158-20ed-dd4b-2fbf23fb3faf",
"modelName": "GMScript",
"mvc": "1.0",
"name": "progress_update",
"IsCompatibility": false,
"IsDnD": false
}

View File

@ -66,6 +66,7 @@
"247a6c1c-04b6-7db1-67ff-297c3ee1feca",
"aa0cd879-2cce-411a-dd1a-10c3fd63f802",
"ba2125b7-8439-ee4b-a25c-45062dccc0e6",
"15f6da05-1158-20ed-dd4b-2fbf23fb3faf",
"6ce290dc-805f-91e8-ca66-1b31a6b638b4"
],
"filterType": "GMScript",