-
Notifications
You must be signed in to change notification settings - Fork 263
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
Token Footprint Functions and Campaign Properties #4886
base: develop
Are you sure you want to change the base?
Token Footprint Functions and Campaign Properties #4886
Conversation
Macro Functions Improved (Get All Footprints for All Grids, Get All Footprints for One Grid, Get One Footprint from One Grid) Campaign Properties Initialise Default Footprints on New Campaign
Adding and Removing new Footprints Resetting Footprints to Default Localized Footprint Name for Token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really needs a UI, functionality like this shouldn't be locked behind macros, also going by past experience macro only functions don't get tested until its too late to change anything if its broken,
src/main/java/net/rptools/maptool/model/CampaignProperties.java
Outdated
Show resolved
Hide resolved
src/main/java/net/rptools/maptool/model/CampaignProperties.java
Outdated
Show resolved
Hide resolved
src/main/java/net/rptools/maptool/model/CampaignProperties.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really needs a UI, functionality like this shouldn't be locked behind macros, also going by past experience macro only functions don't get tested until its too late to change anything if its broken,
The tests this fails will also need to be fixed up |
Remove Grid.loadFootprints (commented for now) Remove uses of Grid.loadFootprints (commented for now) Move FootprintToJSON Comment Cleanup Fixed Dev Env Mistakes Attempted fix of RPTools#4856
Agreed on the UI front, but it's not something I'm very good at, so since @bubblobill offered to do the GUI in #4849 if I got the backend, this PR is solely for backend enablement of the incoming GUI portion. On the tests failing: I've taken a look and can't see anything obvious between what I've changed and which tests fail |
Taking a quick look my guess would be the calls to CampaignProperties.loadFootprints(), the XML probably not loading correctly as its getting xstream errors. Try remove the localizedName in the classe (which shouldn't be saved anyway) and see if that fixes the issue. Or if you need that variable put transient in front of it so it is not persisted you can run the tests locally with .\gradlew.bat test. (or ide) to test |
I noticed you didn't include the grid type "isometric hex". One day someone is going to implement it beyond including it in the code add as an option. :) |
Thanks for volunteering... Just know I believe in you @bubblobill :) |
Okay, its definitely the footprint loading - removing the localizedName variable or making it transient didn't make a difference, but omitting all the calls to footprint loading from the initFootprints step did. Not sure what to try next. At any rate: the reason for my choices with localizedName existing separate to name is to allow for a framework to define sizes/footprints and have the display/localized name overwritten freely by someone else without effecting ability to address footprints by their "true" name - and also not having to make said localization dependant on MapTool - though it does work on the assumption that servers and clients are working in the same locale. |
There is probably no good reason to have default footprints in external serialised files in any case, probably just make classes with the default values
This is not a hreat assumption though there will be cases where client is different from server. Really it should be something that is localised within MT and users don't need to localise themselves |
including localizations for every possible word/phrase people might choose to name a token size? |
Ah gotchya, it's a super supplied name? Then that is fine |
Okay, so excising the XML based defaults and replacing with code based works fine and tests pass. However I've noticed that some footprints on hex grids are busted, and I can't see how my changes effect this |
There are about 5 principal methods of referencing grids, each with a zillion variants. The one we use is probably the least useful for compatibility and interoperability between grid types with the possible exception of polar coordinates. |
Didn't someone recently fix something relating to footprints? Maybe in #4830? |
It's definitely something related to my changes - |
Swap your vertical and horizontal hex logic. |
I did some quick tests - looks like they originate from the point at the centre of the relative x/y rectangle bounding box. Fundamentally I agree, but unsure if I want to get into extending footprints with that functionality at this point. At any rate, I solved my offset grid issues and will open a new issue proposing changes to hex grid coordinate systems. |
Minor annoyance - you cannot set the canonical name for a footprint, only the localised name. |
That's something of a consequence of my choice to use the canonical name as the key for the map as well - the only way to do it would be to remove the existing named footprint and replace with an almost identical footprint. |
Footprint functions:
|
Can be consolidated once the code settles down.
Some Feedback: |
It is already supposed to do that
Supposed to ensure unique names. Been redone a few times and I got distracted so it's probably between two different implementations
Not sure if it's connected yet, but Functionality is supposed to be:
The clicking:
|
Sort button now allows reordering list. Took out the cell selecting cleverness.
…rid visibility. A bunch of refactoring such as moving FootprintManager into the dialog code and its utility methods to FootPrintToolbox Added zoom control buttons back in to layered pane
Since there were no earth-shattering changes required in the Discord discussion, and nobody saw fit to dispute my unilateral decision making, I think we should be pushing this forward. Copy of those unilateral decisions Resurrecting this because I really want the editable footprints. Firstly, disambiguation:
Secondly, Properties of a FootprintOrigin Cell:
Defaults
Optional Points
Unilateral DecisionNo more integers - I am tired of rounding errors screwing things up. |
@bubblobill - I agree with basically all you've put forth, but am unsure whether any are worth pursuing immediately under this PR, or whether they should be postponed as a later enhancement |
More a roadmap for the future and design guide. |
Identify the Bug or Feature request
Basic Implementation of #4849, submitted for review
Description of the Change
Moves Token Footprints from being Static and Part of Campaign Properties.
MTScript functions for getting and setting Footprints
Possible Drawbacks
Initial naive implementation, possibly with some weirdness from my dev environment
Documentation Notes
getTokenFootprints()
getTokenFootprints(gridType)
getTokenFootprints(gridType, footprintName)
getGridTypes()
getFootprintNames()
getFootprintNames(gridType)
removeTokenFootprint(gridType, footprintName)
setTokenFootprint(gridType, footprintName, JSONFootPrintData)
resetFootprintsToDefault()
Release Notes
Custom Token Footprint Support
This change is