Skip to content

Commit

Permalink
fix(release+prenotes): Broken colours in lists (#354)
Browse files Browse the repository at this point in the history
* Fix colours in lists

* Always show callsign and requesting controller
  • Loading branch information
AndyTWF committed Oct 18, 2021
1 parent 3e8022d commit 292a613
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/plugin/prenote/PendingPrenoteList.cpp
Expand Up @@ -134,11 +134,6 @@ namespace UKControllerPlugin::Prenote {

// Draw each decision
for (const auto& prenote : prenotes) {
auto fp = this->plugin.GetFlightplanForCallsign(prenote->GetCallsign());
if (!fp) {
continue;
}

// Shift the cols
callsignColumn.Y += LINE_HEIGHT;
controllerColumn.Y += LINE_HEIGHT;
Expand All @@ -157,6 +152,11 @@ namespace UKControllerPlugin::Prenote {
this->controllers.FetchPositionById(prenote->GetSendingControllerId())->GetCallsign());
graphics.DrawString(controller, controllerColumn, this->textBrush);

auto fp = this->plugin.GetFlightplanForCallsign(prenote->GetCallsign());
if (!fp) {
continue;
}

graphics.DrawString(
HelperFunctions::ConvertToWideString(fp->GetOrigin()), airportColumn, this->textBrush);

Expand Down
8 changes: 4 additions & 4 deletions src/plugin/prenote/PendingPrenoteList.h
Expand Up @@ -81,6 +81,10 @@ namespace UKControllerPlugin::Prenote {
const Gdiplus::Rect sidColumnHeader{275, 5, 65, 25};
const Gdiplus::Rect destColumnHeader{350, 5, 40, 25};

const Gdiplus::Color OFF_WHITE_COLOUR = Gdiplus::Color(255, 255, 255);
const Gdiplus::Color TITLE_BAR_BASE_COLOUR = Gdiplus::Color(130, 50, 154);
const Gdiplus::Color TITLE_BAR_FLASH_COLOUR = Gdiplus::Color(179, 3, 0);

// Brushes
const Gdiplus::SolidBrush textBrush;

Expand Down Expand Up @@ -109,10 +113,6 @@ namespace UKControllerPlugin::Prenote {
const Gdiplus::Rect CLOSE_BUTTON_OFFSET = {375, 5, 10, 10};
const Gdiplus::Rect COLLAPSE_BUTTON_OFFSET = {360, 5, 10, 10};

const Gdiplus::Color OFF_WHITE_COLOUR = Gdiplus::Color(255, 255, 255);
const Gdiplus::Color TITLE_BAR_BASE_COLOUR = Gdiplus::Color(130, 50, 154);
const Gdiplus::Color TITLE_BAR_FLASH_COLOUR = Gdiplus::Color(179, 3, 0);

// Standard window components
std::shared_ptr<Components::TitleBar> titleBar;
std::shared_ptr<Components::Button> closeButton;
Expand Down
10 changes: 5 additions & 5 deletions src/plugin/releases/DepartureReleaseDecisionList.cpp
Expand Up @@ -115,11 +115,6 @@ namespace UKControllerPlugin::Releases {

// Draw each decision
for (const auto& decision : decisions) {
auto fp = this->plugin.GetFlightplanForCallsign(decision->Callsign());
if (!fp) {
continue;
}

// Shift the cols
callsignColumn.Y += lineHeight;
controllerColumn.Y += lineHeight;
Expand All @@ -136,6 +131,11 @@ namespace UKControllerPlugin::Releases {
this->controllers.FetchPositionById(decision->RequestingController())->GetCallsign());
graphics.DrawString(controller, controllerColumn, this->textBrush);

auto fp = this->plugin.GetFlightplanForCallsign(decision->Callsign());
if (!fp) {
continue;
}

graphics.DrawString(
HelperFunctions::ConvertToWideString(fp->GetOrigin()), airportColumn, this->textBrush);

Expand Down
10 changes: 5 additions & 5 deletions src/plugin/releases/DepartureReleaseDecisionList.h
Expand Up @@ -71,6 +71,11 @@ namespace UKControllerPlugin::Releases {
const Gdiplus::Rect airportColumnHeader{225, 5, 40, 25};
const Gdiplus::Rect sidColumnHeader{275, 5, 65, 25};

// Some colours
const Gdiplus::Color OFF_WHITE_COLOUR = Gdiplus::Color(255, 255, 255);
const Gdiplus::Color TITLE_BAR_BASE_COLOUR = Gdiplus::Color(130, 50, 154);
const Gdiplus::Color TITLE_BAR_FLASH_COLOUR = Gdiplus::Color(179, 3, 0);

// Brushes
const Gdiplus::SolidBrush textBrush;

Expand Down Expand Up @@ -103,11 +108,6 @@ namespace UKControllerPlugin::Releases {
// Our window position
Gdiplus::PointF position = {0, 0};

// Some colours
const Gdiplus::Color OFF_WHITE_COLOUR = Gdiplus::Color(255, 255, 255);
const Gdiplus::Color TITLE_BAR_BASE_COLOUR = Gdiplus::Color(130, 50, 154);
const Gdiplus::Color TITLE_BAR_FLASH_COLOUR = Gdiplus::Color(179, 3, 0);

// Standard window components
std::shared_ptr<Components::TitleBar> titleBar;
std::shared_ptr<Components::Button> closeButton;
Expand Down

0 comments on commit 292a613

Please sign in to comment.