void FEditorModeTools::SaveConfig(void) { GConfig->SetBool(TEXT("FEditorModeTools"), TEXT("ShowWidget"), bShowWidget, GEditorPerProjectIni); const bool bGetRawValue = true; GConfig->SetInt(TEXT("FEditorModeTools"), TEXT("CoordSystem"), (int32)GetCoordSystem(bGetRawValue), GEditorPerProjectIni); SaveWidgetSettings(); }
/** * Saves the current state to the INI file */ void FEditorModeTools::SaveConfig(void) { GConfig->SetBool(TEXT("FEditorModeTools"),TEXT("ShowWidget"),bShowWidget, GEditorUserSettingsIni); const bool bGetRawValue = true; GConfig->SetInt(TEXT("FEditorModeTools"),TEXT("CoordSystem"),(int32)GetCoordSystem(bGetRawValue), GEditorUserSettingsIni); GConfig->SetBool( TEXT("UnEdViewport"), TEXT("InterpEdPanInvert"), bInterpPanInverted, GEditorUserSettingsIni ); SaveWidgetSettings(); }
void FEditorModeTools::LoadConfig(void) { GConfig->GetBool(TEXT("FEditorModeTools"),TEXT("ShowWidget"),bShowWidget, GEditorPerProjectIni); const bool bGetRawValue = true; int32 Bogus = (int32)GetCoordSystem(bGetRawValue); GConfig->GetInt(TEXT("FEditorModeTools"),TEXT("CoordSystem"),Bogus, GEditorPerProjectIni); SetCoordSystem((ECoordSystem)Bogus); LoadWidgetSettings(); }
/** * Loads the state that was saved in the INI file */ void FEditorModeTools::LoadConfig(void) { GConfig->GetBool(TEXT("FEditorModeTools"),TEXT("ShowWidget"),bShowWidget, GEditorUserSettingsIni); const bool bGetRawValue = true; int32 Bogus = (int32)GetCoordSystem(bGetRawValue); GConfig->GetInt(TEXT("FEditorModeTools"),TEXT("CoordSystem"),Bogus, GEditorUserSettingsIni); SetCoordSystem((ECoordSystem)Bogus); GConfig->GetBool( TEXT("UnEdViewport"), TEXT("InterpEdPanInvert"), bInterpPanInverted, GEditorUserSettingsIni ); LoadWidgetSettings(); }
FMatrix FEditorModeTools::GetCustomDrawingCoordinateSystem() { FMatrix Matrix = FMatrix::Identity; switch (GetCoordSystem()) { case COORD_Local: { // Let the current mode have a shot at setting the local coordinate system. // If it doesn't want to, create it by looking at the currently selected actors list. bool CustomCoordinateSystemProvided = false; for (const auto& Mode : Modes) { if (Mode->GetCustomDrawingCoordinateSystem(Matrix, nullptr)) { CustomCoordinateSystemProvided = true; break; } } if (!CustomCoordinateSystemProvided) { const int32 Num = GetSelectedActors()->CountSelections<AActor>(); // Coordinate system needs to come from the last actor selected if (Num > 0) { Matrix = FRotationMatrix(GetSelectedActors()->GetBottom<AActor>()->GetActorRotation()); } } if (!Matrix.Equals(FMatrix::Identity)) { Matrix.RemoveScaling(); } } break; case COORD_World: break; default: break; } return Matrix; }