Reduce time till scrolling starts inthe about dialog; pressing shift/alt now causes faster/reverse scrolling (this is an insider trick and not documented on purpose :-)

svn-id: r16383
This commit is contained in:
Max Horn 2004-12-30 14:21:16 +00:00
parent 60deb4200b
commit f0d0ce7979
2 changed files with 13 additions and 3 deletions

View File

@ -28,7 +28,7 @@
namespace GUI {
enum {
kScrollStartDelay = 2500,
kScrollStartDelay = 1500,
kScrollMillisPerPixel = 80,
kXOff = 3,
@ -82,7 +82,7 @@ static const char *credits_intro[] = {
AboutDialog::AboutDialog()
: Dialog(10, 20, 300, 174),
_scrollPos(0), _scrollTime(0) {
_scrollPos(0), _scrollTime(0), _modifiers(0) {
int i;
@ -194,6 +194,12 @@ void AboutDialog::handleTickle() {
const uint32 t = g_system->getMillis();
int scrollOffset = ((int)t - (int)_scrollTime) / kScrollMillisPerPixel;
if (scrollOffset > 0) {
// Scroll faster when shift is pressed
if (_modifiers & OSystem::KBD_SHIFT)
scrollOffset *= 4;
// Reverse scrolling when alt is pressed
if (_modifiers & OSystem::KBD_ALT)
scrollOffset *= -1;
_scrollPos += scrollOffset;
_scrollTime = t;
@ -215,10 +221,13 @@ void AboutDialog::handleMouseUp(int x, int y, int button, int clickCount) {
}
void AboutDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
_modifiers = modifiers;
}
void AboutDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
close();
_modifiers = modifiers;
if (ascii)
close();
}

View File

@ -33,6 +33,7 @@ protected:
uint32 _scrollTime;
StringList _lines;
uint32 _lineHeight;
byte _modifiers;
public:
AboutDialog();