diff --git a/resources/public/image/black/rod-of-asclepius.svg b/resources/public/image/black/rod-of-asclepius.svg new file mode 100644 index 000000000..e88075973 --- /dev/null +++ b/resources/public/image/black/rod-of-asclepius.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/public/image/rod-of-asclepius.svg b/resources/public/image/rod-of-asclepius.svg new file mode 100644 index 000000000..6c7a8d300 --- /dev/null +++ b/resources/public/image/rod-of-asclepius.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/cljc/orcpub/dnd/e5/template.cljc b/src/cljc/orcpub/dnd/e5/template.cljc index de8c957cb..a6f6493fb 100644 --- a/src/cljc/orcpub/dnd/e5/template.cljc +++ b/src/cljc/orcpub/dnd/e5/template.cljc @@ -49,14 +49,22 @@ (assoc a k other-v other-k v)))))) (def ability-icons + "Icons / names are provided by https://game-icons.net/" {::char5e/str "strong" - ::char5e/con "caduceus" + ::char5e/con "rod-of-asclepius" ::char5e/dex "body-balance" ::char5e/int "read" ::char5e/wis "meditation" ::char5e/cha "aura"}) -(defn ability-icon [k size theme] +;; REVIEW: use generic function for all icons instead? +(defn ability-icon + "Takes [k size theme] to generate css class name based on the size and theme. + `k` is the icon name/key in image set, + `size` sets both h and w, + `theme` sets light/dark color and opacity. + Only used for `ability-icons` -- see body of function below." + [k size theme] (let [light-theme? (= "light-theme" theme)] [:img {:class-name (str "h-" size " w-" size (if light-theme? " opacity-7")) :src (str (if light-theme? "/image/black/" "/image/") (ability-icons k) ".svg")}])) diff --git a/src/cljs/orcpub/dnd/e5/views.cljs b/src/cljs/orcpub/dnd/e5/views.cljs index 97002e815..a413ca5ed 100644 --- a/src/cljs/orcpub/dnd/e5/views.cljs +++ b/src/cljs/orcpub/dnd/e5/views.cljs @@ -4258,24 +4258,25 @@ option set-path-prop-event toggle-path-prop-event] + (dispatch [set-path-prop-event [:profs proficiency-choice-key :choose] (get-in option [:profs proficiency-choice-key :choose] 0)]) ;; set the default value [:div.m-b-20 - [:div.f-s-24.f-w-b.m-b-20 title] - [:div.m-b-10 + [:div.f-s-24.f-w-b.m-b-20 title] + [:div.m-b-10 [labeled-dropdown - "Choose" - {:items (map + "Choose" + {:items (map value-to-item - (range 1 6)) + (range 0 6)) :value (get-in option [:profs proficiency-choice-key :choose] 1) :on-change #(dispatch [set-path-prop-event [:profs proficiency-choice-key :choose] (js/parseInt %)])}]] - [:div.f-s-18.f-w-b.m-b-20 "Options"] - [:div.flex.flex-wrap + [:div.f-s-18.f-w-b.m-b-20 "Options"] + [:div.flex.flex-wrap (doall - (map + (map (fn [{:keys [name key]}] ^{:key key} [:span.m-r-20.m-b-10 - [comps/labeled-checkbox + [comps/labeled-checkbox name (get-in option [:profs proficiency-choice-key :options key]) false