Page 4 of 4

Re: Unbind crosshair from mousescrollbutton

Posted: 25 Jun 2010, 18:26
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)?

Re: Unbind crosshair from mousescrollbutton

Posted: 25 Jun 2010, 18:59
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.

Re: Unbind crosshair from mousescrollbutton

Posted: 25 Jun 2010, 19:52
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.

Re: Unbind crosshair from mousescrollbutton

Posted: 25 Jun 2010, 19:58
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.

Re: Unbind crosshair from mousescrollbutton

Posted: 25 Jun 2010, 20:02
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);

Re: Unbind crosshair from mousescrollbutton

Posted: 26 Jun 2010, 07:55
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

Re: Unbind crosshair from mousescrollbutton

Posted: 26 Jun 2010, 11:54
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.

Re: Unbind crosshair from mousescrollbutton

Posted: 27 Jun 2010, 15:40
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.

Re: Unbind crosshair from mousescrollbutton

Posted: 21 Jul 2010, 21:40
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.

Re: Unbind crosshair from mousescrollbutton

Posted: 21 Jul 2010, 22:32
by CarRepairer
SendCommand{unbind backspace}

Re: Unbind crosshair from mousescrollbutton

Posted: 19 Aug 2010, 12:43
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?

Re: Unbind crosshair from mousescrollbutton

Posted: 19 Aug 2010, 19:34
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

Re: Unbind crosshair from mousescrollbutton

Posted: 19 Aug 2010, 23:36
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

Re: Unbind crosshair from mousescrollbutton

Posted: 20 Aug 2010, 16:52
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!

Re: Unbind crosshair from mousescrollbutton

Posted: 20 Aug 2010, 19:46
by hoijui
(i am so sure i never did such commits, or wrote that post...)
thanks :-)