Page 1 of 2

Prospector v1.9

Posted: 10 Jan 2009, 10:07
by Evil4Zerggin
Prospector

This widget calculates the amount of metal a mex will extract when you're about to build it. Doesn't account for spots being already occupied. Nothing fancy. May optimize/merge into another widget later.

Version History:

v1.9
Now displays extraction pre-game when metal map is on instead.

v1.8
Fixed bug where pregame circle was not being drawn level with the ground.

v1.7
Now displays extraction pre-game when Shift is held.

v1.4
Hack to get around broken gl.GetTextWidth. Tooltips should have properly-sized backgrounds now.

v1.2
Fixed for new Spring, a few optimizations.

v1.1
Fixed for even footprints.

v1.0
First forum release.

Get it from caspring: http://trac.caspring.org/browser/trunk/ ... pector.lua

Dev Notes
As with all my widgets, several of the major config variables are at the top.

Pregame extraction display looks for a unitname="armmex". If there is no such mex, it uses the weakest mex (i.e., lowest positive extractsMetal).

Re: Prospector v1.0

Posted: 10 Jan 2009, 12:40
by BaNa
cool pies! I've gotten used to the widget that tells you how much m you reclaim, this will be just as indispensable.

Re: Prospector v1.0

Posted: 10 Jan 2009, 18:54
by manolo_
nice idea, but the background of the font isnt used for the whole length of the font

Re: Prospector v1.0

Posted: 10 Jan 2009, 20:08
by Evil4Zerggin
Yeah, the background thing is a bit wierd; I'm already making its width equal to gl.GetTextWidth times a correction factor, but the necessary correction factor seems to vary from machine to machine. In any case, you can change TEXT_CORRECT_X in the file itself to change the background width (I think Licho used 2.1, while 1.75 works on my current machine).

Re: Prospector v1.0

Posted: 10 Jan 2009, 21:13
by TheFatController
I haven't tried it so not sure if its a big deal or not but you could probably cache the result of 'IntegrateMetal' and update it a few times a second rather than each frame, looks good tho :)

Re: Prospector v1.0

Posted: 10 Jan 2009, 21:43
by Evil4Zerggin
Yeah, it's a pretty unoptimized widget. I'd probably put in a MouseMove callin, check if I need to update, and cache the result. Maybe after I finish working on SWIW's weapon CEGs :p

Re: Prospector v1.0

Posted: 11 Jan 2009, 01:28
by FLOZi
What about S44's CEGs!? :mrgreen:

Re: Prospector v1.0

Posted: 11 Jan 2009, 09:13
by Hoi
WZ 1v1 Flozi to determinate on who's cegs zerg works on :P

Re: Prospector v1.1

Posted: 12 Jan 2009, 21:11
by Evil4Zerggin
Fixed for mexes with even footprints.

As for CEGs, the later you get your CEGs, the more experience I'll have by then :p

Re: Prospector v1.2

Posted: 14 Jan 2009, 03:56
by Evil4Zerggin
Fixed for new Spring; unitDef.ysize got renamed to unitDef.zsize. Also a couple optimizations.

Re: Prospector v1.2

Posted: 14 Jan 2009, 04:07
by MidKnight
I can see this replacing easymetal...

Re: Prospector v1.4

Posted: 19 Jan 2009, 19:15
by manolo_
request:

situation: when u play an unknown map and u dont know what a metalspot gives as M-output(before choosing startpositions). with this lua u will see the m-output (for normal metal spots, not metal areas) while choosing the startpos.

Re: Prospector v1.7

Posted: 20 Jan 2009, 02:18
by Evil4Zerggin
Good idea. Done. Hold Shift pregame to see.

Re: Prospector v1.2

Posted: 20 Jan 2009, 18:08
by CarRepairer
MidKnight wrote:I can see this replacing easymetal...
No, they're two completely different things that can complement eachother.

Re: Prospector v1.7

Posted: 21 Jan 2009, 16:06
by manolo_
seems to be a bug there:

while holding shift (in the startpos-phase) the circle isnt on the right place

Re: Prospector v1.8

Posted: 21 Jan 2009, 20:32
by Evil4Zerggin
Ah, I see, it wasn't being drawn at ground level. Fixed.

Re: Prospector v1.8

Posted: 23 Jan 2009, 15:14
by R-TEAM
Hi,

can the shift key replaced with other key ?
It is a little bit confusing by fast scrolling [with shift pressed]

And btw. great Widget ;)

Regards
R-TEAM

Re: Prospector v1.9

Posted: 23 Jan 2009, 21:26
by Evil4Zerggin
I've changed it so that it displays automatically when you're looking at the metalmap pregame.

Re: Prospector v1.0

Posted: 14 Apr 2009, 22:31
by Forboding Angel
Hoi wrote:WZ 1v1 Flozi to determinate on who's cegs zerg works on :P
But the mod they must 1v1 in has to be one of emmanuel's mods.

Re: Prospector v1.9

Posted: 16 Apr 2009, 05:01
by Warlord Zsinj
En Garde!
Image