Permalink
Browse files

Update

  • Loading branch information...
ThorConzales
ThorConzales committed Sep 5, 2017
1 parent 31a7b42 commit c933822de32da4a4d7fac31967dbe4cfb9155db0
@@ -40,6 +40,7 @@
<Content Include="src\app\reputations\reputations-page\reputations-page.component.html" />
<Content Include="src\app\reputations\save-reputation-dialog\save-reputation-dialog.component.html" />
<Content Include="src\app\settings\general-page\general-page.component.html" />
<Content Include="src\app\settings\overlay-page\overlay-page.component.html" />
<Content Include="src\app\settings\settings-page\settings-page.component.html" />
<Content Include="src\app\shared\assign-reputation-dialog\assign-reputation-dialog.component.html" />
<Content Include="src\app\shared\confirmation-dialog\confirmation-dialog.component.html" />
@@ -101,6 +102,8 @@
<TypeScriptCompile Include="src\app\settings\general-page\general-page.component.ts" />
<TypeScriptCompile Include="src\app\settings\general-page\index.ts" />
<TypeScriptCompile Include="src\app\settings\index.ts" />
<TypeScriptCompile Include="src\app\settings\overlay-page\index.ts" />
<TypeScriptCompile Include="src\app\settings\overlay-page\overlay-page.component.ts" />
<TypeScriptCompile Include="src\app\settings\settings-page\index.ts" />
<TypeScriptCompile Include="src\app\settings\settings-page\settings-page.component.ts" />
<TypeScriptCompile Include="src\app\settings\settings.module.ts" />
@@ -35,6 +35,10 @@ export interface Configuration {
tosAccepted: boolean;
skipSessionHelp: boolean;
cmdPath: string;
overlayActiveTopPosition: number;
overlayActiveLeftPosition: number;
overlayInactiveTopPosition: number;
overlayInactiveLeftPosition: number;
}
export interface BasePlayer {
@@ -1,13 +1,10 @@
<center-spinner *ngIf="loading"></center-spinner>
<div *ngIf="!loading" style="padding: 10px;">
<md-slide-toggle style="display: block;" color="primary" [checked]="conf.showOverlay" [(ngModel)]="conf.showOverlay">Show overlay</md-slide-toggle>
<md-slide-toggle style="display: block; margin-top: 10px;" color="primary" [checked]="conf.showOverlayWhenFocused" [(ngModel)]="conf.showOverlayWhenFocused">Show overlay only when the game is focused</md-slide-toggle>
<md-slide-toggle style="display: block; margin-top: 10px;" color="primary" [checked]="conf.showOverlayWhenInLobby" [(ngModel)]="conf.showOverlayWhenInLobby">Show overlay only when you are in lobby (<strong>you must start the session before joining or hosting a lobby, otherwhise overlay won't be shown</strong>)</md-slide-toggle>
<md-input-container style="width: 100%; margin-top: 20px;">
<input mdInput placeholder="Steam API Key" [value]="conf.steamApiKey" [(ngModel)]="conf.steamApiKey" />
<md-input-container style="width: 100%;">
<input mdInput placeholder="Steam API Key" [value]="conf.steamApiKey" [(ngModel)]="conf.steamApiKey"/>
</md-input-container>
<md-input-container style="width: 100%;">
<input mdInput placeholder="CMD Path" [value]="conf.cmdPath" [(ngModel)]="conf.cmdPath" />
<input mdInput placeholder="CMD Path" [value]="conf.cmdPath" [(ngModel)]="conf.cmdPath"/>
</md-input-container>
<div style="text-align: center;">
<button md-raised-button class="primaryButton" (click)="save()">Save</button>
@@ -36,7 +36,7 @@ export class GeneralPageComponent implements OnInit {
}, error => {
this.loading = false;
console.error("Failed to save settings", error);
this.appService.toastError("Failed to save settings.");
this.appService.toastError("Failed to save settings, check the logs.");
});
}
}
}
@@ -0,0 +1 @@
export * from './overlay-page.component';
@@ -0,0 +1,28 @@
<center-spinner *ngIf="loading"></center-spinner>
<div *ngIf="!loading" style="padding: 10px;">
<md-slide-toggle style="display: block;" color="primary" [checked]="conf.showOverlay" [(ngModel)]="conf.showOverlay">Show overlay</md-slide-toggle>
<md-slide-toggle style="display: block; margin-top: 10px;" color="primary" [checked]="conf.showOverlayWhenFocused" [(ngModel)]="conf.showOverlayWhenFocused">Show overlay only when the game is focused</md-slide-toggle>
<md-slide-toggle style="display: block; margin-top: 10px;" color="primary" [checked]="conf.showOverlayWhenInLobby" [(ngModel)]="conf.showOverlayWhenInLobby">Show overlay only when you are in lobby (<strong>you must start the session before joining or hosting a lobby, otherwhise overlay won't be shown</strong>)</md-slide-toggle>
<div style="font-size: 20px; margin-top: 10px; margin-bottom: 5px;">Overlay Position</div>
<div style="display: inline-block; width: 200px;">
<div style="font-size: 16px; margin-bottom: 5px;">When game is active</div>
<md-input-container style="display: inline-block; width: 50px;">
<input mdInput="number" placeholder="Top" [value]="overlayActiveTopPosition" [(ngModel)]="overlayActiveTopPosition">
</md-input-container>
<md-input-container style="display: inline-block; width: 50px;">
<input mdInput="number" placeholder="Left" [value]="overlayActiveLeftPosition" [(ngModel)]="overlayActiveLeftPosition">
</md-input-container>
</div>
<div style="display: inline-block; width: 200px;">
<div style="font-size: 16px; margin-bottom: 5px;">When game is inactive</div>
<md-input-container style="display: inline-block; width: 50px;">
<input mdInput="number" placeholder="Top" [value]="overlayInactiveTopPosition" [(ngModel)]="overlayInactiveTopPosition">
</md-input-container>
<md-input-container style="display: inline-block; width: 50px;">
<input mdInput="number" placeholder="Left" [value]="overlayInactiveLeftPosition" [(ngModel)]="overlayInactiveLeftPosition">
</md-input-container>
</div>
<div style="text-align: center;">
<button md-raised-button class="primaryButton" (click)="save()">Save</button>
</div>
</div>
@@ -0,0 +1,46 @@
import { Component, OnInit } from '@angular/core';
import { Configuration } from '../../app.models';
import { ConfigurationService, AppService, TrackingService } from '../../shared';
@Component({
selector: 'overlay-page',
templateUrl: 'overlay-page.component.html'
})
export class OverlayPageComponent implements OnInit {
public loading = false;
public conf: Configuration;
public overlayActiveTopPosition: number;
public overlayActiveLeftPosition: number;
public overlayInactiveTopPosition: number;
public overlayInactiveLeftPosition: number;
constructor(private configurationService: ConfigurationService, private appService: AppService, private trackingService: TrackingService) {
}
public ngOnInit() {
this.readConfiguration();
}
private readConfiguration() {
this.loading = true;
this.configurationService.getConfiguration(() => {
this.conf = this.configurationService.configuration;
this.loading = false;
});
}
public save() {
this.loading = true;
this.configurationService.configuration = this.conf;
this.configurationService.saveConfiguration().subscribe(() => {
this.appService.toastSuccess("Settings saved.");
this.readConfiguration();
this.trackingService.sendEvent("Settings", "OverlaySettingsSaved");
}, error => {
this.loading = false;
console.error("Failed to save settings", error);
this.appService.toastError("Failed to save settings, check the logs.");
});
}
}
@@ -1 +1,4 @@
<general-page></general-page>
<md-tab-group>
<md-tab label="Overlay"><overlay-page></overlay-page></md-tab>
<md-tab label="General"><general-page></general-page></md-tab>
</md-tab-group>
@@ -1,16 +1,17 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { MdButtonModule, MdInputModule, MdSlideToggleModule } from '@angular/material';
import { MdButtonModule, MdInputModule, MdSlideToggleModule, MdTabsModule } from '@angular/material';
import { CenterSpinnerModule } from '../shared'
import { SettingsPageComponent } from './settings-page';
import { GeneralPageComponent } from './general-page';
import { OverlayPageComponent } from './overlay-page';
@NgModule({
imports: [BrowserModule, FormsModule, MdButtonModule, MdInputModule, MdSlideToggleModule, CenterSpinnerModule],
imports: [BrowserModule, FormsModule, MdButtonModule, MdInputModule, MdSlideToggleModule, MdTabsModule, CenterSpinnerModule],
exports: [SettingsPageComponent],
declarations: [SettingsPageComponent, GeneralPageComponent],
declarations: [SettingsPageComponent, GeneralPageComponent, OverlayPageComponent],
entryComponents: []
})
export class SettingsModule { }
@@ -19,15 +19,15 @@ export class AppService {
}
constructor(private toastsManager: ToastsManager, private trackingService: TrackingService, private configurationService: ConfigurationService) {
this.startBackend();
window.onbeforeunload = (e) => {
if (this.nethookActive) {
this.stopNethook(() => { });
}
if (this.backendProcess) {
this.backendProcess.kill();
}
}
//this.startBackend();
//window.onbeforeunload = (e) => {
// if (this.nethookActive) {
// this.stopNethook(() => { });
// }
// if (this.backendProcess) {
// this.backendProcess.kill();
// }
//}
}
public toastInfo(message: string) {
@@ -15,9 +15,6 @@ export class ConfigurationService {
this.configuration = configuration;
done(true);
}, error => {
//this.configuration = {
// clientVersion: 0
//};
console.log("Error while reading configuration", error);
done(false);
});
@@ -14,5 +14,9 @@ public class Configuration {
public bool TosAccepted { get; set; }
public bool SkipSessionHelp { get; set; }
public string CmdPath { get; set; }
public int OverlayActiveTopPosition { get; set; }
public int OverlayActiveLeftPosition { get; set; }
public int OverlayInactiveTopPosition { get; set; }
public int OverlayInactiveLeftPosition { get; set; }
}
}
View
@@ -11,7 +11,7 @@
Visibility="Hidden"
Top="0"
Left="0"
Title="MainWindow" Height="200" Width="715.96">
Title="MainWindow" Height="200" Width="716">
<Window.Background>
<SolidColorBrush Opacity="0.5" Color="Black" />
</Window.Background>

0 comments on commit c933822

Please sign in to comment.