From 43ecea0b19b61ad2d4e29cfd62e4bb736a5647fc Mon Sep 17 00:00:00 2001 From: Yichuan Shen Date: Sun, 16 Aug 2015 13:16:11 +0200 Subject: [PATCH] Remove unnecessary stuff --- module/sound.js | 8 ++++---- view/index.js | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/module/sound.js b/module/sound.js index 96079803e..d04a7e964 100644 --- a/module/sound.js +++ b/module/sound.js @@ -9,13 +9,13 @@ var pachiSounds = Object.keys(new Int8Array(5)).map(function(x) { var newGameSound = new Audio('../sound/newgame.wav') var passSound = new Audio('../sound/pass.wav') -exports.playCaptureSound = function() { +exports.playCapture = function() { captureSounds[Math.floor(Math.random() * 5)].play() } -exports.playPachiSound = function() { +exports.playPachi = function() { pachiSounds[Math.floor(Math.random() * 5)].play() } -exports.playNewGameSound = function() { newGameSound.play() } -exports.playPassSound = function() { passSound.play() } +exports.playNewGame = function() { newGameSound.play() } +exports.playPass = function() { passSound.play() } diff --git a/view/index.js b/view/index.js index 08339017a..4f6244168 100644 --- a/view/index.js +++ b/view/index.js @@ -4,7 +4,6 @@ var shell = require('shell') var sgf = require('../module/sgf') var gametree = require('../module/gametree') var sound = require('../module/sound') -var uuid = require('../lib/node-uuid') var process = remote.require('process') var app = remote.require('app') var dialog = remote.require('dialog') @@ -440,11 +439,11 @@ function makeMove(vertex) { // Play sounds if (capture || suicide) setTimeout(function() { - sound.playCaptureSound() + sound.playCapture() }, 300 + Math.floor(Math.random() * 200)) - sound.playPachiSound() - } else sound.playPassSound() + sound.playPachi() + } else sound.playPass() if (tree.current == null && tree.nodes.length - 1 == index) { @@ -779,7 +778,7 @@ function newGame(playSound) { setRootTree(tree) if (arguments.length >= 1 && playSound) { - sound.playNewGameSound() + sound.playNewGame() showGameInfo() }