Unbind crosshair from mousescrollbutton - Page 4

Unbind crosshair from mousescrollbutton

Please use this forum to set up matches and discuss played games.

Moderator: Moderators

SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Unbind crosshair from mousescrollbutton

Post by SirMaverick »

As pointed out that there might be problems when not saving values by default immediately, but adding a non mandatory option if a SetConfig call will result in file write or not would help.
Many (not all) options should be changable in game (without restart), like the new MouseDragScrollThreshold.
zwzsg wrote:(assuming setting change and crash are linked)
Was there ever a bug that was only caused by changing a setting (e.g. not when you just use the new setting)?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Unbind crosshair from mousescrollbutton

Post by aegis »

SirMaverick wrote:
zwzsg wrote:(assuming setting change and crash are linked)
Was there ever a bug that was only caused by changing a setting (e.g. not when you just use the new setting)?
the crash could happen for a reason unrelated to the setting. his specific example, was a widget enabled bumpwater and saved it, but the setting crashed spring... so spring probably crashed on launch in future until he disabled bumpwater.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Unbind crosshair from mousescrollbutton

Post by lurker »

An option to write the config or not seems inherently buggy. An option to make a config change temporary would work better, and wouldn't take much code to support.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Unbind crosshair from mousescrollbutton

Post by zwzsg »

aegis wrote:
SirMaverick wrote:
zwzsg wrote:(assuming setting change and crash are linked)
Was there ever a bug that was only caused by changing a setting (e.g. not when you just use the new setting)?
the crash could happen for a reason unrelated to the setting. his specific example, was a widget enabled bumpwater and saved it, but the setting crashed spring... so spring probably crashed on launch in future until he disabled bumpwater.
Yeah. Also, setting the setting and saving it are one single action.

And I should probably mention I'm draydreaming about writing a widget to display an option/setting menu, so that end-users don't have to use SpringSettings.exe. But considering wrong settings can make Spring crash, I need to think of a way to recover from bad settings even if I'm limiting the only way to set setting to be within Spring. So either delayed savings, to only save setting that we're sure work, or some sort of "Spring didn't end properly last time, do you want to revert to safe settings?" popup.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Unbind crosshair from mousescrollbutton

Post by hoijui »

values are always read from memory (except once, at game start, of course). they are always directly written to file and memory, when changed. the new thing would allow to only write to memory, but not file.

eg:

Code: Select all

bool forThisGameOnly = true;
configHandler->SetValue("key", "newValue", forThisGameOnly);
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Unbind crosshair from mousescrollbutton

Post by CarRepairer »

zwzsg wrote:And I should probably mention I'm draydreaming about writing a widget to display an option/setting menu, so that end-users don't have to use SpringSettings.exe.
It's kind of funny the timing you have, I just did this yesterday.

http://trac.caspring.org/changeset/8126
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Unbind crosshair from mousescrollbutton

Post by Tobi »

hoijui wrote:values are always read from memory (except once, at game start, of course). they are always directly written to file and memory, when changed. the new thing would allow to only write to memory, but not file.

eg:

Code: Select all

bool forThisGameOnly = true;
configHandler->SetValue("key", "newValue", forThisGameOnly);
Take care to store this new value separately from the value that should be written to file, when the file is written. (Or modify the read-modify-write cycle so it will always be excluded from modify when the last call to SetValue changed it for this game only.)

Otherwise it would still get written when another setting is changed that should be saved to file.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Unbind crosshair from mousescrollbutton

Post by hoijui »

i made some commits. Config overlay is now fully implemented (that is, setting stuff only in memory), Available to Lua (see *Overlay parameters):
http://springrts.com/wiki/Lua_UnsyncedC ... ine_Config

And changing "MouseDragScrollThreshold" config value takes effect immediately.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Unbind crosshair from mousescrollbutton

Post by zwzsg »

I would like a Lua code excerpt to detect that the mouse is in "crosshair" mode, and if so switch it back to normal free moving cursor.

(Because HOMF can't work with crosshair mode.)

Spring.SendCommands({"mousestate"}) appears to do nothing, I can't find anything about that crosshair mode in Spring.GetCameraState(), can't find it in settings either. Spring.SetConfigInt("MouseDragScrollThreshold",0) prevent middle click from switching to crosshair more (good!) but if they player hits backspace, he's still screwed.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Unbind crosshair from mousescrollbutton

Post by CarRepairer »

SendCommand{unbind backspace}
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Unbind crosshair from mousescrollbutton

Post by ginekolog »

hoijui wrote:i made some commits. Config overlay is now fully implemented (that is, setting stuff only in memory), Available to Lua (see *Overlay parameters):
http://springrts.com/wiki/Lua_UnsyncedC ... ine_Config

And changing "MouseDragScrollThreshold" config value takes effect immediately.
Sounds great, how can i activate this?
Gouken
Posts: 35
Joined: 18 Aug 2010, 22:55

Re: Unbind crosshair from mousescrollbutton

Post by Gouken »

I use mousewheel click for camera movement, it is the most efficient way of moving around imo and I find it annoying when they go changing the crosshair to some chunky thing which gets in the way, should at least give us a choice between crosshairs
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Unbind crosshair from mousescrollbutton

Post by BrainDamage »

ginekolog wrote:
hoijui wrote:i made some commits. Config overlay is now fully implemented (that is, setting stuff only in memory), Available to Lua (see *Overlay parameters):
http://springrts.com/wiki/Lua_UnsyncedC ... ine_Config

And changing "MouseDragScrollThreshold" config value takes effect immediately.
Sounds great, how can i activate this?
/set MouseDragScrollThreshold -1
Gouken wrote:I use mousewheel click for camera movement, it is the most efficient way of moving around imo and I find it annoying when they go changing the crosshair to some chunky thing which gets in the way, should at least give us a choice between crosshairs
/set MouseDragScrollThreshold 0
or
/set MouseDragScrollThreshold 0.01
whichever works
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: Unbind crosshair from mousescrollbutton

Post by ginekolog »

BrainDamage wrote:
ginekolog wrote:
hoijui wrote:i made some commits. Config overlay is now fully implemented (that is, setting stuff only in memory), Available to Lua (see *Overlay parameters):
http://springrts.com/wiki/Lua_UnsyncedC ... ine_Config

And changing "MouseDragScrollThreshold" config value takes effect immediately.
Sounds great, how can i activate this?
/set MouseDragScrollThreshold -1

wohoo works great, now can I at last use awsome middle click scroll without fear of dreaded crosshair.

Thanx a lot, hoijui!
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Unbind crosshair from mousescrollbutton

Post by hoijui »

(i am so sure i never did such commits, or wrote that post...)
thanks :-)
Post Reply

Return to “Ingame Community”