cljfx

Jonathan Bennett 2024-10-07T02:29:57.174519Z

I'm having a bit of trouble conceptually with dialogs and dialog panes. Here's a mockup of what I want to make. What I don't know how to do is to handle closing the dialog at the end. ButtonTypes is the wrong thing because the different attack types don't map logically to the ButtonTypes enum options.

Jonathan Bennett 2024-10-07T02:33:16.451509Z

I think I need to do something like

{:fx/type :dialog-pane
 :content {:fx/type :v-box
           :children [{:fx/type header-label}
                      {:fx/type attack-details-label}
                      (attack-buttons generator attacker target)]}}
Where header-label is a method that produces that header label, attack-details-label produces the text box, and then attack-buttons-generator produces a vector of button objects with the appropriate text and events. What I can't figure out is the events.

Jonathan Bennett 2024-10-07T02:36:26.450459Z

I should note, there are at least 7 different possible attack buttons that could be generated, based on the unit involved.