-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,18 @@ interface | |
|
||
type | ||
TMain = class(TForm) | ||
ApplyBtn: TButton; | ||
InstallBtn: TButton; | ||
CancelBtn: TButton; | ||
AboutBtn: TButton; | ||
XPManifest: TXPManifest; | ||
DbgMdCb: TCheckBox; | ||
DbgMdLbl: TLabel; | ||
UninstallBtn: TButton; | ||
procedure FormCreate(Sender: TObject); | ||
procedure AboutBtnClick(Sender: TObject); | ||
procedure ApplyBtnClick(Sender: TObject); | ||
procedure InstallBtnClick(Sender: TObject); | ||
procedure CancelBtnClick(Sender: TObject); | ||
procedure UninstallBtnClick(Sender: TObject); | ||
private | ||
{ Private declarations } | ||
public | ||
|
@@ -26,15 +28,26 @@ TMain = class(TForm) | |
|
||
var | ||
Main: TMain; | ||
SteamPath: string; | ||
|
||
implementation | ||
|
||
{$R *.dfm} | ||
|
||
procedure TMain.FormCreate(Sender: TObject); | ||
var | ||
Reg: TRegistry; | ||
begin | ||
Application.Title:=Caption; | ||
|
||
Reg:=TRegistry.Create; | ||
//Steam | ||
Reg.RootKey:=HKEY_CURRENT_USER; | ||
if (Reg.OpenKey('\Software\Valve\Steam', false)) then | ||
SteamPath:=StringReplace(Reg.ReadString('SteamPath'), '/', '\', [rfReplaceAll]); | ||
Reg.CloseKey; | ||
Reg.Free; | ||
|
||
DbgMdLbl.Caption:=DbgMdLbl.Caption + #13#10 + 'Windowed borderless fullscreen' + #13#10 + 'with lock to 30 FPS'; | ||
end; | ||
|
||
|
@@ -45,24 +58,18 @@ procedure TMain.AboutBtnClick(Sender: TObject); | |
'[email protected]', PChar(Caption), MB_ICONINFORMATION); | ||
end; | ||
|
||
procedure TMain.ApplyBtnClick(Sender: TObject); | ||
procedure TMain.InstallBtnClick(Sender: TObject); | ||
var | ||
Reg: TRegistry; | ||
SteamPath: string; | ||
Config: TStringList; | ||
Error: boolean; | ||
|
||
RenderWidth, RenderHeight, ScreenIndex: integer; | ||
IPD, DistortionK1, DistortionK2: double; | ||
begin | ||
Error:=false; | ||
Reg:=TRegistry.Create; | ||
//Steam | ||
Reg.RootKey:=HKEY_CURRENT_USER; | ||
if (Reg.OpenKey('\Software\Valve\Steam', false)) then | ||
SteamPath:=StringReplace(Reg.ReadString('SteamPath'), '/', '\', [rfReplaceAll]); | ||
Reg.CloseKey; | ||
|
||
Reg:=TRegistry.Create; | ||
//TrueOpenVR | ||
Reg.RootKey:=HKEY_CURRENT_USER; | ||
if Reg.OpenKey('\Software\TrueOpenVR', false) then begin | ||
|
@@ -133,7 +140,7 @@ procedure TMain.ApplyBtnClick(Sender: TObject); | |
end; | ||
|
||
if Error = false then | ||
Application.MessageBox('Done', PChar(Caption), MB_ICONINFORMATION); | ||
Application.MessageBox('Installed', PChar(Caption), MB_ICONINFORMATION); | ||
|
||
end else | ||
Application.MessageBox('Steam not found. Please install Steam and SteamVR', PChar(Caption), MB_ICONERROR); | ||
|
@@ -147,4 +154,14 @@ procedure TMain.CancelBtnClick(Sender: TObject); | |
Close; | ||
end; | ||
|
||
procedure TMain.UninstallBtnClick(Sender: TObject); | ||
begin | ||
if DirectoryExists(SteamPath) then begin | ||
if FileExists(SteamPath + '\config\steamvr.vrsettings') then | ||
DeleteFile(SteamPath + '\config\steamvr.vrsettings'); | ||
Application.MessageBox('Uninstalled', PChar(Caption), MB_ICONINFORMATION); | ||
end else | ||
Application.MessageBox('Steam not found. Please install Steam and SteamVR', PChar(Caption), MB_ICONERROR); | ||
end; | ||
|
||
end. |