示例#1
0
MessageReader::MessageReader()
  : Dialog("MessageReader"), mMessageList(NULL), mMessagePane(NULL), mCloseButton(NULL)
{
  setBackground(new FrameBackground());
  Dimension screenSize = rGUIManager()->getScreenDimension();
  setSize(MAGIC_MESSAGE_READER_WIDTH, MAGIC_MESSAGE_READER_HEIGHT);
  centerOnScreen();

  mMessageList = new List(3, this, true);
  mMessageList->setBackground(new FrameBackground());
  mMessageList->setColumnWidth(0, 0.15);
  mMessageList->setColumnWidth(1, 0.30);
  mMessageList->setColumnWidth(2, 0.55);
  
  mMessagePane = new Label();
  mMessagePane->setBackground(new FrameBackground());

  mCloseButton = new Button(L"Close", this);

  GridLayout* gridLayout = new GridLayout(this, 32, 24);
  gridLayout->set_borders(3);
  gridLayout->set_padding(2);

  gridLayout->add(new Label(L"Messages"), 0, 0, 26, 1);
  gridLayout->add(mCloseButton, 26, 0, 6, 1);
  gridLayout->add(mMessageList, 0, 1, 32, 11);
  gridLayout->add(mMessagePane, 0, 12, 32, 12);
  layout();
}
示例#2
0
Debrief::Debrief()
  : Dialog("Debrief"), mDebriefing(NULL), mNextMission(NULL), mReplay(NULL), mHomeBase(NULL), mMissionSelector(NULL)
{
  setBackground(new FrameBackground());
  Dimension screenSize = rGUIManager()->getScreenDimension();
  setSize(MAGIC_DEBRIEF_WIDTH, MAGIC_DEBRIEF_HEIGHT);
  centerOnScreen();

  mDebriefing = new Label(L"DEBRIEFING");

  mNextMission = new Button(L"Next Mission", this);
  mReplay = new Button(L"Replay Mission", this);
  mHomeBase = new Button(L"Home Base", this);
  mMissionSelector = new Button(L"Missions", this);

  GridLayout* gridLayout = new GridLayout(this, 32, 24);
  gridLayout->set_borders(3);
  gridLayout->set_padding(2);

  gridLayout->add(new Label(L"Mission Complete: Debriefing"), 0, 0, 26, 1);

  gridLayout->add(mDebriefing, 0, 1, 32, 22);

  gridLayout->add(mMissionSelector, 0, 23, 6, 1);
  gridLayout->add(mHomeBase, 6, 23, 6, 1);
  gridLayout->add(mReplay, 20, 23, 6, 1);
  gridLayout->add(mNextMission, 26, 23, 6, 1);

  layout();
}
示例#3
0
MissionSelector::MissionSelector()
  : Dialog("MissionSelector"),
    mCampaignList(NULL), mCampaignDesc(NULL),
    mMissionList(NULL), mMissionDesc(NULL),
    mHomeBaseButton(NULL), mStartButton(NULL), mCloseButton(NULL),
    mMissionNum(0), mCurrentCampaign(NULL)
{
  setBackground(new FrameBackground());
  Dimension screenSize = rGUIManager()->getScreenDimension();
  setSize(MAGIC_MISSION_SELECTOR_WIDTH, MAGIC_MISSION_SELECTOR_HEIGHT);
  centerOnScreen();

  mCampaignList = new List(1, this);
  mCampaignList->setBackground(new FrameBackground());
  mCampaignDesc = new Label();
  mCampaignDesc->setBackground(new FrameBackground());

  mMissionList = new List(1, this);
  mMissionList->setBackground(new FrameBackground());  
  mMissionDesc = new Label();
  mMissionDesc->setBackground(new FrameBackground());

  mHomeBaseButton = new Button(L"Home Base", this);
  mStartButton = new Button(L"Start Mission", this);
  mCloseButton = new Button(L"Close", this);

  GridLayout* gridLayout = new GridLayout(this, 32, 24);
  gridLayout->set_borders(3);
  gridLayout->set_padding(2);

  gridLayout->add(new Label(L"Missions available - Select Campaign"), 0, 0, 26, 1);

  gridLayout->add(mCampaignList, 0, 1, 14, 7);
  gridLayout->add(mCampaignDesc, 14, 1, 18, 7);
    
  gridLayout->add(new Label(L"Available missions"), 0, 8, 26, 1);
  gridLayout->add(mMissionList, 0, 9, 14, 14);
  gridLayout->add(mMissionDesc, 14, 9, 18, 14);

  gridLayout->add(mHomeBaseButton, 6, 23, 6, 1);
  gridLayout->add(mStartButton, 0, 23, 6, 1);
  gridLayout->add(mCloseButton, 26, 23, 6, 1);
  layout();
}
示例#4
0
PrototypeLayer::PrototypeLayer()
  : mPrototype(new Prototype()), mFileName(""), mCurrentPort(0), mRightPanel(NULL),
    mRenderNormals(false), mRenderTexture(true), mRenderWireframe(false),
    mImportOBJButton(NULL), mImportSSMButton(NULL),
    mImportTGAButton(NULL), mImportPNGButton(NULL),
    mToggleNormalsButton(NULL), mToggleTextureButton(NULL),

    mPortNumLabel(NULL),
    mPortPosLabel(NULL),

    mPortNextButton(NULL),
    mPortPrevButton(NULL),
    mPortAddButton(NULL),
    mPortRemoveButton(NULL),

    mPortMovXAddButton(NULL),
    mPortMovXSubButton(NULL),
    mPortMovYAddButton(NULL),
    mPortMovYSubButton(NULL),
    mPortMovZAddButton(NULL),
    mPortMovZSubButton(NULL),

    mPortRotXAddButton(NULL),
    mPortRotXSubButton(NULL),
    mPortRotYAddButton(NULL),
    mPortRotYSubButton(NULL),
    mPortRotZAddButton(NULL),
    mPortRotZSubButton(NULL),

    mPortMesh(NULL),
    mNormalMesh(NULL)
{
  GridLayout* layout = new GridLayout(this, 32, 24);

  mRightPanel = new Frame();
  mRightPanel->setBackground(new FrameBackground());
  layout->add(mRightPanel, 27, 2, 5, 10);
  mRightPanel->setLayoutManager(new FlowLayout(FlowLayout::VERTICAL, FlowLayout::RIGHT, FlowLayout::TOP));
  mRightPanel->add(mNewPrototypeButton = new Button(L"New Module", this));
  mRightPanel->add(mLoadPrototypeButton = new Button(L"Load Module", this));
  mRightPanel->add(mSavePrototypeButton = new Button(L"Save Module", this));
  mRightPanel->add(mSaveAsPrototypeButton = new Button(L"Save Module As", this));
  mRightPanel->add(mImportOBJButton = new Button(L"Import OBJ Mesh", this));
  mRightPanel->add(mImportSSMButton = new Button(L"Import SSM Mesh", this));
  mRightPanel->add(mImportTGAButton = new Button(L"Import TGA Texture", this));
  mRightPanel->add(mImportPNGButton = new Button(L"Import PNG Texture", this));
  mRightPanel->add(mImportIconButton = new Button(L"Import PNG Icon", this));
  mRightPanel->add(mToggleNormalsButton = new Button(L"Toggle Normals", this));
  mRightPanel->add(mToggleTextureButton = new Button(L"Toggle Texture", this));
  mRightPanel->add(mToggleWireframeButton = new Button(L"Toggle Wireframe", this));
  mRightPanel->add(mQuitButton = new Button(L"Quit", this));
  
  mStatPanel = new Frame();
  mStatPanel->setBackground(new FrameBackground());
  layout->add(mStatPanel, 0, 0, 20, 1);
  mStatPanel->add(mStatLabel = new Label(L"Mesh stats"));

  mIconPanel = new Frame();
  mIconPanel->setBackground(new FrameBackground());
  layout->add(mIconPanel, 27, 12, 5, 5);
  mIconPanel->add(mIconImage = new RasterImage(mPrototype->getIconSurface128()));
  mIconImage->setPadding(32);

  mPortPanel = new Frame();
  mPortPanel->setBackground(new FrameBackground());
  layout->add(mPortPanel, 24, 20, 8, 4);
  GridLayout* portLayout = new GridLayout(mPortPanel, 8, 6);
  portLayout->set_borders(2);
  portLayout->set_padding(2);
  portLayout->add(mPortNumLabel = new Label(L"Port 1/2"), 0, 0, 6, 1);
  portLayout->add(mPortPosLabel = new Label(L"Pos: 31.0 32.0 33.0"), 0, 1, 8, 1);

  portLayout->add(mPortNextButton = new Button(L"Next", this), 6, 2, 2, 1);
  portLayout->add(mPortPrevButton = new Button(L"Prev", this), 6, 3, 2, 1);
  portLayout->add(mPortAddButton = new Button(L"Add", this), 6, 4, 2, 1);
  portLayout->add(mPortRemoveButton = new Button(L"Remove", this), 6, 5, 2, 1);

  portLayout->add(mPortMovXAddButton = new Button(L"Mov +X", this), 0, 2, 2, 1);
  portLayout->add(mPortMovXSubButton = new Button(L"Mov -X", this), 0, 3, 2, 1);
  portLayout->add(mPortMovYAddButton = new Button(L"Mov +Y", this), 2, 2, 2, 1);
  portLayout->add(mPortMovYSubButton = new Button(L"Mov -Y", this), 2, 3, 2, 1);
  portLayout->add(mPortMovZAddButton = new Button(L"Mov +Z", this), 4, 2, 2, 1);
  portLayout->add(mPortMovZSubButton = new Button(L"Mov -Z", this), 4, 3, 2, 1);

  portLayout->add(mPortRotXAddButton = new Button(L"Rot +X", this), 0, 4, 2, 1);
  portLayout->add(mPortRotXSubButton = new Button(L"Rot -X", this), 0, 5, 2, 1);
  portLayout->add(mPortRotYAddButton = new Button(L"Rot +Y", this), 2, 4, 2, 1);
  portLayout->add(mPortRotYSubButton = new Button(L"Rot -Y", this), 2, 5, 2, 1);
  portLayout->add(mPortRotZAddButton = new Button(L"Rot +Z", this), 4, 4, 2, 1);
  portLayout->add(mPortRotZSubButton = new Button(L"Rot -Z", this), 4, 5, 2, 1);  

  mPortMesh = rRenderSystem()->createMesh();
  mPortMesh->load("assets/user_interface/editor_port.shd");
  mNormalMesh = rRenderSystem()->createMesh();

  clear();
}
示例#5
0
Orbit::Orbit(Main* _main)
  : main(_main), planetFrontBuffer(NULL), planetBackBuffer(NULL), frameTime(0.1), meshGeneration(0), station(NULL), mExclusiveInput(false)
{
  for(int iProt = 0; iProt < 5; ++iProt) quickPrototypes[iProt] = NULL;

  LoadingScreen::tick(L"Orbit::SceneManager");
  Root& ogreRoot = Root::getSingleton();
  sceneManager = static_cast<OctreeSceneManager*>(ogreRoot.getSceneManager(ST_GENERIC));
  sceneManager->_setDestinationRenderSystem(ogreRoot.getRenderSystem());
  sceneManager->setSkyBox(true, "ShortHike/Orbit/Skybox_Stars");
  // Make this a display option
//   sceneManager->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
  sceneManager->setAmbientLight(ColourValue(0.35, 0.35, 0.35));

  rootNode = sceneManager->getRootSceneNode();

  LoadingScreen::tick(L"Orbit::Lights");
  Light* sunLight = sceneManager->createLight("SunLight");
  sunLight->setType(Light::LT_DIRECTIONAL);
  Vector sunDirection(-80, -4, -100);
  sunDirection.normalise();
  sunLight->setPosition(80, 4, 100);
  sunLight->setDirection(sunDirection);
  sunLight->setDiffuseColour(.9f, .9f, .9f);
  sunLight->setSpecularColour(1.0f, 1.0f, 1.0f);
  rootNode->attachObject(sunLight);

  Light* earthLight = sceneManager->createLight("EarthLight");
  earthLight->setType(Light::LT_DIRECTIONAL);
  Vector earthDirection(0, 0, 50);
  earthDirection.normalise();
  earthLight->setPosition(0, 0, -50);
  earthLight->setDirection(earthDirection);
  earthLight->setDiffuseColour(0.55f, 0.55f, 0.70f);
  earthLight->setSpecularColour(0, 0, 0);
  rootNode->attachObject(earthLight);

  trackBallCamera = new TrackBallCamera(sceneManager);

  LoadingScreen::tick(L"Orbit::setPlanetResolution");
  setPlanetResolution(MAGIC_DEFAULT_PLANET_RESOLUTION, false);

  LoadingScreen::tick(L"Orbit::UI - BottomFrame");
  
  // New UI
  {
    interfaceContainer = new Widget();
    Widget* rootContainer = rGUIManager()->getRootContainer();
    rootContainer->add(interfaceContainer);
    interfaceContainer->setPosition(0, 0);
    interfaceContainer->setSize(rootContainer->getSize());
    GridLayout* interfaceLayout = new GridLayout(interfaceContainer, 24, 18);    
    interfaceLayout->set_padding(0);
    interfaceLayout->set_borders(0);
    
    {
      stationInfo = new Label(L"Station information");
      stationInfo->setVerticalAlignment(Label::TOP);
      
      Frame* stationInfoFrame = new Frame("Orbit/StationInfoFrame");
      stationInfoFrame->setLayoutManager(new BorderLayout());
      stationInfoFrame->setBackground(new FrameBackground());
      stationInfoFrame->add(stationInfo, "center");
      interfaceLayout->add(stationInfoFrame, 0, 15, 4, 3);
    }
    
    {
      toolInfo = new Label(L"Tool/Module information");
      toolInfo->setVerticalAlignment(Label::TOP);

      Frame* toolInfoFrame = new Frame("Orbit/ToolInfoFrame");
      toolInfoFrame->setLayoutManager(new BorderLayout());
      toolInfoFrame->setBackground(new FrameBackground());
      toolInfoFrame->add(toolInfo, "center");

      interfaceLayout->add(toolInfoFrame, 20, 15, 4, 3);
    }    
    
    {
      int mapWidth = 300;
      int mapHeight = 150;
      orbitMap = new OrbitMap(this, "user_interface/EarthMap.png");
      orbitMap->setPreferredSize(mapWidth, mapHeight);
      layerDock = new LayerDock(this, orbitMap);
    }

    interfaceLayout->add(ModuleDock::getSingletonPtr(), 0, 1, 4, 14);
    interfaceLayout->add(ControlDock::getSingletonPtr(), 0, 0, 24, 1);
    interfaceLayout->add(layerDock, 4, 15, 16, 3);

    // DEBUG:
//     Frame* debugFrame = new Frame("DEBUGFRAME");
//     debugFrame->setLayoutManager(new BorderLayout());
//     mDebugLabel = new Label();
//     debugFrame->add(mDebugLabel, "center");
//     interfaceLayout->add(debugFrame, 18, 1, 6, 15);
  }

  LoadingScreen::tick(L"Orbit::UI - States");
  readyState = new OrbitReadyState(this);
  addState = new OrbitAddState(this);
  selectedState = new OrbitSelectedState(this);

  stateManager.addState(READY_STATE, readyState);
  stateManager.addState(ADD_STATE, addState);
  stateManager.addState(SELECTED_STATE, selectedState);

  LoadingScreen::tick(L"Randomizing Orbit");
  randomizeOrbit(true);
}