bool GUI::LoadMap(FileName name) { if(GetCurrentEditor() && !GetCurrentMap().hasChanged() && !GetCurrentMap().hasFile()) g_gui.CloseCurrentEditor(); Editor* editor; try { editor = newd Editor(copybuffer, name); } catch(std::runtime_error& e) { PopupDialog(root, wxT("Error!"), wxString(e.what(), wxConvUTF8), wxOK); return false; } MapTab* mapTab = newd MapTab(tabbook, editor); mapTab->OnSwitchEditorMode(mode); root->AddRecentFile(name); mapTab->GetView()->FitToMap(); UpdateTitle(); ListDialog(wxT("Map loader errors"), mapTab->GetMap()->getWarnings()); root->DoQueryImportCreatures(); FitViewToMap(mapTab); root->UpdateMenubar(); return true; }
void GUI::NewMapView() { MapTab* mapTab = GetCurrentMapTab(); if(mapTab) { MapTab* newMapTab = newd MapTab(mapTab); newMapTab->OnSwitchEditorMode(mode); SetStatusText(wxT("Created newd view")); UpdateTitle(); RefreshPalettes(); root->UpdateMenubar(); root->Refresh(); } }
bool GUI::NewMap() { Editor* editor; try { editor = newd Editor(copybuffer); } catch(std::runtime_error& e) { PopupDialog(root, wxT("Error!"), wxString(e.what(), wxConvUTF8), wxOK); return false; } MapTab* mapTab = newd MapTab(tabbook, editor); mapTab->OnSwitchEditorMode(mode); SetStatusText(wxT("Created new map")); UpdateTitle(); RefreshPalettes(); root->UpdateMenubar(); root->Refresh(); return true; }