Merge branch 'master' of ssh://goldsmith.journeyman.cc/srv/git/mw-ui
Conflicts: src/mw_ui/routes/home.clj
This commit is contained in:
commit
12ef500c9f
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
|
||||
resources/public/docs/mw-*/
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -47,7 +47,7 @@
|
|||
(compiler/compile-file
|
||||
(io/get-resource "/rulesets/basic.txt")))
|
||||
(session/get :rules)))
|
||||
generation (+ (or (session/get :generation) 0) 1)
|
||||
generation (inc (or (session/get :generation) 0))
|
||||
w2 (engine/transform-world world rules)
|
||||
]
|
||||
(session/put! :world w2)
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
(let [params (keywordize-keys (:params request))
|
||||
xs (:x params)
|
||||
ys (:y params)
|
||||
x (if (not (empty? xs)) (read-string xs) 0)
|
||||
y (if (not (empty? ys)) (read-string ys) 0)
|
||||
x (if (seq xs) (read-string xs) 0)
|
||||
y (if (seq ys) (read-string ys) 0)
|
||||
world (session/get :world)
|
||||
cell (engine-utils/get-cell world x y)
|
||||
state (:state params)]
|
||||
|
@ -84,6 +84,7 @@
|
|||
:pause (or (session/get :pause) 5)
|
||||
:maybe-refresh "refresh"}))
|
||||
|
||||
|
||||
(defroutes home-routes
|
||||
(GET "/" [] (home-page))
|
||||
(GET "/about" [] (about-page))
|
||||
|
|
|
@ -31,15 +31,14 @@
|
|||
pause (:pause params)
|
||||
rulefile (:ruleset params)
|
||||
rulepath (str "/rulesets/" rulefile ".txt")]
|
||||
(if (not (= map ""))
|
||||
(if (not= map "")
|
||||
(session/put! :world
|
||||
(heightmap/apply-heightmap
|
||||
(io/get-resource (str "/img/heightmaps/" map ".png")))))
|
||||
(if (not (= rulefile ""))
|
||||
(do
|
||||
(session/put! :rule-text (io/slurp-resource rulepath))
|
||||
(session/put! :rules (compiler/compile-file (io/get-resource rulepath)))))
|
||||
(if (not (= pause ""))
|
||||
(when (not= rulefile "")
|
||||
(session/put! :rule-text (io/slurp-resource rulepath))
|
||||
(session/put! :rules (compiler/compile-file (io/get-resource rulepath))))
|
||||
(if (not= pause "")
|
||||
(session/put! :pause pause))
|
||||
(layout/render "params.html"
|
||||
(merge (send-params)
|
||||
|
|
|
@ -16,6 +16,6 @@
|
|||
[path (str (io/resource-path) directory)]
|
||||
(session/put! :list-resources-path path)
|
||||
(sort
|
||||
(filter #(not (nil? %))
|
||||
(remove nil?
|
||||
(map #(first (rest (re-matches pattern (.getName %))))
|
||||
(file-seq (clojure.java.io/file path)))))))
|
||||
|
|
Loading…
Reference in a new issue