summaryrefslogtreecommitdiff
path: root/elm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-11-21 12:55:05 +0100
committerYorhel <git@yorhel.nl>2020-11-21 12:55:05 +0100
commitfeb5d9e07c423b89d6b137b13ea79709d6619745 (patch)
tree087c83e675436de4ed74d44c32e777a9eb9d235a /elm
parentc94cba7163388685abd98d6c1912054a2d763102 (diff)
Chars::Edit: Display error when attmepting to make character instance of itself
Diffstat (limited to 'elm')
-rw-r--r--elm/CharEdit.elm2
1 files changed, 2 insertions, 0 deletions
diff --git a/elm/CharEdit.elm b/elm/CharEdit.elm
index 20fd97fb..acf94de2 100644
--- a/elm/CharEdit.elm
+++ b/elm/CharEdit.elm
@@ -285,6 +285,7 @@ isValid model = not
( (model.name /= "" && model.name == model.original)
|| hasDuplicates (List.map (\v -> (v.vid, Maybe.withDefault 0 v.rid)) model.vns)
|| not (Img.isValid model.image)
+ || (model.mainHas && model.main /= Nothing && model.main == model.id)
)
@@ -370,6 +371,7 @@ view model =
[ text "Selected character: "
, b [ class "grayedout" ] [ text <| "c" ++ String.fromInt m ++ ": " ]
, a [ href <| "/c" ++ String.fromInt m ] [ text model.mainName ]
+ , if Just m == model.id then b [ class "standout" ] [ br [] [], text "A character can't be an instance of itself. Please select another character or disable the above checkbox to remove the instance." ] else text ""
]) model.main
, br [] []
, A.view mainConfig model.mainSearch [placeholder "Set character..."]