Interface* makeInterface(int version = 0) { InterfaceManager im; qDebug() << "Interfaces:"; for (const auto& i : im.getNames<Interface>()) { qDebug() << " " << i; } im.selectVersion(version); return im.getInterface(); }
void TextInputJournal::Init() { //TODO: Turn creation of menus into a template function? InterfaceManager* intfc = InterfaceManager::GetSingleton(); // Is BookMenu already open? BookMenu* bookMenu = (BookMenu*)GetMenuByType(kMenuType_Book); if (bookMenu) // open, so get rid of it first bookMenu->Destructor(1); // create new book menu Tile* tile = intfc->menuRoot->ReadXML("data\\menus\\book_menu.xml"); if (tile) { Tile* bookRoot = tile->GetRoot(); if (bookRoot) { TileMenu* bookMenuTile = tile_cast <TileMenu>(bookRoot); if (bookMenuTile) { BookMenu* bookMenu = (BookMenu*)(bookMenuTile->menu); if (bookMenu) { bookMenu->book = m_dummyBook; bookMenu->bookRef = NULL; ToggleMenuShortcutKeys(false, bookMenu); bookMenu->RegisterTile(bookMenuTile); // update depth Tile* backgroundTile = NULL; if (m_dummyBook->IsScroll()) backgroundTile = bookMenu->tile->GetChildByName("book_background_scroll"); else backgroundTile = bookMenu->tile->GetChildByName("book_background"); Tile::Value* depthVal = backgroundTile->GetValueByType(kTileValue_depth); if (depthVal) { backgroundTile->UpdateFloat(kTileValue_depth, depthVal->num + intfc->GetDepth()); depthVal->num += intfc->GetDepth(); } if (!m_dummyBook->IsScroll()) bookMenu->tile->UpdateFloat(BookMenu::kBookValue_IsBook, 2.0); bookMenu->EnableMenu(false); bookMenu->UpdateText(m_inputText.c_str()); } } } } }
void HelpWindow::showFitFunction(QWidget *parent, const std::string &name) { InterfaceManager interfaceManager; MantidHelpInterface *gui = interfaceManager.createHelpWindow(); if (gui) { connectParent(gui, parent); gui->showFitFunction(name); } else { g_log.error() << "Failed to launch help for fit function " << name << "\n"; } }
void HelpWindow::showPage(QWidget *parent, const QUrl & url) { InterfaceManager interfaceManager; MantidHelpInterface *gui = interfaceManager.createHelpWindow(); if (gui) { connectParent(gui, parent); gui->showPage(url); } else { g_log.error() << "Failed to launch help for page " << url.toString().toStdString() << "\n"; } }
void HelpWindow::showAlgorithm(QWidget *parent, const QString &name, const int version) { InterfaceManager interfaceManager; MantidHelpInterface *gui = interfaceManager.createHelpWindow(); if (gui) { connectParent(gui, parent); gui->showAlgorithm(name, version); } else { g_log.error() << "Failed to launch help for algorithm " << name.toStdString() << " v" << version << "\n"; } }
bool GameClient::RunFrame() { ClientEntity * ent; Actor * actor = NULL; BYTE Status; if(!gClient->GetIsConnected()) return false; //Check if Menu Mode: InterfaceManager* intfc = InterfaceManager::GetSingleton(); if(!intfc->IsGameMode()) g_bRenderGUI = false; else g_bRenderGUI = true; if(!gClient->GetIsInitialized() ) { gClient->GetConnection().Process();//Poll connection until a player id is received return true; } // A heavy command xD // 1 - send local player data up . // 2 - send health magicka and fatigue + equip up. // if MC : // 2 - send up position , stat equip , etc of NPCs //(*g_thePlayer) is ignored ent = (ClientEntity *)gClient->GetEntities()->GetOrCreateEntity(gClient->GetLocalPlayer()); //gClient->GetServerStream()->Send(); // Prevent Lag SendActorPosition(*g_thePlayer,ent); SendActorValues(*g_thePlayer,ent); SendActorEquip(*g_thePlayer,ent); SendActorAnimation(*g_thePlayer,ent); //Find all cells any "ignored objects" are in. these are mostly players. std::set<TESObjectCELL *> cells; cells.insert((*g_thePlayer)->parentCell); BOOST_FOREACH(UINT32 i,ignore) { TESObjectREFR *form = (TESObjectREFR *)LookupFormByID(i); if(!form) continue; if(!form->parentCell) continue; if(cells.find(form->parentCell) == cells.end())//Not present cells.insert(form->parentCell); }
static bool Cmd_GetCursorPos_Execute(COMMAND_ARGS) { UInt32 axis = 0; *result = 0; InterfaceManager* intfc = InterfaceManager::GetSingleton(); if (intfc->IsGameMode()) // can crash during gamemode if playing full-screen return true; if (ExtractArgs(PASS_EXTRACT_ARGS, &axis)) { POINT mouseCoords; if (GetCursorPos(&mouseCoords)) { if (axis == 'X') *result = mouseCoords.x; else if (axis == 'Y') *result = mouseCoords.y; } } return true; }