PyLibMS 4.3.1__py3-none-any.whl → 4.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  from types import MappingProxyType
2
- from typing import Callable, Iterator
2
+ from typing import Iterator
3
3
 
4
4
  from lms.flowchart.definitions.node import LMS_EntryNode, LMS_BranchNode, LMS_BaseNode
5
5
 
@@ -7,12 +7,9 @@ from lms.flowchart.definitions.node import LMS_EntryNode, LMS_BranchNode, LMS_Ba
7
7
  class LMS_Flowchart:
8
8
  """Class that represents a flowchart in a MSBF file."""
9
9
 
10
- def __init__(
11
- self, entry_point: LMS_EntryNode, id_generator: Callable[[], int]
12
- ) -> None:
10
+ def __init__(self, entry_point: LMS_EntryNode) -> None:
13
11
  self._entry_node = entry_point
14
12
  self._nodes: dict[int, LMS_BaseNode] = {}
15
- self._id_generator = id_generator
16
13
 
17
14
  if entry_point is not None:
18
15
  for node in entry_point.get_descendents():
lms/flowchart/msbf.py CHANGED
@@ -69,11 +69,6 @@ class MSBF:
69
69
  """Global node map for the file."""
70
70
  return MappingProxyType(self._nodes)
71
71
 
72
- @property
73
- def shared_references(self) -> MappingProxyType[int, LMS_BaseNode]:
74
- """Shared references of nodes between flowcharts."""
75
- return self._shared_references
76
-
77
72
  @property
78
73
  def flowcharts(self) -> MappingProxyType[str, LMS_Flowchart]:
79
74
  """The flowcharts of the MSBF instance."""
@@ -81,6 +76,10 @@ class MSBF:
81
76
  {flowchart.name: flowchart for flowchart in self._flowcharts}
82
77
  )
83
78
 
79
+ def get_flowchart_references(self, node_id: int) -> set[LMS_Flowchart]:
80
+ """References of nodes between flowcharts."""
81
+ return {flowchart for flowchart in self._flowcharts if node_id in flowchart.nodes}
82
+
84
83
  def register_node(self, node: LMS_BaseNode, flowchart: LMS_Flowchart = None) -> None:
85
84
  """
86
85
  Registers a node to the MSBF instance.
@@ -98,7 +97,7 @@ class MSBF:
98
97
  f"Node of ID '{node.id}' is already registered to this flowchart!"
99
98
  )
100
99
 
101
- node.id = self._id_generator()
100
+ node.id = self._generate_next_id()
102
101
  self._nodes[node.id] = node
103
102
 
104
103
  if flowchart is not None:
@@ -143,12 +142,11 @@ class MSBF:
143
142
  if entry_point is None:
144
143
  entry_point = LMS_EntryNode(self._generate_next_id(), flowchart_name)
145
144
 
146
- flowchart = LMS_Flowchart(entry_point, self._generate_next_id)
145
+ flowchart = LMS_Flowchart(entry_point)
147
146
  self._flowcharts.append(flowchart)
148
147
 
149
148
  for flowchart in self._flowcharts:
150
149
  for node_id, node in flowchart.nodes.items():
151
- self._shared_references.setdefault(node.id, set()).add(flowchart)
152
150
  self._nodes[node_id] = node
153
151
 
154
152
  self._nodes = dict(sorted(self._nodes.items()))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyLibMS
3
- Version: 4.3.1
3
+ Version: 4.3.2
4
4
  Summary: Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF.
5
5
  Author: AbdyyEee
6
6
  License-Expression: MIT
@@ -28,13 +28,13 @@ Dynamic: license-file
28
28
  PyLibMS is a library built in Python 3.10 and above for reading and writing of libMessageStudio (LMS) proprietary file
29
29
  formats from Nintendo.
30
30
 
31
- The following is supported
32
- | Format | Read | Write | Configuration Support |
33
- |-------------|------|-------|-------------------------------------------------------------------------------------------|
34
- | `MSBT` | ✅ | ✅ | Support for full attribute (`ATR1`) decoding. Tag decoding 1:1 with the official Nintendo `.mstxt` file format. |
35
- | `MSBF` | ✅ | ✅ | Support for custom node definitions, attaching names and descriptions to nodes. Altering parameter datatypes for flexibility between games. |
36
- | `MSBP` | ✅ | ❌ | Generating configuration files for use with `MSBT` files. |
31
+ The following is supported:
37
32
 
33
+ | Format | Read | Write | Configuration Support |
34
+ |--------|------|-------|---------------------------------------------------------------------------------------------------------------------------------------------|
35
+ | `MSBT` | ✅ | ✅ | Support for full attribute (`ATR1`) decoding. Tag decoding 1:1 matching with official Nintendo `.mstxt` file format. |
36
+ | `MSBF` | ✅ | ✅ | Support for custom node definitions, attaching names and descriptions to nodes. Altering parameter datatypes for flexibility between games. |
37
+ | `MSBP` | ✅ | ❌ | Generating configuration files for use with `MSBT` files. |
38
38
 
39
39
  This library is designed to support LMS revision >=3.0. These include files generated for late **Wii** titles,
40
40
  **Nintendo 3DS**, **Wii U**, **Mobile**, **Nintendo Switch** and **Nintendo Switch 2** games.
@@ -14,10 +14,10 @@ lms/fileio/encoding.py,sha256=ppchv-Pp23q3MpS9ROMmh4x47LYzFN2CQgYDhbEHuQE,1279
14
14
  lms/fileio/io.py,sha256=XiibCpJahW2_rHHjOaJEYL32dv5x1egvFBMjy9E_VlE,6632
15
15
  lms/flowchart/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  lms/flowchart/flw3.py,sha256=WmKEnAjp29pC8VLqc6lkGOtwG9v3si4thgArazsrW-E,15388
17
- lms/flowchart/msbf.py,sha256=AlThsz11rWNQROblOJYkFLDD-veixL8uU0QkDZsXsoo,6557
17
+ lms/flowchart/msbf.py,sha256=4bk8jMqRi9wBUbYLzkqAbfueDeapwd9h5_dHR4hsoI0,6488
18
18
  lms/flowchart/msbfio.py,sha256=PuyTJgksl_ced-tlxGeArh18ZtrszbFg_1kDsLw4mKE,4221
19
19
  lms/flowchart/definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- lms/flowchart/definitions/flowchart.py,sha256=6GlqYB9bJzAYvB-v4lSJegY1vyKRpPKylF1xqqTc2ck,3374
20
+ lms/flowchart/definitions/flowchart.py,sha256=lNyxAI0jka1rVkkZG_BiYk2IcUZA_8J46fpOMVjxdH8,3268
21
21
  lms/flowchart/definitions/lms_nodeexceptions.py,sha256=hlcqW6ERMVyAf2nqxaiSyFdXDfwthFADK79ggS_B3GU,181
22
22
  lms/flowchart/definitions/node.py,sha256=LsrhMoCagNv4LW0qU46CIzrPZQDrs_8O7xFu37DgGIk,20234
23
23
  lms/flowchart/definitions/node_type.py,sha256=LofkFaDwx-kGiZNwTh-J2OMmDQcLroVqxX7GtAV-Sys,4330
@@ -70,8 +70,8 @@ lms/titleconfig/presets/Super Mario Odyssey.yaml,sha256=mV4BsLPzupEPy2RmPUxXlz0U
70
70
  lms/titleconfig/presets/The Legend of Zelda Echos of Wisdom.yaml,sha256=6AoSNRNORjMzMBp2ais_ujRdLLeOe7FB0YlozZJNvHg,2878
71
71
  lms/titleconfig/presets/The Legend of Zelda a Link Between Worlds.yaml,sha256=IY8wPIWMA4ElnN_dtV455beBucntxEBeeJXxUUIrnuw,9785
72
72
  lms/titleconfig/presets/Tomodachi Life Living The Dream.yaml,sha256=hJNb0_KdUAZrztyphaTeaZJl_os7HpmdglLgly_eerU,82382
73
- pylibms-4.3.1.dist-info/licenses/LICENSE,sha256=IGTA9rMb-XpTMPJOzC6z0rRxSzysj3DlV5IQyDd06Xo,1061
74
- pylibms-4.3.1.dist-info/METADATA,sha256=_EZ-eh9Ui5Sv0kIUv1iPp1GQxXIFrjJ9k9z1Qbc0FZw,4282
75
- pylibms-4.3.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
76
- pylibms-4.3.1.dist-info/top_level.txt,sha256=SWQqb3sjP5r5Ls1Ol4E_PIbsv1sggK4DCkkLEzXNRTU,4
77
- pylibms-4.3.1.dist-info/RECORD,,
73
+ pylibms-4.3.2.dist-info/licenses/LICENSE,sha256=IGTA9rMb-XpTMPJOzC6z0rRxSzysj3DlV5IQyDd06Xo,1061
74
+ pylibms-4.3.2.dist-info/METADATA,sha256=BUOVUmrO_KQWy14wnjFwviQbeCEu6yCt10jVmtl9RK0,4374
75
+ pylibms-4.3.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
76
+ pylibms-4.3.2.dist-info/top_level.txt,sha256=SWQqb3sjP5r5Ls1Ol4E_PIbsv1sggK4DCkkLEzXNRTU,4
77
+ pylibms-4.3.2.dist-info/RECORD,,