-- ========== GENERATED BY XTemplate Editor (Alt-F3) DO NOT EDIT MANUALLY! ========== PlaceObj('XTemplate', { group = "GedApps", id = "ModManager", save_in = "Ged", PlaceObj('XTemplateWindow', { '__class', "GedApp", 'Translate', true, 'Title', "Mods Manager", 'AppId', "ModManager", }, { PlaceObj('XTemplateWindow', { '__context', function (parent, context) return "root" end, '__class', "GedListPanel", 'Id', "idMods", 'Title', "Mods", 'ActionContext', "PanelActions", 'Format', "", 'OnDoubleClick', function (self, item_idx) self.parent:Op("GedOpEditMod", self.context, item_idx) end, 'ItemActionContext', "ChildActions", }), PlaceObj('XTemplateWindow', { '__class', "XPanelSizer", }), PlaceObj('XTemplateWindow', { '__context', function (parent, context) return "log" end, '__class', "GedMultiLinePanel", 'Id', "idMessageLog", 'Title', "Messages", 'FormatFunc', "GedModMessageLog", 'AutoHide', false, }), PlaceObj('XTemplateAction', { 'ActionId', "File", 'ActionName', T(546151333667, --[[XTemplate ModManager ActionName]] "File"), 'ActionMenubar', "main", 'OnActionEffect', "popup", }, { PlaceObj('XTemplateAction', { 'ActionId', "New", 'ActionName', T(687867043540, --[[XTemplate ModManager ActionName]] "New Mod"), 'ActionIcon', "CommonAssets/UI/Ged/new.tga", 'ActionToolbar', "main", 'ActionShortcut', "Ctrl-N", 'OnAction', function (self, host, source, ...) host:Op("GedOpNewMod", host.idMods.context) end, 'ActionContexts', { "ChildActions", }, }), PlaceObj('XTemplateAction', { 'ActionId', "Load", 'ActionName', T(719213652871, --[[XTemplate ModManager ActionName]] "Load"), 'ActionIcon', "CommonAssets/UI/Ged/play.tga", 'ActionToolbar', "main", 'ActionShortcut', "Ctrl-L", 'OnAction', function (self, host, source, ...) local panel = host.idMods if panel:GetSelection() then host:Op("GedOpLoadMod", panel.context, panel:GetSelection()) end end, 'ActionContexts', { "ChildActions", }, }), PlaceObj('XTemplateAction', { 'ActionId', "Unload", 'ActionName', T(814896034284, --[[XTemplate ModManager ActionName]] "Unload"), 'ActionIcon', "CommonAssets/UI/Ged/undo.tga", 'ActionToolbar', "main", 'ActionShortcut', "Ctrl-U", 'OnAction', function (self, host, source, ...) local panel = host.idMods if panel:GetSelection() then host:Op("GedOpUnloadMod", panel.context, panel:GetSelection()) end end, 'ActionContexts', { "ChildActions", }, }), PlaceObj('XTemplateAction', { 'ActionId', "Edit", 'ActionName', T(865079172599, --[[XTemplate ModManager ActionName]] "Edit"), 'ActionIcon', "CommonAssets/UI/Ged/preview.tga", 'ActionToolbar', "main", 'ActionShortcut', "Ctrl-E", 'OnAction', function (self, host, source, ...) local panel = host.idMods if panel:GetSelection() then host:Op("GedOpEditMod", panel.context, panel:GetSelection()) end end, 'ActionContexts', { "ChildActions", }, }), PlaceObj('XTemplateAction', { 'ActionId', "Delete", 'ActionName', T(954766070707, --[[XTemplate ModManager ActionName]] "Delete Mod"), 'ActionIcon', "CommonAssets/UI/Ged/delete.tga", 'ActionToolbar', "main", 'ActionShortcut', "Shift-Delete", 'OnAction', function (self, host, source, ...) local panel = host.idMods if panel:GetSelection() then host:Op("GedOpRemoveMod", panel.context, panel:GetSelection()) end end, 'ActionContexts', { "ChildActions", }, }), PlaceObj('XTemplateAction', { 'ActionId', "Log Viewer", 'ActionName', T(954766070708, --[[XTemplate ModManager ActionName]] "Game Log"), 'ActionIcon', "CommonAssets/UI/Ged/log-dataset.tga", 'ActionToolbar', "main", 'ActionState', function (self, host) if not Platform.desktop then return "hidden" end end, 'OnAction', function (self, host, source, ...) host:Op("ShowLog") end, }), PlaceObj('XTemplateAction', { 'ActionId', "Exit", 'ActionName', T(871800305287, --[[XTemplate ModManager ActionName]] "Exit"), 'OnAction', function (self, host, source, ...) host:Exit() end, }), }), PlaceObj('XTemplateAction', { 'ActionId', "Cheats", 'ActionName', T(580953171470, --[[XTemplate ModManager ActionName]] "Cheats"), 'ActionMenubar', "main", 'OnActionEffect', "popup", }, { PlaceObj('XTemplateTemplate', { '__template', "ModEditorCheats", }), }), PlaceObj('XTemplateAction', { 'ActionId', "Help", 'ActionName', T(515768319493, --[[XTemplate ModManager ActionName]] "Help"), 'ActionIcon', "CommonAssets/UI/Ged/help.tga", 'ActionMenubar', "main", 'ActionToolbar', "main", 'ActionShortcut', "F1", 'OnAction', function (self, host, source, ...) host:Op("GedOpHelpMod", host.idMods.context) end, }), PlaceObj('XTemplateAction', { 'ActionId', "Preferences", 'ActionName', T(837177020258, --[[XTemplate ModManager ActionName]] "Preferences"), 'ActionMenubar', "main", 'OnActionEffect', "popup", }, { PlaceObj('XTemplateAction', { 'ActionId', "DarkLightMode", 'ActionTranslate', false, 'ActionName', "Dark/Light Mode", 'OnActionEffect', "popup", 'OnAction', function (self, host, source, ...) local effect = self.OnActionEffect local param = self.OnActionParam if effect == "close" and host and host.window_state ~= "destroying" then host:Close(param ~= "" and param or nil, source, ...) elseif effect == "mode" and host then assert(IsKindOf(host, "XDialog")) host:SetMode(param) elseif effect == "back" and host then assert(IsKindOf(host, "XDialog")) SetBackDialogMode(host) elseif effect == "popup" then local actions_view = GetParentOfKind(source, "XActionsView") if actions_view then actions_view:PopupAction(self.ActionId, host, source) else XShortcutsTarget:OpenPopupMenu(self.ActionId, terminal.GetMousePos()) end else --print(self.ActionId, "activated") end end, }, { PlaceObj('XTemplateAction', { 'ActionId', "dark", 'ActionTranslate', false, 'ActionName', "Dark", 'OnAction', function (self, host, source, ...) host:Op("GedOpDarkModeChange", "root", "Dark") end, }), PlaceObj('XTemplateAction', { 'ActionId', "light", 'ActionTranslate', false, 'ActionName', "Light", 'OnAction', function (self, host, source, ...) host:Op("GedOpDarkModeChange", "root", "Light") end, }), PlaceObj('XTemplateAction', { 'ActionId', "FollowSystem", 'ActionTranslate', false, 'ActionName', "Use OS setting", 'OnAction', function (self, host, source, ...) host:Op("GedOpDarkModeChange", "root", "Follow system") end, }), }), PlaceObj('XTemplateAction', { 'ActionId', "OpenDocs", 'ActionName', T(993218250056, --[[XTemplate ModManager ActionName]] "Open Documentation on start (toggle)"), 'ActionToggle', true, 'ActionToggled', function (self, host) return host.actions_toggled["OpenModdingDocs"] end, 'OnAction', function (self, host, source, ...) host:Op("GedOpOpenDocsToggle", "root") end, }), PlaceObj('XTemplateTemplate', { '__template', "ModManagerPreferences", 'IgnoreMissing', true, }), }), }), })