Editors::cEditor class

Main class for editors.

A single instance of this class exists during the whole game, and is used for all editors (except the Adventure editor, that one uses App::cScenarioMode); you can access it with the Editor macro.

Base classes

class App::IGameMode
An interface that represents a mode in the game, that can receive mouse/keyboard input and update every frame.
class Graphics::ILayer
This interfaces defines a layer that is rendered every game loop, by callings its ILayer::DrawLayer() method.
class UI::IHintConditioner
class INameableEntity
class App::IMessageListener
An interface that can receive messages sent through the app.
class DefaultRefCounted
The default implementation of a reference counted class.

Public functions

auto HandleMessage(uint32_t messageID, void* msg) -> bool override
Called every time a message is received.
auto Initialize(App::IGameModeManager* pManager) -> bool override
This method is called once on every game mode when all modes have been added.
auto Dispose() -> bool override
This method is called once on every game mode when the game closes.
auto OnEnter() -> bool override
This method is called when the game mode is set as active, and therefore, entered.
auto OnExit() -> void override
This method is called when a different game mode is set as active, and therefore, this game mode is exited (no longer active).
auto OnKeyDown(int virtualKey, KeyModifiers modifiers) -> bool override
An event listener called every time a key is pressed while this mode is active.
auto OnKeyUp(int virtualKey, KeyModifiers modifiers) -> bool override
An event listener called every time a key is released while this mode is active.
auto OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool override
An event listener called every time a mouse key is pressed while this mode is active.
auto OnMouseUp(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool override
An event listener called every time a mouse key is released while this mode is active.
auto OnMouseMove(float mouseX, float mouseY, MouseState mouseState) -> bool override
An event listener called every time the mouse is moved while this mode is active.
auto OnMouseWheel(int wheelDelta, float mouseX, float mouseY, MouseState mouseState) -> bool override
An event listener called every time the mouse wheel is moved while this mode is active.
auto Update(float delta1, float delta2) -> void override
An event listener called every game loop.
auto SetEditorModel(EditorModel* pEditorModel) -> void
Changes the current editor model, updating the creation with the parts and paints of the new editor model.
auto GetEditorModel() const -> EditorModel*
Get current editor model, which is the creation with the parts and paints.
auto CommitEditHistory(bool arg1, EditorStateEditHistory* pStateHistory = nullptr) -> void
Adds an edit history (undo/redo) entry based on the current model of the editor.
auto Undo(bool, bool) -> void
auto Redo() -> void
auto IsMode(Mode mode) const -> bool
Returns true if the editor is currently in the given mode.
auto SetActiveMode(Mode mode, bool) -> void
auto IsActive() const -> bool
Returns true if the editor is currently active.
auto GetCamera() -> EditorCamera*
Returns the camera used to navigate and view the editor.
auto GetSkin() -> cEditorSkin*
Returns the editor skin, which is the model and texture generating system for creations that use skinpaints and metaballs (i.e.
auto GetAnimWorld() -> cEditorAnimWorld*
Returns the class that manages the creature animations in the editor.
auto sub_581F70(EditorRigblock* part, void* activeHandle, int value) -> bool
auto RemovePart(EditorRigblock* part) -> void
auto SetCreatureToNeutralPose() -> void
Emits a cEditorAnimEvent with ID 0x6581B78E, which makes the creature (if any) stop its current animation and return to the neutral, motionless pose.
auto AddCreature(int, const ResourceKey* key = nullptr) -> bool
auto PostEventToActors(uint32_t eventID, int = -1, float = 1.0f, float = 0.0f) -> void

Public variables

int vftable_1C
IGameModeManagerPtr mpGameModeMgr
The App::IGameModeManager that holds this editor.
PropertyListPtr mpPropList
The App::PropertyList that contains the configuration of the current editor.
Math::Point mMousePosition
The current position of the cursor in the editor.
int mMouseFlags
MouseState mMouseState
bool field_38
int field_3C
int field_40
int field_44
int field_48
int field_4C
int field_50
int field_54
int field_58
int field_5C
int field_60
int field_64
float field_68
float mCreatureIdleActivationTime
Time to wait before starting animated creature (in milliseconds).
float field_70
bool field_74
EditorUI* mpEditorUI
EditorPlayMode* mpPlayMode
ILightingWorldPtr mpLightingWorld
THe light to be used by the editor.
IModelWorldPtr mpMainModelWorld
The model world that contains the pedestal and test environment model, and also editor rigblocks.
IModelWorldPtr field_88
IModelWorldPtr mpBackgroundModelWorld
The model world that contains the background model.
int field_90
IEffectsWorldPtr mpEffectWorld
EditorModel* mpEditorModel
int field_9C
ModelPtr mpPedestalModel
The model to be used for the pedestal in the editor. It belongs to mpPedestalModelWorld.
ModelPtr mpTestEnvironmentModel
The model to be used for the test environment in the editor. It belongs mpPedestalModelWorld.
ModelPtr mpBackgroundModel
The model to be used for the background in the editor. It belongs to mpBackgroundModelWorld.
ModelPtr mpAccBackgroundModel
A background model used in accessories editors. It belongs to mpBackgroundModelWorld.
eastl::string16 field_B0
int field_C0
int field_C4
int field_C8
EditorRigblockPtr mpActivePart
Rigblock that is being hovered, and where actions like mouse wheel scaling will be applied.
EditorRigblockPtr mpMovingPart
EditorRigblockPtr mpSelectedPart
EditorRigblockPtr field_D8
EditorRigblockPtr field_DC
bool field_E0
EditorBaseHandle* mpActiveHandle
bool mbMouseIsInSkin
Is the mouse over the skin of the creature?
bool field_E9
int field_EC
int field_F0
int field_F4
char _padding_F8
bool field_140
bool field_141
bool field_142
bool field_143
bool field_144
ObjectPtr field_148
int field_14C
cEditorSkinPtr mpEditorSkin
cEditorSkinPtr field_154
int field_158
just guesses, apparently it calls DefaultRefCounted.Unuse()
int field_15C
eastl::vector<eastl::intrusive_ptr<EditorStateEditHistory>> mStateEditHistory
eastl::vector<cEditorResourcePtr> mEditHistory
int mEditHistoryIndex
uint32_t mEditorName
The ID of the .prop configuration file of the current editor.
bool mbTransitionHideUI
bool mbTransitionCenterCamera
uint32_t mTransitionAnimationID
int field_198
uint32_t mTransitionEffectID
int field_1A0
int field_1A4
int field_1A8
int field_1AC
eastl::map<uint32_t, uint32_t> mDefaultEditors
Maps a creation format extension to its default editor. For example, 'crt' is mapped to 'CreatureEditorExtraLarge'.
EditorRequestPtr mEditorRequest
ResourceKey mParentAssetKey
eastl::string16 field_1DC
int field_1EC
int field_1F0
int field_1F4
uint32_t mCameraThumbnailID
Thumbnail camera, when editor asset is saved, this is the camera used to generate the thumbnail.
uint32_t mCameraPaletteID
Palette camera, this is the camera that will be used to take thumbnails and display 3d swatches in the editor.
ResourceKey mCurrencyIconName
Key to png icon for editor currency.
char16_t mCurrencyChar
Unicode character for editor currency.
bool field_20D
bool mbBackgroundMusic
Whether a background music is played or not.
uint32_t mBackgroundMusicPatchID
The key to the sound patch to play for the background music.
uint32_t mTutorialPartModeID
Instance ID for part mode tutorial.
uint32_t mTutorialPlayModeID
Instance ID for play mode tutorial.
uint32_t mTutorialPaintModeID
Instance ID for paint mode tutorial.
int field_220
int field_224
int field_228
int field_22C
int field_230
int field_234
int field_238
int field_23C
int field_240
int field_244
int field_248
int field_24C
int field_250
int field_254
int field_258
int field_25C
int field_260
int field_264
int field_268
int field_26C
int field_270
int field_274
uint32_t mPlayModeEntryEffectID
uint32_t mPlayModeExitEffectID
uint32_t mSkyBoxEffectID
The ID for the sky box effect.
int field_284
float field_288
TexturePtr mpThumbnailTexture
int field_290
IShadowWorldPtr mpShadowWorld
Graphics::ShadowMapInfo* mpShadowMapInfo
int field_29C
int field_2A0
int field_2A4
uint32_t mSaveExtension
The save extension key which will be parsed both into a key and a three letter extension.
uint32_t mSaveDirectory
The save directory key, Resource::SaveAreaID.
bool mIsActive
char field_2B1
bool mbShowVertebrae
char field_2B3
char field_2B4
bool mbDisableCreatureAnimIK
float mBoundSize
The width of the space that the model skin is constrained to.
float mFeetBoundSize
The width of the space that the feet are constrained to.
float mMinHeight
The base of the cylinder.
float mfMaxHeight
The height of te cylinder.
float mMinPlayableWidth
Minimum width a model has to be to be playable.
float mMinPlayableDepth
Minimum depth a model has to be to be playable.
float mMinPlayableHeight
Minimum height a model has to be to be playable.
float mMinimumLeglessCreatureHeight
The minimum height a legless creature is allowed to be on load.
uint32_t mViewableComplexityFlags
Which complexity limits to show in meter, possible values in the ComplexityFlags enum.
int mComplexityLimit
Maximum complexity of blocks allowed in this editor.
int mBoneComplexityLimit
Maximum bone complexity of blocks allowed in this editor.
int mMaxBakedBlocks
Maximum number of baked blocks allowed in this editor.
int field_2E8
float mMaxGeomScore
Maximum geometric score (from vertices/indices) allowed in this editor.
bool mbCellPinningToRigBlocks
bool mbUseSkin
bool mbUseSpine
bool mbInitSpine
bool field_2F4
bool mbAllowAsymmetry
bool mbOnlyEditFromPalette
bool mbMoveModelToGround
bool mbMoveModelToCenterOfMass
bool mbUseBoundsForDelete
Has the editor use the bounds as a deletion option.
bool editorTranslateModelOnSave
uint32_t mSporepediaConfigID
The ID for the sporepedia config to launch from the editor.
uint32_t mSporepediaCanSwitchConfigID
The ID for the sporepedia config to launch from the editor when you can switch editors.
uint32_t mModelTranslationOptions
Translation flags.
int field_308
int field_30C
bool mbPreserveLineage
Whether to save the parent key to newly saved assets.
float field_314
uint32_t field_318
Mode mMode
eastl::vector<uint32_t> mEnabledManipulators
eastl::vector<uint32_t> mModelTypes
The list of model types that this editor supports, ie. VehicleMilitaryAir, VehicleEconomicLand, BuildingIndustry, BuildingHouse, etc.
int field_348
int mnDefaultBrainLevel
int field_350
int field_354
EditorNamePanelPtr mpEditorNamePanel
int field_35C
cEditorAnimWorldPtr mpEditorAnimWorld
int mCurrentCreatureID
ID used in mpEditorAnimWorld for the current editing creature.
int field_368
eastl::vector<int> mOtherActorsIDs
cEditorAnimEventPtr mpAnimEvent
Anim event that will be played on the creature on the next Update() call.
bool field_384
bool field_385
int field_388
int field_38C
int field_390
bool field_394
bool field_395
bool field_396
bool field_397
bool field_398
bool field_399
bool field_39A
eastl::vector<EditorRigblockPtr> field_39C
int mHoveredPaintRegion
int field_3B4
PaletteMainPtr mpPartsPalette
PaletteUIPtr mpPartsPaletteUI
PaletteMainPtr mpPaintPalette
PaletteUIPtr mpPaintPaletteUI
bool field_3C8
bool field_3C9
App::cViewer* field_3CC
App::cViewer* field_3D0
App::cViewer* field_3D4
App::cViewer* field_3D8
App::cViewer* field_3DC
bool mIsRecordingGIF
bool field_3E1
int field_3E4
int field_3E8
int field_3EC
int field_3F0
int field_3F4
int field_3F8
int field_3FC
int field_400
int field_404
int field_408
int field_40C
int field_410
int field_414
int field_418
int field_41C
int field_420
int field_424
int field_428
int field_42C
bool field_430
StdEditorLimitsPtr mpEditorLimits
int field_438
int field_43C
int field_440
int field_444
int field_448
int field_44C
int field_450
eastl::map<int, int> field_454
bool field_470
bool mbShowBoneLengthHandles
Tells the editor whether or not to show the bone length handle.
bool field_472
float field_474
float mfMouseWheelTimeout
The amount of idle time it takes for a mouse wheel operation to register finished.
float mfMouseWheelDistanceThreshold
The distance the mouse has to travel for a mouse wheel operation to register finished.
float field_480
float field_484
float mAnimationInterruptDistance
The distance the mouse has to travel to interrupt a reactive animation.
int field_48C
int field_490
int field_494
int field_498
int field_49C
int field_4A0
int field_4A4
int field_4A8
int mRenderingQuality
bool field_4B0
bool field_4B1
bool field_4B2
bool field_4B3
bool field_4B4
bool field_4B5
bool field_4B6
bool mbModelForceSaveOver
bool mbModelCopyConsequence
bool mbModelSaveLastChild
int field_4BC
int field_4C0
int field_4C4
bool field_4C8
bool field_4C9
int field_4CC
float field_4D0
int field_4D4
int field_4D8
int field_4DC
int field_4E0
int field_4E4
eastl::vector<int> field_508
eastl::vector<int> field_51C
eastl::vector<int> field_530
eastl::vector<int> field_544
eastl::vector<int> field_558
eastl::vector<int> field_56C
int field_580
int field_584
eastl::vector<int> field_588
uint32_t mDaisType
Used by audio system to play different footsteps based on type of material used in the dais construction.
float mfDaisRadius
Used by audio system to determine if foot is on dais or floor.
int field_5A4
Clock field_5A8
int field_5C0
int field_5C4
int field_5C8
int field_5CC
int field_5D0
int field_5D4
int field_5D8
int field_5DC
int field_5E0
int field_5E4
int field_5E8
int field_5EC
int field_5F0
int field_5F4
int field_5F8
int field_5FC

Function documentation

bool Editors::cEditor::HandleMessage(uint32_t messageID, void* msg) override

Called every time a message is received.

Parameters
messageID The ID of the message received.
msg The data of the message received, it might be nullptr.
Returns Whether the message was handled or not.

Only the messages with an ID this listener signed up for will call this event.

bool Editors::cEditor::Initialize(App::IGameModeManager* pManager) override

This method is called once on every game mode when all modes have been added.

Parameters
pManager The GameModeManager that has called this method.

This should take care of all initializations and setups that are required.

bool Editors::cEditor::Dispose() override

This method is called once on every game mode when the game closes.

This should reverse everything the Initialize method did.

bool Editors::cEditor::OnKeyDown(int virtualKey, KeyModifiers modifiers) override

An event listener called every time a key is pressed while this mode is active.

Parameters
virtualKey The VK code of the key.
modifiers The modifiers (Ctrl, Alt and Shift) currently being pressed. They use the enum values UTFWin::kModifier....
Returns Whether the event was handled or not.

bool Editors::cEditor::OnKeyUp(int virtualKey, KeyModifiers modifiers) override

An event listener called every time a key is released while this mode is active.

Parameters
virtualKey The VK code of the key.
modifiers The modifiers (Ctrl, Alt and Shift) currently being pressed. They use the enum values UTFWin::kModifier....
Returns Whether the event was handled or not.

bool Editors::cEditor::OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) override

An event listener called every time a mouse key is pressed while this mode is active.

Parameters
mouseButton The button that was pressed.
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

bool Editors::cEditor::OnMouseUp(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) override

An event listener called every time a mouse key is released while this mode is active.

Parameters
mouseButton The button that was released.
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

bool Editors::cEditor::OnMouseMove(float mouseX, float mouseY, MouseState mouseState) override

An event listener called every time the mouse is moved while this mode is active.

Parameters
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

bool Editors::cEditor::OnMouseWheel(int wheelDelta, float mouseX, float mouseY, MouseState mouseState) override

An event listener called every time the mouse wheel is moved while this mode is active.

Parameters
wheelDelta The amount of units the wheel moved. This is a multiple of UTFWin::kMouseWheelDelta.
mouseX The X position of the mouse.
mouseY The Y position of the mouse.
mouseState The state of the mouse.
Returns Whether the event was handled or not.

void Editors::cEditor::Update(float delta1, float delta2) override

An event listener called every game loop.

Parameters
delta1 The amount of seconds elapsed since this the last update.
delta2 Usually the same as delta1.

void Editors::cEditor::SetEditorModel(EditorModel* pEditorModel)

Changes the current editor model, updating the creation with the parts and paints of the new editor model.

Parameters
pEditorModel

void Editors::cEditor::CommitEditHistory(bool arg1, EditorStateEditHistory* pStateHistory = nullptr)

Adds an edit history (undo/redo) entry based on the current model of the editor.

Parameters
arg1
pStateHistory

bool Editors::cEditor::IsMode(Mode mode) const

Returns true if the editor is currently in the given mode.

Parameters
mode Either build, paint or play mode.

cEditorSkin* Editors::cEditor::GetSkin()

Returns the editor skin, which is the model and texture generating system for creations that use skinpaints and metaballs (i.e.

creatures and flora). For the rest of creation types, this returns nullptr.

Variable documentation

int Editors::cEditor::field_158

just guesses, apparently it calls DefaultRefCounted.Unuse()