--[===[ Author: YoucefHam Email: youcefham20@gmail.com Discord: YoucefHam#5634 ADD to Main Cheat Engine window the Menu "Window" "Vertical", => The default Cheat Engine window. "Horizontal", => Make the Found list and Address List Side by Side. "Auto Switch", => Enable/Disable change mode automatically when the windows is maximized "Compact CE window" => Button to resize CE window. ]===] local MainForm_WW_State = false local MainForm_WW_State_ = false local MainForm_WW_AutoSwitch = false local CESettings = getSettings('miWideWindow') if CESettings.Value['MainForm_WW_AutoSwitch'] ~= '' then if CESettings.Value['MainForm_WW_AutoSwitch'] == 'true' then MainForm_WW_AutoSwitch = true else MainForm_WW_AutoSwitch = false end else CESettings.Value['MainForm_WW_AutoSwitch'] = tostring(MainForm_WW_AutoSwitch) end --Set window to Vertical mode local function MainForm_miWWVerticalClick() if not MainForm_WW_State then return end --Make Items Visible MainForm['Panel5'].Visible = true --FondList Parent MainForm['Splitter1'].Visible = true --Splitter MainForm['Panel1'].Visible = true --AddressList Parent MainForm['Panel4'].Visible = true --advancedbutton Parent --Adjast Panal5 to the Left MainForm['Panel5'].Align = alTop MainForm['Panel5'].Top = 0 MainForm['Panel5'].Left = 0 MainForm['Panel5'].BorderSpacing.Right = 0 MainForm['Panel5'].Height = MainForm['Panel5'].Constraints.MinHeight --Adjast Spliter to the right of the Panal5 MainForm['Splitter1'].Align = alTop MainForm['Splitter1'].Top = MainForm['Panel5'].Top + MainForm['Panel5'].Height MainForm['Splitter1'].Left = MainForm['Panel5'].Left --Adjust Panel1 to the right of the spliter MainForm['Panel1'].Align = alClient MainForm['Panel1'].Top = MainForm['Splitter1'].Top + MainForm['Splitter1'].Height MainForm['Panel1'].Left = MainForm['Splitter1'].Left MainForm['Panel1'].BorderSpacing.Left = 0 if MainForm.WindowState ~= 'wsMaximized' then MainForm.Width = getScreenWidth() * 0.4 MainForm.Height = getScreenHeight() * 0.9 end MainForm['Panel5'].Height = MainForm['Panel5'].Constraints.MinHeight MainForm_WW_State = false end --Set window to Horizontal mode local function MainForm_miWWHorizontalClick() if MainForm_WW_State then return end --Make Items Visible MainForm['Panel5'].Visible = true --FondList Parent MainForm['Splitter1'].Visible = true --Splitter MainForm['Panel1'].Visible = true --AddressList Parent MainForm['Panel4'].Visible = true --advancedbutton Parent --Adjast Panal5 to the Left MainForm['Panel5'].Align = alLeft MainForm['Panel5'].Top = 0 MainForm['Panel5'].Left = 0 MainForm['Panel5'].BorderSpacing.Right = 5 --Adjast Spliter to the right of the Panal5 MainForm['Splitter1'].Align = alLeft MainForm['Splitter1'].Top = MainForm['Panel5'].Top MainForm['Splitter1'].Left = MainForm['Panel5'].Left + MainForm['Panel5'].Width --Adjust Panel1 to the right of the spliter MainForm['Panel1'].Align = alClient MainForm['Panel1'].BorderSpacing.Left = 2 if MainForm.WindowState ~= 'wsMaximized' then MainForm.Width = getScreenWidth() * 0.9 MainForm.Height = getScreenHeight() * 0.9 end MainForm['Panel5'].Width = MainForm.Width / 2 MainForm_WW_State = true end --Set window to Auto Switch if window Maximized local function MainForm_miWWAutoSwitchClick(sender) sender.Checked = true if MainForm_WW_AutoSwitch == true then MainForm_WW_AutoSwitch = false sender.RadioItem = true else MainForm_WW_AutoSwitch = true sender.RadioItem = false if not MainForm_WW_State and MainForm.WindowState == 'wsMaximized' then MainForm_miWWHorizontalClick() end end CESettings.Value['MainForm_WW_AutoSwitch'] = tostring(MainForm_WW_AutoSwitch) end --Set window to Horizontal mode when window is Maximized if MainForm.OnWindowStateChange ~= nil then if Old_MainForm_OnWindowStateChange == nil then local Old_MainForm_OnWindowStateChange = MainForm.OnWindowStateChange end end MainForm.OnWindowStateChange = function(...) if Old_MainForm_OnWindowStateChange ~= nil then Old_MainForm_OnWindowStateChange(...) end if MainForm_WW_AutoSwitch == true then if MainForm.WindowState == 'wsMaximized' then MainForm_WW_State_ = MainForm_WW_State MainForm_miWWHorizontalClick() elseif MainForm.WindowState == 'wsNormal' then if not MainForm_WW_State_ then MainForm_miWWVerticalClick() end end end end --Set window to Vertical mode when Closing CE if MainForm.OnClose ~= nil then if Old_MainForm_OnClose ~= nil then local Old_MainForm_OnClose = MainForm.OnClose end end MainForm.OnClose = function(sender,option) MainForm_miWWVerticalClick() if Old_MainForm_OnClose ~= nil then return Old_MainForm_OnClose(sender,option) else return option --Possible options: caHide, caFree, caMinimize, caNone end end -- Create Menu local miWideWindowName = 'miWideWindow' local miWideWindowCaption = translate('&Window') local parent = MainForm.Menu.Items local miWideWindow = createMenuItem(parent) miWideWindow.Name = miWideWindowName miWideWindow.Caption = miWideWindowCaption parent.add(miWideWindow) local function addMenuItem(MenuItem, caption, onClick) local newItem = createMenuItem(MenuItem) MenuItem.add(newItem) newItem.Caption = caption newItem.OnClick = onClick if caption == '&Auto Switch' then newItem.Checked = true newItem.RadioItem = not MainForm_WW_AutoSwitch end return newItem end addMenuItem(miWideWindow,translate('&Vertical'), MainForm_miWWVerticalClick) addMenuItem(miWideWindow,'-') addMenuItem(miWideWindow,translate('&Horizontal'), MainForm_miWWHorizontalClick) addMenuItem(miWideWindow,'-') addMenuItem(miWideWindow,translate('&Auto Switch'), MainForm_miWWAutoSwitchClick) -- Compact CE window local cwState = false local MainForm_Height = MainForm.Height local MainForm_Width = MainForm.Width local CompactCEwindow = createButton(MainForm) CompactCEwindow.Name = 'siCompactCEwindow' CompactCEwindow.Cursor = crMultiDrag CompactCEwindow.caption = ('▲▲'):rep(30) CompactCEwindow.Top = MainForm.Height CompactCEwindow.Left = 0 CompactCEwindow.Height = 15 CompactCEwindow.Constraints.MaxHeight = 15 CompactCEwindow.Constraints.MinHeight = 15 CompactCEwindow.Align = alBottom CompactCEwindow.ShowHint = true CompactCEwindow.Hint = translate('Right Click to Compact the Window') --CompactCEwindow.onClick = function () --Left click CompactCEwindow.onContextPopup = function () --Right click cwState = not cwState if cwState then MainForm_Height = MainForm.Height MainForm_Width = MainForm.Width end MainForm['Panel5'].Visible = not cwState --FondList Parent MainForm['Panel1'].Visible = not cwState --AddressList Parent MainForm['splitter1'].Visible = not cwState --splitter --MainForm['Panel4'].Visible = true --advancedbutton Parent MainForm.Constraints.MinHeight = cwState and 0 or MainForm['Panel5'].Constraints.MinHeight + MainForm["Panel4"].Height + 80 MainForm.Height = cwState and (getScreenHeight() * 0.10) + MainForm["Panel4"].Height or MainForm_Height MainForm.Width = cwState and 300 or MainForm_Width CompactCEwindow.Hint = cwState and translate('Right Click to Restore the Window') or translate('Right Click to Compact the Window') CompactCEwindow.caption = cwState and ('▼▼'):rep(30) or ('▲▲'):rep(30) MainForm.BorderIcons = cwState and '[biSystemMenu,biMinimize]' or '[biSystemMenu,biMinimize,biMaximize]' end