Commit 946d3cc7 by Guerric Chupin

Now using cabal.

parent 2af0cb17
......@@ -23,4 +23,6 @@ QUESTIONS.md
*.#*
html/
/GUI/
/img/Shapes.hs
\ No newline at end of file
/img/Shapes.hs
/dist
*.save*
\ No newline at end of file
# Revision history for reactogon
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
-- Initial reactogon.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: RMCA
version: 0.1.0.0
-- synopsis:
-- description:
homepage: https://gitlab.com/chupin/reactogon
-- license:
license-file: LICENSE
author: Guerric Chupin
maintainer: guerric.chupin@gmail.com
-- copyright:
-- category:
build-type: Simple
extra-source-files: ChangeLog.md, README.md
cabal-version: >=1.10
data-files: img/*.png, img/*.svg
executable RMCA
main-is: RMCA/Main.hs
-- other-modules:
other-extensions: MultiParamTypeClasses, ScopedTypeVariables, Arrows, FlexibleInstances, TypeSynonymInstances, FlexibleContexts, GeneralizedNewtypeDeriving
build-depends: base >=4.8 && <4.10, array >=0.5 && <0.6, cairo >=0.13 && <0.14, keera-hails-reactivevalues >=0.2 && <0.3, Yampa >=0.10 && <0.11, gtk-helpers >=0.0 && <0.1, gtk >=0.14 && <0.15, keera-hails-reactive-gtk >=0.3 && <0.4, keera-hails-reactive-yampa >=0.0 && <0.1, containers >=0.5 && <0.6, jack >=0.7 && <0.8, midi >=0.2 && <0.3, explicit-exception >=0.1 && <0.2, transformers >=0.4 && <0.6, event-list >=0.1 && <0.2, keera-callbacks >=0.1 && <0.2, glib >=0.13 && <0.14, directory >=1.2 && <1.3, process >=1.4 && <1.5
hs-source-dirs: src
build-tools: hsc2hs
default-language: Haskell2010
ghc-options: -O2 -threaded
import Distribution.Simple
main = defaultMain
......@@ -20,6 +20,7 @@ import Graphics.UI.Gtk hiding (Action)
import Graphics.UI.Gtk.Board.BoardLink
import Graphics.UI.Gtk.Board.TiledBoard hiding (Board)
import qualified Graphics.UI.Gtk.Board.TiledBoard as BIO
import Paths_RMCA
import RMCA.Global.Clock
import RMCA.Semantics
......@@ -276,10 +277,12 @@ clickHandling board = do
fileToPixbuf :: IO [(FilePath,Pixbuf)]
fileToPixbuf = mapM (\f -> let f' = "img/" ++ f in uncurry (liftM2 (,))
( return f'
, pixbufNewFromFile f' >>=
\p -> pixbufScaleSimple p hexW hexW InterpBilinear ))
fileToPixbuf = mapM (\f -> let f' = ("img/" ++ f) in
uncurry (liftM2 (,))
( return f'
, getDataFileName f' >>=
\f'' -> pixbufNewFromFile f'' >>=
\p -> pixbufScaleSimple p hexW hexW InterpBilinear))
(["hexOn.png","hexOff.png","stop.svg","split.svg","absorb.svg"] ++
concat [["start" ++ show d ++ ".svg","ric" ++ show d ++ ".svg"]
| d <- [N .. NW]])
......@@ -288,11 +291,10 @@ actionToFile :: GUICell -> FilePath
actionToFile GUICell { cellAction = a
, asPh = ph
} =
case (a,ph) of
(Inert,True) -> "img/hexOn.png"
(Inert,False) -> "img/hexOff.png"
(Absorb,_) -> "img/absorb.svg"
(Stop _,_) -> "img/stop.svg"
(ChDir True _ d,_) -> "img/start" ++ show d ++ ".svg"
(ChDir False _ d,_) -> "img/ric" ++ show d ++ ".svg"
(Split _,_) -> "img/split.svg"
case a of
Inert -> "img/hexO" ++ (if ph then "n" else "ff") ++ ".png"
Absorb -> "img/absorb.svg"
Stop _ -> "img/stop.svg"
ChDir True _ d -> "img/start" ++ show d ++ ".svg"
ChDir False _ d -> "img/ric" ++ show d ++ ".svg"
Split _ -> "img/split.svg"
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