Only draw track connections when focused.

This commit is contained in:
Leonardo Zide 2024-11-29 18:45:27 -08:00
parent 7fd23dab4f
commit 41097f8489
3 changed files with 6 additions and 6 deletions

View file

@ -166,7 +166,7 @@ std::optional<lcMatrix44> lcTrainTrackInfo::GetPieceInsertTransform(lcPiece* Cur
if (FocusSection == LC_PIECE_SECTION_POSITION || FocusSection == LC_PIECE_SECTION_INVALID)
{
for (ConnectionIndex = 0; ConnectionIndex < CurrentTrackInfo->GetConnections().size(); ConnectionIndex++)
if (CurrentPiece->IsTrainTrackConnectionVisible(ConnectionIndex))
if (!CurrentPiece->IsTrainTrackConnected(ConnectionIndex))
break;
}
else

View file

@ -375,7 +375,7 @@ void lcViewManipulator::DrawTrainTrack(lcPiece* Piece, lcContext* Context, float
for (quint32 ConnectionIndex = 0; ConnectionIndex < Connections.size(); ConnectionIndex++)
{
if (!Piece->IsTrainTrackConnectionVisible(ConnectionIndex))
if (Piece->IsTrainTrackConnected(ConnectionIndex))
continue;
const lcMatrix44& Transform = Connections[ConnectionIndex].Transform;
@ -966,7 +966,7 @@ std::pair<lcTrackTool, quint32> lcViewManipulator::UpdateSelectMove()
for (quint32 ConnectionIndex = 0; ConnectionIndex < Connections.size(); ConnectionIndex++)
{
if (!Piece->IsTrainTrackConnectionVisible(ConnectionIndex))
if (Piece->IsTrainTrackConnected(ConnectionIndex))
continue;
const lcMatrix44& Transform = Connections[ConnectionIndex].Transform;

View file

@ -150,9 +150,9 @@ public:
UpdateMesh();
}
bool IsTrainTrackConnectionVisible(int ConnectionIndex) const
bool IsTrainTrackConnected(int ConnectionIndex) const
{
return !mTrainTrackConnections[ConnectionIndex];
return mTrainTrackConnections[ConnectionIndex];
}
void SetTrainTrackConnections(std::vector<bool>&& Connections)
@ -353,7 +353,7 @@ protected:
bool AreTrainTrackConnectionsVisible() const
{
return IsSelected();
return IsFocused();
}
void DrawTrainTrackInterface(lcContext* Context, const lcMatrix44& WorldMatrix) const;