Improve event reading
@@ -13,6 +13,8 @@ class EventList:
self.num_properties = read_u32(data, 0x1C)
self.integer_list_offset = read_u32(data, 0x28)
self.num_integers = read_u32(data, 0x2C)
+ self.string_list_offset = read_u32(data, 0x30)
+ self.string_list_total_size = read_u32(data, 0x34)
self.actions = []
for action_index in range(0, self.num_actions):
@@ -47,13 +49,30 @@ class EventList:
write_u32(data, offset, integer)
offset += 4
+ def get_property_value(self, property_index):
+ property = self.properties[property_index]
+
+ if property.data_type == 1:
+ return self.floats[property.data_index]
+ elif property.data_type == 3:
+ return self.integers[property.data_index]
+ elif property.data_type == 4:
+ string_pointer = self.string_list_offset + property.data_index
+ string = read_str(self.file_entry.data, string_pointer, property.data_size)
+ return string
+
class Action:
DATA_SIZE = 0x50
def __init__(self, data, offset):
- self.name = read_str(data, offset, 0x20)
+ self.offset = offset
+ self.name = read_str(data, offset, 0x20)
+ self.duplicate_id = read_u32(data, offset+0x20)
+ self.action_index = read_u32(data, offset+0x24)
+ self.flag_id_to_set = read_u32(data, offset+0x34)
self.property_index = read_u32(data, offset+0x38)
+ self.next_action_index = read_u32(data, offset+0x3C)
class Property:
DATA_SIZE = 0x40
@@ -63,5 +82,5 @@ class Property:
self.data_type = read_u32(data, offset+0x24)
self.data_index = read_u32(data, offset+0x28)
-
+ self.data_size = read_u32(data, offset+0x2C)
self.next_property_index = read_u32(data, offset+0x30)
