Jump to content

Help me please (I'm a complete newbie)

- - - - -

  • Please log in to reply
No replies to this topic

#1
ggyo

ggyo

    Newbie

  • Members
  • Pip
  • 2 posts
Hi. I have the source code for a plugin to a certain game that lets me play with a different mouse speed on the game. How should I go about adding code so that the plugin also disables mouse acceleration? Can someone help me create such code?

Here is the original plugin: (.pas file)
  procedure SaveMouseSettings;
  var ini:TRegistryInifile;
  begin
   ini:=nil;
   try
     ini:=TRegistryInifile.create('Software\Chaosplugin');
     ini.WriteInteger('Mouse','SavedSpeed',GetMouseSpeed);
   finally
     ini.free;
   end;
  end;

var activate:boolean;
begin
  Activate:=ScActive and Settings.DifferentMousesettings and (Settings.Mousespeed>0);
  if Settings.MousesettingsFullscreenOnly and (Screen.Width>640)and(Screen.Height>480)
    then Activate:=false;
  if active=activate then exit;
  RestoreMouseSettings;
  if Activate
   then begin
     SaveMouseSettings;
     SetMouseSpeed(Settings.MouseSpeed);
   end;
  active:=activate;
end;

procedure MouseSettingsTimer;
begin
  UpdateMouseSettings;
end;

procedure MouseSettingsFinish;
begin
  MouseSettingsTimer;
end;

initialization
 RestoreMouseSettings;
 AddTimerHandler(MouseSettingsTimer,[pmLauncher]);
 AddFinishHandler(MouseSettingsFinish,[pmLauncher]);
finalization
 RestoreMouseSettings;
end.

Edited by WingedPanther, 18 May 2010 - 07:00 AM.
add code tags (the # button)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users