 (zc/def-component CraftWeapon
   [this]
   (let [{:keys [game-state]} (zc/props this)]
-    (zc/csx [zcui/Popup {:style {:position :relative :top -15
+    (zc/csx [zcui/Popup {:style {:margin-top 5
                                  :color (rcolor/color->rgb :black)
                                  :background-color (rcolor/color->rgb :white)}} [
               [:text {:style {:bottom 1}} ["| Craft Weapon |"]]

            [Hud {:game-state game-state}]
            [MapUI {:game-state game-state}]]]]]]])))

#_(defn render-enter-name [state]
  (let [screen (state :screen)
        player-name (get-in state [:world :player :name])]
    (clear (state :screen))
    (put-string screen :ui 30 5 "Robinson")
    (put-string screen :ui 20 7 "Name:___________________")
    (put-string screen :ui 25 7 (str player-name "\u2592"))
    (refresh screen)))

(def loading-index (atom 0))
(def loading-tidbits
  ["rat swarm"

                                 (not (nil? (get-in state [:world  :quests (quest :id) :stage] nil))))
                               (:quests state))))

(zc/def-component MultiSelect
  [this]
  (let [{:keys [style]} (zc/props this)
        default-props {:selected-hotkeys []
                       :items []
                       :disable? (fn [_] false)}
        {:keys [title selected-hotkeys items disable?]} (merge default-props (zc/props this))
        children (map (fn [item]
                        (zc/csx [:text {:style {:color (rcolor/color->rgb (if (or (not (disable? item))
                                                                                  (get item :applicable))
                                                                            :black
                                                                            :gray))
                                                :background-color (rcolor/color->rgb :white)}} [
                                  [Highlight {} [(str (or (item :hotkey)
                                                          \space))]]
                                  [:text {} [(format "%c%s%s %s %s"
                                               (if (contains? (set selected-hotkeys) (get item :hotkey))
                                                 \+
                                                 \-)
                                               (if (contains? item :count)
                                                 (format "%dx " (int (get item :count)))
                                                 "")
                                               (get item :name)
                                               (if (contains? item :utility)
                                                 (format "(%d%%)" (int (get item :utility)))
                                                 "")
                                               (cond
                                                 (contains? item :wielded)
                                                   "(wielded)"
                                                 (contains? item :wielded-ranged)
                                                   "(wielded ranged)"
                                                 (contains? item :worn)
                                                   "(worn)"
                                                 :else
                                                   ""))]]]]))
                      items)]
    (zc/csx [:view {:style (or style {})} (concat [(zc/csx [:text {:style {:color (rcolor/color->rgb :black)}} [title]])
                               (zc/csx [:text {} [""]])]
                              children)])))


(zc/def-component CraftSubmenu
  [this]
