Skip to content

Commit

Permalink
Integrate parsing improvement shared by @Arma2braw
Browse files Browse the repository at this point in the history
  • Loading branch information
Viir committed Nov 29, 2023
1 parent 09dacec commit dde947d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
2 changes: 1 addition & 1 deletion implement/alternate-ui/source/src/Common/App.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module Common.App exposing (versionId)

versionId : String
versionId =
"2023-06-21"
"2023-11-21"
37 changes: 13 additions & 24 deletions implement/alternate-ui/source/src/EveOnline/ParseUserInterface.elm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ type alias HeatStatusTooltip =

type alias Neocom =
{ uiNode : UITreeNodeWithDisplayRegion
, iconInventory : Maybe UITreeNodeWithDisplayRegion
, inventoryButton : Maybe UITreeNodeWithDisplayRegion
, clock : Maybe NeocomClock
}

Expand Down Expand Up @@ -2857,17 +2857,11 @@ parseStandaloneBookmarkWindow windowUINode =

parseNeocomFromUITreeRoot : UITreeNodeWithDisplayRegion -> Maybe Neocom
parseNeocomFromUITreeRoot uiTreeRoot =
case
uiTreeRoot
|> listDescendantsWithDisplayRegion
|> List.filter (.uiNode >> .pythonObjectTypeName >> (==) "Neocom")
|> List.head
of
Nothing ->
Nothing

Just uiNode ->
Just (parseNeocom uiNode)
uiTreeRoot
|> listDescendantsWithDisplayRegion
|> List.filter (.uiNode >> .pythonObjectTypeName >> (==) "NeocomContainer")
|> List.head
|> Maybe.map parseNeocom


parseNeocom : UITreeNodeWithDisplayRegion -> Neocom
Expand All @@ -2880,17 +2874,6 @@ parseNeocom neocomUiNode =
|> List.concatMap getAllContainedDisplayTextsWithRegion
|> List.head

nodeFromTexturePathEnd texturePathEnd =
neocomUiNode
|> listDescendantsWithDisplayRegion
|> List.filter
(.uiNode
>> getTexturePathFromDictEntries
>> Maybe.map (String.endsWith texturePathEnd)
>> Maybe.withDefault False
)
|> List.head

clock =
maybeClockTextAndNode
|> Maybe.map
Expand All @@ -2900,9 +2883,15 @@ parseNeocom neocomUiNode =
, parsedText = parseNeocomClockText clockText
}
)

inventoryButton =
neocomUiNode
|> listDescendantsWithDisplayRegion
|> List.filter (.uiNode >> .pythonObjectTypeName >> (==) "ButtonInventory")
|> List.head
in
{ uiNode = neocomUiNode
, iconInventory = nodeFromTexturePathEnd "items.png"
, inventoryButton = inventoryButton
, clock = clock
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1469,9 +1469,9 @@ treeNodeChildrenFromNeocom viewConfig neocom =
treeNodeChildrenFromRecordWithUINode
viewConfig
neocom.uiNode
[ neocom.iconInventory
[ neocom.inventoryButton
|> fieldFromMaybeInstance
{ fieldName = "iconInventory"
{ fieldName = "inventoryButton"
, fieldValueSummary = always "..."
, fieldValueChildren = treeViewNodeFromUINode viewConfig >> List.singleton
}
Expand Down

0 comments on commit dde947d

Please sign in to comment.