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"
:dependencies [[org.clojure/clojure "1.6.0"]
[mw-engine "0.1.0-SNAPSHOT"]
[mw-parser "0.1.0-SNAPSHOT"]
[lib-noir "0.8.4"]
[ring-server "0.3.1"]
[selmer "0.6.8"]
@ -14,7 +15,8 @@
:repl-options {:init-ns mw-ui.repl}
: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
:init mw-ui.handler/init
:destroy mw-ui.handler/destroy}

View file

@ -37,6 +37,8 @@ body {
position: fixed;
z-index: 149;
background-color: black;
background-image: "../img/earth-space-strip.jpg";
background-repeat: no-repeat;
color: white;
}
@ -122,23 +124,4 @@ label {
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;
}
td.pasture {
td.water {
background-color: blue;
}
td.pasture, td.grassland {
background-color: lime;
}
td.scrub {
td.heath {
background-color: chartreuse;
}
td.scrub2 {
td.scrub {
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
(:require [mw-engine.core :as engine]
[mw-engine.world :as world]
[mw-engine.heightmap :as heightmap]
[mw-engine.natural-rules :as rules]
[hiccup.core :refer [html]]
[noir.session :as session]))
@ -32,7 +33,12 @@
(defn render-world-table
"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)
generation (+ (or (session/get :generation) 0) 1)
w2 (engine/transform-world world rules)]