ezParticleAction::ezParticleAction(const ezActionContext& context, const char* szName, ezParticleAction::ActionType type, float fSimSpeed) : ezButtonAction(context, szName, false, "") { m_Type = type; m_fSimSpeed = fSimSpeed; m_pEffectDocument = const_cast<ezParticleEffectAssetDocument*>(static_cast<const ezParticleEffectAssetDocument*>(context.m_pDocument)); m_pEffectDocument->m_Events.AddEventHandler(ezMakeDelegate(&ezParticleAction::EffectEventHandler, this)); switch (m_Type) { case ActionType::PauseEffect: SetIconPath(":/EditorPluginParticle/Icons/Pause16.png"); break; case ActionType::RestartEffect: SetIconPath(":/EditorPluginParticle/Icons/Restart16.png"); break; case ActionType::AutoRestart: SetIconPath(":/EditorPluginParticle/Icons/Loop16.png"); break; case ActionType::RenderVisualizers: SetCheckable(true); SetIconPath(":/EditorFramework/Icons/Visualizers16.png"); SetChecked(m_pEffectDocument->GetRenderVisualizers()); break; } UpdateState(); }
ezGameObjectSelectionAction::ezGameObjectSelectionAction(const ezActionContext& context, const char* szName, ezGameObjectSelectionAction::ActionType type) : ezButtonAction(context, szName, false, "") { m_Type = type; // TODO const cast m_pSceneDocument = const_cast<ezGameObjectDocument*>(static_cast<const ezGameObjectDocument*>(context.m_pDocument)); switch (m_Type) { case ActionType::ShowInScenegraph: SetIconPath(":/EditorFramework/Icons/Scenegraph16.png"); break; case ActionType::FocusOnSelection: SetIconPath(":/EditorFramework/Icons/FocusOnSelection16.png"); break; case ActionType::FocusOnSelectionAllViews: SetIconPath(":/EditorFramework/Icons/FocusOnSelectionAllViews16.png"); break; case ActionType::SnapCameraToObject: // SetIconPath(":/EditorFramework/Icons/Duplicate16.png"); // TODO Icon break; case ActionType::MoveCameraHere: // SetIconPath(":/EditorFramework/Icons/Duplicate16.png"); // TODO Icon break; case ActionType::CreateGameObjectHere: SetIconPath(":/EditorFramework/Icons/CreateEmpty16.png"); break; } UpdateEnableState(); m_Context.m_pDocument->GetSelectionManager()->m_Events.AddEventHandler( ezMakeDelegate(&ezGameObjectSelectionAction::SelectionEventHandler, this)); }
ezAssetAction::ezAssetAction(const ezActionContext& context, const char* szName, ButtonType button) : ezButtonAction(context, szName, false, "") { m_ButtonType = button; switch (m_ButtonType) { case ezAssetAction::ButtonType::TransformAsset: SetIconPath(":/EditorFramework/Icons/TransformAssets16.png"); break; case ezAssetAction::ButtonType::TransformAllAssets: SetIconPath(":/EditorFramework/Icons/TransformAllAssets16.png"); break; case ezAssetAction::ButtonType::ResaveAllAssets: SetIconPath(":/EditorFramework/Icons/ResavAllAssets16.png"); break; case ezAssetAction::ButtonType::CheckFileSystem: SetIconPath(":/EditorFramework/Icons/CheckFileSystem16.png"); break; case ezAssetAction::ButtonType::WriteLookupTable: SetIconPath(":/EditorFramework/Icons/WriteLookupTable16.png"); break; } }