Skip to content

Commit

Permalink
Add difficulty indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
NagaseIori committed Jun 2, 2022
1 parent 25095db commit 4d2d078
Show file tree
Hide file tree
Showing 30 changed files with 525 additions and 5 deletions.
7 changes: 7 additions & 0 deletions DyNode.yyp

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

Binary file added artassets/Difficulties.psd
Binary file not shown.
Binary file added artassets/casual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artassets/giga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artassets/hard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artassets/mega.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artassets/normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artassets/tera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion objects/objmain/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
chartBeatPerMin = 180;
chartBarPerMin = 180/4;
chartOffset = 0;
chartDifficulty = "CASUAL";
chartDifficulty = 0;
chartSideType = ["MIXER", "MULTI"];
chartID = "";
chartMusicFile = "";
Expand Down
7 changes: 6 additions & 1 deletion objects/objmain/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ var _nw = global.resolutionW, _nh = global.resolutionH;
// Draw Title

titleElement
.draw(global.resolutionW*0.021, global.resolutionH - targetLineBelow + 34);
.draw(resor_to_x(0.021), global.resolutionH - targetLineBelow + 34);

// Draw Difficulty
better_scaling_draw_sprite(global.difficultySprite[chartDifficulty], 0,
resor_to_x(0.019), global.resolutionH - targetLineBelow + 77, 0.2, 0.2, 0, c_white,
1, 0);

// Draw targetline

Expand Down
2 changes: 2 additions & 0 deletions objects/objmanager/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ global.fpsAdjust = BASE_FPS / room_speed;
global.scaleXAdjust = global.resolutionW / BASE_RES_W;
global.scaleYAdjust = global.resolutionH / BASE_RES_H;

global.difficultyName = ["CASUAL", "NORMAL", "HARD", "MEGA", "GIGA", "TERA"];
global.difficultySprite = [sprCasual, sprNormal, sprHard, sprMega, sprGiga, sprTera];

// Set GUI Resolution

Expand Down
38 changes: 35 additions & 3 deletions scripts/scrSystem/scrSystem.gml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,40 @@ function map_init() {
// show_debug_message("ARRAY LENGTH:"+string(array_length(chartNotesArray)));
// show_debug_message("ARRAY:"+string(chartNotesArray));
array_sort_f(chartNotesArray, _f);

// Get the chart's difficulty

var _diff = "";
switch string_char_at(chartID, string_length(chartID)) {
case "C":
_diff = 0;
break;
case "N":
_diff = 1;
break;
case "H":
_diff = 2;
break;
case "M":
_diff = 3;
break;
case "G":
_diff = 4;
break;
case "T":
_diff = 5;
break;
default:
_diff = 0;
}
chartDifficulty = _diff;
}

}

function map_load() {
var _file = "";
_file = get_open_filename_ext("XML Files|*.xml", "example.xml",
_file = get_open_filename_ext("XML Files (*.xml)|*.xml", "example.xml",
program_directory, "Load Dynamix Chart File 加载谱面文件");

if(_file == "") return;
Expand Down Expand Up @@ -200,11 +227,13 @@ function map_load_xml(_file) {
break;
}
}

DerpXmlRead_CloseFile();
}

function music_load() {
var _file = "";
_file = get_open_filename_ext("Music Files|*.mp3;*.flac;*.wav;*.ogg", "",
_file = get_open_filename_ext("Music Files (*.mp3;*.flac;*.wav;*.ogg;*.aiff;*.mid)|*.mp3;*.flac;*.wav;*.ogg;*.aiff;*.mid", "",
program_directory, "Load Music File 加载音乐文件");

if(_file == "") return;
Expand All @@ -222,6 +251,9 @@ function music_load() {
music = FMODGMS_Snd_LoadSound(_file);
FMODGMS_Snd_PlaySound(music, channel);
if(!nowPlaying) FMODGMS_Chan_PauseChannel(channel);
else {
nowTime = _time_to_offset(0);
}
sampleRate = FMODGMS_Chan_Get_Frequency(channel);
musicLength = FMODGMS_Snd_Get_Length(music);
musicLength = FMODGMS_Util_SamplesToSeconds(musicLength, sampleRate) * 1000;
Expand All @@ -232,7 +264,7 @@ function music_load() {

function image_load() {
var _file = "";
_file = get_open_filename_ext("Image Files|*.jpg;*.png|JPG Files|*.jpg|PNG Files|*.png", "",
_file = get_open_filename_ext("Image Files (*.jpg;*.jpeg;*.png)|*.jpg;*.jpeg;*.png|JPG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png", "",
program_directory, "Load Background File 加载背景图片");

if(_file == "") return;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions sprites/sprcasual/sprcasual.yy

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions sprites/sprgiga/sprgiga.yy

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4d2d078

Please sign in to comment.