[A16] Mine It All

Started by rshingleton, December 21, 2016, 12:10:41 AM

Previous topic - Next topic

rshingleton

Based on  [A15] VeinMiner [] Mine all the veins! []kaptain_kavern & Gentz & JuliaEllie 
Original Thread: https://ludeon.com/forums/index.php?topic=9616.0
-------------------------------------------------------------------------------------------------
Description:
This is a redux of the VeinMiner by Julia Ellie. I started as a similar project for A16, but realized I was recreating the wheel. I used the original VeinMiner solution and some additions from Rock5 in the other thread along with some clean up and (hopefully) optimization.

Please let me know if there are any issues!

Dropbox Download: https://www.dropbox.com/s/gde9ymeblw9w64i/MineItAll.zip?dl=0
Steam Workshop Link: https://steamcommunity.com/sharedfiles/filedetails/?id=821866381

-----------------------------------
----------------------
Right.....

MisterVertigo

Thanks for doing this, I'll check it out!
"In vertigo you will be..."

"Relax, people. It's a teeny indie game; don't kill it with love." - Bozobub

rshingleton

I updated the mod some, if anyone is running it, let me know if there are any issues.

I added some bootstrapping to remove the xml def files which will hopefully make it less likely to be overridden by other mods.
----------------------
Right.....

Rock5

I thought you fixed it but it still doesn't mark the vein if the ore is already marked. Here is a small video to show you what I mean.
https://vid.me/ehJ2
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

malloc

Thanks for the mod.  It's working great.

rshingleton

Quote from: Rock5 on December 24, 2016, 06:12:10 AM
I thought you fixed it but it still doesn't mark the vein if the ore is already marked. Here is a small video to show you what I mean.
https://vid.me/ehJ2

agh. I'll check it out again. I though I fixed it too. I'll look into it tomorrow after the holiday.
----------------------
Right.....

rshingleton

Quote from: Rock5 on December 24, 2016, 06:12:10 AM
I thought you fixed it but it still doesn't mark the vein if the ore is already marked. Here is a small video to show you what I mean.
https://vid.me/ehJ2

I'm getting it to work as intended, but I rebuilt and redeployed anyway. Make sure you download the latest and delete the old one before dropping it in just to be sure. I changed the brush mesh and icon textures on this one, so it should be easy to tell if you have the right version.
----------------------
Right.....

Rock5

#7
The brush texture is better and I can no longer see into mountains. And, hurray, I can now see the brush when fully zoomed in! That's great.

One downside to the new brush texture is that you can't see what's under it but I know the difficulty in trying to use transparency, so if this is how you have to do it, I can live with it.

There is only one problem left which I think should, in theory, be really easy to fix. It's the ability to "see" into mountains using the vein mine brush. You can see me doing it in the first part of this video. https://vid.me/aNiN. It makes a different sound depending on if there is an open area under the click point or not. I think you need to merge the 2 parts in CanDesignateCell into one so a failure results in only one type of failure message. Anyway, I'll leave you to figure it out.
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

Rock5

#8
After using this a while I still have a little bug that annoys sometimes. It's a bit random as to what size the minebrush will be when I click the designator.

I couldn't see a pattern to it at first but I finally decided to look at it more carefully and work out what the problem is. It turns out that not only does it resize the brush when the minebrush is already selected but also if other designators are already selected.

To make this more clear, this is how you reproduce the problem.
1. Select the MineBrush designator for the first time. It should be orbital beacon sized.
2. Clear the designator by right clicking.
3. Select any other designator then immediately select the MineBrush again. It appears as SuneLamp sized. It should still be Orbital beacon sized.

I had a go at fixing it. I opened minebrush.dll in ILSpy and changed Designator_Minebrush.cs as follows.

Changed line 80 from
            if (Find.DesignatorManager.SelectedDesignator != null && this.radius == 7.9f)
to
            if ( Find.DesignatorManager.SelectedDesignator != null && Find.DesignatorManager.SelectedDesignator.defaultLabel == "Mine Brush" && this.radius == 7.9f)
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

hurtavy

#9
May you add the "Vein" button, when the ore is selected, like in [A14] Veinminer?

[attachment deleted by admin due to age]

Haplo

Quote from: Rock5 on January 23, 2017, 03:47:15 PM
Changed line 80 from
            if (Find.DesignatorManager.SelectedDesignator != null && this.radius == 7.9f)
to
            if ( Find.DesignatorManager.SelectedDesignator != null && Find.DesignatorManager.SelectedDesignator.Label == "Mine Brush" && this.radius == 7.9f)
This solution has one big flaw: It won't work in a language other than english ;D
Better would be to use the DefName as that stays always the same..
Sorry, I'm not at my computer right now, so can't tell the correct variant. But it is most likely something like this:

Find.DesignatorManager.SelectedDesignator.def.defName == "MineBrush"


CJoker3221

Quote from: hurtavy on January 24, 2017, 02:47:37 AM
May you add the "Vein" button, when the ore is selected, like in [A14] Veinminer?
Oh yes, I remembered that one, its so much convenient then heading towards the menu to veinmine.
Yes, call me lazy, but I like it this way :p

Rock5

Quote from: Haplo on January 24, 2017, 03:37:05 AM
Quote from: Rock5 on January 23, 2017, 03:47:15 PM
Changed line 80 from
            if (Find.DesignatorManager.SelectedDesignator != null && this.radius == 7.9f)
to
            if ( Find.DesignatorManager.SelectedDesignator != null && Find.DesignatorManager.SelectedDesignator.Label == "Mine Brush" && this.radius == 7.9f)
This solution has one big flaw: It won't work in a language other than english ;D
Better would be to use the DefName as that stays always the same..
Sorry, I'm not at my computer right now, so can't tell the correct variant. But it is most likely something like this:

Find.DesignatorManager.SelectedDesignator.def.defName == "MineBrush"

Actually that's the first thing I found, a reference to .def.defName, but when I tried typing .def after it it didn't auto complete it. As if it didn't have a member called .def. I'll check it again.
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

Rock5

I couldn't get .def.defname to work but .defaultLabel should work because it's hard coded in the mod to "Mine Brush". I'll change my post above to reflect this.
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

Rock5

#14
rshingleton doesn't seem to be active at the moment and I just finished making some awesome changes to this version of the mod. So I thought I'd share.

Here is a list of the fixes and changes:
- Fixed MineBrush size selection when clicking the designator.
- Fixed being able to use the VeinMiner to detect hidden empty paces in mountains.
- More accurate MineBrush radius increments.
- Added radius number to MineBrush mouse pointer because, why not.
- Added note about sunlamp size and beacon size to MineBrush pointer.
- Changed MineBrush designator circle to regular round designator selector.

Mainly it's changes to MineBrush and a few other fixes. I'm quite proud of being able to change it to the regular circle selector. It wasn't easy. Typically this selector isn't visible over mountains so was of no use to us but I've figured out how to do it. :) Here's a pic.

Update for B19 by Velc[JP] available on Steam
https://steamcommunity.com/sharedfiles/filedetails/?id=1204987547

Download including source
[attachment deleted by admin due to age]
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport