Brought UI up todate with heightmap.

This commit is contained in:
simon 2014-07-04 11:02:40 +01:00
parent 52f19a28cd
commit 53c7d1ca87
6 changed files with 21 additions and 26 deletions

View file

@ -3,6 +3,7 @@
:url "http://example.com/FIXME" :url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.6.0"] :dependencies [[org.clojure/clojure "1.6.0"]
[mw-engine "0.1.0-SNAPSHOT"] [mw-engine "0.1.0-SNAPSHOT"]
[mw-parser "0.1.0-SNAPSHOT"]
[lib-noir "0.8.4"] [lib-noir "0.8.4"]
[ring-server "0.3.1"] [ring-server "0.3.1"]
[selmer "0.6.8"] [selmer "0.6.8"]
@ -14,7 +15,8 @@
:repl-options {:init-ns mw-ui.repl} :repl-options {:init-ns mw-ui.repl}
:plugins [[lein-ring "0.8.10"] :plugins [[lein-ring "0.8.10"]
[lein-environ "0.5.0"]] [lein-environ "0.5.0"]
[lein-marginalia "0.7.1"]]
:ring {:handler mw-ui.handler/app :ring {:handler mw-ui.handler/app
:init mw-ui.handler/init :init mw-ui.handler/init
:destroy mw-ui.handler/destroy} :destroy mw-ui.handler/destroy}

View file

@ -37,6 +37,8 @@ body {
position: fixed; position: fixed;
z-index: 149; z-index: 149;
background-color: black; background-color: black;
background-image: "../img/earth-space-strip.jpg";
background-repeat: no-repeat;
color: white; color: white;
} }
@ -122,23 +124,4 @@ label {
border-right: thin solid gray; border-right: thin solid gray;
} }
table {
width 100%;
padding: 0;
border: 0.25em solid silver;
}
td, th {
margin: 0;
padding: 0.25em 1em;
}
th {
border: thin solid gray;
background-color: silver;
}
td {
border: thin solid silver;
background-color: white;
}

View file

@ -2,15 +2,19 @@ td.waste {
background-color: gray; background-color: gray;
} }
td.pasture { td.water {
background-color: blue;
}
td.pasture, td.grassland {
background-color: lime; background-color: lime;
} }
td.scrub { td.heath {
background-color: chartreuse; background-color: chartreuse;
} }
td.scrub2 { td.scrub {
background-color: lime; background-color: lime;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -1,6 +1,7 @@
(ns mw-ui.render-world (ns mw-ui.render-world
(:require [mw-engine.core :as engine] (:require [mw-engine.core :as engine]
[mw-engine.world :as world] [mw-engine.world :as world]
[mw-engine.heightmap :as heightmap]
[mw-engine.natural-rules :as rules] [mw-engine.natural-rules :as rules]
[hiccup.core :refer [html]] [hiccup.core :refer [html]]
[noir.session :as session])) [noir.session :as session]))
@ -32,7 +33,12 @@
(defn render-world-table (defn render-world-table
"Render the world implied by the session as a complete HTML page." "Render the world implied by the session as a complete HTML page."
[] []
(let [world (or (session/get :world) (world/make-world 20 20)) (let [world (or (session/get :world)
(engine/transform-world
(heightmap/apply-heightmap
(world/make-world 20 20)
"resources/public/img/20x20/hill.png")
rules/init-rules))
rules (or (session/get :rules) rules/natural-rules) rules (or (session/get :rules) rules/natural-rules)
generation (+ (or (session/get :generation) 0) 1) generation (+ (or (session/get :generation) 0) 1)
w2 (engine/transform-world world rules)] w2 (engine/transform-world world rules)]