Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Configs/Editor/ActionLists/Context/Shared.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ SCR_EditorActionList {
Name "#ODIN-Editor_ContextAction_DeleteAllDead_Name"
Icon "{80103D897CF607F4}UI/Textures/Editor/ContextMenu/ContextAction_DeleteDead.edds"
}
m_iOrder -50
m_iOrder -200
m_bEnableShortcutLogics 0
m_bIsServer 1
}
ODIN_TeleportPlayerContextAction "{598975002C63F146}" {
m_Info SCR_UIInfo "{598975001C1C0802}" {
Name "TP Player"
Description "TP Player"
Icon "{F0E0F66182733D39}UI/Textures/Editor/ContextMenu/ContextAction_Teleport_Player.edds"
}
m_iOrder -20
m_bEnableShortcutLogics 0
m_bIsServer 1
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[BaseContainerProps(), SCR_BaseContainerCustomTitleUIInfo("m_Info")]
class ODIN_TeleportPlayerContextAction : SCR_SelectedEntitiesContextAction
{
override bool CanBeShown(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
{
return CanBePerformed(selectedEntity, cursorWorldPosition, flags);
}
override bool CanBePerformed(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
{
if (selectedEntity == null || selectedEntity.GetEntityType() != EEditableEntityType.CHARACTER)
return false;
return true;
}

override void Perform(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition)
{
// TODO do the code that add drawhandler and use the mouse to select destination position for TP


// teleporting part .....

//--- Apply transformation
vector transform[4];
selectedEntity.GetTransform(transform);
transform[3] = cursorWorldPosition;

selectedEntity.SetTransform(transform);

}
};