Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/elevator map updates #255

Merged
merged 8 commits into from
Aug 17, 2023

Conversation

steven11sjf
Copy link
Contributor

Required for randovania/randovania#5070

Room names are updated to show where a transport goes (RDV-side change).
image

Minimap is updated to show destination region on the colored arrows from each transport.
Usable icon for the transport now shows the destination.
image

steven11sjf and others added 3 commits August 15, 2023 11:48
- The colored arrows and text showing destination region on transporters
  are now updated
- Elevator/Shuttle/Spaceball icons show the region/transporter they
  connect to (i.e. "TRANSPORT CAPSULE TO FERENIA - CENTRAL UNIT")
- Room names are updated to show transport destinations (randovania-side
  change)
- This depends on a sister branch in RDV, under
  steven11sjf/randovania : feature/dread-map-transport
- added a value for transport connection name to the schema
usable.sScenarioName = elevator["destination"]["scenario"]
usable.sTargetSpawnPoint = elevator["destination"]["actor"]
_patch_actor(editor, elevator)
_patch_minimap_arrows(editor, elevator)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's future proof this and avoid calling these functions if we're dealing with a Teleportal

coords: tuple[int, int]
disabled_id: str
prefix: str
offset: tuple[int, int] = (0, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you anticipate this field being used? if not, just remove it imo

class TransporterIcon:
default_icon_id: str
coords: tuple[int, int]
disabled_id: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo give this a default of ''

steven11sjf and others added 3 commits August 16, 2023 18:40
- new function gets the usable, checks if its type is a elevator, train
  or capsule, and returns the usable
- refactored TransporterIcon dataclass

class TransporterType(Enum):
ELEVATOR = "ELEVATOR"
TELEPORTER = "TELEPORTER"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be TRANSPORT and TELEPORTAL

default_icon_id="UsableElevator",
coords=(2,4),
prefix="ELEVATOR TO ",
disabled_id="DisabledElevator"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's best to have a trailing comma for things like this to keep diffs cleaner

return TransporterType.TELEPORTER, usable
else:
raise ValueError(f"Elevator {elevator['teleporter']['scenario']}/{elevator['teleporter']['actor']} "
"is not an elevator, shuttle, capsule or teleporter!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include the type of the usable in the error message too

try:
usable = actor.pComponents.USABLE
except AttributeError:
raise ValueError(f'Actor {elevator["teleporter"]} is not a teleporter')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "is not usable"

_patch_minimap_arrows(editor, elevator)
_patch_map_icon(editor, elevator)
else:
# TODO implement teleporter rando
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw in _patch_actor here for now, for the benefit of plando ppl

@duncathan
Copy link
Contributor

oh yeah also fix tests pls

- updated test json by removing most elevator entries and keeping one
  correct one for schema validation
- minor elevator.py fixes
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: -88.78% ⚠️

Comparison is base (a346609) 88.77% compared to head (3f5cbbd) 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #255       +/-   ##
==========================================
- Coverage   88.77%   0.00%   -88.78%     
==========================================
  Files          35      35               
  Lines        1897    1946       +49     
==========================================
- Hits         1684       0     -1684     
- Misses        213    1946     +1733     
Files Changed Coverage Δ
src/open_dread_rando/misc_patches/elevator.py 0.00% <0.00%> (-84.62%) ⬇️

... and 30 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


class TransporterType(Enum):
TRANSPORT = "TRANSPORT"
TELEPORTER = "TELEPORTER"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TELEPORTAL!!!!!!!
!!!

@duncathan duncathan added this pull request to the merge queue Aug 17, 2023
Merged via the queue into randovania:main with commit 6ffa64c Aug 17, 2023
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants