Skip to content

Use memedit to improve code relying on highlighted tile #204

@Lemonymous

Description

@Lemonymous

Functions mouseTile and mouseTileAndEdge which convert mouse position to tile position, is approximating which tile is being highlighted. While this approximation is good, it is not 100% between tiles. Memedit is used for Board.GetHighlighted and Board.IsHighlighted to make them perfectly accurate, matching when the game considers a tile highlighted by the mouse cursor.

Default mod loader functions:

Modified memedit functions:

Memedit does not change mouseTile or mouseTileAndEdge, so everything that uses these functions instead of Board.GetHighlighted or Board.IsHighlighted will not use memedit, and will therefor remain inaccurate, even when memedit is enabled.

mouseTile is used in:

mouseTileAndEdge is used in:

  • modApiExt
    • modApiExtHooks:updateTiles for dispatching events:
      • modapiext.events.onTileDirectionChanged
      • modapiext.events.onTileUnhighlighted
      • modapiext.events.onTileHighlighted

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions