Skip to content

Commit

Permalink
More Sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
tgass committed May 10, 2016
1 parent 9b29eaa commit 2e8da92
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Macbeth/Wx/Config/DefaultSounds.hs
Expand Up @@ -47,5 +47,5 @@ requestS = RequestS {

otherS :: OtherS
otherS = OtherS {
logonToServer = Just "gong.wav"
logonToServer = Just "ding1.wav"
}
3 changes: 2 additions & 1 deletion src/Macbeth/Wx/Configuration.hs
Expand Up @@ -62,4 +62,5 @@ addUser c mUser = c { C.user = mUser }
comments :: String
comments = "# Changes will take effect only after restart (for now).\n\n\
\# If you change the directory make sure it exists.\n\
\# It will not be created for you.\n\n"
\# It will not be created for you.\n\n\
\# You can use your own sounds by putting them in MACBETH_USER_DIR/sounds\n\n\n"
6 changes: 5 additions & 1 deletion src/Macbeth/Wx/ToolBox.hs
Expand Up @@ -20,6 +20,7 @@ import Macbeth.Wx.Game.Game
import Macbeth.Wx.Challenge
import Macbeth.Wx.PartnerOffer
import Macbeth.Wx.Pending
import Macbeth.Wx.Sounds
import qualified Macbeth.Wx.Config.UserConfig as C
import Paths

Expand Down Expand Up @@ -149,6 +150,7 @@ wxToolBox h chan = do
set tbarItem_match [on command := dupChan chan >>= wxMatch h True ]

LoggedIn handle -> do
playSound config (C.sounds config >>= C.logonToServer . C.other)
set nb [on click := (onMouse nb >=> clickHandler h nb)]
hPutStrLn h `mapM_` [ "ping", "set seek 0", "set style 12", "iset pendinfo 1", "iset seekinfo 1", "iset nowrap 1", "iset defprompt 1", "iset block 1", "2 iset lock 1"]
set statusLoggedIn [ text := name handle]
Expand All @@ -160,7 +162,9 @@ wxToolBox h chan = do

WxObserve move chan' -> wxGame h move chan'

MatchRequested c -> dupChan chan >>= wxChallenge h c
MatchRequested c -> do
playSound config (C.sounds config >>= C.challenge . C.request)
dupChan chan >>= wxChallenge h c

WxMatchAccepted move chan' -> wxGame h move chan'

Expand Down

0 comments on commit 2e8da92

Please sign in to comment.