Jump to content

Disable multi click with mouse for unit selection - stopclick mod


go2die
 Share

Recommended Posts

How to remove double click and triple click unit selection please? Looks like hardcoded - why? wil you fix in 024?

 

I was looking in default.cfg and user.cfg but nowhere possible to set.. WHY? when we have hotkeys almost for everything? Is it going to be addressed in future version please?

Edited by go2die
;-)
Link to comment
Share on other sites

Maybe there are players like me who wanted disable those double click and triple click on units - as they have already selections done by autociv and this is not possible to remove from configuration files easily. @nani maybe good idea for nani to implement in autociv (as selectable or binding another activity on it but looking into input.js it will be more difficult)

 

Here is mod i created for you guys! If you like it crush that "love me" button

stopclick_0.1.0.zip

 

Just get this mod and do the same as in case you would be using my custom rating mod (

just make this mod as last or at least after fgod or autociv if you use them.

any feedback welcomed

2020-11-01_01-06.thumb.png.11d5d4a84b1b489b0b63573d438fec0f.png

Edited by go2die
  • Like 1
Link to comment
Share on other sites

  • go2die changed the title to Disable multi click with mouse for unit selection - stopclick mod

Unfortunately input.js has these two gigantic functions that are hard/impossible to modify without breaking other mods changes.

Instead of overriding the function it would be better to wrap the old one and change the input event "ev"  clicks to always 1 for when the state is INPUT_SELECTING, ev.type is "mousebuttonup" and ev.button is SDL_BUTTON_LEFT and pass this new modified event , still ugly.

Input.js should've been refactored long ago to a state machine, I did a refactor + some bug fixes here https://code.wildfiregames.com/D1786 but review stalled and it never went anywhere

  • Thanks 1
Link to comment
Share on other sites

releasing bugfix - first version was ignoring buildings (which we want to have  supported for multiple click selection) only units are ignored now

 

 

stopclick_0.2.0.zip

 

known issues:

- skiritai units of spartan will be selectd for 2x or triple click (no idea why they don't have template as other units/  it seems  not to be consistent)

Edited by go2die
Link to comment
Share on other sites

21 hours ago, m7600 said:

Could you give an example? I wasn't aware of that problem.

There is no example the problem are the functions on itself, they do too much so if somebody changes some part and some other want to change another part you just cant have both

Link to comment
Share on other sites

20 hours ago, go2die said:

releasing bugfix - first version was ignoring buildings (which we want to have  supported for multiple click selection) only units are ignored now

 

 

stopclick_0.2.0.zip 4 kB · 3 downloads

 

known issues:

- skiritai units of spartan will be selectd for 2x or triple click (no idea why they don't have template as other units/  it seems  not to be consistent)

triple click will select same template units with same rank, skiris default is rank 3

Link to comment
Share on other sites

@nani I agree that function handleInputBeforeGui(ev, hoveredObject) and function handleInputAfterGui(ev) are a bit lengthy (I assume you're talking about these). They have a lot of switches and cases. Do you think that using classes or some other object-oriented approach would be better? (I haven't taken a good look at your proposal for refactoring, just glanced over it kind of quickly, but I'll look into it later).

Link to comment
Share on other sites

10 hours ago, go2die said:

My mod breaks autociv functionality at some way.. so still not use it seriously it is very alfa ... just find it out :beta:

 

On 01/11/2020 at 1:24 AM, nani said:

Unfortunately input.js has these two gigantic functions that are hard/impossible to modify without breaking other mods changes.

Instead of overriding the function it would be better to wrap the old one and change the input event "ev"  clicks to always 1 for when the state is INPUT_SELECTING, ev.type is "mousebuttonup" and ev.button is SDL_BUTTON_LEFT and pass this new modified event , still ugly.

:(

Link to comment
Share on other sites

I'm giving up this mod for autociv support, it is at least very hard to amend code to work appropriate. It would be patch onto patch. You can use it but without autociv (which probably is not the case as  is the most useful mod ever). So simple idea to remove double or triple click from unit selection is not that easy as I was thinking... 

Edited by go2die
Link to comment
Share on other sites

On 01/11/2020 at 1:24 AM, nani said:

Unfortunately input.js has these two gigantic functions that are hard/impossible to modify without breaking other mods changes.

Instead of overriding the function it would be better to wrap the old one and change the input event "ev"  clicks to always 1 for when the state is INPUT_SELECTING, ev.type is "mousebuttonup" and ev.button is SDL_BUTTON_LEFT and pass this new modified event , still ugly.

Input.js should've been refactored long ago to a state machine, I did a refactor + some bug fixes here https://code.wildfiregames.com/D1786 but review stalled and it never went anywhere

@nani if we go deep into details it would not work as we want to set ev always 1 ;-) because we want to have selection of buildings, only not infantry .-)

Link to comment
Share on other sites

10 minutes ago, wraitii said:

Mh, I guess we could somewhat easily add a config option to enable/disable this behaviour.

 

Out of curiosity, what is your problem with this feature?

Problem is I can't use it with autociv together (which i want) because as @nani mentioned above it breaks its functionality due to those 2 functions which needs to be edited due to not easy way how to "change it" but if new 024 will count with this by default that we can decide regarding disabling 2xclick or 3xclick feature to select units (infantry) many player will be happy. Please keep choice also for buildings as separate choice (it is on other hand very usefull).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...