Skip to content

Commit

Permalink
improve readability in program code - getDisplayRegionFromDictEntries
Browse files Browse the repository at this point in the history
Use more explicit syntax.
  • Loading branch information
Viir committed Jan 23, 2025
1 parent b599040 commit ec52c9f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions implement/alternate-ui/source/src/EveOnline/ParseUserInterface.elm
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,19 @@ getDisplayRegionFromDictEntries uiNode =
]
)

fixedNumberFromPropertyName : String -> Maybe Int
fixedNumberFromPropertyName propertyName =
uiNode.dictEntriesOfInterest
|> Dict.get propertyName
|> Maybe.andThen (fixedNumberFromJsonValue >> Result.toMaybe)
case Dict.get propertyName uiNode.dictEntriesOfInterest of
Just jsonValue ->
case fixedNumberFromJsonValue jsonValue of
Ok number ->
Just number

Err _ ->
Nothing

Nothing ->
Nothing
in
case
( ( fixedNumberFromPropertyName "_displayX", fixedNumberFromPropertyName "_displayY" )
Expand Down

0 comments on commit ec52c9f

Please sign in to comment.