Skip to content

Commit

Permalink
Add the window controls discovered by Nacho_Vega today
Browse files Browse the repository at this point in the history
Add the window controls discovered in the compression window from play session recording 'session-recording-2023-04-23T20-51-29_1.zip'
  • Loading branch information
Viir committed Apr 24, 2023
1 parent a312721 commit 14b8fb5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 3 deletions.
48 changes: 46 additions & 2 deletions implement/alternate-ui/source/src/EveOnline/ParseUserInterface.elm
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,14 @@ type alias KeyActivationWindow =
type alias CompressionWindow =
{ uiNode : UITreeNodeWithDisplayRegion
, compressButton : Maybe UITreeNodeWithDisplayRegion
, windowControls : Maybe WindowControls
}


type alias WindowControls =
{ uiNode : UITreeNodeWithDisplayRegion
, minimizeButton : Maybe UITreeNodeWithDisplayRegion
, closeButton : Maybe UITreeNodeWithDisplayRegion
}


Expand Down Expand Up @@ -2958,10 +2966,45 @@ parseCompressionWindow windowUiNode =
findButtonInDescendantsContainingDisplayText "Compress" windowUiNode
in
{ uiNode = windowUiNode
, windowControls = parseWindowControlsFromWindow windowUiNode
, compressButton = compressButton
}


parseWindowControlsFromWindow : UITreeNodeWithDisplayRegion -> Maybe WindowControls
parseWindowControlsFromWindow =
listDescendantsWithDisplayRegion
>> List.filter (.uiNode >> .pythonObjectTypeName >> String.contains "WindowControls")
>> List.head
>> Maybe.map parseWindowControls


parseWindowControls : UITreeNodeWithDisplayRegion -> WindowControls
parseWindowControls controlsNode =
let
nodeFromTexturePathContains texturePathSubstring =
controlsNode
|> listDescendantsWithDisplayRegion
|> List.filter
(.uiNode
>> getTexturePathFromDictEntries
>> Maybe.map (String.toLower >> String.contains (String.toLower texturePathSubstring))
>> Maybe.withDefault False
)
|> List.head

minimizeButton =
nodeFromTexturePathContains "eveicon/window/minimize"

closeButton =
nodeFromTexturePathContains "eveicon/window/close"
in
{ uiNode = controlsNode
, minimizeButton = minimizeButton
, closeButton = closeButton
}


parseMessageBoxesFromUITreeRoot : UITreeNodeWithDisplayRegion -> List MessageBox
parseMessageBoxesFromUITreeRoot uiTreeRoot =
let
Expand Down Expand Up @@ -3196,8 +3239,9 @@ getHintTextFromDictEntries =


getTexturePathFromDictEntries : EveOnline.MemoryReading.UITreeNode -> Maybe String
getTexturePathFromDictEntries =
getStringPropertyFromDictEntries "texturePath"
getTexturePathFromDictEntries node =
getStringPropertyFromDictEntries "texturePath" node
|> Maybe.Extra.or (getStringPropertyFromDictEntries "_texturePath" node)


getStringPropertyFromDictEntries : String -> EveOnline.MemoryReading.UITreeNode -> Maybe String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,13 @@ treeNodeChildrenFromCompressionWindow viewConfig compressionWindow =
treeNodeChildrenFromRecordWithUINode
viewConfig
compressionWindow.uiNode
[ compressionWindow.compressButton
[ compressionWindow.windowControls
|> fieldFromMaybeInstance
{ fieldName = "windowControls"
, fieldValueSummary = always "..."
, fieldValueChildren = treeNodeChildrenFromWindowControls viewConfig
}
, compressionWindow.compressButton
|> fieldFromMaybeInstance
{ fieldName = "compressButton"
, fieldValueSummary = always "..."
Expand All @@ -1568,6 +1574,29 @@ treeNodeChildrenFromCompressionWindow viewConfig compressionWindow =
]


treeNodeChildrenFromWindowControls :
ViewConfig event
-> EveOnline.ParseUserInterface.WindowControls
-> List (TreeViewNode event ParsedUITreeViewPathNode)
treeNodeChildrenFromWindowControls viewConfig windowControls =
treeNodeChildrenFromRecordWithUINode
viewConfig
windowControls.uiNode
[ windowControls.minimizeButton
|> fieldFromMaybeInstance
{ fieldName = "minimizeButton"
, fieldValueSummary = always "..."
, fieldValueChildren = treeViewNodeFromUINode viewConfig >> List.singleton
}
, windowControls.closeButton
|> fieldFromMaybeInstance
{ fieldName = "closeButton"
, fieldValueSummary = always "..."
, fieldValueChildren = treeViewNodeFromUINode viewConfig >> List.singleton
}
]


treeNodeChildrenFromUINodeWithMainText :
ViewConfig event
-> { uiNode : UITreeNodeWithDisplayRegion, mainText : Maybe String }
Expand Down

0 comments on commit 14b8fb5

Please sign in to comment.