1
0
Fork 0

Mark nightly builds visually on the splash.

Ensure testers are in no doubt what they’re getting from a nightly
build.
This commit is contained in:
James Turner 2017-02-25 22:11:33 +00:00
parent b7ec790426
commit c316bd4af8
2 changed files with 13 additions and 3 deletions

View file

@ -191,6 +191,14 @@ void SplashScreen::createNodes()
osgText::Text::RIGHT_BOTTOM, osgText::Text::RIGHT_BOTTOM,
fgGetNode("/sim/startup/splash-progress-spinner", true)); fgGetNode("/sim/startup/splash-progress-spinner", true));
#if defined(FG_NIGHTLY)
addText(geode, osg::Vec2(0.5, 0.5), 0.03,
"Unstable nightly build - some features may be under active development",
osgText::Text::CENTER_CENTER,
nullptr, -1.0, osg::Vec4(1.0, 0.0, 0.0, 1.0));
#endif
/////////// ///////////
geometry = new osg::Geometry; geometry = new osg::Geometry;
@ -318,7 +326,8 @@ void SplashScreen::addText(osg::Geode* geode ,
const osg::Vec2& pos, double size, const std::string& text, const osg::Vec2& pos, double size, const std::string& text,
const osgText::Text::AlignmentType alignment, const osgText::Text::AlignmentType alignment,
SGPropertyNode* dynamicValue, SGPropertyNode* dynamicValue,
double maxWidthFraction) double maxWidthFraction,
const osg::Vec4& textColor)
{ {
SGPath path = globals->resolve_resource_path("Fonts/LiberationFonts/LiberationSans-BoldItalic.ttf"); SGPath path = globals->resolve_resource_path("Fonts/LiberationFonts/LiberationSans-BoldItalic.ttf");
@ -326,7 +335,7 @@ void SplashScreen::addText(osg::Geode* geode ,
osg::ref_ptr<osgText::Text> t = new osgText::Text; osg::ref_ptr<osgText::Text> t = new osgText::Text;
item.textNode = t; item.textNode = t;
t->setFont(path.utf8Str()); t->setFont(path.utf8Str());
t->setColor(osg::Vec4(1, 1, 1, 1)); t->setColor(textColor);
t->setFontResolution(64, 64); t->setFontResolution(64, 64);
t->setText(text); t->setText(text);
t->setBackdropType(osgText::Text::OUTLINE); t->setBackdropType(osgText::Text::OUTLINE);

View file

@ -62,7 +62,8 @@ private:
void addText(osg::Geode* geode, const osg::Vec2& pos, double size, const std::string& text, void addText(osg::Geode* geode, const osg::Vec2& pos, double size, const std::string& text,
const osgText::Text::AlignmentType alignment, const osgText::Text::AlignmentType alignment,
SGPropertyNode* dynamicValue = nullptr, SGPropertyNode* dynamicValue = nullptr,
double maxWidthFraction = -1.0); double maxWidthFraction = -1.0,
const osg::Vec4& textColor = osg::Vec4(1, 1, 1, 1));
bool _legacySplashScreenMode = false; bool _legacySplashScreenMode = false;
SGPropertyNode_ptr _splashAlphaNode; SGPropertyNode_ptr _splashAlphaNode;