|
|
|
|
|
PlaceObj('XTemplate', { |
|
SortKey = 200, |
|
group = "Shortcuts", |
|
id = "DebugShortcuts", |
|
save_in = "Libs/Debug", |
|
PlaceObj('XTemplateGroup', { |
|
'__condition', function (parent, context) return true end, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionTranslate', false, |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateForEach', { |
|
'comment', "Preset editors", |
|
'array', function (parent, context) return ClassDescendantsList("Preset") end, |
|
'condition', function (parent, context, item, i) local class = g_Classes[item] local PresetClass = class and class.PresetClass or item return class and class.GedEditor and class.GedEditor ~= "" and class.EditorMenubarName and (PresetClass == item or g_Classes[PresetClass].GedEditor ~= class.GedEditor) end, |
|
'run_after', function (child, context, item, i, n, last) |
|
local class = g_Classes[item] |
|
child.ActionId = "PresetEditor" .. item |
|
child.ActionName = class.EditorMenubarName ~= "" and class.EditorMenubarName or item |
|
child:SetActionShortcuts(class.EditorShortcut, child.ActionShortcut2, child.ActionGamepad) |
|
child.ActionIcon = class.EditorIcon |
|
child:SetActionMenubar(class.EditorMenubar) |
|
child:SetActionSortKey(class.EditorMenubarSortKey) |
|
child.OnAction = function() |
|
OpenPresetEditor(item) |
|
end |
|
end, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionTranslate', false, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Calls Preset:OpenEditor() of the current map thus selecting it in the editor", |
|
'ActionId', "MapDataPresetEditorOpen", |
|
'ActionTranslate', false, |
|
'ActionName', "Edit Map Data", |
|
'ActionIcon', "CommonAssets/UI/Icons/earth global globe internet world", |
|
'ActionMenubar', "Map", |
|
'OnAction', function (self, host, source, ...) |
|
(CurrentMap ~= "" and mapdata or MapDataPreset):OpenEditor() |
|
end, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Debug", |
|
'ActionTranslate', false, |
|
'ActionName', "Debug", |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "(Ctrl-Alt-0)", |
|
'ActionId', "DE_TogglePathVisuals", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Path Visuals", |
|
'ActionIcon', "CommonAssets/UI/Icons/collapse", |
|
'ActionShortcut', "Ctrl-Alt-0", |
|
'ActionShortcut2', "Ctrl-Alt-Numpad 0", |
|
'OnAction', function (self, host, source, ...) DbgTogglePaths() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "DE_ToggleFlightMap", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Flight Map", |
|
'ActionIcon', "CommonAssets/UI/Icons/collapse", |
|
'OnAction', function (self, host, source, ...) DbgFlightToggleFlightMap() end, |
|
'__condition', function (parent, context) return const.FlightTile and Platform.developer end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Console Log", |
|
'RolloverText', "Toggle Console Log", |
|
'ActionId', "DE_ConsoleLogToggle", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Console Log", |
|
'ActionIcon', "CommonAssets/UI/Icons/clipboard document paper report sheet.png", |
|
'OnAction', function (self, host, source, ...) ConsoleSetEnabled(not ConsoleEnabled) end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Inspect a live XWindow, its children, properties, focus, mouse target, etc. (Alt-X)", |
|
'RolloverText', "Inspect a live XWindow, its children, properties, focus, mouse target, etc. (Alt-X)", |
|
'ActionId', "DE_XWindowInspector", |
|
'ActionTranslate', false, |
|
'ActionName', "XWindow Inspector", |
|
'ActionIcon', "CommonAssets/UI/Icons/information mark question.png", |
|
'ActionShortcut', "Alt-X", |
|
'OnAction', function (self, host, source, ...) |
|
OpenXWindowInspector({EditorShortcut = self.ActionShortcut}) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Open the XTemplate the current window was spawned for in the XTemplate Editor", |
|
'RolloverText', "Open the XTemplate the current window was spawned for in the XTemplate Editor.", |
|
'ActionId', "DE_XTemplateEdit", |
|
'ActionTranslate', false, |
|
'ActionName', "Edit in XTemplate Editor", |
|
'ActionShortcut', "Ctrl-Alt-X", |
|
'OnAction', function (self, host, source, ...) |
|
CreateRealTimeThread(function() |
|
local target = terminal.desktop:GetMouseTarget(terminal.GetMousePos()) |
|
local initial_target = target |
|
local template_id |
|
while target do |
|
template_id = rawget(target, "__dbg_template_template") or rawget(target, "__dbg_template") |
|
if template_id then break end |
|
target = target.parent |
|
end |
|
if not template_id then |
|
XFlashWindow(initial_target) |
|
CreateMessageBox(nil, Untranslated("Error"), Untranslated("Could not find the XTemplate this window was spawned from.")) |
|
return |
|
end |
|
|
|
local gedTarget = GetParentOfKind(target, "GedApp") |
|
if gedTarget then |
|
context.dark_mode = gedTarget.dark_mode |
|
end |
|
XTemplates[template_id]:OpenEditor() |
|
XFlashWindow(target) |
|
end) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'RolloverText', "Inspect the XWindow currently under the mouse.", |
|
'ActionId', "DE_InspectXWindowUnderMouse", |
|
'ActionTranslate', false, |
|
'ActionName', "Inspect XWindow Under Mouse", |
|
'ActionIcon', "CommonAssets/UI/Icons/information mark question.png", |
|
'ActionShortcut', "Alt-F8", |
|
'OnAction', function (self, host, source, ...) |
|
local pt = terminal.desktop.last_mouse_pos |
|
local target = terminal.desktop:GetMouseTarget(pt) or terminal.desktop |
|
if target then |
|
Inspect(target) |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Examine the object under cursor (F8)", |
|
'ActionId', "DE_ExamineObject", |
|
'ActionTranslate', false, |
|
'ActionName', "Examine the object under cursor", |
|
'ActionShortcut', "F8", |
|
'OnAction', function (self, host, source, ...) |
|
local solid, transparent = GetPreciseCursorObj() |
|
local o = transparent or solid or GetTerrainCursorObj() |
|
if IsValid(o) then |
|
Inspect(o) |
|
else |
|
print("There is no valid object under the cursor") |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Map", |
|
'ActionTranslate', false, |
|
'ActionName', "Map", |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Change Map (F5)", |
|
'RolloverText', "Change Map (F5)", |
|
'ActionId', "DE_ChangeMap", |
|
'ActionTranslate', false, |
|
'ActionName', "Change Map", |
|
'ActionIcon', "CommonAssets/UI/Icons/chart map paper sheet travel.png", |
|
'ActionShortcut', "F5", |
|
'OnAction', function (self, host, source, ...) |
|
XEditorChooseAndChangeMap() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Reload Map (Ctrl-F5)", |
|
'RolloverText', "Reload Map (Ctrl-F5)", |
|
'ActionId', "DE_ReloadMap", |
|
'ActionTranslate', false, |
|
'ActionName', "Reload Map", |
|
'ActionIcon', "CommonAssets/UI/Icons/loop refresh restart.png", |
|
'ActionShortcut', "Ctrl-F5", |
|
'OnAction', function (self, host, source, ...) |
|
if mapdata and mapdata.GameLogic then |
|
CloseMenuDialogs() |
|
end |
|
CreateRealTimeThread(DevReloadMap) |
|
end, |
|
'__condition', function (parent, context) return not editor.IsModdingEditor() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Go to empty Map (Ctrl-Shift-F5)", |
|
'RolloverText', "Go to empty Map (Ctrl-Shift-F5)", |
|
'ActionId', "DE_LoadEmptyMap", |
|
'ActionTranslate', false, |
|
'ActionName', "Load Empty Map", |
|
'ActionIcon', "CommonAssets/UI/Icons/document note paper.png", |
|
'ActionShortcut', "Ctrl-Shift-F5", |
|
'OnAction', function (self, host, source, ...) |
|
CreateRealTimeThread( function() |
|
CloseMenuDialogs() |
|
ChangeMap("__Empty") |
|
StoreLastLoadedMap() |
|
XShortcutsSetMode("Game") |
|
end ) |
|
end, |
|
'__condition', function (parent, context) return MapData.__Empty and not editor.IsModdingEditor() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionTranslate', false, |
|
'ActionName', "-----", |
|
'ActionIcon', "CommonAssets/UI/Icons/cancel close cross delete remove trash.png", |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Map.Generate", |
|
'ActionTranslate', false, |
|
'ActionName', "Generate ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "ValidateAllPrefabMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Validate All Prefab Maps (thorough)", |
|
'ActionIcon', "CommonAssets/UI/Icons/disk guardar save.png", |
|
'OnAction', function (self, host, source, ...) |
|
CreateRealTimeThread(WaitValidateAllMaps, { validate_properties = true }, IsPrefabMap) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "ResaveAllPrefabs", |
|
'ActionTranslate', false, |
|
'ActionName', "Resave All Prefabs", |
|
'ActionIcon', "CommonAssets/UI/Icons/disk guardar save.png", |
|
'OnAction', function (self, host, source, ...) ResaveAllPrefabs() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "ResaveAllGameMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Resave All Game Maps", |
|
'ActionIcon', "CommonAssets/UI/Icons/disk guardar save.png", |
|
'OnAction', function (self, host, source, ...) ResaveAllGameMaps() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "G_Regenerate", |
|
'ActionTranslate', false, |
|
'ActionName', "Regenerate Random Maps...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "RegenerateCurrent", |
|
'ActionTranslate', false, |
|
'ActionName', "Regenerate Current Map", |
|
'ActionIcon', "CommonAssets/UI/Icons/factory.png", |
|
'OnAction', function (self, host, source, ...) |
|
RegenerateMap(nil, true) |
|
end, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "RegenerateAll", |
|
'ActionTranslate', false, |
|
'ActionName', "Regenerate All Random Maps", |
|
'ActionIcon', "CommonAssets/UI/Icons/factory.png", |
|
'OnAction', function (self, host, source, ...) |
|
RegenerateRandomMaps() |
|
end, |
|
}), |
|
PlaceObj('XTemplateForEach', { |
|
'array', function (parent, context) return GetRegenerateMapLists() end, |
|
'run_after', function (child, context, item, i, n, last) |
|
child.ActionId = "Regenerate_" .. item |
|
child.ActionName = "Regenerate " .. item |
|
child.OnActionParam = item |
|
end, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionTranslate', false, |
|
'ActionIcon', "CommonAssets/UI/Icons/gear option setting setup.png", |
|
'OnAction', function (self, host, source, ...) |
|
RegenerateMapList(self.OnActionParam) |
|
end, |
|
}), |
|
}), |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "MarkerViewer", |
|
'ActionTranslate', false, |
|
'ActionName', "Marker Viewer", |
|
'ActionIcon', "CommonAssets/UI/Icons/flag marker nation.png", |
|
'OnAction', function (self, host, source, ...) |
|
OpenMarkerViewer() |
|
end, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "RoomEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Room Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/building office.png", |
|
'ActionShortcut', "Ctrl-Shift-R", |
|
'OnAction', function (self, host, source, ...) |
|
OpenGedRoomEditor() |
|
end, |
|
'__condition', function (parent, context) return config.MapEditorRooms end, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Collections Editor (Ctrl-Alt-C)", |
|
'RolloverText', "Collections Editor (Ctrl-Alt-C)", |
|
'ActionId', "E_CollectionsEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Collections Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/cabinet cupboard drawer furniture interior.png", |
|
'ActionShortcut', "Ctrl-Alt-C", |
|
'OnAction', function (self, host, source, ...) OpenCollectionsEditor() end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors", |
|
'ActionTranslate', false, |
|
'ActionName', "Editors", |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors.UI", |
|
'ActionTranslate', false, |
|
'ActionName', "UI ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors.Humans", |
|
'ActionTranslate', false, |
|
'ActionName', "Humans ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors.Lists", |
|
'ActionTranslate', false, |
|
'ActionName', "Lists ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors.Other", |
|
'ActionTranslate', false, |
|
'ActionName', "Other ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors.Art", |
|
'ActionTranslate', false, |
|
'ActionName', "Art & FX ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "BillboardEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Billboard Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/gallery images media photos thumbnail.png", |
|
'OnAction', function (self, host, source, ...) |
|
OpenGedApp("BillboardEditor", BillboardsTree()) |
|
end, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Particle editor", |
|
'ActionId', "E_FX_ParticleEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Particle Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/outline starburst.png", |
|
'ActionShortcut', "Ctrl-Alt-P", |
|
'OnAction', function (self, host, source, ...) |
|
local sel = editor and editor.GetSel() |
|
if sel and #sel > 0 then |
|
for key, value in ipairs(sel) do |
|
if IsKindOf(value, "ParSystem") then |
|
local par_name = value:GetParticlesName() |
|
local par_sys = ParticleSystemPresets[par_name] |
|
if par_sys then |
|
par_sys:OpenEditor(true) |
|
return |
|
end |
|
end |
|
end |
|
end |
|
|
|
OpenPresetEditor("ParticleSystemPreset") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "E_FX_AnimMetadataEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Anim Metadata Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/video.tga", |
|
'OnAction', function (self, host, source, ...) |
|
OpenAnimationMomentsEditor() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "E_FX_SkinDecalEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Skin Decal Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/video.tga", |
|
'OnAction', function (self, host, source, ...) |
|
OpenSkinDecalEditor() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Editors.Audio", |
|
'ActionTranslate', false, |
|
'ActionName', "Audio ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Sound Debug", |
|
'RolloverText', "Toggle Sound Debug", |
|
'ActionId', "E_SoundToggleDebug", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Sound Debug", |
|
'ActionIcon', "CommonAssets/UI/Icons/volume.png", |
|
'ActionShortcut', "Ctrl-\\", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleSoundDebug() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Listener Update", |
|
'RolloverText', "Toggle Listener Update", |
|
'ActionId', "E_ToggleListenerUpdate", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Listener Update", |
|
'ActionIcon', "CommonAssets/UI/Icons/volume.png", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleListenerUpdate() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "ModEditor", |
|
'ActionTranslate', false, |
|
'ActionName', "Mod Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/outline puzzle", |
|
'OnAction', function (self, host, source, ...) |
|
ModEditorOpen() |
|
end, |
|
'__condition', function (parent, context) return config.Mods end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Scripting", |
|
'ActionTranslate', false, |
|
'ActionName', "Scripting", |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "StoryBitsLog", |
|
'ActionTranslate', false, |
|
'ActionName', "Story Bits Log", |
|
'ActionIcon', "CommonAssets/UI/Icons/clipboard.png", |
|
'OnAction', function (self, host, source, ...) |
|
if g_StoryBitsLog then |
|
OpenGedApp("StoryBitLog", g_StoryBitsLog) |
|
else |
|
print("Story Bits log is unavailable.") |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render", |
|
'ActionTranslate', false, |
|
'ActionName', "Render", |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'__condition', function (parent, context) return const.DebugRender end, |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Framerate Boost (Alt-+ or Alt-Numpad +)", |
|
'ActionId', "DbgToggleFramerateBoost", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Framerate Boost", |
|
'ActionShortcut', "Alt-+", |
|
'ActionShortcut2', "Alt-Numpad +", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleFramerateBoost() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Shift-I)", |
|
'RolloverText', " (Ctrl-Shift-I)", |
|
'ActionId', "G_ChangeFPSIndicator", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Change FPS Indicator mode", |
|
'ActionIcon', "CommonAssets/UI/Icons/chart graph growth increase profit stock.png", |
|
'ActionShortcut', "Ctrl-Shift-I", |
|
'OnAction', function (self, host, source, ...) |
|
local mode = hr.FpsCounter |
|
mode = mode + 1 |
|
if mode >= 3 then mode = 0 end |
|
if mode == 0 then print("framerate indicator off") |
|
else if mode == 1 then print("show frames-per-second") |
|
else if mode == 2 then print("show (milli)seconds-per-frame") |
|
end end end |
|
hr.FpsCounter = mode |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', 'Cycle "Object Details"', |
|
'RolloverText', "Editor settings", |
|
'ActionId', "E_EditorCycleObjectDetails", |
|
'ActionTranslate', false, |
|
'ActionName', 'Cycle "Object Details"', |
|
'ActionIcon', "CommonAssets/UI/Menu/object_options.tga", |
|
'ActionShortcut', "Ctrl-Alt-/", |
|
'OnAction', function (self, host, source, ...) |
|
local details |
|
if EngineOptions.ObjectDetail == "Very Low" then |
|
details = "Low" |
|
elseif EngineOptions.ObjectDetail == "Low" then |
|
details = "Medium" |
|
elseif EngineOptions.ObjectDetail == "Medium" then |
|
details = "High" |
|
else |
|
details = table.find(OptionsData.Options.ObjectDetail, "value", "Very Low") and "Very Low" or "Low" |
|
end |
|
EngineSetObjectDetail(details, IsEditorActive() and "dont apply filters") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Debug Textures", |
|
'ActionTranslate', false, |
|
'ActionName', "Debug Textures ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Wireframe", |
|
'RolloverText', "Toggle Wireframe (Ctrl-Alt-W)", |
|
'ActionId', "G_Wireframe", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Wireframe", |
|
'ActionIcon', "CommonAssets/UI/Menu/Wireframe.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["Wireframe"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "Wireframe" |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Base Color Maps", |
|
'RolloverText', "Toggle Base Color Maps", |
|
'ActionId', "G_DisableBaseColorMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Base Color Maps", |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableBaseColorMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DisableBaseColorMaps"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DisableBaseColorMaps" |
|
hr.TR_ForceReloadNoTextures = 1 |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle RM Maps", |
|
'RolloverText', "Toggle RM Maps", |
|
'ActionId', "G_DisableRMMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle RM Maps", |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableRMMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DisableRMMaps"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DisableRMMaps" |
|
hr.TR_ForceReloadNoTextures = 1 |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Normal Maps", |
|
'RolloverText', "Toggle Normal Maps", |
|
'ActionId', "G_DisableNormalMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Normal Maps", |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableNormalMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DisableNormalMaps"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DisableNormalMaps" |
|
hr.TR_ForceReloadNoTextures = 1 |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle AO Maps", |
|
'RolloverText', "Toggle AO Maps", |
|
'ActionId', "G_DisableAOMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle AO Maps", |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableAOMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DisableAOMaps"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DisableAOMaps" |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Self-Illumination Maps", |
|
'RolloverText', "Toggle Self-Illumination Maps", |
|
'ActionId', "G_DisableSIMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Self-illumination Maps", |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableSIMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DisableSIMaps"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DisableSIMaps" |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Colorization Maps", |
|
'RolloverText', "Toggle Colorization Maps", |
|
'ActionId', "G_DisableColorizationMaps", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Colorization Maps", |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableBaseColorMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DisableColorizationMaps"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DisableColorizationMaps" |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle the height the terrain uses for blend", |
|
'RolloverText', "Toggle the height the terrain uses for blend", |
|
'ActionId', "G_ToggleTerrainHeight", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Terrain Height", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleTerrainHeight.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["TR_ShowHeight"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "TR_ShowHeight" |
|
hr.TR_ForceReloadNoTextures = 1 |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle color picker for screen render target (Alt-Shift-I)", |
|
'RolloverText', "Toggle color picker for screen render target (Alt-Shift-I)", |
|
'ActionId', "E_Colorpicker", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Color picker", |
|
'ActionIcon', "CommonAssets/UI/Icons/color drop graphic paint picker tool.png", |
|
'ActionShortcut', "Alt-Shift-I", |
|
'OnAction', function (self, host, source, ...) |
|
local state = GetPostProcPredicate("debug_color_pick") |
|
SetPostProcPredicate("debug_color_pick", not state) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'RolloverText', T(709899432615, "Toggle Fsr2 textures debug display"), |
|
'ActionId', "G_TemporalDebug", |
|
'ActionName', T(103678002139, "Toggle Temporal Upscaler debug"), |
|
'ActionIcon', "CommonAssets/UI/Menu/DisableBaseColorMaps.tga", |
|
'ActionShortcut', "Alt-Shift-J", |
|
'OnAction', function (self, host, source, ...) |
|
local modes = { "None", "Motion Vectors", "Reactivity Mask", "Transparency Mask", "Adjust Reactivity" } |
|
hr.TemporalDebug=hr.TemporalDebug+1 |
|
if hr.TemporalDebug > #modes - 1 then |
|
hr.TemporalDebug = 0 |
|
end |
|
print("TemporalDebug mode: ", modes[hr.TemporalDebug+1]) |
|
end, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle stretch factor usage", |
|
'RolloverText', "Toggle stretch factor usage", |
|
'ActionId', "G_ToggleStretchFactorUsage", |
|
'ActionTranslate', false, |
|
'ActionName', "ToggleStretchFactorUsage", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleStretchFactor.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["DbgUseStretchFactor"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "DbgUseStretchFactor" |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggleuv density", |
|
'RolloverText', "Toggle uv density", |
|
'ActionId', "G_ToggleUVDensity", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle UV Density", |
|
'ActionIcon', "CommonAssets/UI/Menu/ForceDiffuseMaps.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.UseCheckerboardAsBaseColor == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "UseCheckerboardAsBaseColor" |
|
hr.DisableBaseColorMaps = hr.UseCheckerboardAsBaseColor |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle SatGammaModifier rendering", |
|
'RolloverText', "Toggle SatGammaModifier rendering", |
|
'ActionId', "G_ToggleSatGamma", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle SatGamma Modifier", |
|
'ActionIcon', "CommonAssets/UI/Menu/toggle_dtm_slots.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.UseSatGammaModifier ~= 0 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
hr.UseSatGammaModifier = 1 - hr.UseSatGammaModifier |
|
RecreateRenderObjects() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Finds duplicated objects", |
|
'RolloverText', "Finds duplicated objects", |
|
'ActionId', "DbgFindOverlappingObjects", |
|
'ActionTranslate', false, |
|
'ActionName', "Find overlapping objects", |
|
'ActionIcon', "CommonAssets/UI/Icons/copy duplicate paste 2.png", |
|
'OnAction', function (self, host, source, ...) ReportOverlappingObjects() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Follow cam for 2nd player", |
|
'RolloverText', "Follow cam for 2nd player", |
|
'ActionId', "DbgFollowCamera", |
|
'ActionTranslate', false, |
|
'ActionName', "Follow cam for 2nd player", |
|
'OnAction', function (self, host, source, ...) StartFollowCam() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Render everything two-sided", |
|
'RolloverText', "Render everything two-sided", |
|
'ActionId', "G_ForceTwoSidedMode", |
|
'ActionTranslate', false, |
|
'ActionName', "Force two-sided mode", |
|
'ActionIcon', "CommonAssets/UI/Menu/ForceTwoSidedMode.tga", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["ForceTwoSidedMode"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR("ForceTwoSidedMode") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Shows/Hides the frustum", |
|
'RolloverText', "Shows/Hides the frustum", |
|
'ActionId', "DbgShowFrustum", |
|
'ActionTranslate', false, |
|
'ActionName', "Frustum", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.ShowFrustum == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "ShowFrustum" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-U)", |
|
'RolloverText', " (Shift-U)", |
|
'ActionId', "G_LockCamera", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Lock Camera", |
|
'ActionIcon', "CommonAssets/UI/Icons/lock login padlock password safe secure.png", |
|
'ActionShortcut', "Shift-U", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return camera.IsLocked(1) |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
if camera.IsLocked(1) then |
|
camera.Unlock(1) |
|
else |
|
camera.Lock(1) |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-I)", |
|
'RolloverText', " (Ctrl-I)", |
|
'ActionId', "G_MoveFPSIndicator", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Move FPS Indicator", |
|
'ActionIcon', "CommonAssets/UI/Icons/drag move.png", |
|
'ActionShortcut', "Ctrl-I", |
|
'OnAction', function (self, host, source, ...) |
|
local pos = hr.FpsCounterPos |
|
pos = pos + 1 |
|
if pos < 4 then |
|
hr.FpsCounterPos = pos |
|
else |
|
hr.FpsCounterPos = 0 |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the object counter", |
|
'RolloverText', "Toggles the object counter", |
|
'ActionId', "DbgObjectCounter", |
|
'ActionTranslate', false, |
|
'ActionName', "Object counter", |
|
'ActionIcon', "CommonAssets/UI/Icons/th.png", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.ObjectCounter == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "ObjectCounter" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Objects, Billboards & Particles", |
|
'ActionTranslate', false, |
|
'ActionName', "Objects, Billboards & Particles ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Shift-O)", |
|
'RolloverText', " (Ctrl-Shift-O)", |
|
'ActionId', "G_SimulateParticles", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Particle Simulation", |
|
'ActionShortcut', "Ctrl-Shift-O", |
|
'OnAction', function (self, host, source, ...) ToggleHR("SimulateParticles") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Shift-P)", |
|
'RolloverText', " (Ctrl-Shift-P)", |
|
'ActionId', "G_RenderParticles", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Particle Rendering", |
|
'ActionShortcut', "Ctrl-Shift-P", |
|
'OnAction', function (self, host, source, ...) ToggleHR("RenderParticles") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-T)", |
|
'RolloverText', " (Shift-T)", |
|
'ActionId', "G_ObjectBillboards", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Billboards", |
|
'ActionShortcut', "Shift-T", |
|
'OnAction', function (self, host, source, ...) ToggleHR("ObjectBillboards") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "G_MapObjects", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Map Objects", |
|
'OnAction', function (self, host, source, ...) ToggleHR("RenderMapObjects") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-O)", |
|
'RolloverText', " (Shift-O)", |
|
'ActionId', "G_Outsiders", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Outsider Objects", |
|
'ActionShortcut', "Shift-O", |
|
'OnAction', function (self, host, source, ...) ToggleHR("RenderOutsiders") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-N)", |
|
'RolloverText', " (Shift-N)", |
|
'ActionId', "G_RenderOBBs", |
|
'ActionTranslate', false, |
|
'ActionName', "Render Oriented Bounding Boxes", |
|
'ActionShortcut', "Shift-N", |
|
'OnAction', function (self, host, source, ...) ToggleHR("RenderOBBs") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-B)", |
|
'RolloverText', " (Shift-B)", |
|
'ActionId', "G_RenderBSpheres", |
|
'ActionTranslate', false, |
|
'ActionName', "Render Bounding Spheres", |
|
'ActionShortcut', "Shift-B", |
|
'OnAction', function (self, host, source, ...) ToggleHR("RenderBSpheres") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-C)", |
|
'RolloverText', " (Ctrl-C)", |
|
'ActionId', "G_ObjectCull", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Object Cull", |
|
'ActionShortcut', "Ctrl-C", |
|
'OnAction', function (self, host, source, ...) ToggleHR("ObjectCull") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Alt-Z)", |
|
'RolloverText', " (Ctrl-Alt-Z)", |
|
'ActionId', "G_ObjectLOD", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Object LOD", |
|
'ActionShortcut', "Ctrl-Alt-Z", |
|
'OnAction', function (self, host, source, ...) |
|
if ToggleHR("VisualizeLOD") then |
|
print("0 red, 1 green, 2 blue, 3 yellow, 4 pink, 5 cyan") |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the building of render queues", |
|
'RolloverText', "Toggles the building of render queues", |
|
'ActionId', "G_TogglePauseRQ", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Pause RQ", |
|
'OnAction', function (self, host, source, ...) ToggleHR("PauseRQ") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle postprocess (Ctrl-0)", |
|
'RolloverText', "Toggle postprocess (Ctrl-0)", |
|
'ActionId', "G_Postprocess", |
|
'ActionTranslate', false, |
|
'ActionName', "Postprocess", |
|
'ActionIcon', "CommonAssets/UI/Menu/toggle_post.tga", |
|
'ActionShortcut', "Ctrl-0", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr["EnablePostprocess"] == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "EnablePostprocess" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Profiler HUD", |
|
'ActionTranslate', false, |
|
'ActionName', "Profiler HUD ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Profiler HUD (Alt-Shift-0)", |
|
'ActionId', "ProfilerHUDEnable", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Profiler", |
|
'ActionShortcut', "Alt-Shift-0", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHR "ProfilerHUD" |
|
ToggleHR "EnableGPUProfiler" |
|
ProfilerHUD_InitColors() |
|
UIL.Invalidate() |
|
end, |
|
'__condition', function (parent, context) return hr.ProfilerHUD end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Live update (Alt-Shift-9)", |
|
'RolloverText', " (Alt-Shift-9)", |
|
'ActionId', "ProfilerHUDRefresh", |
|
'ActionTranslate', false, |
|
'ActionName', "Live update", |
|
'ActionShortcut', "Alt-Shift-9", |
|
'OnAction', function (self, host, source, ...) |
|
if hr.ProfilerHUDRefreshInterval == 0 then |
|
hr.ProfilerHUDRefreshInterval = 1000 |
|
else |
|
hr.ProfilerHUDRefreshInterval = 0 |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Alt-Shift-8)", |
|
'RolloverText', " (Alt-Shift-8)", |
|
'ActionId', "ProfilerHUDForceCapture", |
|
'ActionTranslate', false, |
|
'ActionName', "Force capture", |
|
'ActionShortcut', "Alt-Shift-8", |
|
'OnAction', function (self, host, source, ...) |
|
hr.ProfilerHUDForceCapture = 1 |
|
UIL.Invalidate() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Alt-Shift-7)", |
|
'RolloverText', " (Alt-Shift-7)", |
|
'ActionId', "ProfilerHUDExclusiveTiming", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Exclusive Timing", |
|
'ActionShortcut', "Alt-Shift-7", |
|
'OnAction', function (self, host, source, ...) |
|
hr.ProfilerHUDExclusiveTiming = not hr.ProfilerHUDExclusiveTiming |
|
UIL.Invalidate() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "(Alt-Shift-6)", |
|
'RolloverText', "(Alt-Shift-6)", |
|
'ActionId', "ProfilerHUDSaveCapture", |
|
'ActionTranslate', false, |
|
'ActionName', "Save capture", |
|
'ActionShortcut', "Alt-Shift-6", |
|
'OnAction', function (self, host, source, ...) |
|
hr.ProfilerHUDSaveCapture = 1 |
|
UIL.Invalidate() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "(Alt-Shift-5)", |
|
'RolloverText', "(Alt-Shift-5)", |
|
'ActionId', "ProfilerHUDAutoSaveFrameSpike", |
|
'ActionTranslate', false, |
|
'ActionName', "Auto Save Frame Spike", |
|
'ActionShortcut', "Alt-Shift-5", |
|
'OnAction', function (self, host, source, ...) |
|
if hr.ProfilerHUDAutoSaveCapture == 0 then |
|
hr.ProfilerHUDAutoSaveCapture = 100 |
|
elseif hr.ProfilerHUDAutoSaveCapture == 100 then |
|
hr.ProfilerHUDAutoSaveCapture = 200 |
|
elseif hr.ProfilerHUDAutoSaveCapture == 200 then |
|
hr.ProfilerHUDAutoSaveCapture = 300 |
|
elseif hr.ProfilerHUDAutoSaveCapture == 300 then |
|
hr.ProfilerHUDAutoSaveCapture = 0 |
|
end |
|
UIL.Invalidate() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "G_RelativeZoom", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Relaitve Zoom", |
|
'OnAction', function (self, host, source, ...) hr.CameraRTSRelativeZoomingMode = 1 - hr.CameraRTSRelativeZoomingMode end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Reload", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Reload ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-R)", |
|
'RolloverText', " (Shift-R)", |
|
'ActionId', "G_ReloadShaders", |
|
'ActionTranslate', false, |
|
'ActionName', "Reload Shaders", |
|
'ActionShortcut', "Shift-R", |
|
'OnAction', function (self, host, source, ...) ReloadShaders() end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Render targets", |
|
'ActionTranslate', false, |
|
'ActionName', "Render targets ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Shift-2)", |
|
'RolloverText', " (Ctrl-Shift-2)", |
|
'ActionId', "DbgShowRTEnable", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle RTs", |
|
'ActionShortcut', "Ctrl-Shift-2", |
|
'OnAction', function (self, host, source, ...) ToggleHR "ShowRTEnable" end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Save a screenshot", |
|
'RolloverText', "Save a screenshot", |
|
'ActionId', "G_SaveScreenShot", |
|
'ActionTranslate', false, |
|
'ActionName', "Save Screenshot", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleEnvMap.tga", |
|
'OnAction', function (self, host, source, ...) |
|
local imageName = GenerateScreenshotFilename("") |
|
CreateRealTimeThread(function() |
|
WaitNextFrame(3) |
|
WriteScreenshot(imageName) |
|
os.execute("start " .. lfs.currentdir()) |
|
end) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Capture the GPU with RenderDoc", |
|
'RolloverText', "Make a GPU capture using RenderDoc", |
|
'ActionId', "G_RenderDocCapture", |
|
'ActionTranslate', false, |
|
'ActionName', "RenderDoc Capture", |
|
'ActionIcon', "CommonAssets/UI/Menu/RenderDoc_logo", |
|
'OnAction', function (self, host, source, ...) |
|
hr.CaptureRenderDoc = 1 |
|
print("The RenderDoc capture was saved in AppData/Local/Temp/RenderDoc"); |
|
end, |
|
'__condition', function (parent, context) return hr.CaptureRenderDoc end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Shows/Hides the shadow frustum", |
|
'RolloverText', "Shows/Hides the shadow frustum", |
|
'ActionId', "DbgShadowShowFrustum", |
|
'ActionTranslate', false, |
|
'ActionName', "Shadow frustum", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.ShadowShowFrustum == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "ShadowShowFrustum" end, |
|
'__condition', function (parent, context) return hr.ShadowShowFrustum end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'RolloverText', "Toggles lights shadow statistics", |
|
'ActionId', "Render.Lights", |
|
'ActionTranslate', false, |
|
'ActionName', "Lights...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles lights shadow statistics", |
|
'RolloverText', "Toggles lights shadow statistics", |
|
'ActionId', "DbgLightsShadowStatistics", |
|
'ActionTranslate', false, |
|
'ActionName', "Lights Shadow Stats", |
|
'ActionShortcut', "Alt-Shift-X", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.LightShadowsStatistics ~= 0 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
if hr.LightShadowsStatistics == 0 then |
|
ShowLightShadowsStats(1000) |
|
else |
|
HideLightShadowsStats() |
|
end |
|
end, |
|
'__condition', function (parent, context) return hr.LightShadowsStatistics end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Cycle through Lights Objects", |
|
'RolloverText', "Cycle through Lights Objects", |
|
'ActionId', "CycleLightsPrev", |
|
'ActionTranslate', false, |
|
'ActionName', "Cycle through Lights(Previous)", |
|
'ActionShortcut', "Alt-Shift-V", |
|
'OnAction', function (self, host, source, ...) |
|
ViewNextLight(-1) |
|
end, |
|
'__condition', function (parent, context) return rawget(_G, "ViewNextLight") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Cycle through Lights Objects", |
|
'RolloverText', "Cycle through Lights Objects", |
|
'ActionId', "CycleLightsNext", |
|
'ActionTranslate', false, |
|
'ActionName', "Cycle through Lights(Next)", |
|
'ActionShortcut', "Alt-V", |
|
'OnAction', function (self, host, source, ...) |
|
ViewNextLight(1) |
|
end, |
|
'__condition', function (parent, context) return rawget(_G, "ViewNextLight") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Capture Screen Lights", |
|
'RolloverText', "Capture Screen Lights for cycling them", |
|
'ActionId', "CaptureScreenLights", |
|
'ActionTranslate', false, |
|
'ActionName', "Capture Screen Lights", |
|
'ActionShortcut', "Ctrl-Alt-Shift-X", |
|
'OnAction', function (self, host, source, ...) |
|
CaptureScreenLights() |
|
end, |
|
'__condition', function (parent, context) return rawget(_G, "CaptureScreenLights") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Cycle through Screen Lights", |
|
'RolloverText', "Cycle through Lights Objects", |
|
'ActionId', "CycleScreenLightsPrev", |
|
'ActionTranslate', false, |
|
'ActionName', "Cycle through Screen Lights(Previous)", |
|
'ActionShortcut', "Alt-Shift-F", |
|
'OnAction', function (self, host, source, ...) |
|
ViewNextLight(-1, "screen lights") |
|
end, |
|
'__condition', function (parent, context) return rawget(_G, "ViewNextLight") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Cycle through Lights", |
|
'RolloverText', "Cycle through Lights Objects", |
|
'ActionId', "CycleScreenLightsNext", |
|
'ActionTranslate', false, |
|
'ActionName', "Cycle through Screen Lights(Next)", |
|
'ActionShortcut', "Alt-F", |
|
'OnAction', function (self, host, source, ...) |
|
ViewNextLight(1, "screen lights") |
|
end, |
|
'__condition', function (parent, context) return rawget(_G, "ViewNextLight") end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (0)", |
|
'RolloverText', " (0)", |
|
'ActionId', "G_Statistics", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Show Statistics", |
|
'ActionShortcut', "0", |
|
'ActionShortcut2', "Alt-0", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.RenderStatistics ~= 0 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
local stats = config.RenderStatistics or { 0, 5, -1 } |
|
local i = table.find(stats, hr.RenderStatistics) |
|
if i then |
|
hr.RenderStatistics = stats[i + 1] or stats[1] |
|
else |
|
hr.RenderStatistics = hr.RenderStatistics == 0 and -1 or 0 |
|
end |
|
end, |
|
'__condition', function (parent, context) return hr.RenderStatistics end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (0)", |
|
'RolloverText', " (0)", |
|
'ActionId', "Histograms", |
|
'ActionTranslate', false, |
|
'ActionName', "Show Histograms", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleHistogram() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Override DIPs to consist of a single triangle (Ctrl-Shift-1)", |
|
'RolloverText', "Override DIPs to consist of a single triangle (Ctrl-Shift-1)", |
|
'ActionId', "G_RenderSingleTriangle", |
|
'ActionTranslate', false, |
|
'ActionName', "Single Triangle DIPs", |
|
'ActionIcon', "CommonAssets/UI/Menu/RenderSingleTriangle.tga", |
|
'ActionShortcut', "Ctrl-Shift-1", |
|
'OnAction', function (self, host, source, ...) |
|
if hr.PrimitiveCountModifier == 1 then |
|
hr.PrimitiveCountModifier = -100 |
|
else |
|
hr.PrimitiveCountModifier = 1 |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Shows render statistics", |
|
'RolloverText', "Shows render statistics", |
|
'ActionId', "DbgSubsystemsRenderCosts", |
|
'ActionTranslate', false, |
|
'ActionName', "Subsystems render costs", |
|
'OnAction', function (self, host, source, ...) |
|
CreateMapRealTimeThread( |
|
function() |
|
local function Print100f( v ) |
|
local str = "" |
|
str = str .. (v/100) |
|
v = abs( v - (v/100)*100 ) |
|
str = str .. "." .. (v/10) |
|
v = v - (v/10)*10 |
|
str = str .. v |
|
return str |
|
end |
|
local function GetMs100() |
|
local ms = hr.RenderStatsFrameTimeGPU |
|
return ms*100 |
|
end |
|
local function WaitRenderFrames( ms, weight100 ) |
|
weight100 = weight100 or 10 |
|
local t0 = GetClock() |
|
local time = 0 |
|
local ms100 = 0 |
|
local arr = {} |
|
local frame = 1 |
|
WaitNextFrame(hr.RenderStatsSmoothing) |
|
while time < ms do |
|
WaitNextFrame() |
|
arr[frame] = GetMs100() |
|
|
|
time = GetClock()-t0 |
|
frame = frame + 1 |
|
if frame > 30 then frame = 1 end |
|
end |
|
ms100 = 0 |
|
for i=1,#arr do |
|
ms100 = ms100 + arr[i] |
|
end |
|
ms100 = ms100 / #arr |
|
return ms100 |
|
end |
|
|
|
|
|
|
|
local saved_value = false |
|
local tests = {{ |
|
name = "Post processing", |
|
start = function() hr.EnablePostprocess = 0 end, |
|
finish = function() hr.EnablePostprocess = 1 end, |
|
}, { |
|
name = "Particles", |
|
start = function() hr.RenderParticles = 0 end, |
|
finish = function() hr.RenderParticles = 1 end, |
|
}, { |
|
name = "Transparents", |
|
start = function() hr.RenderTransparent = 0 end, |
|
finish = function() hr.RenderTransparent = 1 end, |
|
}, { |
|
name = "Billboards", |
|
start = function() hr.RenderBillboards = 0 end, |
|
finish = function() hr.RenderBillboards = 1 end, |
|
}, { |
|
name = "Objects", |
|
start = function() hr.RenderMapObjects = 0 end, |
|
finish = function() hr.RenderMapObjects = 1 end, |
|
}, { |
|
name = "Streaming", |
|
start = function() hr.StreamingForceFallbacks = 1 end, |
|
finish = function() hr.StreamingForceFallbacks = 0 end, |
|
}, { |
|
name = "Shadowmap", |
|
start = function() hr.Shadowmap = 0 end, |
|
finish = function() hr.Shadowmap = 1 end, |
|
}, { |
|
name = "Shadowmap 1k", |
|
start = function() saved_value = hr.ShadowmapSize hr.ShadowmapSize = 1024 end, |
|
finish = function() hr.ShadowmapSize = saved_value end, |
|
}, { |
|
name = "Shadowmap 880", |
|
start = function() saved_value = hr.ShadowmapSize hr.ShadowmapSize = 880 end, |
|
finish = function() hr.ShadowmapSize = saved_value end, |
|
}, { |
|
name = "Skinned objects", |
|
start = function() hr.RenderSkinned = 0 end, |
|
finish = function() hr.RenderSkinned = 1 end, |
|
}, { |
|
name = "Decals", |
|
start = function() hr.RenderDecals = 0 end, |
|
finish = function() hr.RenderDecals = 1 end, |
|
}, |
|
} |
|
|
|
print( "Render subsystems test started ("..#tests.." tests) - please wait..." ) |
|
|
|
local saved_preciseselection = hr.EnablePreciseSelection |
|
hr.EnablePreciseSelection = 0 |
|
|
|
local frame_ms = WaitRenderFrames( 12000, 5 ) |
|
print( " 0. Whole frame: "..Print100f(frame_ms).." ms - "..(1000/(frame_ms/100)).." fps" ) |
|
|
|
for i=1,#tests do |
|
tests[i].start() |
|
local ms = WaitRenderFrames( 10000, 10 ) |
|
local diff = frame_ms - ms |
|
local percent = diff*100/frame_ms |
|
print( " "..i..". "..tests[i].name..": "..Print100f(diff).." ms "..percent.." %" ) |
|
tests[i].finish() |
|
WaitRenderFrames( 2000 ) |
|
end |
|
print( "done." ) |
|
hr.EnablePreciseSelection = saved_preciseselection |
|
end |
|
) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Surfaces", |
|
'ActionTranslate', false, |
|
'ActionName', "Surfaces ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the grid (Alt-G)", |
|
'ActionId', "E-Grid", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Alignment Grid", |
|
'ActionShortcut', "Alt-G", |
|
'OnAction', function (self, host, source, ...) |
|
|
|
local grid_properties = rawget(_G, "g_ActiveGridProperties") or config.DeveloperGridDefaultProperties or empty_table |
|
table.overwrite(hr, grid_properties) |
|
|
|
local grids = config.DeveloperGrids |
|
local show_construction_grid = rawget(_G, "ShowConstructionGridWithDevGrid") or empty_func |
|
for idx, grid in ipairs(config.DeveloperGrids) do |
|
if GetPostProcPredicate(grid) then |
|
SetPostProcPredicate(grid, false) |
|
if hr.TerrainDebugDraw ~= 0 then show_construction_grid() end |
|
if idx ~= #grids then |
|
SetPostProcPredicate(grids[idx+1], true) |
|
if hr.TerrainDebugDraw ~= 0 then show_construction_grid(grids[idx + 1]) end |
|
end |
|
hr.TemporalReset() |
|
return |
|
end |
|
end |
|
SetPostProcPredicate(grids[1], true) |
|
if hr.TerrainDebugDraw ~= 0 then show_construction_grid(grids[1]) end |
|
hr.TemporalReset() |
|
end, |
|
'__condition', function (parent, context) return config.DeveloperGrids end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Collisions (Ctrl-Shift-K)", |
|
'RolloverText', "Toggle Collisions (Ctrl-Shift-K)", |
|
'ActionId', "G_ToggleCollisions", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Collisions", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleCollisions.tga", |
|
'ActionShortcut', "Ctrl-Shift-K", |
|
'OnAction', function (self, host, source, ...) |
|
if hr.ShowCollisionSurfaces == 0 and hr.ShowColliders == 0 then |
|
print("Showing collision surfaces") |
|
hr.ShowCollisionSurfaces = 1 |
|
elseif hr.ShowCollisionSurfaces ~= 0 and const.maxCollidersPerObject > 0 then |
|
print("Showing colliders") |
|
hr.ShowCollisionSurfaces = 0 |
|
hr.ShowColliders = -1 |
|
OpenDialog("CollisionsLegend") |
|
else |
|
print("Collision display off") |
|
hr.ShowColliders = 0 |
|
hr.ShowCollisionSurfaces = 0 |
|
CloseDialog("CollisionsLegend") |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Walk (Ctrl-Shift-L)", |
|
'RolloverText', "Toggle Walk (Ctrl-Shift-L)", |
|
'ActionId', "G_ToggleWalk", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Walk", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleWalk.tga", |
|
'ActionShortcut', "Ctrl-Shift-L", |
|
'OnAction', function (self, host, source, ...) ToggleHR("ShowWalk") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle BlockPass (Shift-K)", |
|
'RolloverText', "Toggle BlockPass (Shift-K)", |
|
'ActionId', "G_ToggleBlockPass", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle BlockPass", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleBlockPass.tga", |
|
'ActionShortcut', "Shift-K", |
|
'OnAction', function (self, host, source, ...) ToggleHR("ShowBlockPass") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Build", |
|
'RolloverText', "Toggle Build", |
|
'ActionId', "G_ToggleBuild", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Build", |
|
'ActionIcon', "CommonAssets/UI/Menu/ToggleWalk.tga", |
|
'OnAction', function (self, host, source, ...) ToggleHR("ShowBuildSurfaces") end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "(Ctrl-Shift-9)", |
|
'ActionId', "G_DebugDrawTunnels", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Tunnels", |
|
'ActionShortcut', "Ctrl-Shift-9", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleDrawTunnels() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "(Ctrl-Alt-9)", |
|
'ActionId', "G_TunnelHelpers", |
|
'ActionTranslate', false, |
|
'ActionName', "Tunnel Helpers", |
|
'ActionIcon', "CommonAssets/UI/Menu/object_options.tga", |
|
'ActionShortcut', "Ctrl-Alt-9", |
|
'OnAction', function (self, host, source, ...) |
|
local tunnels = 0 |
|
MapForEach("map", "SlabTunnel", function(tunnel) |
|
local helper = PlaceObject("SlabTunnelHelper") |
|
helper:SetPos(tunnel:GetPos()) |
|
helper.tunnel = tunnel |
|
if tunnel.dbg_tunnel_color then |
|
helper:SetColorModifier(tunnel.dbg_tunnel_color) |
|
end |
|
helper:SetScale(35) |
|
tunnels = tunnels + 1 |
|
end) |
|
print(string.format("%d Tunnel helpers created", tunnels)) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "G_PathDebugDraw", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Path", |
|
'OnAction', function (self, host, source, ...) |
|
if hr.TerrainDebugDraw == 1 and DbgGetTerrainOverlay() == "path" and terrain.GetPassGridsCount() > 1 then |
|
DbgSetTerrainOverlay("path_large") |
|
print("path_large") |
|
else |
|
DbgSetTerrainOverlay("path") |
|
print("path") |
|
ToggleHR("TerrainDebugDraw") |
|
if hr.TerrainDebugDraw == 0 then |
|
pf.DbgDrawFindPath() |
|
end |
|
end |
|
end, |
|
'__condition', function (parent, context) return const.DebugOverlay end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-8)", |
|
'RolloverText', " (Ctrl-8)", |
|
'ActionId', "G_WindDebugDraw", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Wind", |
|
'ActionShortcut', "Ctrl-8", |
|
'OnAction', function (self, host, source, ...) |
|
DbgDrawWind(not g_DebugWindDraw) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Shift-8)", |
|
'RolloverText', " (Ctrl-Shift-8)", |
|
'ActionId', "G_WindDebugDrawTexts", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Wind + Numbers", |
|
'ActionShortcut', "Ctrl-Shift-8", |
|
'OnAction', function (self, host, source, ...) |
|
DbgDrawWind(not g_DebugWindDraw, "texts") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Alt-8)", |
|
'RolloverText', " (Ctrl-Alt-8)", |
|
'ActionId', "G_WindDebugDrawTextsTiles", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Wind + Numbers + Tiles", |
|
'ActionShortcut', "Ctrl-Alt-8", |
|
'OnAction', function (self, host, source, ...) |
|
DbgDrawWind(not g_DebugWindDraw, "texts", "show tiles around cursor") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-9)", |
|
'RolloverText', " (Ctrl-9)", |
|
'ActionId', "G_TerrainDebugDraw", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Passability", |
|
'ActionShortcut', "Ctrl-9", |
|
'OnAction', function (self, host, source, ...) |
|
if hr.TerrainDebugDraw == 0 then |
|
DbgSetTerrainOverlay("passability") |
|
EnablePassability3DVisualization(true) |
|
hr.TerrainDebugDraw = 1 |
|
else |
|
EnablePassability3DVisualization(false) |
|
hr.TerrainDebugDraw = 0 |
|
end |
|
end, |
|
'__condition', function (parent, context) return const.DebugOverlay end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-C)", |
|
'RolloverText', " (Shift-C)", |
|
'ActionId', "G_CameraChange", |
|
'ActionMode', "Game", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Camera Type", |
|
'ActionShortcut', "Shift-C", |
|
'OnAction', function (self, host, source, ...) |
|
CheatToggleFlyCamera() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Render.Toggle Render", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Render ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the rendering of the shadows", |
|
'RolloverText', "Toggles the rendering of the shadows", |
|
'ActionId', "DbgRenderShadows", |
|
'ActionTranslate', false, |
|
'ActionName', "Shadow", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.Shadowmap == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "Shadowmap" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the rendering of the objects", |
|
'RolloverText', "Toggles the rendering of the objects", |
|
'ActionId', "DbgRenderObjects", |
|
'ActionTranslate', false, |
|
'ActionName', "Objects", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.RenderMapObjects == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "RenderMapObjects" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the rendering of the BSpheres", |
|
'RolloverText', "Toggles the rendering of the BSpheres", |
|
'ActionId', "DbgShowBSpheres", |
|
'ActionTranslate', false, |
|
'ActionName', "BSpheres", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.RenderBSpheres == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "RenderBSpheres" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the rendering of the billboards", |
|
'RolloverText', "Toggles the rendering of the billboards", |
|
'ActionId', "DbgRenderBillboards", |
|
'ActionTranslate', false, |
|
'ActionName', "Billboards", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.RenderBillboards == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "RenderBillboards" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the rendering of the terrain bounding boxes", |
|
'RolloverText', "Toggles the rendering of the terrain bounding boxes", |
|
'ActionId', "DbgShowTerrainBBoxes", |
|
'ActionTranslate', false, |
|
'ActionName', "Terrain bboxes", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.TerrainAABB == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) ToggleHR "TerrainAABB" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Shift-Z)", |
|
'RolloverText', " (Shift-Z)", |
|
'ActionId', "G_Shadowmap", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Shadowmap", |
|
'ActionShortcut', "Shift-Z", |
|
'OnAction', function (self, host, source, ...) ToggleHR "Shadowmap" end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "DbgCycleUpscalingModes", |
|
'ActionTranslate', false, |
|
'ActionName', "Cycle Upscaling Modes", |
|
'OnAction', function (self, host, source, ...) |
|
CycleUpscaling() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Safearea Lines", |
|
'RolloverText', "Toggle Safearea Lines", |
|
'ActionId', "G_ToggleSafeareaLines", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Safearea Lines", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleSafearea() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Obj Mask Mode", |
|
'ActionId', "DbgToggleObjMaskMode", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Obj Mask Mode", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.DeferMode == DeferModes["OBJ_MASK"] |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
if hr.DeferMode ~= DeferModes["OBJ_MASK"] then |
|
OpenDevDSForceModeDlg("OBJ_MASK") |
|
else |
|
CloseDialog("DevDSForceModeDlg") |
|
end |
|
end, |
|
'__condition', function (parent, context) return Platform.developer end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle Skinned Decal Space", |
|
'ActionId', "DbgToggleToggleSkinnedDecalSpace", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Skinned Decal Space", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.ShowSkinnedDecalSpace ~= 0 |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
hr.ShowSkinnedDecalSpace = 1 - hr.ShowSkinnedDecalSpace |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Show decals", |
|
'RolloverText', "Show decals", |
|
'ActionId', "G_ShowDecals", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle Decals", |
|
'ActionIcon', "CommonAssets/UI/Icons/art brush creative design graphic paint.png", |
|
'ActionToggle', true, |
|
'ActionToggled', function (self, host) |
|
return hr.DecalsRenderBoxes == 1 |
|
end, |
|
'OnAction', function (self, host, source, ...) hr.DecalsRenderBoxes = 1 - hr.DecalsRenderBoxes end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Tools", |
|
'ActionTranslate', false, |
|
'ActionName', "Tools", |
|
'ActionMenubar', "DevMenu", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Enter/Exit Editor (F3)", |
|
'RolloverText', "Editor mode (F3)", |
|
'ActionId', "MO_Editor", |
|
'ActionTranslate', false, |
|
'ActionName', "Enter/Exit Editor", |
|
'ActionIcon', "CommonAssets/UI/Icons/door emergency enter entry exit login.png", |
|
'ActionShortcut', "F3", |
|
'OnAction', function (self, host, source, ...) |
|
ToggleEnterExitEditor() |
|
end, |
|
'__condition', function (parent, context) return not editor.IsModdingEditor() end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Clear ignored errors", |
|
'RolloverText', "Clear ignored errors", |
|
'ActionId', "Clear Ignored Errors", |
|
'ActionTranslate', false, |
|
'ActionName', "Clear Ignored Errors", |
|
'ActionIcon', "CommonAssets/UI/Icons/bathroom commode restroom toilet washroom.png", |
|
'OnAction', function (self, host, source, ...) |
|
ClearIgnoredErrors() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'ActionId', "Tools.Extras", |
|
'ActionTranslate', false, |
|
'ActionName', "Extras ...", |
|
'ActionIcon', "CommonAssets/UI/Menu/folder.tga", |
|
'OnActionEffect', "popup", |
|
'replace_matching_id', true, |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Write screenshot (-PrtScr)", |
|
'RolloverText', "Write screenshot (-PrtScr)", |
|
'ActionId', "DE_Screenshot", |
|
'ActionTranslate', false, |
|
'ActionName', "Screenshot", |
|
'ActionShortcut', "-PrtScr", |
|
'OnAction', function (self, host, source, ...) |
|
WriteScreenshot(GenerateScreenshotFilename("SS", "AppData/")) |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Isolated object screenshot (-Ctrl-Alt-PrtScr)", |
|
'RolloverText', "Isolated object screenshot (-Ctrl-Alt-PrtScr)", |
|
'ActionId', "DE_Isolated_Object_Screenshot", |
|
'ActionTranslate', false, |
|
'ActionName', "Isolated Object Screenshot", |
|
'ActionShortcut', "-Ctrl-Alt-PrtScr", |
|
'OnAction', function (self, host, source, ...) |
|
IsolatedObjectScreenshot() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Report Bug (Ctrl-F1)", |
|
'RolloverText', "Report Bug (Ctrl-F1)", |
|
'ActionId', "DE_BugReport", |
|
'ActionTranslate', false, |
|
'ActionName', "Report Bug", |
|
'ActionIcon', "CommonAssets/UI/Icons/bacteria bug insect protection security virus.png", |
|
'ActionShortcut', "Ctrl-F1", |
|
'OnAction', function (self, host, source, ...) |
|
CreateRealTimeThread(CreateXBugReportDlg) |
|
end, |
|
'__condition', function (parent, context) return not Platform.steamdeck and not Platform.demo or Platform.asserts end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggle UI in screenshots (-Ctrl-Shift-PrtScr)", |
|
'RolloverText', "Toggle UI in screenshots (-Ctrl-Shift-PrtScr)", |
|
'ActionId', "DE_ToggleScreenshotInterface", |
|
'ActionTranslate', false, |
|
'ActionName', "Toggle UI in screenshots", |
|
'ActionShortcut', "-Ctrl-Shift-PrtScr", |
|
'OnAction', function (self, host, source, ...) |
|
hr.InterfaceInScreenshot = hr.InterfaceInScreenshot ~= 0 and 0 or 1 |
|
print("UI in screenshots is now", hr.InterfaceInScreenshot ~= 0 and "enabled" or "disabled") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Write upsampled screenshot (-Ctrl-PrtScr)", |
|
'RolloverText', "Write upsampled screenshot (-Ctrl-PrtScr)", |
|
'ActionId', "DE_UpsampledScreenshot", |
|
'ActionTranslate', false, |
|
'ActionName', "Upsampled Screenshot", |
|
'ActionShortcut', "-Ctrl-PrtScr", |
|
'OnAction', function (self, host, source, ...) |
|
if Platform.developer then |
|
CreateRealTimeThread(function() |
|
WaitNextFrame(3) |
|
LockCamera("Screenshot") |
|
local store = {} |
|
Msg("BeforeUpsampledScreenshot", store) |
|
WaitNextFrame() |
|
MovieWriteScreenshot(GenerateScreenshotFilename("SSAA", "AppData/"), 0, 64, false) |
|
WaitNextFrame() |
|
Msg("AfterUpsampledScreenshot", store) |
|
UnlockCamera("Screenshot") |
|
end) |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'RolloverText', "Toggle terrain types display", |
|
'ActionId', "G_ShowTerrainTypes", |
|
'ActionTranslate', false, |
|
'ActionName', "Terrain types", |
|
'ActionShortcut', "Ctrl-Alt-1", |
|
'OnAction', function (self, host, source, ...) |
|
DbgToggleOverlay("type") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'RolloverText', "Toggle grass density display", |
|
'ActionId', "G_ShowGrassDensity", |
|
'ActionTranslate', false, |
|
'ActionName', "Grass density", |
|
'ActionShortcut', "Ctrl-Alt-2", |
|
'OnAction', function (self, host, source, ...) |
|
DbgToggleOverlay("grass_density") |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Toggles the buildable debug grid (Ctrl-B)", |
|
'ActionId', "ToggleBuildable", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-B", |
|
'OnAction', function (self, host, source, ...) |
|
DbgToggleBuildableGrid() |
|
end, |
|
'__condition', function (parent, context) return Libs.Sim end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Editor actions", |
|
'ActionMode', "Editor", |
|
}, { |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-C)", |
|
'ActionId', "E_CopyToClipboard", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-C", |
|
'OnAction', function (self, host, source, ...) |
|
if IsEditorActive() and selo() then |
|
ExecuteWithStatusUI("Copying to clipboard...", XEditorCopyToClipboard) |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-X)", |
|
'ActionId', "E_CutToClipboard", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-X", |
|
'ActionState', function (self, host) |
|
return IsEditorActive() and "enabled" or "disabled" |
|
end, |
|
'OnAction', function (self, host, source, ...) |
|
if IsEditorActive() and selo() then |
|
ExecuteWithStatusUI("Cutting to clipboard...", function() XEditorCopyToClipboard() editor.DelSelWithUndoRedo() end) |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Paste (Ctrl-V)", |
|
'ActionId', "G_Paste", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-V", |
|
'OnAction', function (self, host, source, ...) |
|
if IsEditorActive() then |
|
local clipboard = GetFromClipboard(-1) |
|
if clipboard then |
|
if clipboard:starts_with("--[[HGE place script]]--") then |
|
editor.PasteFromClipboard() |
|
else |
|
local lua_code = GetFromClipboard(-1) |
|
if not lua_code:starts_with(XEditorCopyScriptTag) then |
|
ExecuteWithStatusUI("No objects in clipboard.", function() Sleep(500) end) |
|
return |
|
end |
|
ExecuteWithStatusUI("Pasting...", XEditorPasteFromClipboard) |
|
end |
|
end |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Adds the visible objects to the selection (Ctrl-Alt-Space)", |
|
'ActionId', "Dbg_AddVisibleClassToSelection", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-Alt-Space", |
|
'OnAction', function (self, host, source, ...) |
|
local ol = editor.GetSel() |
|
if #ol == 0 then |
|
print( "Select something first!" ) |
|
else |
|
local num = #ol |
|
local locked = Collection.GetLockedCollection() |
|
editor.AddToSel(XEditorGetVisibleObjects(function(obj) |
|
for i = 1, num do |
|
if ol[i].class == obj.class and (not locked or obj:GetRootCollection() == locked) then |
|
return true |
|
end |
|
end |
|
return false |
|
end)) |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', " (Ctrl-Shift-V)", |
|
'ActionId', "G_PasteNoZ", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-Shift-V", |
|
'OnAction', function (self, host, source, ...) editor.PasteFromClipboard(true) end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Execute last console command (.)", |
|
'ActionId', "LastCommand", |
|
'ActionTranslate', false, |
|
'ActionShortcut', ".", |
|
'OnAction', function (self, host, source, ...) |
|
if rawget(_G, "dlgConsole") then |
|
dlgConsole:ExecuteLast() |
|
end |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
PlaceObj('XTemplateAction', { |
|
'comment', "Delete slab without deleting suppressed slabs underneath.", |
|
'ActionId', "DeleteSelectedSlabsWithoutPropagation", |
|
'ActionTranslate', false, |
|
'ActionShortcut', "Ctrl-Delete", |
|
'OnAction', function (self, host, source, ...) |
|
DeleteSelectedSlabsWithoutPropagation() |
|
end, |
|
'replace_matching_id', true, |
|
}), |
|
}), |
|
}) |
|
|
|
|