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 


[UPDATE] Edit CE all forms font size!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1462

PostPosted: Thu May 09, 2024 2:12 pm    Post subject: [UPDATE] Edit CE all forms font size! Reply with quote

This list includes the Address list and Memory Browser.

Move: Hold down L'Ctrl (Left Ctrl) and move the mouse wheel.

Back: To return to the original size, hold down R'Ctrl (Right Ctrl key) and move the mouse wheel.

There is a feature to save the last edit (last font value).
For the registration; You have changed the last font range based on the form and just press "Ctrl + Enter" keys simultaneously as mentioned in the code.
At the next DT opening, it will probably open at the recorded value.
You must change the font value at least once before saving.

Increase font value: L'Ctrl + Mouse Wheel Up.
Decrease font value: L'Ctrl + Mouse Wheel Down.
Default font value: R'Ctrl + Mouse Wheel (Up or down).
Saving the last value: L'Ctrl + Enter


Look at what forms it accesses in the code list.

here is a video:


Link


Size ranging from 7 ~20 maximum.
Copy the code, paste it into a ".lua" file, save it and drop it into the CE >> Autorun folder and start using it.


Code:

------------------------------------- Save all font size -----------------------
fntSttng1 = getSettings("fntSzSv")
local svClsNm1 = ""
local svFntSz1 = 0
alist = getAddressList()
mvf = getMemoryViewForm().DisassemblerView
mvf1 = getMemoryViewForm().HexadecimalView.Osb.Canvas

function saveFnt(fcn,val)
    fntSttng1.Value[fcn] = val
end

function loadFnt(frm,frmcls1)
local frmcls = frmcls1
    if frmcls=="TDisassemblerview" then
     if fntSttng1.Value[frmcls] ~= nil then
        mvf.Font.Size = fntSttng1.Value[frmcls]
        mvf1.Font.Size = fntSttng1.Value[frmcls]
        for i=1, mvf.Header.Sections.count -1 do
          nm1 = frmcls..i
          if tonumber(fntSttng1.Value[nm1])~=nil then
            mvf.Header.Sections[i].width=fntSttng1.Value[nm1]
          end
        end
     end
    elseif frmcls=="TAddresslist" then
      clnm = fntSttng1.Value[frmcls] or nil
      if clnm ~= nil then
        alist.List.Font.Size = fntSttng1.Value[frmcls]
        for i=1, alist.Header.Sections.count -1 do
          nm2 = frmcls..i
          if tonumber(fntSttng1.Value[nm2])~=nil then
           alist.Header.Sections[i].width=fntSttng1.Value[nm2]
          end
        end
      end
    else
      if tonumber(fntSttng1.Value[nm2])~=nil then
          frm.Font.Size = fntSttng1.Value[frmcls]
      end
    end
end


  loadFnt(alist,"TAddresslist")
  loadFnt(mvf,"TDisassemblerview")
------------------------------------- All form font size -----------------------
local function allowedTForms(formClassName)
    local someTForms = {
                        ['TAbout']=1,
                        ['TChangeOffset']=1,
                        ['TFindDialogForm']=1,
                        ['TFindWindow']=1,
                        ['TFormDesigner']=1,
                        ['TFormMemoryRegions']=1,
                        ['TFoundCodeDialog']=1,
                        ['TFrmMemoryRecordDropdownSettings']=1,
                        ['THotKeyForm']=1,
                        ['TInputboxTop']=1,
                        ['TMemoryBrowser']=1,
                        ['TObjectInspectorDlg']=1,
                        ['TProcessWindow']=1,
                        ['TReplaceDialogForm']=1,
                        ['TformAddressChange']=1,
                        ['TfrmAAEditPrefs']=1,
                        ['TfrmAccessedMemory']=1,
                        ['TfrmAssemblyScan']=1,
                        ['TfrmAutoInject']=1,
                        ['TfrmBreakpointlist']=1,
                        ['TfrmChangedAddresses']=1,
                        ['TfrmCodeFilter']=1,
                        ['TfrmCodecaveScanner']=1,
                        ['TfrmDissectCode']=1,
                        ['TfrmEnumerateDLLs']=1,
                        ['TfrmFillMemory']=1,
                        ['TfrmFindStatics']=1,
                        ['TfrmLuaEngine']=1,
                        ['TfrmMemoryAllocHandler']=1,
                        ['TfrmMemoryViewEx']=1,
                        ['TfrmMemviewPreferences']=1,
                        ['TfrmPEInfo']=1,
                        ['TfrmPointerScannerSettings']=1,
                        ['TfrmReferencedFunctions']=1,
                        ['TfrmReferencedStrings']=1,
                        ['TfrmRescanPointer']=1,
                        ['TfrmSetupPSNNode']=1,
                        ['TfrmStacktrace']=1,
                        ['TfrmStringMap']=1,
                        ['TfrmStringPointerScan']=1,
                        ['TfrmStructureCompare']=1,
                        ['TfrmStructures2']=1,
                        ['TfrmStructuresConfig']=1,
                        ['TfrmThreadlist']=1,
                        ['TfrmTrainerGenerator']=1,
                        ['TfrmUltimap']=1,
                        ['TfrmUltimap2']=1,
                        ['TfrmWatchlist']=1,
                        ['TfrmdissectWindow']=1,
                        ['Tfrmpointerscanner']=1,
                        ['TMainForm']=1,
                       }

    return someTForms[formClassName]~=nil
  end

function formFontEffect(form1)
 local form = form1
      form.OnMouseWheelUp=function(sender)
        sleep(200)
        if isKeyPressed(VK_LCONTROL) then
          if sender.Font.Size==0 then sender.Font.Size=10 end
          if sender.Font.Size < 20 then -- max = 20
            sender.Font.Size = sender.Font.Size + 1
            svClsNm1=sender.className
            svFntSz1=sender.Font.Size
          end
        end
        if isKeyPressed(VK_RCONTROL) then
         svFntSz1=9
         svClsNm1=sender.className
         sender.Font.Size=9
        end
      end

      form.OnMouseWheelDown=function(sender)
        sleep(200)
        if isKeyPressed(VK_LCONTROL) then
          if sender.Font.Size==0 then sender.Font.Size=8 end
            if sender.Font.Size > 7 then -- min = 7
              sender.Font.Size = sender.Font.Size - 1
              svClsNm1=sender.className
              svFntSz1=sender.Font.Size
            end
        end
        if isKeyPressed(VK_RCONTROL) then
         svFntSz1=9
         svClsNm1=sender.className
         sender.Font.Size=9
        end
      end
end

  registerFormAddNotification(function (form)
    --print(form.className)
    if not allowedTForms(form.className) then return end
    local t=createTimer()
    t.Interval = 1
    t.OnTimer = function (timer)
      timer.destroy()
      formFontEffect(form)
      loadFnt(form,form.className)
    end
  end)

----------------------------------- CE built forms -----------------------------
------------------------------- address list ---------------------------
alistTbl1 = {9,50,160,115,80,10000}

function dftText()
   alist.List.Font.Size = alistTbl1[1]
   local idx = 1
   for i=0, alist.Header.Sections.count -1 do
     idx = tonumber(idx) + 1
      alist.Header.Sections[i].width = alistTbl1[idx]
   end
end

alist.List.OnMouseWheelUp=function(sender)
    sleep(200)
  if isKeyPressed(VK_LCONTROL) then
    if alist.List.Font.Size==0 then alist.List.Font.Size=10 end
   if alist.List.Font.Size < 20 then -- max = 20
    alist.List.Font.Size = alist.List.Font.Size + 1
    svClsNm1=sender.className
    svFntSz1=sender.Font.Size
    for i=1, alist.Header.Sections.count -1 do
      alist.Header.Sections[i].width=alist.Header.Sections[i].width + 4
    end
   end
  end
   if isKeyPressed(VK_RCONTROL) then
     svFntSz1=sender.Font.Size
     svClsNm1=sender.className
     dftText()
   end
end

alist.List.OnMouseWheelDown=function(sender)
    sleep(200)
  if isKeyPressed(VK_LCONTROL) then
    if alist.List.Font.Size==0 then alist.List.Font.Size=8 end
   if alist.List.Font.Size > 7 then  -- min = 7
    alist.List.Font.Size = alist.List.Font.Size - 1
    svClsNm1=sender.className
    svFntSz1=sender.Font.Size
    for i=1, alist.Header.Sections.count -1 do
      alist.Header.Sections[i].width=alist.Header.Sections[i].width - 4
    end
   end
  end
   if isKeyPressed(VK_RCONTROL) then
     svFntSz1=sender.Font.Size
     svClsNm1=sender.className
     dftText()
   end
end

--####################################################################--
--------------------------------- Memory View --------------------------

mvfTbl1 = {9,120,135,250,200}

function dftText1()
   mvf.Font.Size = 9
   mvf1.Font.Size = 9
   local idx = 1
   for i=0, mvf.Header.Sections.count -1 do
     idx = tonumber(idx) + 1
      mvf.Header.Sections[i].width = mvfTbl1[idx]
   end
end

mvf.OnMouseWheelUp=function(sender)
    sleep(200)
  if isKeyPressed(VK_LCONTROL) then
    if mvf.Font.Size==0 then mvf.Font.Size=10 mvf1.Font.Size=10 end
   if mvf.Font.Size < 20 then -- max = 20
    mvf.Font.Size = mvf.Font.Size + 1
    mvf1.Font.Size = mvf1.Font.Size + 1
    for i=1, mvf.Header.Sections.count -1 do
      mvf.Header.Sections[i].width=mvf.Header.Sections[i].width + 4
    end
   end
  end
   if isKeyPressed(VK_RCONTROL) then svClsNm1=mvf.className dftText1() end
end

mvf.OnMouseWheelDown=function(sender)
    sleep(200)
  if isKeyPressed(VK_LCONTROL) then
    if mvf.Font.Size==0 then mvf.Font.Size=8 mvf1.Font.Size=8 end
   if mvf.Font.Size > 7 then  -- min = 7
    mvf.Font.Size = mvf.Font.Size - 1
    mvf1.Font.Size = mvf1.Font.Size - 1
    svFntSz1=mvf.Font.Size
    svClsNm1=mvf.className
    for i=1, mvf.Header.Sections.count -1 do
      mvf.Header.Sections[i].width=mvf.Header.Sections[i].width - 3
    end
   end
  end
   if isKeyPressed(VK_RCONTROL) then
     svFntSz1=mvf.Font.Size
     svClsNm1=mvf.className
     dftText1()
   end
end

--------------------------------- save key options -----------------------------
----------------------- save keys: Ctrl + Enter
function svKyOpt()
sleep(200)
  if isKeyPressed(VK_RETURN) then
      if svClsNm1=="TDisassemblerview" then
        saveFnt(svClsNm1,svFntSz1)
        local hdr = 0
        for i=1, mvf.Header.Sections.count -1 do
          nm1 = svClsNm1..i
          hdrw1 = mvf.Header.Sections[i].width
          saveFnt(nm1,hdrw1)
        end
      elseif svClsNm1=="TAddresslist" then
        saveFnt(svClsNm1,svFntSz1)
        for i=1, alist.Header.Sections.count -1 do
          nm2 = svClsNm1..i
          hdrw2 = alist.Header.Sections[i].width
          saveFnt(nm2,hdrw2)
        end
      else
        saveFnt(svClsNm1,svFntSz1)
      end
  end
end

 if svOptKy2 then svOptKy2.Destroy() svOptKy2=nil end
 svOptKy2=createHotkey(svKyOpt,VK_LCONTROL)

------------------------------------- THE END ----------------------------------



For more, please vote and support from the reputation icon under the profile picture.

Until we meet again on another crazy project, enjoy it! Smile

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past


Last edited by AylinCE on Tue May 14, 2024 10:15 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3282

PostPosted: Sat May 11, 2024 10:43 am    Post subject: Reply with quote

This! I love it, thanks!
Could you do one for a) the memory viewer and b) the structure dissect windows to zoom in/out?
Thanks!
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1462

PostPosted: Tue May 14, 2024 10:17 am    Post subject: Reply with quote

UPDATE ..

Many forms have been added.
Some key combinations have changed.
Added save last edit feature.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions 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