コード例 #1
0
ファイル: VCursor.cpp プロジェクト: Bewolf2/projectanarchy
bool VCursor::Parse(TiXmlElement *pNode, const char *szPath)
{
  if (!IVMenuSystemResource::Parse(pNode,szPath))
    return false;

  // user 0 parse from cursor root
  m_UserProperties[0].Parse(GetMenuManager(),pNode,szPath);

  // assign to all other user properties
  for (int i=1;i<VGUIUserInfo_t::GUIMaxUser;i++)
    m_UserProperties[i] = m_UserProperties[0];

  // see whether we have a subnode and parse
  for (TiXmlElement *pUserNode=pNode->FirstChildElement("user"); pUserNode; pUserNode=pUserNode->NextSiblingElement("user"))
  {
    int iUser = -1;
    XMLHelper::Exchange_Int(pUserNode,"ID",iUser,false);
    VASSERT_MSG(iUser>=0 && iUser<VGUIUserInfo_t::GUIMaxUser,"Missing or invalid user ID");
    m_UserProperties[iUser].Parse(GetMenuManager(),pUserNode,szPath);
  }

//  if (!GetFilename())
//    SetFilename(szFilename);

  return true; 
}
コード例 #2
0
ファイル: PlayerUI.cpp プロジェクト: Bewolf2/projectanarchy
void RPG_PlayerUIDialog_Mouse::OnActivate()
{
  RPG_PlayerUIDialog::OnActivate();

  // Load resources (cursor)
  GetMenuManager()->LoadResourceFile("GUI\\MouseHUDResources.xml");
}
コード例 #3
0
void PlayerUIDialog::OnSetFocus(bool focus)
{
  VDialog::OnSetFocus(focus);
#if defined(_VISION_MOBILE)
  m_cursor = GetMenuManager()->LoadCursorResource("GUI/Textures/MouseMobile.tga");
#else
  VASSERT_MSG(!m_cursorTextureFilename.IsEmpty(), "Cursor texture filename hasn't been specified.");
  m_cursor = GetMenuManager()->LoadCursorResource(m_cursorTextureFilename.AsChar());
  VASSERT_MSG(m_cursor, "Cursor failed to load.");
#endif

#if defined(SUPPORTS_MULTITOUCH) && (HAVOK_VISION_RESTRUCTURING) && !defined(_VISION_ANDROID)

  m_touchInput = NULL;

  IVInputDevice* inputDevice = &VInputManagerPC::GetInputDevice(INPUT_DEVICE_TOUCHSCREEN);
  if(inputDevice != &VInputManagerPC::s_NoInputDevice)
    m_touchInput = static_cast<IVMultiTouchInput*>(inputDevice);

#endif
}
コード例 #4
0
ファイル: EditToolBar.cpp プロジェクト: SteveDaulton/audacity
void EditToolBar::OnButton(wxCommandEvent &event)
{
   int id = event.GetId()-first_ETB_ID;
   // Be sure the pop-up happens even if there are exceptions, except for buttons which toggle.
   auto cleanup = finally( [&] { mButtons[id]->InteractionOver();});

   AudacityProject *p = GetActiveProject();
   if (!p) return;
   CommandManager* cm = p->GetCommandManager();
   if (!cm) return;

   auto flags = GetMenuManager(*p).GetUpdateFlags(*p);
   const CommandContext context( *GetActiveProject() );
   cm->HandleTextualCommand(EditToolbarButtonList[id].commandName, context, flags, NoFlagsSpecified);
}
コード例 #5
0
void AnimationMainMenu::OnInitDialog()
{
  // position the GUI to the left side of the screen
  SetPosition(Vision::Video.GetXRes() - GetSize().x,0);
  SetSize(GetSize().x, (float)Vision::Video.GetYRes());

  // find the entities in the scene
  for (int i = 0; i < ENTITY_COUNT; i++)
  {
    char szKey[64];
    sprintf(szKey, "Soldier_%i", i);
    m_pSoldiers[i] = Vision::Game.SearchEntity(szKey);
    VASSERT(m_pSoldiers[i]);
  }
  // sub menus
  m_pSubMenu = static_cast<VDialogSubCtrl*>(Items().FindItem(VGUIManager::GetID("SUBMENU")));
  m_spSubMenuDialog = GetMenuManager()->CreateDialogInstance("CharacterLOD\\Dialogs\\SubMenu.xml", GetContext(), this);
  VASSERT(m_pSubMenu && m_spSubMenuDialog);

  // skeletal anim
  m_pLODSelectionList = static_cast<VListControl*>(m_spSubMenuDialog->Items().FindItem(VGUIManager::GetID("LOD_SELECTION")));
  m_pCheckBoxStopPlay = static_cast<VCheckBox*>(m_spSubMenuDialog->Items().FindItem(VGUIManager::GetID("STOP_PLAY")));
  VASSERT(m_pLODSelectionList && m_pCheckBoxStopPlay);
  
  // fill the list control (put the enum in the data member):
  VListControlItem *pItem;
  ADD_MODE(VLOD_HIGH,     "High Quality",     "Use characters with high polygon count");
  ADD_MODE(VLOD_MEDIUM,   "Medium Quality",   "Use characters with medium polygon count");
  ADD_MODE(VLOD_LOW,      "Low Quality",      "Use characters with low polygon count");
  ADD_MODE(VLOD_ULTRALOW, "UltraLow Quality", "Use characters with ultra low polygon count");
  ADD_MODE(VLOD_AUTO,     "Use AutoLOD",      "Choose LOD-Level by distance");

  m_pSubMenu->SetDialog(m_spSubMenuDialog);

  // set the initial mode
  SetLODLevel(VLOD_AUTO);
}
コード例 #6
0
ファイル: MenuSystem.cpp プロジェクト: Alagong/projectanarchy
void AnimationMainMenu::OnInitDialog()
{
  // position the GUI to the right side of the screen
  SetPosition(Vision::Video.GetXRes() - GetSize().x,0);
  SetSize(GetSize().x, (float)Vision::Video.GetYRes());

  // find the entities in the scene
  m_pSkeletalCharacter = (SimpleSkeletalAnimatedObject_cl *)Vision::Game.SearchEntity("SkeletalAnimEntity");
  m_pVertexAnimCharacter = (SimpleVertexAnimatedObject_cl *)Vision::Game.SearchEntity("VertexAnimEntity");
  VASSERT(m_pSkeletalCharacter && m_pVertexAnimCharacter);

  // sub menues
  m_pSubMenu = (VDialogSubCtrl *)Items().FindItem(VGUIManager::GetID("SUBMENU"));
  m_spSubMenu_Skeletal = GetMenuManager()->CreateDialogInstance("BasicAnimation\\SubMenu_Skeletal.xml", GetContext(), this);
  m_spSubMenu_Vertex   = GetMenuManager()->CreateDialogInstance("BasicAnimation\\SubMenu_Vertex.xml", GetContext(), this);
  VASSERT(m_pSubMenu && m_spSubMenu_Skeletal && m_spSubMenu_Vertex);

  m_pCheckBoxSkeletalAnim = (VCheckBox *)Items().FindItem(VGUIManager::GetID("SKELETALANIM"));
  m_pCheckBoxVertexAnim = (VCheckBox *)Items().FindItem(VGUIManager::GetID("VERTEXANIM"));
  VASSERT(m_pCheckBoxSkeletalAnim);
  VASSERT(m_pCheckBoxVertexAnim);

  m_pCheckBoxSkeletalAnim->SetChecked(true);

  // vertex anim
  m_pCheckBoxPlayVertexAnim = (VCheckBox *)m_spSubMenu_Vertex->Items().FindItem(VGUIManager::GetID("PLAY_VERTEXANIM"));
  VASSERT(m_pCheckBoxPlayVertexAnim);

  // skeletal anim
  m_pSkeletalModeList = (VListControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKELETAL_MODE"));
  VASSERT(m_pSkeletalModeList);
  VListControlItem *pItem;
    // fill the list control (put the enum in the data member):
    ADD_MODE(MODE_SINGLEANIM,       "Single animation",     "Plays a single animation");
    ADD_MODE(MODE_BLENDTWOANIMS,    "Blend two animations", "Blends two animations");
    ADD_MODE(MODE_LISTENTOEVENTS,   "Listen to events",     "Demonstrates event callbacks");
    ADD_MODE(MODE_SETANIMATIONTIME, "Set animation time",   "Shows manual animation time setting");
    ADD_MODE(MODE_LAYERTWOANIMATIONS,"Layer two animations","Layers one animation on top of the other");
    ADD_MODE(MODE_FORWARDKINEMATICS,"Forward kinematics",   "Inserts a bone modifier node\ninto the animation tree");
    ADD_MODE(MODE_LOOKAT,           "Look-at",              "Uses forward kinematics for simple lookat");

  // skeletal mode specific:
  m_pCheckBoxSkelPlay   = (VCheckBox *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_PLAYANIM"));
  m_pCheckBoxSkelBlend  = (VCheckBox *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_BLEND_TOGGLE"));
  m_pSliderSetAnimTime  = (VSliderControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_ANIM_TIME"));
  m_pSetAnimTimeLabel   = (VTextLabel *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_ANIM_TIME_LABEL"));
  m_pSliderFKinYaw      = (VSliderControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_FKIN_YAW"));
  m_pFKinLabel          = (VTextLabel *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_FKIN_LABEL"));
  m_pSliderLayered      = (VSliderControl *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_LAYERANIMS"));
  m_pLayeredLabel       = (VTextLabel *)m_spSubMenu_Skeletal->Items().FindItem(VGUIManager::GetID("SKEL_LAYERANIMS_LABEL"));

  VASSERT(m_pCheckBoxSkelPlay);
  VASSERT(m_pCheckBoxSkelBlend);
  VASSERT(m_pSliderSetAnimTime);
  VASSERT(m_pSetAnimTimeLabel);
  VASSERT(m_pSliderFKinYaw);
  VASSERT(m_pFKinLabel);
  VASSERT(m_pSliderLayered);
  VASSERT(m_pLayeredLabel);

  // set the initial mode
  SetSkeletalMode(SimpleSkeletalAnimatedObject_cl::MODE_SINGLEANIM);

}
コード例 #7
0
ファイル: HavokAi.cpp プロジェクト: cDoru/projectanarchy
	VOVERRIDE void OnSetFocus(bool bStatus)
	{
		m_spCursor = GetMenuManager()->LoadCursorResource("GUI\\mouseNorm.TGA");
	}