Page 1 of 1

sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 10:11
by dansan
In BA 7.66 until (incl.) BA-test417

way to reproduce:
* queue a sonar with a con or the com with the shift-key pressed
* when the mouse (with the semi-transparent sonar) is moved once to several times over a built unit (tidal/mex/sea lab) it changes into a dragons eye

Re: sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 10:17
by klapmongool
dansan wrote:In BA 7.66 until (incl.) BA-test417

way to reproduce:
* queue a sonar with a con or the com with the shift-key pressed
* when the mouse (with the semi-transparent sonar) is moved once to several times over a built unit (tidal/mex/sea lab) it changes into a dragons eye
Lol that could explain why I made a dragon eye instead of sonar the other day. I thought i just misclicked it in the menu.

Re: sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 10:46
by very_bad_soldier
That actually is a feature of the widget cmd_context_build.lua.

It automatically changes the selected building to the appropriate one when moving mouse from water <-> land.

So when you select a land mex and move your mouse to a water mex spot it automatically changes to water mex.
klapmongool wrote: Lol that could explain why I made a dragon eye instead of sonar the other day. I thought i just misclicked it in the menu.
Hm that might happen in shallow water where it is possible to build sonar as well as dragon eye. I will exclude eye/sonar from that mechanism.

Re: sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 11:33
by dansan
very_bad_soldier wrote:That actually is a feature of the widget cmd_context_build.lua.

It automatically changes the selected building to the appropriate one when moving mouse from water <-> land.
It's triggered when mouse moves over a unit (floating unit?) inside the water.

Re: sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 16:04
by Niobium
The context build widget is poorly written, the main problem being that it permanently switches your build option each time, forgetting what you originally selected.

Here's a scenario:
- You want to build a sonar
- You select the sonar from the list
- By chance the the buildmenu is 'over' land, and so the context build widget immediately switches your building selection to the dragons eye
- Because dragons eyes can be build on land and water, any location is valid and thus it never switches back to the sonar that you originally clicked.

While you could rewrite the widget to not be fail, a better solution would be to merge each of the equivalent land/sea units into a single amphibious/floating unit, resulting in a tidier mod and removing the need for the widget in the first place.

Re: sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 16:39
by LulzTyphon
why would I want sonar to change to DT ?

just seems totally random and I already have a DT keybind :|

Re: sonar changes in q to dragon eye (7.66 - test417)

Posted: 23 Mar 2012, 21:51
by very_bad_soldier
Niobium wrote: While you could rewrite the widget to not be fail
The problem is that the dragon eye can be build everywhere and therefore it does not qualify to be used in that widget.
How can that be solved by a different widget implementation?