void ProdRestartGridCtrl::ResetGrid() { static const int maxRestart = 16; productionRestartTimes.ReAlloc(maxRestart); SetRowCount(maxRestart + 1); SetColCount(2); SetCenteredText(0, 1, "Restart Time" ); CString sRowHeader; for (int i = 0; i < maxRestart; i++) { int row = i + 1; sRowHeader.Format("%d", row); SetCenteredText(row, 0, sRowHeader ); if (i > productionRestartTimes.UpperBound()) productionRestartTimes[i] = nullReal; SetCell(row, 1, new ProdRestartTimeGridCell(i)); } SetEditMode(); SetBorderThickness(4); AutoSize(); SetColSize(1, GetColSize(1) + 15); UpdateAllRows(); }
void GridControl::Create(const CRect& rect) { int nID = GetID(); CWnd* pParent = GetParentWnd(); VERIFY(CGridCtrlCell::Create(rect, pParent, nID, NULL, WS_CHILD|WS_VISIBLE)); TRACE("GridControl %d\r\n", nID); AutoSize(); SetEditMode(); }
aui_UI::~aui_UI() { if (m_editMode) { SetEditMode(FALSE); } delete m_mouse; delete m_audioManager; delete m_movieManager; delete m_keyboard; delete m_blitter; delete m_memmap; delete m_joystick; delete m_primary; delete m_secondary; delete m_colorAreas; delete m_imageAreas; delete m_imageResource; delete m_cursorResource; delete m_bitmapFontResource; delete m_dirtyList; delete m_actionList; delete m_destructiveActionList; delete m_winList; delete m_dirtyRectInfoList; delete m_dirtyRectInfoMemory; aui_Ldl::Remove(this); delete m_ldl; if (this == g_ui) { g_ui = NULL; } free_crc(); }
void levelInit() { arx_assert(entities.player()); LogDebug("Initializing level ..."); g_requestLevelInit = true; ARX_PARTICLES_FirstInit(); RenderBatcher::getInstance().reset(); progressBarAdvance(2.f); LoadLevelScreen(); if(!pParticleManager) pParticleManager = new ParticleManager(); if(GMOD_RESET) ARX_GLOBALMODS_Reset(); GMOD_RESET = true; STARTDRAG = Vec2s_ZERO; DANAEMouse = Vec2s_ZERO; if(LOAD_N_ERASE) arxtime.init(); ARX_BOOMS_ClearAllPolyBooms(); ARX_DAMAGES_Reset(); ARX_MISSILES_ClearAll(); spells.clearAll(); ARX_SPELLS_ClearAllSymbolDraw(); ARX_PARTICLES_ClearAll(); if(LOAD_N_ERASE) { CleanScriptLoadedIO(); RestoreInitialIOStatus(); DRAGINTER=NULL; } ARX_SPELLS_ResetRecognition(); eyeball.exist=0; for(size_t i = 0; i < MAX_DYNLIGHTS; i++) { lightHandleGet((LightHandle)i)->exist = 0; } arxtime.update_last_frame_time(); if(LOAD_N_ERASE) { CleanInventory(); ARX_SCRIPT_Timer_ClearAll(); UnlinkAllLinkedObjects(); ARX_SCRIPT_ResetAll(false); } SecondaryInventory=NULL; TSecondaryInventory=NULL; ARX_FOGS_Render(); if(LOAD_N_ERASE) { arxtime.init(); if(!DONT_ERASE_PLAYER) ARX_PLAYER_InitPlayer(); g_hudRoot.playerInterfaceFader.resetSlid(); player.lifePool.current = player.lifePool.max; player.manaPool.current = player.manaPool.max; if(!DONT_ERASE_PLAYER) { ARX_PLAYER_MakeFreshHero(); } } InitSnapShot(fs::paths.user / "snapshot"); if(FASTmse) { FASTmse = 0; if(LOADEDD) { Vec3f trans = Mscenepos; player.pos = loddpos + trans; } else { player.pos.y += player.baseHeight(); } progressBarAdvance(4.f); LoadLevelScreen(); } #if BUILD_EDIT_LOADSAVE else if(mse) { Mscenepos.x=-mse->cub.xmin-(mse->cub.xmax-mse->cub.xmin)*.5f+((float)ACTIVEBKG->Xsize*(float)ACTIVEBKG->Xdiv)*.5f; Mscenepos.z=-mse->cub.zmin-(mse->cub.zmax-mse->cub.zmin)*.5f+((float)ACTIVEBKG->Zsize*(float)ACTIVEBKG->Zdiv)*.5f; float t1=(float)(long)(mse->point0.x/BKG_SIZX); float t2=(float)(long)(mse->point0.z/BKG_SIZZ); t1=mse->point0.x-t1*BKG_SIZX; t2=mse->point0.z-t2*BKG_SIZZ; Mscenepos.x=(float)((long)(Mscenepos.x/BKG_SIZX))*BKG_SIZX+(float)BKG_SIZX*.5f; Mscenepos.z=(float)((long)(Mscenepos.z/BKG_SIZZ))*BKG_SIZZ+(float)BKG_SIZZ*.5f; mse->pos.x=Mscenepos.x=Mscenepos.x+BKG_SIZX-t1; mse->pos.z=Mscenepos.z=Mscenepos.z+BKG_SIZZ-t2; Mscenepos.y=mse->pos.y=-mse->cub.ymin-100.f-mse->point0.y; if (PLAYER_POSITION_RESET) { player.pos.x = mse->pos.x+mse->point0.x; player.pos.z = mse->pos.z+mse->point0.z; player.pos.y = mse->pos.y+mse->point0.y; } EERIERemovePrecalcLights(); progressBarAdvance(); LoadLevelScreen(); SceneAddMultiScnToBackground(mse); progressBarAdvance(2.f); LoadLevelScreen(); Vec3f trans = mse->pos; ReleaseMultiScene(mse); mse=NULL; if(PLAYER_POSITION_RESET) { if(LOADEDD) { player.pos = loddpos + trans; } else { player.pos.y += player.baseHeight(); } } PLAYER_POSITION_RESET = true; progressBarAdvance(); LoadLevelScreen(); } #endif // BUILD_EDIT_LOADSAVE else { progressBarAdvance(4.f); LoadLevelScreen(); } if(player.torch) { ARX_SOUND_PlaySFX(SND_TORCH_LOOP, NULL, 1.0F, ARX_SOUND_PLAY_LOOPED); } MagicFlareSetCamera(&subj); lastteleport = player.basePosition(); subj.orgTrans.pos = g_moveto = player.pos; subj.angle = player.angle; RestoreLastLoadedLightning(*ACTIVEBKG); progressBarAdvance(); LoadLevelScreen(); if(LOAD_N_ERASE) SetEditMode(0); progressBarAdvance(); LoadLevelScreen(); LOAD_N_ERASE = true; DONT_ERASE_PLAYER=0; progressBarAdvance(); LoadLevelScreen(); g_requestLevelInit = false; PrepareIOTreatZone(1); CURRENTLEVEL=GetLevelNumByName(LastLoadedScene.string()); if(TIME_INIT) arxtime.init(); arxtime.update_last_frame_time(); progressBarAdvance(); LoadLevelScreen(); if(DONT_WANT_PLAYER_INZONE) { player.inzone = NULL; DONT_WANT_PLAYER_INZONE = 0; } progressBarAdvance(); LoadLevelScreen(); player.desiredangle.setYaw(0.f); player.angle.setYaw(0.f); ARX_PLAYER_RectifyPosition(); entities.player()->_npcdata->vvpos = -99999; SendGameReadyMsg(); PLAYER_MOUSELOOK_ON = false; player.Interface &= ~INTER_NOTE; if(!TIME_INIT) { arxtime.force_time_restore(FORCE_TIME_RESTORE); arxtime.force_frame_time_restore(FORCE_TIME_RESTORE); } else { arxtime.resume(); } EntityHandle t = entities.getById("seat_stool1_0012"); if(ValidIONum(t)) { entities[t]->ioflags |= IO_FORCEDRAW; } if(WILL_RESTORE_PLAYER_POSITION_FLAG) { Entity * io = entities.player(); player.pos = WILL_RESTORE_PLAYER_POSITION; io->pos = player.basePosition(); for(size_t i = 0; i < io->obj->vertexlist.size(); i++) { io->obj->vertexlist3[i].v = io->obj->vertexlist[i].v + io->pos; } WILL_RESTORE_PLAYER_POSITION_FLAG = 0; } ARX_NPC_RestoreCuts(); ResetVVPos(entities.player()); progressBarAdvance(); LoadLevelScreen(); LoadLevelScreen(-2); if ( (!CheckInPoly(player.pos)) && (LastValidPlayerPos.x!=0.f) && (LastValidPlayerPos.y!=0.f) && (LastValidPlayerPos.z!=0.f)) { player.pos = LastValidPlayerPos; } LastValidPlayerPos = player.pos; }
AUI_ERRCODE aui_UI::HandleWindowsMessage( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) { #ifdef __AUI_USE_DIRECTX__ AUI_ERRCODE errcode = AUI_ERRCODE_UNHANDLED; if ( hwnd == m_hwnd ) switch( message ) { case WM_PAINT: PAINTSTRUCT ps; BeginPaint( hwnd, &ps ); Invalidate( &ps.rcPaint ); EndPaint( hwnd, &ps ); errcode = AUI_ERRCODE_HANDLED; break; case WM_SETCURSOR: if ( m_mouse && !m_mouse->IsSuspended() ) { while ( ShowCursor( FALSE ) >= 0 ) ; } else { while ( ShowCursor( TRUE ) < 0 ) ; } errcode = AUI_ERRCODE_HANDLED; break; case WM_SYSKEYUP: if ( !IsIconic( m_hwnd ) ) switch ( (int)wParam ) { case VK_TAB: case VK_ESCAPE: AltTabOut(); errcode = AUI_ERRCODE_HANDLED; break; case VK_MENU: errcode = AUI_ERRCODE_HANDLED; break; } break; case WM_ACTIVATE: if ( LOWORD(wParam) == WA_INACTIVE ) { if (g_exclusiveMode) { if ( !IsChildWin( (HWND)lParam ) ) if ( !IsIconic( m_hwnd ) ) { AltTabOut(); errcode = AUI_ERRCODE_HANDLED; } } else { if ( !IsChildWin( (HWND)lParam ) ) { AltTabOut(); errcode = AUI_ERRCODE_HANDLED; } } } else { if (g_exclusiveMode) { if (IsIconic( m_hwnd ) ) { AltTabIn(); errcode = AUI_ERRCODE_HANDLED; } } else { AltTabIn(); errcode = AUI_ERRCODE_HANDLED; } } break; case WM_SYSCOMMAND: { if (LOWORD(wParam) == SC_SCREENSAVE) { if (g_exclusiveMode) { if ( !IsChildWin( (HWND)lParam ) ) if ( !IsIconic( m_hwnd ) ) { AltTabOut(); errcode = AUI_ERRCODE_HANDLED; } } else { if ( !IsChildWin( (HWND)lParam ) ) { AltTabOut(); errcode = AUI_ERRCODE_HANDLED; } } } } break; case WM_KEYDOWN: #ifdef _DEBUG { static RECT resizer = { 0, 0, 0, 0 }; switch ( (int)wParam ) { case VK_ESCAPE: if ( m_editMode ) g_ui->SetEditRegion( NULL ); break; case VK_F1: if ( GetKeyState( VK_SHIFT ) < 0 ) { if ( m_editMode ) { aui_Region::PurgeUndoList(); SetEditMode( FALSE ); } else { SetEditMode( TRUE ); } } errcode = AUI_ERRCODE_HANDLED; break; case VK_F2: if ( m_editMode ) { m_ldl->GetLdl()->WriteData(); errcode = AUI_ERRCODE_HANDLED; } break; case 'Z': if ( m_editMode ) { if ( GetKeyState( VK_CONTROL ) < 0 ) { aui_Region::UndoEdit( ); errcode = AUI_ERRCODE_HANDLED; } } break; case VK_LEFT: if ( m_editMode ) { if ( GetKeyState( VK_SHIFT ) < 0 ) SetRect( &resizer, -1, 0, 0, 0 ); else if ( GetKeyState( VK_CONTROL ) < 0 ) SetRect( &resizer, 0, 0, -1, 0 ); else SetRect( &resizer, -1, 0, -1, 0 ); aui_Region::EditModeModifyRegion( resizer ); errcode = AUI_ERRCODE_HANDLED; } break; case VK_UP: if ( m_editMode ) { if ( GetKeyState( VK_SHIFT ) < 0 ) SetRect( &resizer, 0, -1, 0, 0 ); else if ( GetKeyState( VK_CONTROL ) < 0 ) SetRect( &resizer, 0, 0, 0, -1 ); else SetRect( &resizer, 0, -1, 0, -1 ); aui_Region::EditModeModifyRegion( resizer ); errcode = AUI_ERRCODE_HANDLED; } break; case VK_RIGHT: if ( m_editMode ) { if ( GetKeyState( VK_SHIFT ) < 0 ) SetRect( &resizer, 0, 0, 1, 0 ); else if ( GetKeyState( VK_CONTROL ) < 0 ) SetRect( &resizer, 1, 0, 0, 0 ); else SetRect( &resizer, 1, 0, 1, 0 ); aui_Region::EditModeModifyRegion( resizer ); errcode = AUI_ERRCODE_HANDLED; } break; case VK_DOWN: if ( m_editMode ) { if ( GetKeyState( VK_SHIFT ) < 0 ) SetRect( &resizer, 0, 0, 0, 1 ); else if ( GetKeyState( VK_CONTROL ) < 0 ) SetRect( &resizer, 0, 1, 0, 0 ); else SetRect( &resizer, 0, 1, 0, 1 ); aui_Region::EditModeModifyRegion( resizer ); errcode = AUI_ERRCODE_HANDLED; } break; } } #endif // _DEBUG break; } return errcode; #else return AUI_ERRCODE_UNHANDLED; #endif// __AUI_USE_DIRECTX__ }
void DataCaptureGridCtrl::ResetDataCaptureGrid() { // start with a clean slate dataCapture.DataCaptureCleanup(); // set type strings captureTypeStrings.Alloc(5); // always valid captureTypeStrings += "Pressure"; captureTypeStrings += "Flow"; captureTypeStrings += "Production"; if (!control.IsGas()) captureTypeStrings += "Test Zone"; if (control.IsUnconfined()) captureTypeStrings += "Water Table"; pressureCapTypeStrings.Alloc(3); pressureCapTypeStrings += "Test Zone"; pressureCapTypeStrings += "Observation Well"; pressureCapTypeStrings += "Superposition"; flowCapTypeStrings.Alloc(4); flowCapTypeStrings += "Well"; flowCapTypeStrings += "Formation"; flowCapTypeStrings += "Test Zone"; flowCapTypeStrings += "Wellbore Storage"; productionCapTypeStrings.Alloc(4); productionCapTypeStrings += "Well"; productionCapTypeStrings += "Formation"; productionCapTypeStrings += "Test Zone"; productionCapTypeStrings += "Wellbore Storage"; testZoneCapTypeStrings.Alloc(3); testZoneCapTypeStrings += "TZ Temp."; testZoneCapTypeStrings += "TZ Comp."; testZoneCapTypeStrings += "TZ Volume"; waterTableCapTypeStrings.Alloc(1); waterTableCapTypeStrings += "Observation Well"; int maxCol = 6; if (control.IsLayered()) { maxCol++; wellboreZoneStrings.Alloc(layerSpec.GetNWellboreZone()); for (int i = 0; i < wellBoreZones.Size(); i++) { const WellBoreZone& currZone = wellBoreZones[i]; if (!currZone.zoneIsPacker) wellboreZoneStrings += currZone.intervalID; } } if (control.Is1DRadial()) maxCol++; // make sure there are 20 blanks dataCaptureData.ReAlloc(dataCaptureData.Size() + 20); SetRowCount(dataCaptureData.AllocSize() + 1); SetColCount(maxCol); SetCenteredText(0, 1, "Well ID" ); SetCenteredText(0, 2, "Output Type" ); SetCenteredText(0, 3, "Sub-Type" ); int nextCol = 4; if (control.IsLayered()) SetCenteredText(0, nextCol++, "Wellbore Zone" ); SetCenteredText(0, nextCol++, "Radius" ); if (control.Is1DRadial()) SetCenteredText(0, nextCol++, "RadiusUnits" ); SetCenteredText(0, nextCol++, "Output Units" ); CString sRowHeader; for (int i = 0; i < dataCaptureData.AllocSize(); i++) { int row = i + 1; sRowHeader.Format("%d", row); SetCenteredText(row, 0, sRowHeader ); SetCell(row, 1, new DcapDesigGridCell(i)); SetCell(row, 2, new CaptureTypeGridCell(i)); SetCell(row, 3, new CaptureSubTypeGridCell(i)); nextCol = 4; if (control.IsLayered()) SetCell(row, nextCol++, new DcapWellboreZoneDesigGridCell(i)); SetCell(row, nextCol++, new DataCaptureRadiusGridCell(i)); if (control.Is1DRadial()) SetCell(row, nextCol++, new RadUnitsGridCell(i)); SetCell(row, nextCol++, new OutputUnitsGridCell(i)); // reset all data for (int j = 1; j < maxCol; j++) ResetCell(i + 1, j); } SetEditMode(); SetBorderThickness(4); AutoSize(); for (int j = 1; j < maxCol; j++) SetColSize(j, GetColSize(j) + 15); InvalidateAll(); }
void levelInit() { arx_assert(entities.player()); LogDebug("Initializing level ..."); ARX_PARTICLES_FirstInit(); g_renderBatcher.reset(); progressBarAdvance(2.f); LoadLevelScreen(); g_particleManager.Clear(); if(GMOD_RESET) ARX_GLOBALMODS_Reset(); GMOD_RESET = true; STARTDRAG = Vec2s(0); DANAEMouse = Vec2s(0); PolyBoomClear(); ARX_DAMAGES_Reset(); ARX_MISSILES_ClearAll(); spells.clearAll(); ARX_SPELLS_ClearAllSymbolDraw(); ARX_PARTICLES_ClearAll(); ParticleSparkClear(); if(LOAD_N_ERASE) { CleanScriptLoadedIO(); RestoreInitialIOStatus(); DRAGINTER = NULL; } ARX_SPELLS_ResetRecognition(); eyeball.exist = 0; resetDynLights(); if(LOAD_N_ERASE) { CleanInventory(); ARX_SCRIPT_Timer_ClearAll(); UnlinkAllLinkedObjects(); ARX_SCRIPT_ResetAll(false); } SecondaryInventory = NULL; TSecondaryInventory = NULL; ARX_FOGS_Render(); if(LOAD_N_ERASE) { if(!DONT_ERASE_PLAYER) ARX_PLAYER_InitPlayer(); g_hudRoot.playerInterfaceFader.resetSlid(); player.lifePool.current = player.lifePool.max; player.manaPool.current = player.manaPool.max; if(!DONT_ERASE_PLAYER) { ARX_PLAYER_MakeFreshHero(); } } InitSnapShot(fs::getUserDir() / "snapshot"); progressBarAdvance(4.f); LoadLevelScreen(); if(player.torch) { player.torch_loop = ARX_SOUND_PlaySFX_loop(g_snd.TORCH_LOOP, NULL, 1.0F); } g_playerCamera.m_pos = g_moveto = player.pos; g_playerCamera.angle = player.angle; RestoreLastLoadedLightning(*ACTIVEBKG); progressBarAdvance(); LoadLevelScreen(); if(LOAD_N_ERASE) { SetEditMode(); ARX_SOUND_MixerStop(ARX_SOUND_MixerGame); ARX_SCRIPT_ResetAll(true); EERIE_ANIMMANAGER_PurgeUnused(); } progressBarAdvance(); LoadLevelScreen(); LOAD_N_ERASE = true; DONT_ERASE_PLAYER = false; progressBarAdvance(); LoadLevelScreen(); PrepareIOTreatZone(1); progressBarAdvance(); LoadLevelScreen(); if(DONT_WANT_PLAYER_INZONE) { player.inzone = NULL; DONT_WANT_PLAYER_INZONE = 0; } progressBarAdvance(); LoadLevelScreen(); player.desiredangle.setPitch(0.f); player.angle.setPitch(0.f); ARX_PLAYER_RectifyPosition(); entities.player()->_npcdata->vvpos = -99999; SendMsgToAllIO(NULL, SM_GAME_READY); PLAYER_MOUSELOOK_ON = false; g_note.clear(); EntityHandle t = entities.getById("seat_stool1_0012"); if(ValidIONum(t)) { entities[t]->ioflags |= IO_FORCEDRAW; } ARX_NPC_RestoreCuts(); ResetVVPos(entities.player()); progressBarAdvance(); LoadLevelScreen(); LoadLevelScreen(-2); if(!CheckInPoly(player.pos) && LastValidPlayerPos.x != 0.f && LastValidPlayerPos.y != 0.f && LastValidPlayerPos.z != 0.f) { player.pos = LastValidPlayerPos; } LastValidPlayerPos = player.pos; g_platformTime.updateFrame(); g_gameTime.resume(GameTime::PauseInitial | GameTime::PauseMenu); }
void TestZoneCurveGridCtrl::ResetTestZoneCurveGrid() { // start with a clean slate sequence.SequenceCleanup(); // set type strings curveTypeStrings.Alloc(6); curveTypeMap.Alloc(6); // always valid curveTypeStrings += "Pressure"; curveTypeMap += TestZoneCurve::tzPressure; curveTypeStrings += "Flow"; curveTypeMap += TestZoneCurve::tzFlowRate; if (testZoneTemperatureVaries && control.IsLiquid()) { curveTypeStrings += "Temperature"; curveTypeMap += TestZoneCurve::tzTemperature; } if (testZoneCompressibilityVaries && control.IsLiquid()) { curveTypeStrings += "Compressibility"; curveTypeMap += TestZoneCurve::tzCompressibility; } if (testZoneVolumeVaries) { curveTypeStrings += "Volume Change"; curveTypeMap += TestZoneCurve::tzDeltaVolume; curveTypeStrings += "Volume"; curveTypeMap += TestZoneCurve::tzAbsVolume; } // curve file desigs if (control.UseCurveFiles()) { nsCurveFileStatics::testZoneBCCurveFile.GetIDs(curveFileDesigStrings); } else { curveFOOK = AppMenuC::GetFuncObjList(typeid(DO_Curve), curveFOStrings, curveFOData, " "); } // and sequences sequence.GetSequenceIDs(sequenceDesigStrings); // make sure there are 20 blanks testZoneCurves.ReAlloc(testZoneCurves.Size() + 20); SetRowCount(testZoneCurves.AllocSize() + 1); SetColCount(6); SetCenteredText(0, 1, "Type" ); if (control.UseCurveFiles()) SetCenteredText(0, 2, "Curve ID" ); else SetCenteredText(0, 2, "Curve Object" ); SetCenteredText(0, 3, "Start Sequence" ); SetCenteredText(0, 4, "End Sequence" ); SetCenteredText(0, 5, "Curve Data" ); CString sRowHeader; for (int i = 0; i < testZoneCurves.AllocSize(); i++) { int row = i + 1; sRowHeader.Format("%d", row); SetCenteredText(row, 0, sRowHeader ); SetCell(row, 1, new CurveTypeGridCell(i)); if (control.UseCurveFiles()) SetCell(row, 2, new CurveDesigGridCell(i)); else SetCell(row, 2, new CurveFOGridCell(i)); SetCell(row, 3, new StartSequenceDesigGridCell(i)); SetCell(row, 4, new EndSequenceDesigGridCell(i)); SetCell(row, 5, new TZDataGridCell(i)); // reset all data for (int j = 1; j < 6; j++) ResetCell(i + 1, j); } SetEditMode(); SetBorderThickness(4); AutoSize(); for (int j = 1; j < 6; j++) SetColSize(j, GetColSize(j) + 15); InvalidateAll(); }