Adds a box on-top with the current player coordinates.
Allows for 0-4 decimal places of precision.
This can be set through the coordinates.significantdigits setting in the config.lua file.
Can also toggle on and off z coordinates as well (It's displayed as a string for compatibility. Default off.)
Skuzzzy helped LOTS! Optimized my code as well as created the feature that allows changing of decimal places by clicking on it. (Added to my GitHub repository and this thread).
StanFear helped with pointing me in the right direction for making the z coordinates work! He makes the Subsurfaces mod. Thanks viewtopic.php?t=19178
ToDo
Allow smaller size coordinates. - Added in 1.3.0! Add compatibility with Subsurface mod - Added in 1.2.0!
Add in config button and menu
1.3.0 - 2016.03.07
- Changed: UI completely. Now transparent text.
- Removed: button functionality to change significant digits on the fly. (will add config button/menu).
- Added: option to specify if you want single or multiline (will make this better in future. Still keeps X & Y on same line for now.)
1.2.0 - 2016.03.07
- Added ability to show Z Coordinates (String instead of an int, to allow for mods)
- Added option in config file to enable/disable Z Coordinates (disabled by default)
- Changed default config for significant digits to 0
- Fixed MAJOR bug with the significant digits changing with ANY button click, regardless of which plugin.
1.1.0 - 2016.02.24
- Added: Clickable button to change precision (Thanks to Skuzzzy!)
- Simplified code (Thanks to Skuzzzy again!)
1.0.0 - 2015.10.17
- Added: config file
- Added: option to specify number of decimal places/significant digits
- Changed: version number convention
- Fixed: 0.12.11 support
0.12.0 - 2015.10.12
- Initial Release
Tell me what you think!
Re: [MOD 0.12.x] Coordinates
Posted: Mon Dec 21, 2015 12:12 am
by _Skuzzzy
Hi I have submitted a pull request for this mod to simplify some of the code.
Does it CHANGE any of the function?
Or is it a shorter way to write everything while keeping it the same?
Also, I was wondering if maybe you could help me with a feature that I couldn't figure out on my own yet.
Do you know how to make it so when you click on the button it changes how many decimal places it shows? so it would cycle from 0-->4 and back with every click?
No worries if not! Thanks again!
Re: [MOD 0.12.x] Coordinates
Posted: Mon Dec 21, 2015 3:40 am
by _Skuzzzy
Gergith wrote:Can you explain your code?
Thanks VERY much for the update!
Does it CHANGE any of the function?
Or is it a shorter way to write everything while keeping it the same?
Also, I was wondering if maybe you could help me with a feature that I couldn't figure out on my own yet.
Do you know how to make it so when you click on the button it changes how many decimal places it shows? so it would cycle from 0-->4 and back with every click?
No worries if not! Thanks again!
Hi, the update should maintain the same functionality of the mod, everything should stay the same, the code is just a little shorter.
See the changes here https://github.com/Gergith/factorio-coo ... ll/1/files
Instead of having 4 lines with hardcoded format strings, now the format string is generated from the significant digits, then used. Because you already guarantee that the number is within the bounds of 0 and 4, this maintains the same functionality.
As for the cycle functionality, I will look into it and see what I can find, if I figure it out I will make another pull request. I am just getting into modding myself (I program quite a lot but am not familiar with the mod API or Lua).
Re: [MOD 0.12.x] Coordinates
Posted: Mon Dec 21, 2015 7:13 am
by _Skuzzzy
I have added this functionality, it is with the rest of my pull request now. Could you merge it and repackage the releases? I was too lazy too, but I added the behavior you described.
_Skuzzzy wrote:I have added this functionality, it is with the rest of my pull request now. Could you merge it and repackage the releases? I was too lazy too, but I added the behavior you described.
Thank you so very muchly! I will update everything very shortly. Thanks for all your help.
Holidays are crazy! It's sad how excited I was to see the first time someone else submitted a pull request to commit code on my first github project. That's got to be some sort of internet/nerd achievement unlocked :p
Re: [MOD 0.12.x] Coordinates
Posted: Wed Dec 23, 2015 10:03 am
by ssilk
Hehe... Christmas wishing:
Could you add also a LuaStyle to the whole box to make it nice and small? And put X and Y in a separate line so that it is very narrow?
See Evo-GUI: https://forums.factorio.com/forum/vie ... 92&t=13837
To address both these requests below: I'll get to them quicker than the last update!
ssilk wrote:Hehe... Christmas wishing:
Could you add also a LuaStyle to the whole box to make it nice and small? And put X and Y in a separate line so that it is very narrow?
See Evo-GUI: https://forums.factorio.com/forum/vie ... 92&t=13837
Hopefully this should be no problem I'll get to it in the coming week or two though
You have to turn it on in the config file. Just set the value to true to have the menu show it
EDIT:
ssilk wrote:Hehe... Christmas wishing:
Could you add also a LuaStyle to the whole box to make it nice and small? And put X and Y in a separate line so that it is very narrow?
See Evo-GUI: https://forums.factorio.com/forum/vie ... 92&t=13837
I haven't EXACTLY done what you've asked... But i've MOSTLY done it