Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How make a a Lua Window be under CE

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
_Iuri
Newbie cheater
Reputation: 0

Joined: 08 Jul 2021
Posts: 13

PostPosted: Sat Jul 31, 2021 10:34 am    Post subject: How make a a Lua Window be under CE Reply with quote

Hi everyone, i have this script to replace the Lua Output Window, but this window is always over CE main window. So ¿how can i make a Lua Window under CE Main window?

Also i want to add a new item in the AddressList popup menu ¿how can i do this?



outputwindow.lua
 Description:
My custom output window

Download
 Filename:  outputwindow.lua
 Filesize:  3.96 KB
 Downloaded:  123 Time(s)

Back to top
View user's profile Send private message
_Iuri
Newbie cheater
Reputation: 0

Joined: 08 Jul 2021
Posts: 13

PostPosted: Sun Aug 01, 2021 5:57 pm    Post subject: Reply with quote

Nobody can answer my question? :/
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Mon Aug 02, 2021 11:08 am    Post subject: Reply with quote

Well the reason I stripped down the lua engine window (in my Notepad+ Script Editor extension) was so we could execute code and see its output/errors without an additional window, but in your case to just display logs why not simply hide everything and just keep the memo visible in the lua engine window instead of using a timer, function overloading and such.

Like this:
Code:
local le = getLuaEngine()
for i=0,le.ComponentCount-1 do
   local c = le.Component[i]
   if (c.Name == "mOutput") then
      c.Align = 'alClient';
                c.Parent = le; -- change parent object from groupbox to form
   else
      c.visible = false;
   end
end


You could alternatively disable popup on show (LuaEngineForm...), create a form and memo and overload the mOutput(luaengineform tmemo object) onChange event and simply copy the memo text over yours.

Regarding "its always stays on top", this occurs when using autorun files MainForm gets assigned as the parent object, if you were to execute it in lua engine window or lua script form then the same symptoms would happen but with these windows.
You have to set form PopupMode to 'pmNone' to fix that (I'm not sure why it is not by default).

Code:
tdebug.PopupMode = 'pmNone'



At the end of the CE Notepad+ Script Editor source there is the script that I used to add an item to the addresslist

Code:
-- @DB : https://forum.cheatengine.org/viewtopic.php?p=5567408#5567408
local al = getAddressList();
if (al.PopupMenu) then
   local popMenu = al.PopupMenu;
   local ItemExists = popMenu.open_in_script_editor;
   if (ItemExists) then
      ItemExists.name = '';
      ItemExists.destroy();
   end
   local Item = createMenuItem(popMenu);
   Item.Name = 'open_in_script_editor';
   Item.Shortcut = "CTRL+SPACE";
   Item.Caption = 'Open in script editor';
   Item.OnClick = function(sender)
      local selectedItems = al.getSelectedRecords();
      if (selectedItems) then
         for k,memrecord in pairs(selectedItems) do
            if (memrecord.Type == vtAutoAssembler) then -- onyl autoassemble scripts
               if (not scriptForm.visible) then
                  scriptForm.show();
               end
               selectedView.openFile(memrecord);
            end
         end
      end
   end
   local _onpopup = popMenu.OnPopup;
   if (_onpopup) then
      popMenu.OnPopup = function(sender)
         Item.Visible = al.SelCount > 0;
         _onpopup(sender);
      end
   else
      popMenu.OnPopup = function(sender)
         Item.Visible = al.SelCount > 0;
      end
   end
   popMenu.Items.add(Item);
end

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites