summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/votann/codex_view.clj185
-rw-r--r--src/votann/core.clj6
-rw-r--r--src/votann/point_chart_widget.clj2
-rw-r--r--src/votann/tab_widget.clj11
-rw-r--r--src/votann/util.clj2
5 files changed, 197 insertions, 9 deletions
diff --git a/src/votann/codex_view.clj b/src/votann/codex_view.clj
new file mode 100644
index 0000000..b2faddb
--- /dev/null
+++ b/src/votann/codex_view.clj
@@ -0,0 +1,185 @@
+(ns votann.codex-view
+ (:require [hiccup2.core :as h]
+ [hiccup.page :as page]))
+
+(def stat-head
+ [:tr
+ [:th "M"]
+ [:th "T"]
+ [:th "SV"]
+ [:th "W"]
+ [:th "LD"]
+ [:th "OC"]])
+
+(def stat-head-empty
+ [:tr
+ [:th]
+ [:th]
+ [:th]
+ [:th]
+ [:th]
+ [:th]])
+
+(def stat-body
+ [:tr
+ [:td "5\""]
+ [:td "5"]
+ [:td "3+"]
+ [:td "5"]
+ [:td "7+"]
+ [:td "1"]])
+
+(def stat-table
+ [:table
+ stat-head
+ stat-body])
+
+(def stat-table-bottom
+ [:table
+ stat-head-empty
+ stat-body])
+
+(defn stat-model [name]
+ [:div {:class "stat-name"} [:h3 name]])
+
+(defn stat-model-bottom [name]
+ [:div {:class "stat-name-bottom"} [:h3 name]])
+
+(def stats
+ [:stats
+ [:div {:class "stat-container"}
+ stat-table
+ (stat-model "Brokhyr Iron-Master")]
+ [:div {:class "stat-container"}
+ stat-table
+ (stat-model "Kahl")]
+ [:div {:class "stat-container"}
+ stat-table-bottom
+ (stat-model-bottom "CORVs")]
+ [:div {:class "stat-container"}
+ stat-table-bottom
+ (stat-model-bottom "XX")]
+ ])
+
+(def ranged-head
+ [:tr
+ [:th]
+ [:th {:class "text"} "Ranged Weapons"]
+ [:th "Range"]
+ [:th "A"]
+ [:th "BS"]
+ [:th "S"]
+ [:th "AP"]
+ [:th "D"]])
+
+(def ranged-body
+ [:tr
+ [:td {:class "icon"}]
+ [:td {:class "text"} "Autoch-pattern bolt pistol"]
+ [:td "12\""]
+ [:td "1"]
+ [:td "3+"]
+ [:td "4"]
+ [:td "0"]
+ [:td "1"]])
+
+(def melee-head
+ [:tr
+ [:th]
+ [:th {:class "text"} "Melee Weapons"]
+ [:th "Range"]
+ [:th "A"]
+ [:th "BS"]
+ [:th "S"]
+ [:th "AP"]
+ [:th "D"]])
+
+(def melee-body
+ [:tr
+ [:td {:class "icon"}]
+ [:td {:class "text"} "Autoch-pattern bolt pistol"]
+ [:td "Melee"]
+ [:td "1"]
+ [:td "3+"]
+ [:td "4"]
+ [:td "0"]
+ [:td "1"]])
+
+(def weapons
+ [:div {:class "weapons"}
+ [:table
+ ranged-head
+ ranged-body]
+ [:table
+ melee-head
+ melee-body]])
+
+(def column-1
+ [:div {:id "column-1"}
+ weapons])
+
+(def abilities-head
+ [:tr
+ [:th {:class "text"} "Abilities"]])
+
+(def abilities-body
+ [:tr
+ [:td "CORE: Leader"]])
+
+(def abilities
+ [:div {:class "abilities"}
+ [:table
+ abilities-head
+ abilities-body]])
+
+(def column-2
+ [:div {:id "column-2"}
+ abilities])
+
+(def keywords-model
+ [:div {:class "model"}
+ [:span "Keywords - All Models: Infanctry, Brokhyr Iron-Master | Brokhyr Iron-Master Model: Character"]])
+
+(def keywords-faction
+ [:div {:class "faction"}
+ [:div "Faction Keywords:"]
+ [:span "Leagues of Votann"]])
+
+(def keywords
+ [:div {:class "keywords"}
+ keywords-model
+ keywords-faction])
+
+(def star
+ [:div {:class "star"} ""])
+
+(def top
+ [:top
+ [:h1 "Uthar the Destined"]
+ stats])
+
+(def content
+ [:content
+ column-1
+ column-2])
+
+(def bottom
+ [:bottom
+ keywords
+ star])
+
+(def head
+ [:head
+ [:link {:rel "stylesheet" :href (votann.util/get-resource-path "css/style.css")}]])
+
+(def body
+ [:body
+ top
+ content
+ bottom])
+
+(def codex-page
+ (page/html5
+ (h/html
+ head
+ body)))
diff --git a/src/votann/core.clj b/src/votann/core.clj
index 2f8b09f..ef03fe7 100644
--- a/src/votann/core.clj
+++ b/src/votann/core.clj
@@ -7,8 +7,10 @@
(defn root-view [data]
{:fx/type :stage
- :max-width 1253
- :max-height 860
+ :max-width 1340
+ :min-width 1340
+ :max-height 1000
+ :min-height 1000
:on-close-request (fn [_] (System/exit 0))
:icons [(get-resource-path (str "leagues-of-votann/icon256x256.png"))
(get-resource-path (str "leagues-of-votann/icon48x48.png"))
diff --git a/src/votann/point_chart_widget.clj b/src/votann/point_chart_widget.clj
index f2d44fd..8fe0e89 100644
--- a/src/votann/point_chart_widget.clj
+++ b/src/votann/point_chart_widget.clj
@@ -12,6 +12,6 @@
{:fx/type ext-recreate-on-key-changed
:key units
:desc {:fx/type :pie-chart
- :pref-width 623
+ :pref-width 725
:title "Point Distribution"
:data (chart-data units)}})
diff --git a/src/votann/tab_widget.clj b/src/votann/tab_widget.clj
index 653a12c..cf468ca 100644
--- a/src/votann/tab_widget.clj
+++ b/src/votann/tab_widget.clj
@@ -3,7 +3,9 @@
[votann.util :refer [get-models unit-file-name]]
[votann.unit-widget :refer [unit-view-widget]]
[votann.enhancements-widget :refer [enhancements-view-widget]]
- [cljfx.api :as fx]))
+ [votann.codex-view :refer [codex-page]]
+ [cljfx.api :as fx]
+ [cljfx.ext.web-view :as fx.ext.web-view]))
(defn list-view-tab [data]
[{:fx/type :tab
@@ -35,8 +37,9 @@
[{:fx/type :tab
:text "Battle Simulator"
:closable false
- :content {:fx/type :label
- :text "placeholder battle simulator page"}}])
+ :content {:fx/type fx.ext.web-view/with-engine-props
+ :props {:content codex-page}
+ :desc {:fx/type :web-view}}}])
(defn tab-widget [data]
- (vec (apply concat [(list-view-tab data) codex-view-tab battle-simulator-view-tab])))
+ (vec (apply concat [(list-view-tab data) battle-simulator-view-tab])))
diff --git a/src/votann/util.clj b/src/votann/util.clj
index 2706a58..ed021a1 100644
--- a/src/votann/util.clj
+++ b/src/votann/util.clj
@@ -19,8 +19,6 @@
(defn get-resource-path [file]
(.toExternalForm (clojure.java.io/resource file)))
-(comment get-local-path)
-
(defn unit-file-name [unit]
(string/lower-case (string/replace unit " " "-")))