Skip to content

Commit

Permalink
semanticflexicolouroverrides
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Apr 27, 2024
1 parent 179e361 commit 5fd6107
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 10 deletions.
31 changes: 31 additions & 0 deletions generated/formats/semanticflexicolours/compounds/ColorOverride.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from generated.formats.ovl_base.compounds.MemStruct import MemStruct
from generated.formats.semanticflexicolours.imports import name_type_map


class ColorOverride(MemStruct):

"""
PZ: 24 bytes
"""

__name__ = 'ColorOverride'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)
self.color = name_type_map['FloatColor'](self.context, 0, None)
self.flexi_name = name_type_map['Pointer'](self.context, 0, name_type_map['ZString'])
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'flexi_name', name_type_map['Pointer'], (0, name_type_map['ZString']), (False, None), (None, None)
yield 'color', name_type_map['FloatColor'], (0, None), (False, None), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'flexi_name', name_type_map['Pointer'], (0, name_type_map['ZString']), (False, None)
yield 'color', name_type_map['FloatColor'], (0, None), (False, None)
33 changes: 33 additions & 0 deletions generated/formats/semanticflexicolours/compounds/FloatColor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from generated.formats.ovl_base.compounds.MemStruct import MemStruct
from generated.formats.semanticflexicolours.imports import name_type_map


class FloatColor(MemStruct):

__name__ = 'FloatColor'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)
self.r = name_type_map['Float'](self.context, 0, None)
self.g = name_type_map['Float'](self.context, 0, None)
self.b = name_type_map['Float'](self.context, 0, None)
self.a = name_type_map['Float'](self.context, 0, None)
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'r', name_type_map['Float'], (0, None), (False, None), (None, None)
yield 'g', name_type_map['Float'], (0, None), (False, None), (None, None)
yield 'b', name_type_map['Float'], (0, None), (False, None), (None, None)
yield 'a', name_type_map['Float'], (0, None), (False, None), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'r', name_type_map['Float'], (0, None), (False, None)
yield 'g', name_type_map['Float'], (0, None), (False, None)
yield 'b', name_type_map['Float'], (0, None), (False, None)
yield 'a', name_type_map['Float'], (0, None), (False, None)
37 changes: 37 additions & 0 deletions generated/formats/semanticflexicolours/compounds/GameOverride.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from generated.formats.ovl_base.compounds.MemStruct import MemStruct
from generated.formats.semanticflexicolours.imports import name_type_map


class GameOverride(MemStruct):

"""
PZ: 32 bytes
"""

__name__ = 'GameOverride'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)
self.game_names_count = name_type_map['Uint64'](self.context, 0, None)
self.num_flexi_names = name_type_map['Uint64'](self.context, 0, None)
self.game_names = name_type_map['Pointer'](self.context, self.game_names_count, name_type_map['ZStringList'])
self.flexi_names = name_type_map['Pointer'](self.context, self.num_flexi_names, name_type_map['ZStringList'])
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'game_names', name_type_map['Pointer'], (None, name_type_map['ZStringList']), (False, None), (None, None)
yield 'game_names_count', name_type_map['Uint64'], (0, None), (False, None), (None, None)
yield 'flexi_names', name_type_map['Pointer'], (None, name_type_map['ZStringList']), (False, None), (None, None)
yield 'num_flexi_names', name_type_map['Uint64'], (0, None), (False, None), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'game_names', name_type_map['Pointer'], (instance.game_names_count, name_type_map['ZStringList']), (False, None)
yield 'game_names_count', name_type_map['Uint64'], (0, None), (False, None)
yield 'flexi_names', name_type_map['Pointer'], (instance.num_flexi_names, name_type_map['ZStringList']), (False, None)
yield 'num_flexi_names', name_type_map['Uint64'], (0, None), (False, None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from generated.formats.ovl_base.compounds.MemStruct import MemStruct
from generated.formats.semanticflexicolours.imports import name_type_map


class SemanticFlexiColourOverridesRoot(MemStruct):

__name__ = 'SemanticFlexiColourOverridesRoot'


def __init__(self, context, arg=0, template=None, set_default=True):
super().__init__(context, arg, template, set_default=False)
self.num_color_overrides = name_type_map['Ushort'](self.context, 0, None)
self.num_game_overrides = name_type_map['Ushort'](self.context, 0, None)
self._z_0 = name_type_map['Int'](self.context, 0, None)
self._z_1 = name_type_map['Uint64'](self.context, 0, None)
self.color_overrides = name_type_map['ArrayPointer'](self.context, self.num_color_overrides, name_type_map['ColorOverride'])
self.game_overrides = name_type_map['ArrayPointer'](self.context, self.num_game_overrides, name_type_map['GameOverride'])
if set_default:
self.set_defaults()

@classmethod
def _get_attribute_list(cls):
yield from super()._get_attribute_list()
yield 'color_overrides', name_type_map['ArrayPointer'], (None, name_type_map['ColorOverride']), (False, None), (None, None)
yield 'game_overrides', name_type_map['ArrayPointer'], (None, name_type_map['GameOverride']), (False, None), (None, None)
yield 'num_color_overrides', name_type_map['Ushort'], (0, None), (False, None), (None, None)
yield 'num_game_overrides', name_type_map['Ushort'], (0, None), (False, None), (None, None)
yield '_z_0', name_type_map['Int'], (0, None), (False, None), (None, None)
yield '_z_1', name_type_map['Uint64'], (0, None), (False, None), (None, None)

@classmethod
def _get_filtered_attribute_list(cls, instance, include_abstract=True):
yield from super()._get_filtered_attribute_list(instance, include_abstract)
yield 'color_overrides', name_type_map['ArrayPointer'], (instance.num_color_overrides, name_type_map['ColorOverride']), (False, None)
yield 'game_overrides', name_type_map['ArrayPointer'], (instance.num_game_overrides, name_type_map['GameOverride']), (False, None)
yield 'num_color_overrides', name_type_map['Ushort'], (0, None), (False, None)
yield 'num_game_overrides', name_type_map['Ushort'], (0, None), (False, None)
yield '_z_0', name_type_map['Int'], (0, None), (False, None)
yield '_z_1', name_type_map['Uint64'], (0, None), (False, None)
4 changes: 4 additions & 0 deletions generated/formats/semanticflexicolours/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
'Empty': 'generated.formats.ovl_base.compounds.Empty',
'ZStringList': 'generated.formats.ovl_base.compounds.ZStringList',
'SemanticFlexiColoursRoot': 'generated.formats.semanticflexicolours.compounds.SemanticFlexiColoursRoot',
'SemanticFlexiColourOverridesRoot': 'generated.formats.semanticflexicolours.compounds.SemanticFlexiColourOverridesRoot',
'FloatColor': 'generated.formats.semanticflexicolours.compounds.FloatColor',
'ColorOverride': 'generated.formats.semanticflexicolours.compounds.ColorOverride',
'GameOverride': 'generated.formats.semanticflexicolours.compounds.GameOverride',
}

name_type_map = {}
Expand Down
30 changes: 30 additions & 0 deletions generated/formats/semanticflexicolours/semanticflexicolours.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,34 @@
<add name="names_count" type="uint64" />
</compound>

<compound name="SemanticFlexiColourOverridesRoot" inherit="MemStruct">
<add name="color_overrides" type="ArrayPointer" template="ColorOverride" arg="num_color_overrides"/>
<add name="game_overrides" type="ArrayPointer" template="GameOverride" arg="num_game_overrides"/>
<add name="num_color_overrides" type="ushort" />
<add name="num_game_overrides" type="ushort" />
<add name="_z0" type="int" />
<add name="_z1" type="uint64" />
</compound>

<compound name="FloatColor" inherit="MemStruct">
<add name="R" type="float"/>
<add name="G" type="float"/>
<add name="B" type="float"/>
<add name="A" type="float"/>
</compound>

<compound name="ColorOverride" inherit="MemStruct">
PZ: 24 bytes
<add name="flexi_name" type="Pointer" template="ZString"/>
<add name="color" type="FloatColor" />
</compound>

<compound name="GameOverride" inherit="MemStruct">
PZ: 32 bytes
<add name="game_names" type="Pointer" template="ZStringList" arg="game_names_count"/>
<add name="game_names_count" type="uint64" />
<add name="flexi_names" type="Pointer" template="ZStringList" arg="num_flexi_names"/>
<add name="num_flexi_names" type="uint64" />
</compound>

</niftoolsxml>
65 changes: 65 additions & 0 deletions icons/semanticflexicolouroverrides.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 59 additions & 9 deletions icons/semanticflexicolours.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions modules/formats/SEMANTICFLEXICOLOURS.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from generated.formats.semanticflexicolours.compounds.SemanticFlexiColourOverridesRoot import \
SemanticFlexiColourOverridesRoot
from generated.formats.semanticflexicolours.compounds.SemanticFlexiColoursRoot import SemanticFlexiColoursRoot
from modules.formats.BaseFormat import MemStructLoader


class SemanticFlexiColoursLoader(MemStructLoader):
target_class = SemanticFlexiColoursRoot
extension = ".semanticflexicolours"


class SemanticFlexiColourOverridesLoader(MemStructLoader):
target_class = SemanticFlexiColourOverridesRoot
extension = ".semanticflexicolouroverrides"
30 changes: 30 additions & 0 deletions source/formats/semanticflexicolours/semanticflexicolours.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,34 @@
<add name="names_count" type="uint64" />
</compound>

<compound name="SemanticFlexiColourOverridesRoot" inherit="MemStruct">
<add name="color_overrides" type="ArrayPointer" template="ColorOverride" arg="num_color_overrides"/>
<add name="game_overrides" type="ArrayPointer" template="GameOverride" arg="num_game_overrides"/>
<add name="num_color_overrides" type="ushort" />
<add name="num_game_overrides" type="ushort" />
<add name="_z0" type="int" />
<add name="_z1" type="uint64" />
</compound>

<compound name="FloatColor" inherit="MemStruct">
<add name="R" type="float"/>
<add name="G" type="float"/>
<add name="B" type="float"/>
<add name="A" type="float"/>
</compound>

<compound name="ColorOverride" inherit="MemStruct">
PZ: 24 bytes
<add name="flexi_name" type="Pointer" template="ZString"/>
<add name="color" type="FloatColor" />
</compound>

<compound name="GameOverride" inherit="MemStruct">
PZ: 32 bytes
<add name="game_names" type="Pointer" template="ZStringList" arg="game_names_count"/>
<add name="game_names_count" type="uint64" />
<add name="flexi_names" type="Pointer" template="ZStringList" arg="num_flexi_names"/>
<add name="num_flexi_names" type="uint64" />
</compound>

</niftoolsxml>
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0733d0119 - Tue Apr 23 16:48:39 2024 +0200
179e361ea - Sat Apr 27 10:58:14 2024 +0200

0 comments on commit 5fd6107

Please sign in to comment.