-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Migrate crates config to configurator * Add crates to configurator app * Refactor configuration code --------- Co-authored-by: tvillegas98 <[email protected]>
- Loading branch information
1 parent
656640b
commit e49121b
Showing
13 changed files
with
344 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...onfigurator/lib/configurator_web/controllers/map_configuration_html/edit_crates.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<.simple_form :let={f} for={@changeset} action={@action}> | ||
<.error :if={@changeset.action}> | ||
Oops, something went wrong! Please check the errors below. | ||
</.error> | ||
|
||
<.header> | ||
Crates | ||
</.header> | ||
<.inputs_for :let={crate_f} field={f[:crates]}> | ||
<.input field={crate_f[:radius]} type="number" label="Radius" step="any" /> | ||
<.input field={crate_f[:health]} type="number" label="Health" step="any" /> | ||
<.input field={crate_f[:amount_of_power_ups]} type="number" label="Amount of power ups to drop" step="any" /> | ||
<.input field={crate_f[:power_up_spawn_delay_ms]} type="number" label="Power up spawn delay" step="any" /> | ||
|
||
<.input | ||
field={crate_f[:shape]} | ||
type="select" | ||
label="Shape" | ||
options={Ecto.Enum.values(GameBackend.CurseOfMirra.MapConfiguration.Crate, :shape)} | ||
/> | ||
<.inputs_for :let={position_f} field={crate_f[:position]}> | ||
<.input field={position_f[:x]} type="number" label="X" step="any" /> | ||
<.input field={position_f[:y]} type="number" label="Y" step="any" /> | ||
</.inputs_for> | ||
|
||
<.button type="button" phx-click={show_modal("crate-vertices-#{crate_f.data.id}")}>Edit Vertices</.button> | ||
<.modal id={"crate-vertices-#{crate_f.data.id}"}> | ||
<.inputs_for :let={vertices_form} field={crate_f[:vertices]}> | ||
<h3>Vertex</h3> | ||
<.input field={vertices_form[:x]} type="number" label="X" step="any" /> | ||
<.input field={vertices_form[:y]} type="number" label="Y" step="any" /> | ||
</.inputs_for> | ||
</.modal> | ||
</.inputs_for> | ||
|
||
<:actions> | ||
<.button>Save Map Crates</.button> | ||
</:actions> | ||
</.simple_form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.