mirror of
https://github.com/PoshoDev/DexTool.git
synced 2026-08-24 19:44:13 -05:00
Added a working progress bar.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
@@ -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 };
|
||||
@@ -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+".");
|
||||
}
|
||||
|
||||
4
Project/scripts/progress_update/progress_update.gml
Normal file
4
Project/scripts/progress_update/progress_update.gml
Normal file
@@ -0,0 +1,4 @@
|
||||
if (own_prev==0 && own!=0)
|
||||
global.progress++;
|
||||
else if (own_prev!=0 && own==0)
|
||||
global.progress--;
|
||||
8
Project/scripts/progress_update/progress_update.yy
Normal file
8
Project/scripts/progress_update/progress_update.yy
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "15f6da05-1158-20ed-dd4b-2fbf23fb3faf",
|
||||
"modelName": "GMScript",
|
||||
"mvc": "1.0",
|
||||
"name": "progress_update",
|
||||
"IsCompatibility": false,
|
||||
"IsDnD": false
|
||||
}
|
||||
Reference in New Issue
Block a user