-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from construct import Construct, Container | ||
|
||
from mercury_engine_data_structures.formats import BaseResource, standard_format | ||
from mercury_engine_data_structures.game_check import Game | ||
|
||
BMMAP = standard_format.create('CMinimapData', 0x02000001) | ||
|
||
|
||
class Bmmap(BaseResource): | ||
@classmethod | ||
def construct_class(cls, target_game: Game) -> Construct: | ||
return BMMAP | ||
|
||
@property | ||
def items(self) -> Container: | ||
return self.raw.Root.mapItems | ||
|
||
@property | ||
def ability_labels(self) -> Container: | ||
return self.raw.Root.mapAbilityLabels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import Tuple | ||
from construct import Construct, Container | ||
|
||
from mercury_engine_data_structures.formats import BaseResource, standard_format | ||
from mercury_engine_data_structures.game_check import Game | ||
|
||
BMMDEF = standard_format.create('CMinimapDef', 0x02000001) | ||
|
||
|
||
class Bmmdef(BaseResource): | ||
@classmethod | ||
def construct_class(cls, target_game: Game) -> Construct: | ||
return BMMDEF | ||
|
||
@property | ||
def icons(self) -> Container: | ||
return self.raw.Root.mapIconDefs | ||
|
||
def add_icon(self, icon_id: str, uSpriteRow: int, uSpriteCol: int, | ||
sInspectorLabel: str, sDisabledIconId: str = '', | ||
vAnchorOffset: Tuple[int, int] = (0, 0), bAutoScale: bool = True, **kwargs): | ||
icon = Container() | ||
icon.uSpriteRow = uSpriteRow | ||
icon.uSpriteCol = uSpriteCol | ||
icon.sDisabledIconId = sDisabledIconId | ||
icon.sInspectorLabel = sInspectorLabel | ||
icon.vAnchorOffset = list(vAnchorOffset) | ||
icon.bAutoScale = bAutoScale | ||
for k, v in kwargs.items(): | ||
icon[k] = v | ||
|
||
self.icons[icon_id] = icon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from mercury_engine_data_structures.formats.bmmap import BMMAP | ||
from mercury_engine_data_structures.formats.bmmdef import BMMDEF | ||
from mercury_engine_data_structures.game_check import Game | ||
from test.test_lib import parse_and_build_compare | ||
|
||
|
||
def test_compare_bmmap_dread(dread_path): | ||
parse_and_build_compare( | ||
BMMAP, Game.DREAD, dread_path.joinpath("maps/levels/c10_samus/s010_cave/s010_cave.bmmap"), True | ||
) | ||
|
||
def test_compare_bmmdef_dread(dread_path): | ||
parse_and_build_compare( | ||
BMMDEF, Game.DREAD, dread_path.joinpath("system/minimap/minimap.bmmdef"), True | ||
) |