Commit da6a9d05 authored by Guerric Chupin's avatar Guerric Chupin

Rotation is now done with right click and selection with left.

parent 180da363
{-# LANGUAGE ScopedTypeVariables, TupleSections, FlexibleContexts #-}
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, ScopedTypeVariables,
TupleSections #-}
module RMCA.GUI.NoteSettings where
......@@ -209,26 +210,28 @@ clickHandling pieceArrRV board pieceBox = do
return True
)
boardOnRelease board
(\fPos -> liftIO $ do
postGUIAsync $ do
mp <- boardGetPiece fPos board
mstate <- tryTakeMVar state
when (fPos `elem` validArea && isJust mp) $ do
let piece = snd $ fromJust mp
when (maybe False (== fPos) mstate) $
boardSetPiece fPos (BF.second rotateGUICell (Player,piece)) board
nmp <- boardGetPiece fPos board
--print nmp
when (isJust nmp) $ do
let nC = snd $ fromJust nmp
reactiveValueWrite setRV (fPos,nC)
fromMaybeM_ $ reactiveValueWrite artComboRV . naArt <$>
getNAttr (cellAction nC)
fromMaybeM_ $
reactiveValueWrite slideComboRV . ornSlide . naOrn <$> getNAttr (cellAction nC)
reactiveValueWrite rCountRV $ repeatCount nC
fromMaybeM_ $ reactiveValueWrite noteDurRV . naDur <$>
getNAttr (cellAction nC)
(\fPos -> do
button <- eventButton
liftIO $ do
postGUIAsync $ do
mp <- boardGetPiece fPos board
mstate <- tryTakeMVar state
when (fPos `elem` validArea && isJust mp) $ do
let piece = snd $ fromJust mp
when (button == RightButton && maybe False (== fPos) mstate) $
boardSetPiece fPos (BF.second rotateGUICell (Player,piece)) board
nmp <- boardGetPiece fPos board
--print nmp
when (button == LeftButton && isJust nmp) $ do
let nC = snd $ fromJust nmp
reactiveValueWrite setRV (fPos,nC)
fromMaybeM_ $ reactiveValueWrite artComboRV . naArt <$>
getNAttr (cellAction nC)
fromMaybeM_ $
reactiveValueWrite slideComboRV . ornSlide . naOrn <$> getNAttr (cellAction nC)
reactiveValueWrite rCountRV $ repeatCount nC
fromMaybeM_ $ reactiveValueWrite noteDurRV . naDur <$>
getNAttr (cellAction nC)
return True
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment