Skip to content

Commit

Permalink
Improve icon selection during ENUM self learning - so the wide hold l…
Browse files Browse the repository at this point in the history
…ines all get icons assigned
  • Loading branch information
meikelm committed Jun 14, 2018
1 parent 88a046c commit 60e2da7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions makerules/WED
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ RESOURCES += ./src/WEDResources/line_types/line_ILSCriticalCenterW.png
RESOURCES += ./src/WEDResources/line_types/line_BILSCriticalCenterW.png
RESOURCES += ./src/WEDResources/line_types/line_TaxiCenterUni.png
RESOURCES += ./src/WEDResources/line_types/line_HoldShortCenterUni.png
RESOURCES += ./src/WEDResources/line_types/line_BSolidWhite.png
RESOURCES += ./src/WEDResources/parking_spots/ClassA.png
RESOURCES += ./src/WEDResources/parking_spots/ClassB.png
RESOURCES += ./src/WEDResources/parking_spots/ClassC.png
Expand Down
17 changes: 13 additions & 4 deletions src/WEDCore/WED_LibraryMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ void WED_LibraryMgr::RescanLines()
}
}
#else
for(int i = 0; i < resnam.length(); ++i) resnam[i] = tolower(resnam[i]); // C11 would make this so much easier ...

if(resnam.find("_red") != string::npos)
{
if(resnam.find("_dash") != string::npos) icon = linetype < 50 ? "line_BrokenRed" : "line_BBrokenRed";
Expand All @@ -483,15 +485,22 @@ void WED_LibraryMgr::RescanLines()
else if(resnam.find("_orange") != string::npos) icon = linetype < 50 ? "line_SolidOrange": "line_BSolidOrange";
else if(resnam.find("_green") != string::npos) icon = linetype < 50 ? "line_SolidGreen" : "line_BSolidGreen";
else if(resnam.find("_blue") != string::npos) icon = linetype < 50 ? "line_SolidBlue" : "line_BSolidBlue";
else if(resnam.find("_yellow") != string::npos || resnam.find("_taxi") != string::npos)
else if(resnam.find("_yellow") != string::npos || resnam.find("_taxi") != string::npos || resnam.find("_hold") != string::npos)
{
if(resnam.find("_wide") != string::npos) icon = linetype < 50 ? "line_SolidYellowW" : "line_BSolidYellowW";
else icon = linetype < 50 ? "line_SolidYellow" : "line_BSolidYellow";
if(resnam.find("_hold") != string::npos)
{
if(resnam.find("_ils") != string::npos) icon = linetype < 50 ? "line_ILSHold" : "line_BILSHold";
else if(resnam.find("_double") != string::npos ||
resnam.find("_runway") != string::npos) icon = linetype < 50 ? "line_RunwayHold": "line_BRunwayHold";
else icon = linetype < 50 ? "line_OtherHold" : "line_BOtherHold";
}
else if(resnam.find("_wide") != string::npos) icon = linetype < 50 ? "line_SolidYellowW" : "line_BSolidYellowW";
else icon = linetype < 50 ? "line_SolidYellow" : "line_BSolidYellow";
}
else if(resnam.find("_white") != string::npos || resnam.find("_road") != string::npos)
{
if(resnam.find("_dash") != string::npos) icon = "line_BrokenWhite";
else icon = "line_SolidWhite";
else icon = linetype < 50 ? "line_SolidWhite" : "line_BSolidWhite";
}
#endif
ENUM_Create(LinearFeature, icon, nice_name, linetype);
Expand Down
1 change: 1 addition & 0 deletions src/WEDResources/WED.rc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ line_ILSCriticalCenterW.png GUI_RES line_types/line_ILSCriticalCenterW.png
line_BILSCriticalCenterW.png GUI_RES line_types/line_BILSCriticalCenterW.png
line_TaxiCenterUni.png GUI_RES line_types/line_TaxiCenterUni.png
line_HoldShortCenterUni.png GUI_RES line_types/line_HoldShortCenterUni.png
line_BSolidWhite.png GUI_RES line_types/line_BSolidWhite.png

/* parking spots*/
ClassA.png GUI_RES parking_spots/ClassA.png
Expand Down
Binary file added src/WEDResources/line_types/line_BSolidWhite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 60e2da7

Please sign in to comment.