MMapper icon indicating copy to clipboard operation
MMapper copied to clipboard

Add background image support with modding fallback and UI toggle

Open Sunnyl75 opened this issue 8 months ago • 1 comments

This PR adds support for an optional background image on the map canvas.

Features:

  • Background image loads via the existing texture/modding system
  • User can toggle background image visibility from the Preferences > Graphics tab
  • Image is drawn beneath the map using a new render layer above the canvas

Technical Notes:

  • Image is named background-image.png
  • Respects modding fallback: first loads from modding directory if available
  • Does not rely on depth testing

Additional Info:

  • Adds showBackgroundImage setting to config
  • Adds backgroundImageCheckBox to the UI

Considerations/Limitations:

-Stretches the image between pre-defined room co-ordinates in order to match the background map I cropped. -These are arbitrary for my uses with the map I made, but could be given an 'official' range if you think it's useful generally. -The image I supplied isn't necessary - could be a transparent background-image.png in Pixmaps. Then it only loads if in modding folder and toggled.

Tested on macOS with both default and custom background images.

Let me know if any adjustments are needed!

Sunnyl75 avatar May 14 '25 00:05 Sunnyl75

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.05%. Comparing base (c59476e) to head (a4c60ba). Report is 60 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
- Coverage   68.77%   67.05%   -1.73%     
==========================================
  Files          84       85       +1     
  Lines        4029     4107      +78     
  Branches      249      249              
==========================================
- Hits         2771     2754      -17     
- Misses       1258     1353      +95     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 15 '25 21:05 codecov[bot]