From: <rds...@us...> - 2007-12-11 05:03:45
|
Revision: 418 http://planeshift.svn.sourceforge.net/planeshift/?rev=418&view=rev Author: rdschulz Date: 2007-12-10 21:03:50 -0800 (Mon, 10 Dec 2007) Log Message: ----------- - fix BT#2883 - change shortcut numbers to start with 1 everywhere (old 0-based in shortcutcommands.xml still read and translated). Modified Paths: -------------- trunk/docs/history.txt trunk/src/client/gui/shortcutwindow.cpp Modified: trunk/docs/history.txt =================================================================== --- trunk/docs/history.txt 2007-12-11 03:50:21 UTC (rev 417) +++ trunk/docs/history.txt 2007-12-11 05:03:50 UTC (rev 418) @@ -3,6 +3,8 @@ disabled when dead). - trying to fix FS#742. - fix temporary freeze of client when focus returns to client window. +- fix BT#2883 - change shortcut numbers to start with 1 everywhere + (old 0-based in shortcutcommands.xml still read and translated). *** 2007-12-10 by Michael Gist - Widgets now default to not scaling to client resolution. This means that Modified: trunk/src/client/gui/shortcutwindow.cpp =================================================================== --- trunk/src/client/gui/shortcutwindow.cpp 2007-12-11 03:50:21 UTC (rev 417) +++ trunk/src/client/gui/shortcutwindow.cpp 2007-12-11 05:03:50 UTC (rev 418) @@ -470,6 +470,8 @@ csRef<iDocumentNodeIterator> iter = doc->GetRoot()->GetNode("shortcuts")->GetNodes(); + bool zerobased = false; + while ( iter->HasNext() ) { csRef<iDocumentNode> child = iter->Next(); @@ -477,6 +479,14 @@ if ( child->GetType() != CS_NODE_ELEMENT ) continue; sscanf(child->GetValue(), "shortcut%d", &number); + if(number == 0) + { + zerobased = true; + } + if(!zerobased) + { + number--; + } if (number < 0 || number >= NUM_SHORTCUTS) continue; names[number] = child->GetAttributeValue("name"); @@ -520,7 +530,7 @@ if (cmds[i].IsEmpty()) continue; parent = parentMain->CreateNodeBefore (CS_NODE_ELEMENT); - sprintf(temp, "shortcut%d", i); + sprintf(temp, "shortcut%d", i + 1); parent->SetValue(temp); if (names[i].IsEmpty()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |