VHDDManagerDialog::VHDDManagerDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, "Virtual HDD Manager") { m_list = new wxListView(this); wxBoxSizer* s_btns = new wxBoxSizer(wxHORIZONTAL); s_btns->Add(new wxButton(this, wxID_OK)); s_btns->AddSpacer(30); s_btns->Add(new wxButton(this, wxID_CANCEL)); wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL); s_main->Add(m_list, 1, wxEXPAND | wxALL, 5); s_main->Add(s_btns, 0, wxALL | wxCENTER, 10); SetSizerAndFit(s_main); SetSize(800, 600); m_list->InsertColumn(0, "Path"); //m_list->InsertColumn(1, "Size"); //m_list->InsertColumn(2, "Block size"); m_list->Bind(wxEVT_LIST_ITEM_ACTIVATED, &VHDDManagerDialog::DClick, this); m_list->Bind(wxEVT_RIGHT_DOWN, &VHDDManagerDialog::OnContextMenu, this); Bind(wxEVT_MENU, &VHDDManagerDialog::AddHDD, this, id_add_hdd); Bind(wxEVT_MENU, &VHDDManagerDialog::OnOpen, this, id_open); Bind(wxEVT_MENU, &VHDDManagerDialog::OnRemove, this, id_remove); Bind(wxEVT_MENU, &VHDDManagerDialog::OnCreateHDD, this, id_create_hdd); Bind(wxEVT_BUTTON, &VHDDManagerDialog::OnOk, this, wxID_OK); LoadPaths(); UpdateList(); }
VHDDManagerDialog::VHDDManagerDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, "Virtual HDD Manager", wxDefaultPosition) { m_list = new wxListView(this); wxBoxSizer& s_main(*new wxBoxSizer(wxVERTICAL)); s_main.Add(m_list, 1, wxEXPAND | wxALL, 5); SetSizerAndFit(&s_main); SetSize(800, 600); m_list->InsertColumn(0, "Path"); //m_list->InsertColumn(1, "Size"); //m_list->InsertColumn(2, "Block size"); Connect(m_list->GetId(), wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(VHDDManagerDialog::DClick)); Connect(m_list->GetId(), wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(VHDDManagerDialog::OnContextMenu)); Connect(id_add_hdd, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(VHDDManagerDialog::AddHDD)); Connect(id_open, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(VHDDManagerDialog::OnOpen)); Connect(id_remove, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(VHDDManagerDialog::OnRemove)); Connect(id_create_hdd, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(VHDDManagerDialog::OnCreateHDD)); Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(VHDDManagerDialog::OnClose)); LoadPaths(); UpdateList(); }
bool CBratSettings::LoadConfig() { return base_t::LoadConfig() && ReadSection( GROUP_COMMON, k_v( ENTRY_LAST_DATA_PATH, &m_lastDataPath ), k_v( ENTRY_LAST_PAGE_REACHED, &m_lastPageReached ), k_v( ENTRY_ADVANCED_OPERATIONS, &mAdvancedOperations, false ), k_v( ENTRY_LOAD_WKSPC_AT_STARTUP, &mLoadLastWorkspaceAtStartUp ), k_v( ENTRY_MAIN_LAYER_BASE_TYPE, (int*)&mMainLayerBaseType, (int)smDefaultLayerBaseType ), k_v( ENTRY_VIEWS_LAYER_BASE_TYPE, (int*)&mViewsLayerBaseType, (int)smDefaultLayerBaseType ), k_v( ENTRY_VECTOR_SIMPLIFY_METHOD, &mVectorSimplifyMethod, true ), k_v( ENTRY_DESKTOP_MANAGER_SDI, &mDesktopManagerSdi, true ), k_v( ENTRY_CHECK_OPENGL, &mCheckOpenGL, true ) ) && ReadValues( GROUP_WKS, { { ENTRY_LAST, m_lastWksPath }, } ) && ReadValues( GROUP_COLORTABLE, { { ENTRY_LAST, m_lastColorTable }, } ) && LoadPaths(); }
int Init(const char *pApplicationName, int StorageType, int NumArgs, const char **ppArguments) { // get userdir fs_storage_path(pApplicationName, m_aUserdir, sizeof(m_aUserdir)); // get datadir FindDatadir(ppArguments[0]); // get currentdir if(!fs_getcwd(m_aCurrentdir, sizeof(m_aCurrentdir))) m_aCurrentdir[0] = 0; // load paths from storage.cfg LoadPaths(ppArguments[0]); if(!m_NumPaths) { dbg_msg("storage", "using standard paths"); AddDefaultPaths(); } // add save directories if(StorageType != STORAGETYPE_BASIC) { if(m_NumPaths && (!m_aaStoragePaths[TYPE_SAVE][0] || !fs_makedir(m_aaStoragePaths[TYPE_SAVE]))) { char aPath[MAX_PATH_LENGTH]; if(StorageType == STORAGETYPE_CLIENT) { fs_makedir(GetPath(TYPE_SAVE, "screenshots", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "screenshots/auto", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "maps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedmaps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedassets", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedassets/universes", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedassets/worlds", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedassets/lands", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "skins", aPath, sizeof(aPath))); } fs_makedir(GetPath(TYPE_SAVE, "assets", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "assets/universes", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "assets/worlds", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "assets/lands", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "editorresources", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "dumps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "demos", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "demos/auto", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "configs", aPath, sizeof(aPath))); } else { dbg_msg("storage", "unable to create save directory"); return 1; } } return m_NumPaths ? 0 : 1; }
void JustRespawned() { paths = LoadPaths(); tRun = 500; tRun2 = 2500; tSay = 1000; onceRun = onceRun2 = onceSay = onceGet = true; x = me->m_positionX + cos(me->_orientation)*5; y = me->m_positionY + sin(me->_orientation)*5; z = me->m_positionZ; }
int Init(const char *pApplicationName, int StorageType, int NumArgs, const char **ppArguments) { // get userdir fs_storage_path(pApplicationName, m_aUserdir, sizeof(m_aUserdir)); // get datadir FindDatadir(ppArguments[0]); // get currentdir if(!fs_getcwd(m_aCurrentdir, sizeof(m_aCurrentdir))) m_aCurrentdir[0] = 0; // load paths from storage.cfg LoadPaths(ppArguments[0]); if(!m_NumPaths) { dbg_msg("storage", "using standard paths"); AddDefaultPaths(); } // add save directories if(StorageType != STORAGETYPE_BASIC && m_NumPaths && (!m_aaStoragePaths[TYPE_SAVE][0] || !fs_makedir(m_aaStoragePaths[TYPE_SAVE]))) { char aPath[MAX_PATH_LENGTH]; if(StorageType == STORAGETYPE_CLIENT) { fs_makedir(GetPath(TYPE_SAVE, "screenshots", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "screenshots/auto", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "screenshots/auto/stats", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "maps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedmaps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "identities", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "tmp", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "tmp/cache", aPath, sizeof(aPath))); fs_makedir("rsa"); } fs_makedir(GetPath(TYPE_SAVE, "dumps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "dumps/console_local", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "dumps/console_remote", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "dumps/memory", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "dumps/tilelayer", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "dumps/network", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "demos", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "demos/auto", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "editor", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "ghosts", aPath, sizeof(aPath))); } return m_NumPaths ? 0 : 1; }