Minor fixes/adjustments

This commit is contained in:
Aruki 2017-02-21 00:09:03 -07:00
parent d350e983d9
commit ac2430e61c
4 changed files with 13 additions and 9 deletions

View File

@ -17,7 +17,7 @@ CCamera::CCamera()
, mProjectionDirty(true)
, mFrustumPlanesDirty(true)
{
SetOrbit(CVector3f(0), 5.f);
ResetOrbit();
}
// todo: make it actually look at the target!

View File

@ -87,6 +87,8 @@ public:
inline void SetLookSpeed(float LookSpeed) { mLookSpeed = LookSpeed; }
inline void SetAspectRatio(float AspectRatio) { mAspectRatio = AspectRatio; mProjectionDirty = true; mFrustumPlanesDirty = true; }
inline void ResetOrbit() { SetOrbit(CVector3f::skZero, 5.f); }
// Private
private:
void ValidatePitch();

View File

@ -83,8 +83,8 @@ CWorldEditor::CWorldEditor(QWidget *parent)
AddEditModeButton( QIcon(":/icons/World.png"), "Edit World Info",eWEM_EditWorldInfo );
AddEditModeButton( QIcon(":/icons/Modify.png"), "Edit Script", eWEM_EditScript );
mpPoiMapButton = AddEditModeButton( QIcon(":/icons/PoiSymbol_24px.png"), "Edit POI Mappings", eWEM_EditPOIMappings );
mpPoiMapButton->setEnabled(false);
mpPoiMapAction = AddEditModeButton( QIcon(":/icons/PoiSymbol_24px.png"), "Edit POI Mappings", eWEM_EditPOIMappings );
mpPoiMapAction->setVisible(false);
ChangeEditMode(eWEM_EditWorldInfo);
@ -546,7 +546,7 @@ void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj)
{
ui->ActionProjectSettings->setEnabled( pProj != nullptr );
ui->ActionCloseProject->setEnabled( pProj != nullptr );
mpPoiMapButton->setEnabled( pProj != nullptr && pProj->Game() >= eEchoesDemo && pProj->Game() <= eCorruption );
mpPoiMapAction->setVisible( pProj != nullptr && pProj->Game() >= eEchoesDemo && pProj->Game() <= eCorruption );
ResetCamera();
UpdateWindowTitle();
@ -925,7 +925,7 @@ void CWorldEditor::UpdateNewLinkLine()
}
// ************ PROTECTED ************
QPushButton* CWorldEditor::AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode)
QAction* CWorldEditor::AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode)
{
ASSERT(mpEditModeButtonGroup->button(Mode) == nullptr);
@ -934,9 +934,9 @@ QPushButton* CWorldEditor::AddEditModeButton(QIcon Icon, QString ToolTip, EWorld
pButton->setToolTip(ToolTip);
pButton->setIconSize(QSize(24, 24));
ui->EditModeToolBar->addWidget(pButton);
QAction *pAction = ui->EditModeToolBar->addWidget(pButton);
mpEditModeButtonGroup->addButton(pButton, Mode);
return pButton;
return pAction;
}
void CWorldEditor::SetSidebar(CWorldEditorSidebar *pSidebar)
@ -1172,6 +1172,8 @@ void CWorldEditor::UpdateCameraOrbit()
pCamera->SetOrbit(mpSelection->Bounds());
else if (mpArea)
pCamera->SetOrbit(mpArea->AABox(), 1.2f);
else
pCamera->ResetOrbit();
}
void CWorldEditor::OnCameraSpeedChange(double Speed)

View File

@ -73,7 +73,7 @@ class CWorldEditor : public INodeEditor
CScriptEditSidebar *mpScriptSidebar;
CPoiMapSidebar *mpPoiMapSidebar;
QPushButton *mpPoiMapButton;
QAction *mpPoiMapAction;
public:
explicit CWorldEditor(QWidget *parent = 0);
@ -134,7 +134,7 @@ public slots:
void UpdateNewLinkLine();
protected:
QPushButton* AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode);
QAction* AddEditModeButton(QIcon Icon, QString ToolTip, EWorldEditorMode Mode);
void SetSidebar(CWorldEditorSidebar *pSidebar);
void GizmoModeChanged(CGizmo::EGizmoMode Mode);