View Issue Details

IDProjectCategoryView StatusLast Update
0003879Spring engineLuapublic2017-08-21 16:26
ReporterPepeAmpere Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version94.1.1+git 
Summary0003879: widget:MouseRelease() callin standalone
DescriptionIts not possible to catch callins of widget:MouseRelease without use of widget:MousePress at the same time in the same widget - which eats the MousePress callin for rest of the game.

Why is MouseRelease dependable on use of MousePress, but KeyRelease doesnt depend on KeyPress? Is it some speedup/optimalization?

I would like to let it work like the KeyPress/Release.

I think i can uderstand the duality (dependance) of callings, but i dont uderstand the blockade of callin for other widgets.

I think its normal situation that there are more widgets reacting on the same event. Why it is not possible here?
Steps To Reproducefunction widget:MousePress()
    Spring.Echo("Imma pressed!")
    return true
end

function widget:MouseRelease()
    Spring.Echo("Imma released!")
end
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

jK

2013-07-04 00:32

developer   ~0010957

when you press a button on a GUI you don't want that e.g. custom formations gives units a command on the worldpos behind that button

PepeAmpere

2013-07-04 02:32

reporter   ~0010958

Thx for response.

Yes, i understand this - the option to catch the callin for rest of the widgets, but theres no way how to use MouseRelease without this option used.

Do you plan to make MousePress/MouseRelease similar to KeyPress/KeyRelease?

Is there any problem to do it this way?

PepeAmpere

2013-07-04 02:46

reporter   ~0010959

Last edited: 2013-07-04 02:47

Btw I need it for this application:

Im interested in list of units under selection just in the moment player Release the mouse button when area-selecting units.

My idea was to use:

widget:MouseRelease() + Spring.GetSelectedUnits

I want to use this units list at least in two or three new widgets.

jK

2013-07-05 07:17

developer   ~0010966

saying it the x'ed time: you are doing it wrong
rethink it again with what I said and what it means for you and maybe you will see where your logic error is

PepeAmpere

2013-07-07 20:15

reporter   ~0010986

jk, my idea doesnt kill the ability to use it the way you described in example. There still can be an option to avoid clicks on GUI (not much different from current one), but with current setup im not able to use MouseRelease.

All my responses takes in consideration what you said. I still see no problem, maybe your counterexample was not described enough.

sprung

2017-06-21 16:23

reporter   ~0017856

This is doable as-is. The default widget handler only allows 1 widget to receive the callin but a game has control over its WH and can rewrite mouse event handling.

PepeAmpere

2017-08-21 16:22

reporter   ~0018235

Ok, this answer makes sense for me. I didn't know I can completely change exactly this in WH.

Issue History

Date Modified Username Field Change
2013-07-03 21:45 PepeAmpere New Issue
2013-07-04 00:32 jK Note Added: 0010957
2013-07-04 02:32 PepeAmpere Note Added: 0010958
2013-07-04 02:46 PepeAmpere Note Added: 0010959
2013-07-04 02:47 PepeAmpere Note Edited: 0010959
2013-07-05 07:17 jK Note Added: 0010966
2013-07-05 20:32 abma Severity block => minor
2013-07-07 20:15 PepeAmpere Note Added: 0010986
2017-06-21 16:23 sprung Note Added: 0017856
2017-08-21 16:22 PepeAmpere Note Added: 0018235
2017-08-21 16:26 Kloot Status new => closed
2017-08-21 16:26 Kloot Resolution open => no change required