[Feature]: Add setMapLightingStyle() Function and Ability to Set other Map Settings via Macros

Open
#6,042 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
desktop, game-dev

Research direction

This is a feature request to expose existing map properties as macro functions, matching the keys already accepted by createMap() (lighting style, vision type/distance, grid, fog, visibility, assets, and so on). Start by locating how createMap() and current map macros are implemented and how lighting style is applied in the UI, then add setters that update an existing map the same way. Done means macros can change those settings without duplicating lights, with behavior aligned to the menu toggles. No source paths are named in the issue.

Written by the indexing model from the issue text.

Description

feature
Describe the Problem

(Just following the example suggested here, lol):

"I'm always frustrated when..." I go to toggle a setting that can be toggled via menus, but there isn't a macro function() that can do the same thing.

Case in point is various Map settings, such as Lighting Style, Vision Distance, and Grid Settings.

The Solution you'd like

I would like to be able to change map aspects via macro functions. Maybe something like setMapLightingStyle() as one example (and, in my particular case, the most significant, since I'm unable to adjust scene data that would look better toggling between map lighting styles based on time-of-day changes).

Would actually be nice if ALL of the variables that can be used in the createMap() function could have associated macro functions() to allow adjusting them on an existing map:

    "display name", "Display Name",
    "player visible", json.true,
    "vision type", "NIGHT",
    "vision distance", 600,
    "lighting style", "OVERTOP",
    "has fog", json.true,
    "ai rounding", "CELL_UNIT",
    "grid", json.set("{}",
            "type", "Square",
            "color", "#FF0000",
            "units per cell", 20,
            "size", 200,
            "x offset", 7,
            "y offset", 11
    ),
    "background paint", "asset://c93660c09e3d3f9aff04df49a6c594b4",
    "map asset", "asset://014aaa10a10b5ddcbbe006f3c22188c2"
Alternatives that you've considered.

I've considered writing scripts that would cycle through all the lights on a map and set to them to a dimmer or brighter variant to mimic what happens when toggling the Map Lighting Style between Environmental and Overhead. While the actual scripting wouldn't be crazy complex, it requires duplicate light entries for an effect that's already baked into MapTool.

Additional Context

No response

Dominant language
Java
Stars
927
Forks
286
Avg merge
3d 17h
Merged PRs (30d)
94

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RPTools/maptool

All issues in RPTools/maptool

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.