PDA

View Full Version : Is it possible to override the Distance Suffix



ronnke
June 7th, 2022, 03:49
Is it possible to override the distance suffix field/control in the image window?

I would like to define a number of preset units that could be selected via a dropdown or similar.

Moon Wizard
June 7th, 2022, 22:34
It can be defined on a ruleset basis using Interface APIs.

Regards,
JPG

ronnke
June 8th, 2022, 04:03
It can be defined on a ruleset basis using Interface APIs.


Are you able to point me to some documentation. I've looked at the "ImageControl", "Interface", "Assets and Settings" API reference material and there doesn't appear to be anything related to the image subwindows, specifically how to override the distance suffix.

The image below shows the field/control I want to override. I would like to turn that into a dropdown with a number of preset values the GM can select from.

53055

celestian
June 8th, 2022, 05:06
Are you able to point me to some documentation. I've looked at the "ImageControl", "Interface", "Assets and Settings" API reference material and there doesn't appear to be anything related to the image subwindows, specifically how to override the distance suffix.

The image below shows the field/control I want to override. I would like to turn that into a dropdown with a number of preset values the GM can select from.

53055

Something along these lines probably

(this was an imagewindow)


window.image.setDistanceBaseUnits(sOldDistance);
window.image.setDistanceSuffix(sOldSuffix);


I can't point the the docs but thats what I used previously.

Mephisto
June 8th, 2022, 09:35
I might be wrong but I think the "gameelements.xml" controls this:



<distance>
<base>1</base>
<diagmult>1</diagmult>
<suffix>y</suffix>
</distance>

ronnke
June 8th, 2022, 09:48
I might be wrong but I think the "gameelements.xml" controls this:

I want something more like this:



<distance>
<base>1</base>
<diagmult>1</diagmult>
<suffix>ft</suffix>
<suffix>yd</suffix>
<suffix>m</suffix>
<suffix>mi</suffix>
<suffix>AU</suffix>
<suffix>ly</suffix>
<suffix>pc</suffix>
</distance>

celestian
June 8th, 2022, 15:05
I want something more like this:



<distance>
<base>1</base>
<diagmult>1</diagmult>
<suffix>ft</suffix>
<suffix>yd</suffix>
<suffix>m</suffix>
<suffix>mi</suffix>
<suffix>AU</suffix>
<suffix>ly</suffix>
<suffix>pc</suffix>
</distance>


You would need to create your own UI to display the allowed units and then use the method I mentioned above to set them after selection. At least that's where I would start.