private void toolBar_main_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) { if (e.Button==toolBarButton_Save) { // turn this temporarily off (these properties aren't target specific!) // enabled again when changing target LightmapManager.bNoBaseLight = false; LightmapManager.bNoRadiosity = false; // when saving, apply the respective color matrix LightmapManager.ApplyColorMatrices(_lightmapsParameter.BaseLightingParams.ColorMatrix, _lightmapsParameter.RadiosityParams.ColorMatrix); LightmapManager.SaveAllLightmaps(); LightmapManager.ApplyColorMatrices(_lightgridParameter.BaseLightingParams.ColorMatrix, _lightgridParameter.RadiosityParams.ColorMatrix); LightmapManager.SaveLightGrid(); toolBarButton_Save.Enabled = _bCanSave = false; // force update GUI etc. TweakTarget oldTarget = Target; _tweakTarget = TweakTarget.None; Target = oldTarget; } if (e.Button==toolBarButton_Reset) ResetLightingParams(); if (e.Button==toolBarButton_Undo) _actions.Undo(); if (e.Button==toolBarButton_Redo) _actions.Redo(); if (e.Button==toolBarButton_DirectLighting) { BaseLightingEnabled = toolBarButton_DirectLighting.Pushed && _currentTargetParameter.bBaseLightingAvailable; UpdateToolbarStates(); } if (e.Button==toolBarButton_Radiosity) { RadiosityEnabled = toolBarButton_Radiosity.Pushed && _currentTargetParameter.bRadiosityAvailable; UpdateToolbarStates(); } }
void LightingChanged(bool bForceUpdate) { if (Active) { LightmapsEnabled = LightmapManager.GetSceneLightmapInfo(bForceUpdate); LightGridEnabled = LightmapManager.GetSceneLightGridInfo(bForceUpdate); } //reset some params NewBaseParams.Reset(); NewRadiosityParams.Reset(); _actions.Reset(); _bCanSave = true; // force update GUI etc. _tweakTarget = TweakTarget.None; Target = TweakTarget.Lightmaps; }