master
rexim 2019-10-21 00:51:32 +07:00
parent 41321346fc
commit ed72f0b925
6 changed files with 22 additions and 5 deletions

View File

@ -47,4 +47,3 @@ script_show_goal_2 1249.832397 -862.224976 323.924408 544.635071 deaa87
script_hide_label_double_jump 1033.862549 -862.224976 215.969864 569.733276 d35f5f 1 label_double_jump
hide_wasd_script 260.383636 24.900909 125.925934 209.259262 a1e764 1 label_wasd
hide_space_to_jump 1449.166626 -122.291687 104.166626 165.000015 1ae5a0 1 label_space_to_jump

BIN
assets/sounds/dev/click.wav Normal file

Binary file not shown.

BIN
assets/sounds/dev/save.wav Normal file

Binary file not shown.

View File

@ -506,6 +506,8 @@ int level_editor_idle_event(LevelEditor *level_editor,
&level_editor->undo_history) < 0) {
return -1;
}
} else {
level_editor->click = 1;
}
@ -576,6 +578,7 @@ static int level_editor_dump(LevelEditor *level_editor)
fclose(RELEASE_LT(level_editor->lt, filedump));
fading_wiggly_text_reset(&level_editor->notice);
level_editor->save = 1;
return 0;
}
@ -587,11 +590,22 @@ int level_editor_update(LevelEditor *level_editor, float delta_time)
void level_editor_sound(LevelEditor *level_editor, Sound_samples *sound_samples)
{
// trace_assert(level_editor);
trace_assert(sound_samples);
if (level_editor && level_editor->bell) {
level_editor->bell = 0;
sound_samples_play_sound(sound_samples, 2);
if (level_editor) {
if (level_editor->bell) {
level_editor->bell = 0;
sound_samples_play_sound(sound_samples, 2);
}
if (level_editor->click) {
level_editor->click = 0;
sound_samples_play_sound(sound_samples, 3);
}
if (level_editor->save) {
level_editor->save = 0;
sound_samples_play_sound(sound_samples, 4);
}
}
}

View File

@ -46,6 +46,8 @@ struct LevelEditor
bool drag;
int bell;
int click;
int save;
const char *file_name;
};

View File

@ -118,6 +118,8 @@ int main(int argc, char *argv[])
"./sounds/nothing.wav",
"./sounds/something.wav",
"./sounds/dev/ding.wav",
"./sounds/dev/click.wav",
"./sounds/dev/save.wav"
};
const size_t sound_sample_files_count = sizeof(sound_sample_files) / sizeof(char*);