Skip to content

Commit c694211

Browse files
committed
Fixed formatting
1 parent cf8ac5f commit c694211

File tree

3 files changed

+48
-37
lines changed

3 files changed

+48
-37
lines changed

src/clj/orcpub/styles/core.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,8 @@
10931093
:border-radius "2px"
10941094
:text-transform :uppercase
10951095
:padding "8px 8px"
1096+
:margin-right "2px"
1097+
:margin-left "2px"
10961098
:cursor :pointer
10971099
:background-image "linear-gradient(to bottom, #f1a20f, #dbab50)"}]
10981100

src/cljc/orcpub/dice.cljc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
mod (* raw-mod plus-minus)
6363
rolls (roll-n num sides)
6464
total (apply + mod rolls)]
65+
(prn (str "total:" total " roll:" rolls " plus-minus:" plus-minus-str " raw-mod:" raw-mod " dice-text:" dice-text))
6566
(str total " = " rolls " " plus-minus-str " " raw-mod))))
6667

6768
(spec/def ::num pos-int?)

src/cljs/orcpub/dnd/e5/views.cljs

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,10 +1794,10 @@
17941794
(let [spell-map @(subscribe [::spells/spells-map])
17951795
spell (spell-map key)
17961796
cls-mods (get spell-modifiers class)
1797+
spell-dc (get cls-mods :spell-save-dc)
17971798
remaining-preps (- prepare-spell-count
17981799
prepared-spell-count)]
1799-
[[:tr.pointer
1800-
{:on-click on-click}
1800+
[[:tr.spell
18011801
[:td.p-l-10.p-b-10.p-t-10.f-w-b
18021802
(if (and (pos? lvl)
18031803
(get prepares-spells class))
@@ -1820,7 +1820,11 @@
18201820
[:td.p-l-10.p-b-10.p-t-10 (if ability (s/upper-case (common/safe-name ability)))]
18211821
[:td.p-l-10.p-b-10.p-t-10 (get cls-mods :spell-save-dc)]
18221822
[:td.p-l-10.p-b-10.p-t-10 (common/bonus-str (get cls-mods :spell-attack-modifier))]
1823-
[:td.p-r-10.orange
1823+
[:td.p-l-10.p-b-10.p-t-10 [:button.form-button-checks
1824+
{:on-click #(dispatch [:show-message-2 (str (:name spell) " attack " (dice/dice-roll-text-2 (str "1d20" (common/bonus-str (get cls-mods :spell-attack-modifier)))))])}
1825+
"Roll"]]
1826+
[:td.p-l-10.p-b-10.p-t-10.pointer.orange
1827+
{:on-click on-click}
18241828
[:i.fa
18251829
{:class-name (if expanded? "fa-caret-up" "fa-caret-down")}]]]
18261830
(if expanded?
@@ -1853,7 +1857,7 @@
18531857
(if (pos? lvl)
18541858
[:span.f-w-b (str @(subscribe [::char/spell-slots-remaining id lvl]) " remaining")])]
18551859
[:table.w-100-p.t-a-l.striped
1856-
[:tbody
1860+
[:tbody.spells
18571861
[:tr.f-w-b.f-s-12
18581862
[:th.p-l-10.p-b-10.p-t-10 (if (and (not (zero? lvl))
18591863
(seq prepares-spells))
@@ -1862,9 +1866,11 @@
18621866
[:th.p-l-10.p-b-10.p-t-10 (if mobile? "Src" "Source")]
18631867
[:th.p-l-10.p-b-10.p-t-10 (if mobile? "Aby" "Ability")]
18641868
[:th.p-l-10.p-b-10.p-t-10 "DC"]
1865-
[:th.p-l-10
1869+
[:th
18661870
{:class-name (if (not mobile?) "p-b-10 p-t-10")}
1867-
"Mod."]]
1871+
"Mod."]
1872+
[:th.p-l-10.p-b-10.p-t-10 "Attack"]
1873+
[:th.p-l-10.p-b-10.p-t-10]]
18681874
(doall
18691875
(map-indexed
18701876
(fn [i r]
@@ -2161,7 +2167,7 @@
21612167
v]]
21622168
(if (boolean show-button)
21632169
[:div.f-s-24.f-w-b [:button.form-button-checks
2164-
{:on-click #(dispatch [:show-message-2 (str title " check " (dice/dice-roll-text-2 (str "1d20" v))) 10000])}
2170+
{:on-click #(dispatch [:show-message-2 (str title " check " (dice/dice-roll-text-2 (str "1d20" v)))])}
21652171
"Roll"]])])
21662172

21672173
(def current-hit-points-editor-style
@@ -2284,7 +2290,7 @@
22842290
[:span.m-l-5.saving-throw-name (s/upper-case (name k))]]]
22852291
[:td [:div.p-5.saving-throw-bonus (common/bonus-str (save-bonuses k))]]
22862292
[:td [:button.form-button-checks
2287-
{:on-click #(dispatch [:show-message-2 (str (s/upper-case (name k)) " check " (dice/dice-roll-text-2 (str "1d20" (common/mod-str (save-bonuses k))))) 10000])}
2293+
{:on-click #(dispatch [:show-message-2 (str (s/upper-case (name k)) " check " (dice/dice-roll-text-2 (str "1d20" (common/mod-str (save-bonuses k)))))])}
22882294
"Roll"]]])
22892295
char/ability-keys))]]]))
22902296

@@ -2626,14 +2632,14 @@
26262632
[:span.m-l-5.f-w-b.f-s-18 "Armor"]]
26272633
[:div
26282634
[:table.w-100-p.t-a-l.striped
2629-
[:tbody
2635+
[:tbody.armor
26302636
[:tr.f-w-b
26312637
{:class-name (if mobile? "f-s-12")}
26322638
[:th.p-10 "Name"]
26332639
(if (not mobile?) [:th.p-10 "Proficient?"])
26342640
[:th.p-10 "Details"]
2635-
[:th]
2636-
[:th.p-10 "AC"]]
2641+
[:th.p-10 "AC"]
2642+
[:th.p-10]]
26372643
(doall
26382644
(for [{:keys [name description type key] :as armor} (conj armor-details nil)
26392645
shield (conj shield-details nil)]
@@ -2648,22 +2654,22 @@
26482654
(armor-profs type)))
26492655
expanded? (@expanded-details k)]
26502656
^{:key (str key (:key shield))}
2651-
[:tr.pointer
2652-
{:on-click (toggle-details-expanded-handler expanded-details k)}
2657+
[:tr.item
26532658
[:td.p-10.f-w-b (str (or (::mi/name armor) (:name armor) "unarmored")
26542659
(if shield (str " + " (:name shield))))]
26552660
(if (not mobile?)
26562661
[:td.p-10 (boolean-icon proficient?)])
26572662
[:td.p-10.w-100-p
26582663
[:div
26592664
(armor-details-section armor shield expanded?)]]
2665+
[:td.p-10.f-w-b.f-s-18 ac]
26602666
[:td
26612667
[:div.orange
2662-
(if (not mobile?)
2663-
[:span.underline (if expanded? "less" "more")])
2668+
{:on-click (toggle-details-expanded-handler expanded-details k)}
2669+
#_(if (not mobile?)
2670+
[:span.underline (if expanded? "less" "more")])
26642671
[:i.fa.m-l-5
2665-
{:class-name (if expanded? "fa-caret-up" "fa-caret-down")}]]]
2666-
[:td.p-10.f-w-b.f-s-18 ac]])))]]]]))))
2672+
{:class-name (if expanded? "fa-caret-up" "fa-caret-down")}]]]])))]]]]))))
26672673

26682674
(defn section-header [icon title]
26692675
[:div.flex.align-items-c
@@ -2686,14 +2692,15 @@
26862692
[section-header "crossed-swords" "Weapons"]
26872693
[:div
26882694
[:table.w-100-p.t-a-l.striped
2689-
[:tbody
2695+
[:tbody.weapons
26902696
[:tr.f-w-b
26912697
{:class-name (if mobile? "f-s-12")}
26922698
[:th.p-10 "Name"]
26932699
(if (not mobile?) [:th.p-10 "Proficient?"])
26942700
[:th "Details"]
2695-
[:th]
2696-
[:th (if mobile? "Atk" [:div.w-40 "Attack Bonus"])]]
2701+
2702+
[:th (if mobile? "Atk" [:div.w-40 "Attack Bonus"])]
2703+
[:th.p-10]]
26972704
(doall
26982705
(map
26992706
(fn [[weapon-key {:keys [equipped?]}]]
@@ -2704,7 +2711,7 @@
27042711
droll (str damage-die-count "d" damage-die)]
27052712
(if (not= type :ammunition)
27062713
^{:key weapon-key}
2707-
[:tr
2714+
[:tr.weapon
27082715
[:td.p-10.f-w-b (or (:name weapon)
27092716
(::mi/name weapon))]
27102717
(if (not mobile?)
@@ -2714,20 +2721,21 @@
27142721
(weapon-attack-description weapon damage-modifier nil)]
27152722
(if expanded?
27162723
(weapon-details weapon weapon-damage-modifier))]
2717-
[:td.pointer
2718-
{:on-click (toggle-details-expanded-handler expanded-details weapon-key)}
2719-
[:div.orange
2720-
(if (not mobile?)
2721-
[:span.underline (if expanded? "less" "more")])
2722-
[:i.fa.m-l-5
2723-
{:class-name (if expanded? "fa-caret-up" "fa-caret-down")}]]]
2724+
27242725
[:td.p-10.f-w-b.f-s-18 (common/bonus-str (weapon-attack-modifier weapon))]
27252726
[:td [:button.form-button-checks
27262727
{:on-click #(dispatch [:show-message-2 (str name " attack " (dice/dice-roll-text-2 (str "1d20" (common/mod-str (weapon-attack-modifier weapon)))))])}
27272728
"Attack"]]
27282729
[:td [:button.form-button-checks
27292730
{:on-click #(dispatch [:show-message-2 (str name " damage " (dice/dice-roll-text-2 (str droll (common/mod-str (weapon-attack-modifier weapon)))))])}
2730-
"Damage"]]])))
2731+
"Damage"]]
2732+
[:td.pointer
2733+
{:on-click (toggle-details-expanded-handler expanded-details weapon-key)}
2734+
[:div.orange
2735+
#_(if (not mobile?)
2736+
[:span.underline (if expanded? "less" "more")])
2737+
[:i.fa.m-l-5
2738+
{:class-name (if expanded? "fa-caret-up" "fa-caret-down")}]]]])))
27312739
all-weapons))]]]]))))
27322740

27332741
(defn magic-item-rows [expanded-details magic-item-cfgs magic-weapon-cfgs magic-armor-cfgs]
@@ -2737,16 +2745,16 @@
27372745
(fn [[item-kw item-cfg]]
27382746
(let [{:keys [::mi/name ::mi/type ::mi/item-subtype ::mi/rarity ::mi/attunement ::mi/description ::mi/summary] :as item} (magic-item-map item-kw)
27392747
expanded? (@expanded-details item-kw)]
2740-
[[:tr.pointer
2741-
{:on-click (toggle-details-expanded-handler expanded-details item-kw)}
2748+
[[:tr
27422749
[:td.p-10.f-w-b (or (:name item) name)]
27432750
[:td.p-10 (str (common/kw-to-name type)
27442751
", "
27452752
(common/kw-to-name rarity))]
2746-
[:td.p-r-5
2753+
[:td.p-r-5.pointer
2754+
{:on-click (toggle-details-expanded-handler expanded-details item-kw)}
27472755
[:div.orange
2748-
(if (not mobile?)
2749-
[:span.underline (if expanded? "less" "more")])
2756+
#_(if (not mobile?)
2757+
[:span.underline (if expanded? "less" "more")])
27502758
[:i.fa.m-l-5
27512759
{:class-name (if expanded? "fa-caret-up" "fa-caret-down")}]]]]
27522760
(if expanded?
@@ -2772,7 +2780,7 @@
27722780
[:span.m-l-5.f-w-b.f-s-18 "Other Magic Items"]]
27732781
[:div.f-s-14
27742782
[:table.w-100-p.t-a-l.striped
2775-
[:tbody
2783+
[:tbody.other-magic-items
27762784
[:tr.f-w-b
27772785
{:class-name (if mobile? "f-s-12")}
27782786
[:th.p-10 "Name"]
@@ -2802,7 +2810,7 @@
28022810
[:span.m-l-5.f-w-b.f-s-18 "Other Equipment"]]
28032811
[:div
28042812
[:table.w-100-p.t-a-l.striped
2805-
[:tbody
2813+
[:tbody.equipment
28062814
[:tr.f-w-b
28072815
{:class-name (if mobile? "f-s-12")}
28082816
[:th.p-10 "Name"]
@@ -2817,7 +2825,7 @@
28172825
;;expanded? (@expanded-details item-kw)
28182826
]
28192827
^{:key item-kw}
2820-
[:tr
2828+
[:tr.item
28212829
[:td.p-10.f-w-b (or (:name item) item-name)]
28222830
[:td.p-10 (::char-equip/quantity item-cfg)]
28232831
[:td.p-10

0 commit comments

Comments
 (0)