| 1056 | |
| 1057 | void CEdNodeGraph::DrawPinTooltip(CEdNodeGraphPin* Pin) |
| 1058 | { |
| 1059 | const FString TypeName = Pin->GetPinTypeName(); |
| 1060 | if (!TypeName.IsEmpty()) |
| 1061 | { |
| 1062 | ImGui::TextColored(ImVec4(0.60f, 0.80f, 1.00f, 1.0f), "%s", *TypeName); |
| 1063 | ImGui::SameLine(); |
| 1064 | } |
| 1065 | |
| 1066 | ImGui::TextUnformatted(*Pin->GetPinName()); |
| 1067 | } |
| 1068 | |
| 1069 | uint64 CEdNodeGraph::MakeLinkID(const CEdNodeGraphPin* InputPin, const CEdNodeGraphPin* OutputPin) |
| 1070 | { |
| 1071 | return ((uint64)OutputPin->GetPinGUID() << 32) | (uint64)InputPin->GetPinGUID(); |
| 1072 | } |
| 1073 | |
| 1074 | void CEdNodeGraph::BeginCanvasNode(CEdGraphNode* Node, const FGraphNodeStyle& Style) |
| 1075 | { |
| 1076 | ImVec2 Position(Node->GetNodeX(), Node->GetNodeY()); |
| 1077 | Editor.BeginNode(Node->GetNodeID(), Position, Style); |
| 1078 | SyncNodePosition(Node, Position); |
| 1079 | } |
| 1080 | |
| 1081 | void CEdNodeGraph::SyncNodePosition(CEdGraphNode* Node, ImVec2 Position) |
| 1082 | { |
| 1083 | if (Position.x != Node->GetNodeX() || Position.y != Node->GetNodeY()) |
| 1084 | { |
| 1085 | Node->SetGridPos(Position.x, Position.y); |
| 1086 | bLayoutChangedSinceImage = true; |
| 1087 | } |
| 1088 | } |
| 1089 | |