Difference between revisions of "Lua:Class:Addresslist"
Jump to navigation
Jump to search
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | Addresslist '''class''': ('''Inheritance''': ''[[Panel]]''->''[[WinControl]]''->''[[Control]]''->''[[Component]]''->''[[Object]]'') | + | [[Category:Lua]] |
+ | Addresslist '''class''': ('''Inheritance''': ''[[Lua:Class:Panel|Panel]]''->''[[Lua:Class:WinControl|WinControl]]''->''[[Lua:Class:Control|Control]]''->''[[Lua:Class:Component|Component]]''->''[[Lua:Class:Object|Object]]'') | ||
− | + | The AddressList class represents the list of memory records (cheat entries) in Cheat Engine. | |
+ | It provides access to all records, selection, appearance, and event handling for the address list. | ||
== Properties == | == Properties == | ||
− | + | {| class="wikitable" style="width:100%" | |
− | + | ! Property | |
− | + | ! Type | |
− | + | ! Description | |
− | + | |- | |
− | + | | LoadedTableVersion | |
− | + | | Integer | |
− | + | | Returns the tableVersion of the last loaded table. | |
− | + | |- | |
− | + | | Count | |
− | + | | Integer | |
− | + | | The number of records in the table. | |
− | + | |- | |
− | + | | SelCount | |
+ | | Integer | ||
+ | | The number of records that are selected. | ||
+ | |- | ||
+ | | SelectedRecord | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | The main selected record. | ||
+ | |- | ||
+ | | MemoryRecord[] | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Array to access the individual memory records. | ||
+ | |- | ||
+ | | [index] | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Default accessor for memory records. | ||
+ | |- | ||
+ | | CheckboxActiveSelectedColor | ||
+ | | Color | ||
+ | | Color for active and selected checkboxes. | ||
+ | |- | ||
+ | | CheckboxActiveColor | ||
+ | | Color | ||
+ | | Color for active checkboxes. | ||
+ | |- | ||
+ | | CheckboxSelectedColor | ||
+ | | Color | ||
+ | | Color for selected checkboxes. | ||
+ | |- | ||
+ | | CheckboxColor | ||
+ | | Color | ||
+ | | Color for checkboxes. | ||
+ | |- | ||
+ | | SelectedBackgroundColor | ||
+ | | Color | ||
+ | | Color for the selected row background. | ||
+ | |- | ||
+ | | SelectedSecondaryBackgroundColor | ||
+ | | Color | ||
+ | | Secondary color for selected row background. | ||
+ | |- | ||
+ | | ExpandSignColor | ||
+ | | Color | ||
+ | | Color for the expand/collapse sign. | ||
+ | |- | ||
+ | | IncreaseArrowColor | ||
+ | | Color | ||
+ | | Color for the increase arrow. | ||
+ | |- | ||
+ | | DecreaseArrowColor | ||
+ | | Color | ||
+ | | Color for the decrease arrow. | ||
+ | |} | ||
== Methods == | == Methods == | ||
− | + | {| class="wikitable" style="width:100%" | |
− | : Returns the | + | ! Method |
+ | ! Parameters | ||
+ | ! Returns | ||
+ | ! Description | ||
+ | |- | ||
+ | | getCount | ||
+ | | None | ||
+ | | Integer | ||
+ | | Returns the number of memory records. | ||
+ | |- | ||
+ | | getMemoryRecord | ||
+ | | Integer (index) | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Returns the memory record at the given index. | ||
+ | |- | ||
+ | | getMemoryRecordByDescription | ||
+ | | String (description) | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Returns the memory record with the given description. | ||
+ | |- | ||
+ | | getMemoryRecordByID | ||
+ | | Integer (ID) | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Returns the memory record with the given ID. | ||
+ | |- | ||
+ | | createMemoryRecord | ||
+ | | None | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Creates a generic cheat table entry and adds it to the list. | ||
+ | |- | ||
+ | | getSelectedRecords | ||
+ | | None | ||
+ | | Table of [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Returns a table containing all the selected records. | ||
+ | |- | ||
+ | | doDescriptionChange | ||
+ | | None | ||
+ | | None | ||
+ | | Shows the GUI window to change the description of the selected entry. | ||
+ | |- | ||
+ | | doAddressChange | ||
+ | | None | ||
+ | | None | ||
+ | | Shows the GUI window to change the address of the selected entry. | ||
+ | |- | ||
+ | | doTypeChange | ||
+ | | None | ||
+ | | None | ||
+ | | Shows the GUI window to change the type of the selected entries. | ||
+ | |- | ||
+ | | doValueChange | ||
+ | | None | ||
+ | | None | ||
+ | | Shows the GUI window to change the value of the selected entries. | ||
+ | |- | ||
+ | | getSelectedRecord | ||
+ | | None | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | Gets the main selected memory record. | ||
+ | |- | ||
+ | | setSelectedRecord | ||
+ | | [[Lua:Class:MemoryRecord|MemoryRecord]] | ||
+ | | None | ||
+ | | Sets the currently selected memory record (unselects all others). | ||
+ | |- | ||
+ | | disableAllWithoutExecute | ||
+ | | None | ||
+ | | None | ||
+ | | Disables all memory records without executing their [Disable] section. | ||
+ | |- | ||
+ | | rebuildDescriptionCache | ||
+ | | None | ||
+ | | None | ||
+ | | Rebuilds the description-to-record lookup table. | ||
+ | |} | ||
− | + | == Events / Callbacks == | |
− | : | + | {| class="wikitable" style="width:100%" |
+ | ! Event | ||
+ | ! Parameters | ||
+ | ! Description | ||
+ | |- | ||
+ | | OnDescriptionChange | ||
+ | | function(addresslist, memrec):boolean | ||
+ | | Called when the user initiates a description column change on a record. Return true if you handle it, false for normal behaviour. | ||
+ | |- | ||
+ | | OnAddressChange | ||
+ | | function(addresslist, memrec):boolean | ||
+ | | Called when the user initiates an address column change on a record. Return true if you handle it, false for normal behaviour. | ||
+ | |- | ||
+ | | OnTypeChange | ||
+ | | function(addresslist, memrec):boolean | ||
+ | | Called when the user initiates a type column change on a record. Return true if you handle it, false for normal behaviour. | ||
+ | |- | ||
+ | | OnValueChange | ||
+ | | function(addresslist, memrec):boolean | ||
+ | | Called when the user initiates a value column change on a record. Return true if you handle it, false for normal behaviour. | ||
+ | |- | ||
+ | | OnAutoAssemblerEdit | ||
+ | | function(addresslist, memrec) | ||
+ | | Called when the user initiates a memory record AA script edit. This function will be responsible for changing the memory record. | ||
+ | |} | ||
− | + | == Other Functions == | |
− | + | * '''MouseHighlightedRecord()''' — Returns the memory record that the mouse points at, or nil if nothing. | |
− | + | == Examples == | |
− | + | <pre> | |
− | + | -- Print all memory record descriptions | |
− | + | for i = 0, AddressList.Count - 1 do | |
− | + | print(AddressList[i].Description) | |
− | + | end | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | -- Create a new memory record | |
− | + | local newrec = AddressList:createMemoryRecord() | |
+ | newrec.Description = "My New Entry" | ||
+ | newrec.Address = "00400000" | ||
− | + | -- Get all selected records | |
− | : | + | local selected = AddressList:getSelectedRecords() |
+ | for i, rec in ipairs(selected) do | ||
+ | print("Selected:", rec.Description) | ||
+ | end | ||
− | + | -- Change the selected record | |
− | + | AddressList:setSelectedRecord(AddressList[0]) | |
− | + | </pre> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{LuaSeeAlso}} | |
− | |||
− | |||
=== Related Functions === | === Related Functions === | ||
− | * [[getMainForm]] | + | * [[Lua:getMainForm|getMainForm]] |
− | * [[getAddressList]] | + | * [[Lua:getAddressList|getAddressList]] |
=== Related Classes === | === Related Classes === | ||
− | * [[MemoryRecord]] | + | * [[Lua:Class:MemoryRecord|MemoryRecord]] |
Latest revision as of 13:46, 11 July 2025
Addresslist class: (Inheritance: Panel->WinControl->Control->Component->Object)
The AddressList class represents the list of memory records (cheat entries) in Cheat Engine. It provides access to all records, selection, appearance, and event handling for the address list.
Contents
Properties[edit]
Property | Type | Description |
---|---|---|
LoadedTableVersion | Integer | Returns the tableVersion of the last loaded table. |
Count | Integer | The number of records in the table. |
SelCount | Integer | The number of records that are selected. |
SelectedRecord | MemoryRecord | The main selected record. |
MemoryRecord[] | MemoryRecord | Array to access the individual memory records. |
[index] | MemoryRecord | Default accessor for memory records. |
CheckboxActiveSelectedColor | Color | Color for active and selected checkboxes. |
CheckboxActiveColor | Color | Color for active checkboxes. |
CheckboxSelectedColor | Color | Color for selected checkboxes. |
CheckboxColor | Color | Color for checkboxes. |
SelectedBackgroundColor | Color | Color for the selected row background. |
SelectedSecondaryBackgroundColor | Color | Secondary color for selected row background. |
ExpandSignColor | Color | Color for the expand/collapse sign. |
IncreaseArrowColor | Color | Color for the increase arrow. |
DecreaseArrowColor | Color | Color for the decrease arrow. |
Methods[edit]
Method | Parameters | Returns | Description |
---|---|---|---|
getCount | None | Integer | Returns the number of memory records. |
getMemoryRecord | Integer (index) | MemoryRecord | Returns the memory record at the given index. |
getMemoryRecordByDescription | String (description) | MemoryRecord | Returns the memory record with the given description. |
getMemoryRecordByID | Integer (ID) | MemoryRecord | Returns the memory record with the given ID. |
createMemoryRecord | None | MemoryRecord | Creates a generic cheat table entry and adds it to the list. |
getSelectedRecords | None | Table of MemoryRecord | Returns a table containing all the selected records. |
doDescriptionChange | None | None | Shows the GUI window to change the description of the selected entry. |
doAddressChange | None | None | Shows the GUI window to change the address of the selected entry. |
doTypeChange | None | None | Shows the GUI window to change the type of the selected entries. |
doValueChange | None | None | Shows the GUI window to change the value of the selected entries. |
getSelectedRecord | None | MemoryRecord | Gets the main selected memory record. |
setSelectedRecord | MemoryRecord | None | Sets the currently selected memory record (unselects all others). |
disableAllWithoutExecute | None | None | Disables all memory records without executing their [Disable] section. |
rebuildDescriptionCache | None | None | Rebuilds the description-to-record lookup table. |
Events / Callbacks[edit]
Event | Parameters | Description |
---|---|---|
OnDescriptionChange | function(addresslist, memrec):boolean | Called when the user initiates a description column change on a record. Return true if you handle it, false for normal behaviour. |
OnAddressChange | function(addresslist, memrec):boolean | Called when the user initiates an address column change on a record. Return true if you handle it, false for normal behaviour. |
OnTypeChange | function(addresslist, memrec):boolean | Called when the user initiates a type column change on a record. Return true if you handle it, false for normal behaviour. |
OnValueChange | function(addresslist, memrec):boolean | Called when the user initiates a value column change on a record. Return true if you handle it, false for normal behaviour. |
OnAutoAssemblerEdit | function(addresslist, memrec) | Called when the user initiates a memory record AA script edit. This function will be responsible for changing the memory record. |
Other Functions[edit]
- MouseHighlightedRecord() — Returns the memory record that the mouse points at, or nil if nothing.
Examples[edit]
-- Print all memory record descriptions for i = 0, AddressList.Count - 1 do print(AddressList[i].Description) end -- Create a new memory record local newrec = AddressList:createMemoryRecord() newrec.Description = "My New Entry" newrec.Address = "00400000" -- Get all selected records local selected = AddressList:getSelectedRecords() for i, rec in ipairs(selected) do print("Selected:", rec.Description) end -- Change the selected record AddressList:setSelectedRecord(AddressList[0])