Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/bc5.ini
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ secondary_mode=0
secondary_mode_DESC=Set to 1 to automatically start Bridge Command in secondary mode
hide_instruments=0
hide_instruments_DESC=Set to 1 to start Bridge Command with a full screen 3d view and the 2d instrument panel hidden
own_ship_hidden=0
own_ship_hidden_DESC=Set to 1 to start Bridge Command with the own ship model hidden in the 3d view
full_radar=0
full_radar_DESC=Set to 1 to start Bridge Command with a full screen radar view
arpa_on=0
Expand Down
1 change: 1 addition & 0 deletions bin/language-en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ zoom="Zoom"
magnification="Magnification"
view="View"
changeView="View"
ownShipVisible="Own ship visible"
3dView="3D View"
range="Range: "
vrm="VRM: "
Expand Down
1 change: 1 addition & 0 deletions bin/language-es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ zoom="Zoom"
magnification="Aumento"
view="Vista"
changeView="Vista"
ownShipVisible="Visibilidad del barco"
3dView="Vista 3D"
range="Alcance: "
vrm="VRM: "
Expand Down
1 change: 1 addition & 0 deletions bin/language-fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ zoom="Zoom"
magnification="Grossissement"
view="Vue"
changeView="Vue"
ownShipVisible="Visibilité du navire"
3dView="Vue 3D"
range="Echelle : "
vrm="VRM : "
Expand Down
9 changes: 7 additions & 2 deletions src/GUIMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,12 @@ void GUIMain::load(irr::IrrlichtDevice* device, Lang* language, std::vector<std:
//Add extra controls for view (zoom etc)
irr::gui::IGUITab* extraControlsTabView = extraControlsTabControl->addTab(language->translate("view").c_str());

guienv->addStaticText(language->translate("3dView").c_str(), irr::core::rect<irr::s32>(0.005 * su, 0.02 * sh, 0.085 * su, 0.05 * sh), false, true, extraControlsTabView)->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
show3d = guienv->addCheckBox(true, irr::core::rect<irr::s32>(0.038 * su, 0.080 * sh, 0.052 * su, 0.100 * sh), extraControlsTabView);
guienv->addStaticText(language->translate("3dView").c_str(), irr::core::rect<irr::s32>(0.005 * su, 0.02 * sh, 0.085 * su, 0.04 * sh), false, true, extraControlsTabView)->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
show3d = guienv->addCheckBox(true, irr::core::rect<irr::s32>(0.038 * su, 0.040 * sh, 0.052 * su, 0.060 * sh), extraControlsTabView);

guienv->addStaticText(language->translate("ownShipVisible").c_str(), irr::core::rect<irr::s32>(0.005 * su, 0.070 * sh, 0.085 * su, 0.090 * sh), false, true, extraControlsTabView)->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
viewOwnShip = guienv->addCheckBox(true, irr::core::rect<irr::s32>(0.038 * su, 0.090 * sh, 0.052 * su, 0.110 * sh), extraControlsTabView, GUI_ID_OWNSHIP_VIEW_BOX);

guienv->addStaticText(language->translate("magnification").c_str(), irr::core::rect<irr::s32>(0.085 * su, 0.02 * sh, 0.165 * su, 0.05 * sh), false, true, extraControlsTabView)->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
magnificationScrollbar = new irr::gui::ScrollDial(irr::core::vector2d<irr::s32>(0.125 * su, 0.09 * sh), 0.03 * su, guienv, extraControlsTabView, GUI_ID_MAGNIFICATION_SCROLL_BAR);
magnificationScrollbar->setMax(200); //Divide by 10 to get magnification
Expand Down Expand Up @@ -1226,6 +1229,8 @@ void GUIMain::load(irr::IrrlichtDevice* device, Lang* language, std::vector<std:
streamSpeedScrollbar->setPos(Utilities::round(guiData->streamSpeed));
streamOverride->setChecked(guiData->streamOverride);

viewOwnShip->setChecked(guiData->viewOwnShip);


// DEE vvvvv this should display the rate of turn data on the screen
// DEE since internalrate of turn is in rads per second then for deg per min x 3438
Expand Down
5 changes: 4 additions & 1 deletion src/GUIMain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct GUIData {
irr::f32 streamSpeed;
bool streamOverride;
bool radarOn;
bool viewOwnShip;
irr::f32 radarRangeNm;
irr::f32 radarGain;
irr::f32 radarClutter;
Expand Down Expand Up @@ -213,7 +214,8 @@ class GUIMain //Create, build and update GUI
GUI_ID_TIMECOMPRESSION_15_BUTTON,
GUI_ID_TIMECOMPRESSION_30_BUTTON,
GUI_ID_TIMECOMPRESSION_60_BUTTON,
GUI_ID_TIMECOMPRESSION_3600_BUTTON
GUI_ID_TIMECOMPRESSION_3600_BUTTON,
GUI_ID_OWNSHIP_VIEW_BOX
};

bool getShowInterface() const;
Expand Down Expand Up @@ -339,6 +341,7 @@ class GUIMain //Create, build and update GUI

irr::gui::IGUIScrollBar* magnificationScrollbar;
irr::gui::IGUICheckBox* show3d;
irr::gui::IGUICheckBox* viewOwnShip;

irr::gui::IGUIButton* showInterfaceButton;
irr::gui::IGUIButton* hideInterfaceButton;
Expand Down
5 changes: 5 additions & 0 deletions src/MyEventReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ bool MyEventReceiver::OnEvent(const irr::SEvent &event)
{
model->setStreamOverride(((irr::gui::IGUICheckBox *)event.GUIEvent.Caller)->isChecked());
}

if (id == GUIMain::GUI_ID_OWNSHIP_VIEW_BOX)
{
model->getOwnShipSceneNode()->setVisible(((irr::gui::IGUICheckBox *)event.GUIEvent.Caller)->isChecked());
}
}

if (event.GUIEvent.EventType == irr::gui::EGET_SCROLL_BAR_CHANGED)
Expand Down
6 changes: 6 additions & 0 deletions src/SimulationModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,11 @@ SimulationModel::~SimulationModel()
return &lines;
}

irr::scene::ISceneNode* SimulationModel::getRadarSceneNode()
{
return radarScreen.getSceneNode();
}

void SimulationModel::updateCameraVRPos(irr::core::quaternion quat, irr::core::vector3df pos, irr::core::vector2df lensShift)
{
camera.update(0, quat, pos, lensShift, true);
Expand Down Expand Up @@ -2055,6 +2060,7 @@ SimulationModel::~SimulationModel()
guiData->streamDirection = streamOverrideDirection;
guiData->streamSpeed = streamOverrideSpeed;
guiData->streamOverride = streamOverride;
guiData->viewOwnShip = getOwnShipSceneNode()->isVisible();
guiData->radarRangeNm = radarCalculation.getRangeNm();
guiData->radarGain = radarCalculation.getGain();
guiData->radarClutter = radarCalculation.getClutter();
Expand Down
2 changes: 2 additions & 0 deletions src/SimulationModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ class SimulationModel //Start of the 'Model' part of MVC
irr::scene::ISceneNode* getLandObjectSceneNode(int number);
irr::scene::ISceneNode* getTerrainSceneNode(int number);

irr::scene::ISceneNode* getRadarSceneNode();

Terrain* getTerrain();

irr::f32 getTerrainHeight(irr::f32 posX, irr::f32 posZ) const;
Expand Down
6 changes: 6 additions & 0 deletions src/iniEditor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ int main (int argc, char ** argv)
iniFilename = "repeater.ini";
}

// Allow ini file name to be overwritten from the command line
if ((argc>2)&&(strcmp(argv[1],"-c")==0)) {
iniFilename = std::string(argv[2]); //TODO: Check this for sanity?
std::cout << "Using Ini file >" << iniFilename << "<" << std::endl;
}

bool autoMode = false;
if (((argc > 1) && (strcmp(argv[1], "-auto") == 0)) ||
((argc > 2) && (strcmp(argv[2], "-auto") == 0))) {
Expand Down
20 changes: 16 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,16 +434,18 @@ int main(int argc, char ** argv)

//Read basic ini settings
std::string iniFilename = "bc5.ini";
//Use local ini file if it exists
if (Utilities::pathExists(userFolder + iniFilename)) {
iniFilename = userFolder + iniFilename;
}

// Allow ini file name to be overwritten from the command line
if ((argc>2)&&(strcmp(argv[1],"-c")==0)) {
iniFilename = std::string(argv[2]); //TODO: Check this for sanity?
std::cout << "Using Ini file >" << iniFilename << "<" << std::endl;
}

//Use local ini file if it exists
if (Utilities::pathExists(userFolder + iniFilename)) {
iniFilename = userFolder + iniFilename;
}

std::string scriptToExe = IniFile::iniFileToString(iniFilename, "script_start_BC");
if (!scriptToExe.empty()) {
std::string scriptPath;
Expand Down Expand Up @@ -538,6 +540,8 @@ int main(int argc, char ** argv)
viewAngle = 90;
}

bool viewOwnShip = (IniFile::iniFileTou32(iniFilename, "own_ship_hidden") != 1);

irr::f32 cameraMinDistance = IniFile::iniFileTof32(iniFilename, "minimum_distance");
irr::f32 cameraMaxDistance = IniFile::iniFileTof32(iniFilename, "maximum_distance");
if (cameraMinDistance<=0) {
Expand Down Expand Up @@ -1026,6 +1030,11 @@ int main(int argc, char ** argv)
scenarioData,
modelParameters);

// Set own ship visibility
if (!viewOwnShip) {
model.getOwnShipSceneNode()->setVisible(false);
}

//check enough time has elapsed to show the credits screen (5s)
while (device->getTimer()->getRealTime() - creditsStartTime < 5000) {
device->run();
Expand Down Expand Up @@ -1200,6 +1209,9 @@ int main(int argc, char ** argv)
}
}

model.getRadarSceneNode()->setVisible(model.getOwnShipSceneNode()->isVisible());


// renderRadarProfile.toc();

// renderProfile.tic();
Expand Down
Loading