void CMembersView::OnDelete() { static const tchar* pszMsg = TXT("Delete the member: %s?\n\n") TXT("This will also delete their stats, any\n") TXT("income and their place in any team sheets."); // Ignore if no selection. if (!m_lvGrid.IsSelection()) return; // Get the current selection. int iLVItem = m_lvGrid.Selection(); CRow& oRow = Row(iLVItem); int nID = oRow[CMembers::ID]; CString strName = App.FormatName(oRow, CMembers::FORENAME, CMembers::SURNAME); // Get user to confirm action. if (QueryMsg(pszMsg, strName) != IDYES) return; // Remove any stats, income and team sheet places. m_oDB.m_oMemStats.DeleteMembersStats(nID); // m_oDB.m_oSubs; // m_oDB.m_oTeamSels; // Remove from the list view and collection. DeleteRow(iLVItem); m_oTable.DeleteRow(oRow); App.m_AppCmds.UpdateUI(); }
void CPrefsDlg::SetAppSettings (bool bInitApp) { if (m_bInvalid) return; if (strcmp (descent_path, strlwr (m_d1Path))) { strcpy (descent_path, m_d1Path); WritePrivateProfileString ("DLE-XP", "DescentDirectory", descent_path, "dle-xp.ini"); if (file_type == RDL_FILE) FreeTextureHandles(); } if (strcmp(descent2_path, strlwr (m_d2Path))) { bool bChangePig = true; if (HasCustomTextures() && (QueryMsg ("Changing the pig file will affect the custom textures\n" "in this level because of the change in palette.\n" "(Reload the level to fix custom texture appeareance.)\n\n" "Are you sure you want to do this?") != IDOK)) bChangePig = false; if (bChangePig) { strcpy (descent2_path, m_d2Path); WritePrivateProfileString ("DLE-XP", "Descent2Directory", descent2_path, "dle-xp.ini"); if (file_type == RL2_FILE) FreeTextureHandles (false); GetMine ()->LoadPalette (); theApp.MineView ()->ResetView (true); } } if (strcmp (levels_path, strlwr (m_missionsPath))) { strcpy (levels_path, m_missionsPath); WritePrivateProfileString ("DLE-XP", "levelsDirectory", levels_path, "dle-xp.ini"); } if (!bInitApp) theApp.MineView ()->DelayRefresh (true); theApp.MineView ()->m_nViewDist = m_nViewDist; theApp.MineView ()->SetViewMineFlags (m_mineViewFlags); theApp.MineView ()->SetViewObjectFlags (m_objViewFlags); theApp.TextureView ()->SetViewFlags (m_texViewFlags); depth_perception = m_depthPerceptions [m_iDepthPerception]; theApp.MineView ()->DepthPerception () = depth_perception; *(theApp.MineView ()->MineCenter ()) = m_nMineCenter; if (!bInitApp) { theApp.MineView ()->DelayRefresh (false); theApp.MineView ()->Refresh (false); } angle_rate = m_rotateRates [m_iRotateRate]; move_rate = (long) (m_moveRate * 0x10000L); bExpertMode = (m_bExpertMode != 0); theApp.GetMine ()->UseTexColors () = m_bUseTexColors != 0; if (!bInitApp) SaveAppSettings (false); theApp.m_bSplashScreen = m_bSplashScreen; theApp.m_undoList.SetMaxSize (m_nMaxUndo); }
bool CAppWnd::OnQueryClose() { int nClients = static_cast<int>(App.m_aoConnections.Size()); // Warn user if server in use. if (nClients > 0) { CString strMsg; strMsg.Format(TXT("There are %d client(s) still connected.\n\nAre you sure you want to close it?"), nClients); // Abort if NO or CANCEL. if (QueryMsg(strMsg) != IDYES) return false; } return true; }
void CTextureTool::OnReplace () { UpdateData (TRUE); if (!(m_bUse1st || m_bUse2nd)) return; if (!GetMine ()) return; INT16 segnum, sidenum; CDSegment *seg = m_mine->Segments (); CDSide *side; bool bChange = false, bAll = !m_mine->GotMarkedSides (); if (bAll && (QueryMsg ("Replace textures in entire mine?") != IDYES)) return; bool bUndo = theApp.SetModified (TRUE); theApp.LockUndo (); if (bAll) INFOMSG (" Replacing textures in entire mine."); for (segnum = 0; segnum < m_mine->SegCount (); segnum++, seg++) for (sidenum = 0, side = seg->sides; sidenum < 6; sidenum++, side++) if (bAll || m_mine->SideIsMarked (segnum, sidenum)) { if (m_bUse1st && (side->nBaseTex != last_texture1)) continue; if (m_bUse2nd && ((side->nOvlTex & 0x3FFF) != last_texture2)) continue; if ((seg->children [sidenum] >= 0) && (side->nWall == NO_WALL)) continue; if (m_mine->SetTexture (segnum, sidenum, m_bUse1st ? save_texture1 : -1, m_bUse2nd ? save_texture2 : -1)) bChange = true; // int i; // for (i = 0; i < 4; i++) // side->uvls [i].l = save_uvls [i].l; } if (bChange) theApp.UnlockUndo (); else theApp.ResetModified (bUndo); Refresh (); theApp.MineView ()->Refresh (); }
void CTextureTool::OnPasteMarked () { UpdateData (TRUE); if (!(m_bUse1st || m_bUse2nd)) return; if (!GetMine ()) return; INT16 segnum, sidenum; CDSegment *seg = m_mine->Segments (); CDSide *side; bool bChange = false, bAll = !m_mine->GotMarkedSides (); if (bAll && (QueryMsg ("Paste texture to entire mine?") != IDYES)) return; bool bUndo = theApp.SetModified (TRUE); theApp.LockUndo (); if (bAll) INFOMSG (" Pasting texture in entire mine."); for (segnum = 0; segnum < m_mine->SegCount (); segnum++, seg++) { for (sidenum = 0, side = seg->sides; sidenum < 6; sidenum++, side++) { if (bAll || m_mine->SideIsMarked (segnum, sidenum)) { if (seg->children [sidenum] == -1) { bChange = true; m_mine->SetTexture (segnum, sidenum, m_bUse1st ? save_texture1 : -1, m_bUse2nd ? save_texture2 : -1); int i; for (i = 0; i < 4; i++) side->uvls [i].l = save_uvls [i].l; } } } } if (bChange) theApp.UnlockUndo (); else theApp.ResetModified (bUndo); Refresh (); theApp.MineView ()->Refresh (); }
void CMembersView::OnDeleteAll() { // static const tchar* pszMsg = TXT("Delete the member: %s?\n\n") // TXT("This will also delete their stats, any\n") // TXT("income and their place in any team sheets."); // Get user to confirm action. if (QueryMsg(TXT("Delete ALL members?")) != IDYES) return; // Remove any stats, income and team sheet places. // m_oDB.m_oMemStats.DeleteMembersStats(nID); // m_oDB.m_oSubs; // m_oDB.m_oTeamSels; // Remove from the list view and collection. DeleteAllRows(); m_oTable.Truncate(); App.m_AppCmds.UpdateUI(); }