mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-08 21:17:53 +00:00
Editor: Mark remaining undo command strings as translatable
Ensures that we're marking the remnant potential display strings properly.
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
#include "CAddLinkCommand.h"
|
#include "CAddLinkCommand.h"
|
||||||
#include <Core/Resource/Script/CLink.h>
|
#include <Core/Resource/Script/CLink.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CAddLinkCommand::CAddLinkCommand(CWorldEditor *pEditor, CLink Link)
|
CAddLinkCommand::CAddLinkCommand(CWorldEditor *pEditor, CLink Link)
|
||||||
: IUndoCommand("Add Link")
|
: IUndoCommand(QCoreApplication::translate("CAddLinkCommand", "Add Link"))
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
, mLink(Link)
|
, mLink(Link)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#include "CChangeLayerCommand.h"
|
#include "CChangeLayerCommand.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CChangeLayerCommand::CChangeLayerCommand(CWorldEditor *pEditor, const QList<CScriptNode*>& rkNodeList, CScriptLayer *pNewLayer)
|
CChangeLayerCommand::CChangeLayerCommand(CWorldEditor *pEditor, const QList<CScriptNode*>& rkNodeList, CScriptLayer *pNewLayer)
|
||||||
: IUndoCommand("Change Layer")
|
: IUndoCommand(QCoreApplication::translate("CChangeLayerCommand", "Change Layer"))
|
||||||
, mpNewLayer(pNewLayer)
|
, mpNewLayer(pNewLayer)
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
#include <Core/Scene/CSceneNode.h>
|
#include <Core/Scene/CSceneNode.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CClearSelectionCommand : public IUndoCommand
|
class CClearSelectionCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CNodeSelection *mpSelection;
|
CNodeSelection *mpSelection;
|
||||||
@@ -14,7 +16,7 @@ class CClearSelectionCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CClearSelectionCommand(CNodeSelection *pSelection)
|
explicit CClearSelectionCommand(CNodeSelection *pSelection)
|
||||||
: IUndoCommand("Clear Selection"),
|
: IUndoCommand(QCoreApplication::translate("CClearSelectionCommand", "Clear Selection")),
|
||||||
mpSelection(pSelection)
|
mpSelection(pSelection)
|
||||||
{
|
{
|
||||||
for (CSelectionIterator It(pSelection); It; ++It)
|
for (CSelectionIterator It(pSelection); It; ++It)
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#include "CCloneSelectionCommand.h"
|
#include "CCloneSelectionCommand.h"
|
||||||
#include "Editor/CSelectionIterator.h"
|
#include "Editor/CSelectionIterator.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CCloneSelectionCommand::CCloneSelectionCommand(INodeEditor *pEditor)
|
CCloneSelectionCommand::CCloneSelectionCommand(INodeEditor *pEditor)
|
||||||
: IUndoCommand("Clone")
|
: IUndoCommand(QCoreApplication::translate("CCloneSelectionCommand", "Clone"))
|
||||||
, mpEditor(qobject_cast<CWorldEditor*>(pEditor)) // todo: fix this! bad assumption! (clone handling code is in INodeEditor but active area is in CWorldEditor)
|
, mpEditor(qobject_cast<CWorldEditor*>(pEditor)) // todo: fix this! bad assumption! (clone handling code is in INodeEditor but active area is in CWorldEditor)
|
||||||
{
|
{
|
||||||
mOriginalSelection = mpEditor->Selection()->SelectedNodeList();
|
mOriginalSelection = mpEditor->Selection()->SelectedNodeList();
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#include "CCreateInstanceCommand.h"
|
#include "CCreateInstanceCommand.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CCreateInstanceCommand::CCreateInstanceCommand(CWorldEditor *pEditor, CScriptTemplate *pTemplate, CScriptLayer *pLayer, const CVector3f& rkPosition)
|
CCreateInstanceCommand::CCreateInstanceCommand(CWorldEditor *pEditor, CScriptTemplate *pTemplate, CScriptLayer *pLayer, const CVector3f& rkPosition)
|
||||||
: IUndoCommand("Create Instance")
|
: IUndoCommand(QCoreApplication::translate("CCreateInstanceCommand", "Create Instance"))
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
, mpScene(pEditor->Scene())
|
, mpScene(pEditor->Scene())
|
||||||
, mpArea(pEditor->ActiveArea())
|
, mpArea(pEditor->ActiveArea())
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#include "CDeleteLinksCommand.h"
|
#include "CDeleteLinksCommand.h"
|
||||||
#include <Core/Resource/Script/CLink.h>
|
#include <Core/Resource/Script/CLink.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CDeleteLinksCommand::CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QList<uint32>& rkIndices)
|
CDeleteLinksCommand::CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QList<uint32>& rkIndices)
|
||||||
: IUndoCommand("Delete Links")
|
: IUndoCommand(QCoreApplication::translate("CDeleteLinksCommand", "Delete Links"))
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
{
|
{
|
||||||
mAffectedInstances.push_back(pObject);
|
mAffectedInstances.push_back(pObject);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "Editor/WorldEditor/CWorldEditor.h"
|
#include "Editor/WorldEditor/CWorldEditor.h"
|
||||||
#include <Core/Scene/CSceneNode.h>
|
#include <Core/Scene/CSceneNode.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
// todo: currently only supports deleting script nodes; needs support for light nodes as well
|
// todo: currently only supports deleting script nodes; needs support for light nodes as well
|
||||||
// plus maybe it should be extensible enough to support other possible types
|
// plus maybe it should be extensible enough to support other possible types
|
||||||
class CDeleteSelectionCommand : public IUndoCommand
|
class CDeleteSelectionCommand : public IUndoCommand
|
||||||
@@ -47,7 +49,7 @@ class CDeleteSelectionCommand : public IUndoCommand
|
|||||||
QList<SDeletedLink> mDeletedLinks;
|
QList<SDeletedLink> mDeletedLinks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CDeleteSelectionCommand(CWorldEditor *pEditor, const QString& rkCommandName = "Delete");
|
explicit CDeleteSelectionCommand(CWorldEditor *pEditor, const QString& rkCommandName = QCoreApplication::translate("CDeleteSelectionCommand", "Delete"));
|
||||||
void undo() override;
|
void undo() override;
|
||||||
void redo() override;
|
void redo() override;
|
||||||
bool AffectsCleanState() const override { return true; }
|
bool AffectsCleanState() const override { return true; }
|
||||||
|
|||||||
@@ -6,13 +6,15 @@
|
|||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
#include <Core/Scene/CSceneNode.h>
|
#include <Core/Scene/CSceneNode.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CDeselectNodeCommand : public IUndoCommand
|
class CDeselectNodeCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CNodePtr mpNode;
|
CNodePtr mpNode;
|
||||||
CNodeSelection *mpSelection;
|
CNodeSelection *mpSelection;
|
||||||
public:
|
public:
|
||||||
CDeselectNodeCommand(CNodeSelection *pSelection, CSceneNode *pNode)
|
CDeselectNodeCommand(CNodeSelection *pSelection, CSceneNode *pNode)
|
||||||
: IUndoCommand("Deselect")
|
: IUndoCommand(QCoreApplication::translate("CDeselectNodeCommand", "Deselect"))
|
||||||
, mpNode(pNode)
|
, mpNode(pNode)
|
||||||
, mpSelection(pSelection)
|
, mpSelection(pSelection)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define CEDITINTRINSICPROPERTYCOMMAND_H
|
#define CEDITINTRINSICPROPERTYCOMMAND_H
|
||||||
|
|
||||||
#include "IEditPropertyCommand.h"
|
#include "IEditPropertyCommand.h"
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CEditIntrinsicPropertyCommand : public IEditPropertyCommand
|
class CEditIntrinsicPropertyCommand : public IEditPropertyCommand
|
||||||
{
|
{
|
||||||
@@ -13,7 +14,7 @@ public:
|
|||||||
const QList<void*>& kDataPointers,
|
const QList<void*>& kDataPointers,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
QModelIndex Index = QModelIndex(),
|
QModelIndex Index = QModelIndex(),
|
||||||
const QString& kCommandName = "Edit Property")
|
const QString& kCommandName = QCoreApplication::translate("CEditIntrinsicPropertyCommand", "Edit Property"))
|
||||||
: IEditPropertyCommand(pProperty, pModel, Index, kCommandName)
|
: IEditPropertyCommand(pProperty, pModel, Index, kCommandName)
|
||||||
, mDataPointers(kDataPointers)
|
, mDataPointers(kDataPointers)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#include "CEditLinkCommand.h"
|
#include "CEditLinkCommand.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CEditLinkCommand::CEditLinkCommand(CWorldEditor *pEditor, CLink *pLink, CLink NewLink)
|
CEditLinkCommand::CEditLinkCommand(CWorldEditor *pEditor, CLink *pLink, CLink NewLink)
|
||||||
: IUndoCommand("Edit Link")
|
: IUndoCommand(QCoreApplication::translate("CEditLinkCommand", "Edit Link"))
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
, mpEditLink(pLink)
|
, mpEditLink(pLink)
|
||||||
, mOldLink(*pLink)
|
, mOldLink(*pLink)
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include "ObjReferences.h"
|
#include "ObjReferences.h"
|
||||||
#include "Editor/WorldEditor/CWorldEditor.h"
|
#include "Editor/WorldEditor/CWorldEditor.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CEditScriptPropertyCommand : public IEditPropertyCommand
|
class CEditScriptPropertyCommand : public IEditPropertyCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -16,7 +18,7 @@ public:
|
|||||||
const QList<CScriptObject*>& kInstances,
|
const QList<CScriptObject*>& kInstances,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
QModelIndex Index = QModelIndex(),
|
QModelIndex Index = QModelIndex(),
|
||||||
const QString& kCommandName = "Edit Property")
|
const QString& kCommandName = QCoreApplication::translate("CEditScriptPropertyCommand", "Edit Property"))
|
||||||
: IEditPropertyCommand(pProperty, pModel, Index, kCommandName)
|
: IEditPropertyCommand(pProperty, pModel, Index, kCommandName)
|
||||||
, mIndex(Index)
|
, mIndex(Index)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
#include <Core/Scene/CSceneNode.h>
|
#include <Core/Scene/CSceneNode.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CInvertSelectionCommand : public IUndoCommand
|
class CInvertSelectionCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CNodeSelection *mpSelection;
|
CNodeSelection *mpSelection;
|
||||||
@@ -14,7 +16,7 @@ class CInvertSelectionCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CInvertSelectionCommand(CNodeSelection *pSelection, CScene *pScene, FNodeFlags NodeFlags)
|
CInvertSelectionCommand(CNodeSelection *pSelection, CScene *pScene, FNodeFlags NodeFlags)
|
||||||
: IUndoCommand("Invert Selection")
|
: IUndoCommand(QCoreApplication::translate("CInvertSelectionCommand", "Invert Selection"))
|
||||||
, mpSelection(pSelection)
|
, mpSelection(pSelection)
|
||||||
{
|
{
|
||||||
for (CSceneIterator It(pScene, NodeFlags); It; ++It)
|
for (CSceneIterator It(pScene, NodeFlags); It; ++It)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include <Core/GameProject/CResourceStore.h>
|
#include <Core/GameProject/CResourceStore.h>
|
||||||
#include <Core/GameProject/CVirtualDirectory.h>
|
#include <Core/GameProject/CVirtualDirectory.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CMoveDirectoryCommand : public IUndoCommand
|
class CMoveDirectoryCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CResourceStore *mpStore;
|
CResourceStore *mpStore;
|
||||||
@@ -16,7 +18,7 @@ class CMoveDirectoryCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CMoveDirectoryCommand(CResourceStore *pStore, CVirtualDirectory *pDir, CVirtualDirectory *pNewParent)
|
CMoveDirectoryCommand(CResourceStore *pStore, CVirtualDirectory *pDir, CVirtualDirectory *pNewParent)
|
||||||
: IUndoCommand("Move Directory")
|
: IUndoCommand(QCoreApplication::translate("CMoveDirectoryCommand", "Move Directory"))
|
||||||
, mpStore(pStore)
|
, mpStore(pStore)
|
||||||
, mTargetDir(pDir->FullPath())
|
, mTargetDir(pDir->FullPath())
|
||||||
, mOldParent(pDir->Parent()->FullPath())
|
, mOldParent(pDir->Parent()->FullPath())
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||||
#include <Core/GameProject/CResourceEntry.h>
|
#include <Core/GameProject/CResourceEntry.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CMoveResourceCommand : public IUndoCommand
|
class CMoveResourceCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CResourceEntry *mpEntry;
|
CResourceEntry *mpEntry;
|
||||||
@@ -15,7 +17,7 @@ class CMoveResourceCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CMoveResourceCommand(CResourceEntry *pEntry, CVirtualDirectory *pNewDir)
|
CMoveResourceCommand(CResourceEntry *pEntry, CVirtualDirectory *pNewDir)
|
||||||
: IUndoCommand("Move Resource")
|
: IUndoCommand(QCoreApplication::translate("CMoveResourceCommand", "Move Resource"))
|
||||||
, mpEntry(pEntry)
|
, mpEntry(pEntry)
|
||||||
, mOldDirPath(pEntry->DirectoryPath())
|
, mOldDirPath(pEntry->DirectoryPath())
|
||||||
, mNewDirPath(pNewDir->FullPath())
|
, mNewDirPath(pNewDir->FullPath())
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#include "CPasteNodesCommand.h"
|
#include "CPasteNodesCommand.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CPasteNodesCommand::CPasteNodesCommand(CWorldEditor *pEditor, CScriptLayer *pLayer, CVector3f PastePoint)
|
CPasteNodesCommand::CPasteNodesCommand(CWorldEditor *pEditor, CScriptLayer *pLayer, CVector3f PastePoint)
|
||||||
: IUndoCommand("Paste")
|
: IUndoCommand(QCoreApplication::translate("CPasteNodesCommand", "Paste"))
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
, mpLayer(pLayer)
|
, mpLayer(pLayer)
|
||||||
, mPastePoint(PastePoint)
|
, mPastePoint(PastePoint)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||||
#include <Core/GameProject/CVirtualDirectory.h>
|
#include <Core/GameProject/CVirtualDirectory.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CRenameDirectoryCommand : public IUndoCommand
|
class CRenameDirectoryCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CVirtualDirectory *mpDir;
|
CVirtualDirectory *mpDir;
|
||||||
@@ -14,7 +16,7 @@ class CRenameDirectoryCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CRenameDirectoryCommand(CVirtualDirectory *pDir, const TString& rkNewName)
|
CRenameDirectoryCommand(CVirtualDirectory *pDir, const TString& rkNewName)
|
||||||
: IUndoCommand("Rename Directory")
|
: IUndoCommand(QCoreApplication::translate("CRenameDirectoryCommand", "Rename Directory"))
|
||||||
, mpDir(pDir)
|
, mpDir(pDir)
|
||||||
, mOldName(pDir->Name())
|
, mOldName(pDir->Name())
|
||||||
, mNewName(rkNewName)
|
, mNewName(rkNewName)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||||
#include <Core/GameProject/CResourceEntry.h>
|
#include <Core/GameProject/CResourceEntry.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CRenameResourceCommand : public IUndoCommand
|
class CRenameResourceCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CResourceEntry *mpEntry;
|
CResourceEntry *mpEntry;
|
||||||
@@ -15,7 +17,7 @@ class CRenameResourceCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CRenameResourceCommand(CResourceEntry *pEntry, const TString& rkNewName)
|
CRenameResourceCommand(CResourceEntry *pEntry, const TString& rkNewName)
|
||||||
: IUndoCommand("Rename Resource")
|
: IUndoCommand(QCoreApplication::translate("CRenameResourceCommand", "Rename Resource"))
|
||||||
, mpEntry(pEntry)
|
, mpEntry(pEntry)
|
||||||
, mOldName(pEntry->Name())
|
, mOldName(pEntry->Name())
|
||||||
, mNewName(rkNewName)
|
, mNewName(rkNewName)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define CRESIZESCRIPTARRAYCOMMAND_H
|
#define CRESIZESCRIPTARRAYCOMMAND_H
|
||||||
|
|
||||||
#include "CEditScriptPropertyCommand.h"
|
#include "CEditScriptPropertyCommand.h"
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CResizeScriptArrayCommand : public CEditScriptPropertyCommand
|
class CResizeScriptArrayCommand : public CEditScriptPropertyCommand
|
||||||
{
|
{
|
||||||
@@ -14,7 +15,7 @@ public:
|
|||||||
const QList<CScriptObject*>& rkInstances,
|
const QList<CScriptObject*>& rkInstances,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
QModelIndex Index = QModelIndex(),
|
QModelIndex Index = QModelIndex(),
|
||||||
const QString& rkCommandName = "Resize Array"
|
const QString& rkCommandName = QCoreApplication::translate("CResizeScriptArrayCommand", "Resize Array")
|
||||||
)
|
)
|
||||||
: CEditScriptPropertyCommand(pProperty, rkInstances, pModel, Index, rkCommandName)
|
: CEditScriptPropertyCommand(pProperty, rkInstances, pModel, Index, rkCommandName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
#include "EUndoCommand.h"
|
#include "EUndoCommand.h"
|
||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CRotateNodeCommand::CRotateNodeCommand()
|
CRotateNodeCommand::CRotateNodeCommand()
|
||||||
: IUndoCommand("Rotate")
|
: IUndoCommand(QCoreApplication::translate("CRotateNodeCommand", "Rotate"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +18,7 @@ CRotateNodeCommand::CRotateNodeCommand(
|
|||||||
const CQuaternion& rkDelta,
|
const CQuaternion& rkDelta,
|
||||||
ETransformSpace TransformSpace
|
ETransformSpace TransformSpace
|
||||||
)
|
)
|
||||||
: IUndoCommand("Rotate"),
|
: IUndoCommand(QCoreApplication::translate("CRotateNodeCommand", "Rotate")),
|
||||||
mpEditor(pEditor)
|
mpEditor(pEditor)
|
||||||
{
|
{
|
||||||
mNodeList.reserve(rkNodes.size());
|
mNodeList.reserve(rkNodes.size());
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include "IUndoCommand.h"
|
#include "IUndoCommand.h"
|
||||||
#include <Core/GameProject/CResourceStore.h>
|
#include <Core/GameProject/CResourceStore.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
/** Command that calls ConditionalSaveStore on a resource store.
|
/** Command that calls ConditionalSaveStore on a resource store.
|
||||||
* This is meant to be added to undo macros that modify the resource store
|
* This is meant to be added to undo macros that modify the resource store
|
||||||
* in order to trigger the store to resave when the macro is complete.
|
* in order to trigger the store to resave when the macro is complete.
|
||||||
@@ -14,7 +16,7 @@ class CSaveStoreCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CSaveStoreCommand(CResourceStore* pInStore)
|
explicit CSaveStoreCommand(CResourceStore* pInStore)
|
||||||
: IUndoCommand("Save Store")
|
: IUndoCommand(QCoreApplication::translate("CSaveStoreCommand", "Save Store"))
|
||||||
, mpStore(pInStore)
|
, mpStore(pInStore)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
#include "EUndoCommand.h"
|
#include "EUndoCommand.h"
|
||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CScaleNodeCommand::CScaleNodeCommand()
|
CScaleNodeCommand::CScaleNodeCommand()
|
||||||
: IUndoCommand("Scale")
|
: IUndoCommand(QCoreApplication::translate("CScaleNodeCommand", "Scale"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta)
|
CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta)
|
||||||
: IUndoCommand("Scale"),
|
: IUndoCommand(QCoreApplication::translate("CScaleNodeCommand", "Scale")),
|
||||||
mpEditor(pEditor)
|
mpEditor(pEditor)
|
||||||
{
|
{
|
||||||
mNodeList.reserve(rkNodes.size());
|
mNodeList.reserve(rkNodes.size());
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
#include <Core/Scene/CSceneNode.h>
|
#include <Core/Scene/CSceneNode.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CSelectAllCommand : public IUndoCommand
|
class CSelectAllCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CNodePtrList mOldSelection;
|
CNodePtrList mOldSelection;
|
||||||
@@ -15,7 +17,7 @@ class CSelectAllCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CSelectAllCommand(CNodeSelection *pSelection, CScene *pScene, FNodeFlags NodeFlags)
|
CSelectAllCommand(CNodeSelection *pSelection, CScene *pScene, FNodeFlags NodeFlags)
|
||||||
: IUndoCommand("Select All")
|
: IUndoCommand(QCoreApplication::translate("CSelectAllCommand", "Select All"))
|
||||||
, mpSelection(pSelection)
|
, mpSelection(pSelection)
|
||||||
{
|
{
|
||||||
for (CSelectionIterator It(pSelection); It; ++It)
|
for (CSelectionIterator It(pSelection); It; ++It)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
#include <Core/Scene/CSceneNode.h>
|
#include <Core/Scene/CSceneNode.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class CSelectNodeCommand : public IUndoCommand
|
class CSelectNodeCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
CNodePtr mpNode;
|
CNodePtr mpNode;
|
||||||
@@ -13,7 +15,7 @@ class CSelectNodeCommand : public IUndoCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CSelectNodeCommand(CNodeSelection *pSelection, CSceneNode *pNode)
|
CSelectNodeCommand(CNodeSelection *pSelection, CSceneNode *pNode)
|
||||||
: IUndoCommand("Select")
|
: IUndoCommand(QCoreApplication::translate("CSelectNodeCommand", "Select"))
|
||||||
, mpNode(pNode)
|
, mpNode(pNode)
|
||||||
, mpSelection(pSelection)
|
, mpSelection(pSelection)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
#include "EUndoCommand.h"
|
#include "EUndoCommand.h"
|
||||||
#include "Editor/INodeEditor.h"
|
#include "Editor/INodeEditor.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
CTranslateNodeCommand::CTranslateNodeCommand()
|
CTranslateNodeCommand::CTranslateNodeCommand()
|
||||||
: IUndoCommand("Translate")
|
: IUndoCommand(QCoreApplication::translate("CTranslateNodeCommand", "Translate"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CTranslateNodeCommand::CTranslateNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, const CVector3f& Delta, ETransformSpace TransformSpace)
|
CTranslateNodeCommand::CTranslateNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, const CVector3f& Delta, ETransformSpace TransformSpace)
|
||||||
: IUndoCommand("Translate"),
|
: IUndoCommand(QCoreApplication::translate("CTranslateNodeCommand", "Translate")),
|
||||||
mpEditor(pEditor)
|
mpEditor(pEditor)
|
||||||
{
|
{
|
||||||
mNodeList.reserve(rkNodes.size());
|
mNodeList.reserve(rkNodes.size());
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include <Core/GameProject/CResourceStore.h>
|
#include <Core/GameProject/CResourceStore.h>
|
||||||
#include <Core/GameProject/CVirtualDirectory.h>
|
#include <Core/GameProject/CVirtualDirectory.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class ICreateDeleteDirectoryCommand : public IUndoCommand
|
class ICreateDeleteDirectoryCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -64,7 +66,7 @@ class CCreateDirectoryCommand : public ICreateDeleteDirectoryCommand
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCreateDirectoryCommand(CResourceStore *pStore, TString ParentPath, TString DirName)
|
CCreateDirectoryCommand(CResourceStore *pStore, TString ParentPath, TString DirName)
|
||||||
: ICreateDeleteDirectoryCommand("Create Directory", pStore, ParentPath, DirName)
|
: ICreateDeleteDirectoryCommand(QCoreApplication::translate("CCreateDirectoryCommand", "Create Directory"), pStore, ParentPath, DirName)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void undo() override { DoDelete(); }
|
void undo() override { DoDelete(); }
|
||||||
@@ -75,7 +77,7 @@ class CDeleteDirectoryCommand : public ICreateDeleteDirectoryCommand
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CDeleteDirectoryCommand(CResourceStore *pStore, TString ParentPath, TString DirName)
|
CDeleteDirectoryCommand(CResourceStore *pStore, TString ParentPath, TString DirName)
|
||||||
: ICreateDeleteDirectoryCommand("Delete Directory", pStore, ParentPath, DirName)
|
: ICreateDeleteDirectoryCommand(QCoreApplication::translate("CDeleteDirectoryCommand", "Delete Directory"), pStore, ParentPath, DirName)
|
||||||
{
|
{
|
||||||
mpDir = pStore->GetVirtualDirectory(ParentPath + DirName, false);
|
mpDir = pStore->GetVirtualDirectory(ParentPath + DirName, false);
|
||||||
ASSERT(mpDir);
|
ASSERT(mpDir);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include <Core/GameProject/CResourceEntry.h>
|
#include <Core/GameProject/CResourceEntry.h>
|
||||||
#include <Core/GameProject/CResourceStore.h>
|
#include <Core/GameProject/CResourceStore.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class ICreateDeleteResourceCommand : public IUndoCommand
|
class ICreateDeleteResourceCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -49,7 +51,7 @@ class CCreateResourceCommand : public ICreateDeleteResourceCommand
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit CCreateResourceCommand(CResourceEntry* pEntry)
|
explicit CCreateResourceCommand(CResourceEntry* pEntry)
|
||||||
: ICreateDeleteResourceCommand("Create Resource", pEntry)
|
: ICreateDeleteResourceCommand(QCoreApplication::translate("CCreateResourceCommand", "Create Resource"), pEntry)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void undo() override { DoDelete(); }
|
void undo() override { DoDelete(); }
|
||||||
@@ -60,7 +62,7 @@ class CDeleteResourceCommand : public ICreateDeleteResourceCommand
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit CDeleteResourceCommand(CResourceEntry* pEntry)
|
explicit CDeleteResourceCommand(CResourceEntry* pEntry)
|
||||||
: ICreateDeleteResourceCommand("Delete Resource", pEntry)
|
: ICreateDeleteResourceCommand(QCoreApplication::translate("CDeleteResourceCommand", "Delete Resource"), pEntry)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void undo() override { DoCreate(); }
|
void undo() override { DoCreate(); }
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include "EUndoCommand.h"
|
#include "EUndoCommand.h"
|
||||||
#include "Editor/PropertyEdit/CPropertyModel.h"
|
#include "Editor/PropertyEdit/CPropertyModel.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
class IEditPropertyCommand : public IUndoCommand
|
class IEditPropertyCommand : public IUndoCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -30,7 +32,7 @@ public:
|
|||||||
IProperty* pProperty,
|
IProperty* pProperty,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
const QModelIndex& kIndex,
|
const QModelIndex& kIndex,
|
||||||
const QString& kCommandName = "Edit Property"
|
const QString& kCommandName = QCoreApplication::translate("IEditPropertyCommand", "Edit Property")
|
||||||
);
|
);
|
||||||
|
|
||||||
~IEditPropertyCommand() override = default;
|
~IEditPropertyCommand() override = default;
|
||||||
|
|||||||
Reference in New Issue
Block a user