]> git.lizzy.rs Git - nothing.git/commitdiff
(#1108) NothingXP
authorrexim <reximkut@gmail.com>
Sun, 20 Oct 2019 17:51:32 +0000 (00:51 +0700)
committerrexim <reximkut@gmail.com>
Sun, 20 Oct 2019 17:51:32 +0000 (00:51 +0700)
assets/levels/level-01.txt
assets/sounds/dev/click.wav [new file with mode: 0644]
assets/sounds/dev/save.wav [new file with mode: 0644]
src/game/level/level_editor.c
src/game/level/level_editor.h
src/main.c

index 7259a96cf39d0700e80a528b84ff17c5c734be46..c0e9f06207d8b570807668090551c031eb3c25d7 100644 (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
-
diff --git a/assets/sounds/dev/click.wav b/assets/sounds/dev/click.wav
new file mode 100644 (file)
index 0000000..b6ecb06
Binary files /dev/null and b/assets/sounds/dev/click.wav differ
diff --git a/assets/sounds/dev/save.wav b/assets/sounds/dev/save.wav
new file mode 100644 (file)
index 0000000..f1d38e6
Binary files /dev/null and b/assets/sounds/dev/save.wav differ
index aadd23d1339f9264167ef591fb706b670fce6550..9d9a0e94d08db2737cd5fd1f60d219aba6b26b50 100644 (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);
+        }
     }
 }
index 1eaedbfbc907b65623914e6c0fa9a39b566f880b..aa5a91eb298788979f82a5c55f89305b5d81f092 100644 (file)
@@ -46,6 +46,8 @@ struct LevelEditor
 
     bool drag;
     int bell;
+    int click;
+    int save;
 
     const char *file_name;
 };
index 9cdbc66bab4c9757fb733c6764a85aaf90e42aab..81ca4de5054cf5ed5c8b2f61164ae11f6def823a 100644 (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*);