From 28fce7c0751ea864c8ab83023db50579ae50778b Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Tue, 12 Jan 2021 21:40:24 +0100 Subject: [PATCH 1/5] SES-147 edded Tooltips and basic dialog model --- .../ClientApp/src/app/app.module.ts | 3 ++ .../abilities/abilities.component.ts | 2 +- .../ability-card/ability-card.component.html | 6 +-- .../ability-card/ability-card.component.ts | 14 ++++++- .../throw-primary-ability.component.css | 41 +++++++++++++++++++ .../throw-primary-ability.component.html | 13 ++++++ .../throw-primary-ability.component.spec.ts | 25 +++++++++++ .../throw-primary-ability.component.ts | 20 +++++++++ 8 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.spec.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index ab57d47..c2741ec 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -44,6 +44,7 @@ import { SpellService } from '../services/spell.service'; import { WeaponService } from '../services/weapon.service'; import { ArmorService } from '../services/armor.service'; import { OtherEquipmentService } from '../services/other-equipment.service'; +import { ThrowPrimaryAbilityComponent } from './components/throws/throw-primary-ability/throw-primary-ability.component'; @NgModule({ declarations: [ @@ -60,6 +61,7 @@ import { OtherEquipmentService } from '../services/other-equipment.service'; GameMasterArmorsTableComponent, GameMasterWeaponsTableComponent, GameMasterCharacterActionsDialogComponent, + ThrowPrimaryAbilityComponent, ], imports: [ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), @@ -103,6 +105,7 @@ import { OtherEquipmentService } from '../services/other-equipment.service'; GameMasterWeaponsTableComponent, AbilitiesComponent, GameMasterCharacterActionsDialogComponent, + ThrowPrimaryAbilityComponent ], }) export class AppModule {} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts index d0d7d49..b1de142 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts @@ -30,7 +30,7 @@ export class AbilitiesComponent implements OnInit { .pipe(first()) .subscribe((characterId) => { this.characterService - .getCharacterStats(characterId) + .getCharacterStats(2) .pipe(first()) .subscribe( (characterStats) => { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html index f85cbf5..55018a5 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -1,19 +1,19 @@
-
{{ability.value}}
+
{{ability.value}}
Mod: {{ability.modification > 0? '+' + ability.modification : + ability.modification}}
{{ability.name}}
-
ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : ability.savingThrows}}
+
ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : ability.savingThrows}}
- + {{skill.name}}     diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts index d6eb61d..539da57 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts @@ -1,5 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; -import {CharacterStatsViewModel} from '../../../types/viewmodels/character-viewmodels/CharacterStatsViewModel'; +import { CharacterStatsViewModel } from '../../../types/viewmodels/character-viewmodels/CharacterStatsViewModel'; +import { ThrowPrimaryAbilityComponent } from '../throws/throw-primary-ability/throw-primary-ability.component'; +import { MatDialog } from '@angular/material'; @Component({ selector: 'app-ability-card', @@ -11,7 +13,8 @@ export class AbilityCardComponent implements OnInit { @Input() headStyle: { bgColor: string; textColor: string }; @Input() contentStyle: { bgColor: string; textColor: string }; - constructor() {} + constructor(public dialog: MatDialog) { + } ngOnInit() { if (this.ability.skills != null) { @@ -42,4 +45,11 @@ export class AbilityCardComponent implements OnInit { break; } } + + public OpenPrimaryThrowDialog(): void { + this.dialog.open(ThrowPrimaryAbilityComponent, { + }); + } + } + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css new file mode 100644 index 0000000..b94a9d5 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css @@ -0,0 +1,41 @@ +.throw-container { + top: 50%; +} + +::ng-deep.mat-dialog-container { + background-color: #102028; + color: whitesmoke; +} +.header-throw-dialog { + color: orange; + background-color: #102028; +} + +.content-throw-dialog { + background-color: #102028; + color: orange; + height: 400px; +} + +.throw-dialog-actions { + background-color: #102028; + color: orange; +} + +@media (max-width: 468px) { + .throw-container { + width: 250px; + } +} + +@media (min-width: 468px) and (max-width: 768px) { + .throw-container { + width: 420px; + } +} + +@media (min-width: 768px) { + .throw-container { + width: 480px; + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html new file mode 100644 index 0000000..28e27cf --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html @@ -0,0 +1,13 @@ +
+
+ Header +
+
+ Content +
+
+ + +
+
+ diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.spec.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.spec.ts new file mode 100644 index 0000000..70facd1 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ThrowPrimaryAbilityComponent } from './throw-primary-ability.component'; + +describe('ThrowPrimaryAbilityComponent', () => { + let component: ThrowPrimaryAbilityComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ThrowPrimaryAbilityComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ThrowPrimaryAbilityComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts new file mode 100644 index 0000000..36bf106 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts @@ -0,0 +1,20 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; +import { AbilitiesComponent } from '../../abilities/abilities.component'; + +@Component({ + selector: 'app-throw-primary-ability', + templateUrl: './throw-primary-ability.component.html', + styleUrls: ['./throw-primary-ability.component.css'] +}) +export class ThrowPrimaryAbilityComponent implements OnInit { + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} + + ngOnInit() { + } + +} From bf58d055037db2e7c3ae424fb4d1b50e0c0707ad Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Fri, 15 Jan 2021 20:32:12 +0100 Subject: [PATCH 2/5] SES-147 modified UI dialog throw --- .../ClientApp/src/app/app.module.ts | 2 + .../ability-card/ability-card.component.html | 2 +- .../ability-card/ability-card.component.ts | 7 ++- .../player-dashboard.component.css | 4 ++ .../throw-primary-ability.component.css | 45 ++++++++++++++++--- .../throw-primary-ability.component.html | 26 +++++++++-- .../throw-primary-ability.component.ts | 39 +++++++++++++++- 7 files changed, 112 insertions(+), 13 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index c2741ec..4c735be 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -45,6 +45,7 @@ import { WeaponService } from '../services/weapon.service'; import { ArmorService } from '../services/armor.service'; import { OtherEquipmentService } from '../services/other-equipment.service'; import { ThrowPrimaryAbilityComponent } from './components/throws/throw-primary-ability/throw-primary-ability.component'; +import { MatRadioModule } from '@angular/material/radio'; @NgModule({ declarations: [ @@ -89,6 +90,7 @@ import { ThrowPrimaryAbilityComponent } from './components/throws/throw-primary- MatTableModule, MatSortModule, MatTooltipModule, + MatRadioModule, ], providers: [ UserService, diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html index 55018a5..3397a90 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -1,7 +1,7 @@
-
{{ability.value}}
+
{{ability.value}}
Mod: {{ability.modification > 0? '+' + ability.modification : + ability.modification}}
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts index 539da57..a5a2fb1 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts @@ -46,8 +46,13 @@ export class AbilityCardComponent implements OnInit { } } - public OpenPrimaryThrowDialog(): void { + public OpenPrimaryThrowDialog(abilityName: string, abilityValue: number, abilityMod: number): void { this.dialog.open(ThrowPrimaryAbilityComponent, { + data: { + abilityName: abilityName, + abilityValue: abilityValue, + abilityMod: abilityMod, + } }); } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css index 544e80b..702d3cc 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css @@ -1,5 +1,9 @@ @import "../../../styles.css"; +.toggle-class{ + margin: 5px; +} + .menu-spacer { flex: 1 1 auto; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css index b94a9d5..4a844fc 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css @@ -5,6 +5,7 @@ ::ng-deep.mat-dialog-container { background-color: #102028; color: whitesmoke; + box-shadow: -1px 3px 48px 23px rgba(0,0,0,0.82); } .header-throw-dialog { color: orange; @@ -15,6 +16,7 @@ background-color: #102028; color: orange; height: 400px; + display: block; } .throw-dialog-actions { @@ -28,14 +30,45 @@ } } -@media (min-width: 468px) and (max-width: 768px) { - .throw-container { - width: 420px; - } -} - @media (min-width: 768px) { .throw-container { width: 480px; } } + +.button-dialog:hover { + opacity: 0.5; +} + +#radio-group-label-class { + margin-bottom: 5%; +} + +.radio-group { + display: flex; + flex-direction: column; +} + +.radio-button { + padding: 5%; + border: 1px #e9cca7 solid; + border-radius: 10px; + margin-bottom: 5%; + font-size: 14px; +} + +.radio-button:hover { + opacity: 0.5; +} + +.mat-divider--custom-style{ + background-color: #9e8b6e; + margin-bottom: 20px; + box-shadow: 0 1px 0 0 #d8d8d8; +} + +.score-result { + height: 50px; + padding-bottom: 5%; + font-weight: bold; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html index 28e27cf..abea869 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html @@ -1,13 +1,31 @@
- Header + Click to roll the {{abilityName}}
+
- Content + + + + + Normal throw on ability + + + Hidden throw for Game Master + + +
+ Your score has been send to Game Master +
+
Your roll result is: {{score}}
+
Your roll with mode result is: {{score+abilityMod}}
+
- - +
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts index 36bf106..1492347 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts @@ -1,4 +1,4 @@ -import { Component, Inject, OnInit } from '@angular/core'; +import {Component, Inject, Input, OnInit} from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { AbilitiesComponent } from '../../abilities/abilities.component'; @@ -8,6 +8,21 @@ import { AbilitiesComponent } from '../../abilities/abilities.component'; styleUrls: ['./throw-primary-ability.component.css'] }) export class ThrowPrimaryAbilityComponent implements OnInit { + score: number; + checked = false; + choosedThrow: string; + throws: string[] = [`Normal throw on ability`, 'Hidden throw for Game Master']; + dataCube: { + currentFaceIndex: 0, + isRolling: false, + faces: [], + }; + showSendToGMMessage: boolean; + + @Input() abilityName: string; + @Input() abilityValue: number; + @Input() abilityMod: number; + @Input() message: string; constructor( public dialogRef: MatDialogRef, @@ -15,6 +30,28 @@ export class ThrowPrimaryAbilityComponent implements OnInit { ) {} ngOnInit() { + this.abilityName = this.data.abilityName; + this.abilityValue = this.data.abilityValue; + this.abilityMod = this.data.abilityMod; } + getRandomNumberBetween(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min)) + min; +} + + getResultOfRoll(choice: string) { + switch (choice) { + case 'normal': + this.score = this.getRandomNumberBetween(1, 20); + this.showSendToGMMessage = false; + break; + case 'hidden': + this.score = null; + this.showSendToGMMessage = true; + //TODO tutaj bedzie wyslanie rzutu do GM + break; + } + } } From b740fdc3b43581335eacb1b451e5ca5cc7357cdc Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Fri, 15 Jan 2021 22:55:19 +0100 Subject: [PATCH 3/5] SES-147 display dialog for ST and other skills also --- .../app/components/abilities/abilities.component.ts | 2 +- .../ability-card/ability-card.component.html | 6 +++--- .../ability-card/ability-card.component.ts | 3 +-- .../throw-primary-ability.component.css | 2 +- .../throw-primary-ability.component.html | 12 +++++++++--- .../throw-primary-ability.component.ts | 5 ----- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts index b1de142..d0d7d49 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts @@ -30,7 +30,7 @@ export class AbilitiesComponent implements OnInit { .pipe(first()) .subscribe((characterId) => { this.characterService - .getCharacterStats(2) + .getCharacterStats(characterId) .pipe(first()) .subscribe( (characterStats) => { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html index 3397a90..86bfa75 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -1,19 +1,19 @@
-
{{ability.value}}
+
{{ability.value}}
Mod: {{ability.modification > 0? '+' + ability.modification : + ability.modification}}
{{ability.name}}
-
ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : ability.savingThrows}}
+
ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : ability.savingThrows}}
-
+ {{skill.name}}     diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts index a5a2fb1..01c921f 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts @@ -46,7 +46,7 @@ export class AbilityCardComponent implements OnInit { } } - public OpenPrimaryThrowDialog(abilityName: string, abilityValue: number, abilityMod: number): void { + public OpenThrowDialog(abilityName: string, abilityValue: number, abilityMod: number): void { this.dialog.open(ThrowPrimaryAbilityComponent, { data: { abilityName: abilityName, @@ -55,6 +55,5 @@ export class AbilityCardComponent implements OnInit { } }); } - } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css index 4a844fc..1723c44 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css @@ -55,6 +55,7 @@ border-radius: 10px; margin-bottom: 5%; font-size: 14px; + text-align: center; } .radio-button:hover { @@ -68,7 +69,6 @@ } .score-result { - height: 50px; padding-bottom: 5%; font-weight: bold; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html index abea869..eb11727 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html @@ -6,10 +6,12 @@
+ + Normal throw on ability @@ -17,11 +19,15 @@ Hidden throw for Game Master -
+ +
Your score has been send to Game Master
-
Your roll result is: {{score}}
-
Your roll with mode result is: {{score+abilityMod}}
+
+
Your roll result is: {{score}}
+
Your roll with modification is: {{score+abilityMod}}
+
+
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts index 1492347..42fa488 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.ts @@ -12,11 +12,6 @@ export class ThrowPrimaryAbilityComponent implements OnInit { checked = false; choosedThrow: string; throws: string[] = [`Normal throw on ability`, 'Hidden throw for Game Master']; - dataCube: { - currentFaceIndex: 0, - isRolling: false, - faces: [], - }; showSendToGMMessage: boolean; @Input() abilityName: string; From 5949512a38aa8fadbeccb8ec0f32e60b056bfc45 Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Sat, 16 Jan 2021 20:03:37 +0100 Subject: [PATCH 4/5] SES-147 fixed css for mobile --- .../abilities/abilities.component.ts | 2 +- .../ability-card/ability-card.component.css | 10 ++- .../player-dashboard.component.css | 2 +- .../throw-primary-ability.component.css | 63 ++++++++++++------- 4 files changed, 51 insertions(+), 26 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts index d0d7d49..b1de142 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts @@ -30,7 +30,7 @@ export class AbilitiesComponent implements OnInit { .pipe(first()) .subscribe((characterId) => { this.characterService - .getCharacterStats(characterId) + .getCharacterStats(2) .pipe(first()) .subscribe( (characterStats) => { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css index cc66099..f053ea1 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css @@ -19,7 +19,13 @@ padding-bottom: 15px; } -@media (max-width: 468px) { +@media (max-width: 365px) { + #main { + width: 315px; + } +} + +@media (min-width: 365px) and (max-width: 468px) { #main { width: 340px; } @@ -27,7 +33,7 @@ @media (min-width: 468px) and (max-width: 768px) { #main { - width: 420px; + width: 410px; } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css index 702d3cc..95aaff4 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css @@ -41,7 +41,7 @@ } .ability_card_container { - margin: 5%; + margin: 2%; display: flex; justify-content: center; align-items: center; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css index 1723c44..4f6793c 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css @@ -2,6 +2,24 @@ top: 50%; } +.radio-group { + display: flex; + flex-direction: column; +} + +.radio-button { + padding: 3%; + border: 1px #e9cca7 solid; + border-radius: 10px; + margin-bottom: 5%; + font-size: 14px; + text-align: center; +} + +.radio-button:hover { + opacity: 0.5; +} + ::ng-deep.mat-dialog-container { background-color: #102028; color: whitesmoke; @@ -24,14 +42,33 @@ color: orange; } -@media (max-width: 468px) { - .throw-container { - width: 250px; +@media (max-width: 365px) { + .content-throw-dialog { + height: 350px; + } + .radio-button { + padding: 5%; + font-size: 12px; + } + #main { + width: 320px; + } +} + +@media (min-width: 365px) and (max-width: 468px) { + #main { + width: 340px; + } +} + +@media (min-width: 468px) and (max-width: 768px) { + #main { + width: 410px; } } @media (min-width: 768px) { - .throw-container { + #main { width: 480px; } } @@ -44,24 +81,6 @@ margin-bottom: 5%; } -.radio-group { - display: flex; - flex-direction: column; -} - -.radio-button { - padding: 5%; - border: 1px #e9cca7 solid; - border-radius: 10px; - margin-bottom: 5%; - font-size: 14px; - text-align: center; -} - -.radio-button:hover { - opacity: 0.5; -} - .mat-divider--custom-style{ background-color: #9e8b6e; margin-bottom: 20px; From a16f03a720a7140ed4f6b18dd0c3822500531d55 Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Sat, 16 Jan 2021 21:49:22 +0100 Subject: [PATCH 5/5] SES-147 displaying score whith other information --- .../abilities/abilities.component.ts | 2 +- .../throw-primary-ability.component.css | 138 ++++++++++++++---- .../throw-primary-ability.component.html | 11 +- 3 files changed, 115 insertions(+), 36 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts index b1de142..d0d7d49 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/abilities/abilities.component.ts @@ -30,7 +30,7 @@ export class AbilitiesComponent implements OnInit { .pipe(first()) .subscribe((characterId) => { this.characterService - .getCharacterStats(2) + .getCharacterStats(characterId) .pipe(first()) .subscribe( (characterStats) => { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css index 4f6793c..072bf7e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.css @@ -42,37 +42,6 @@ color: orange; } -@media (max-width: 365px) { - .content-throw-dialog { - height: 350px; - } - .radio-button { - padding: 5%; - font-size: 12px; - } - #main { - width: 320px; - } -} - -@media (min-width: 365px) and (max-width: 468px) { - #main { - width: 340px; - } -} - -@media (min-width: 468px) and (max-width: 768px) { - #main { - width: 410px; - } -} - -@media (min-width: 768px) { - #main { - width: 480px; - } -} - .button-dialog:hover { opacity: 0.5; } @@ -88,6 +57,111 @@ } .score-result { - padding-bottom: 5%; + font-size: 16px; font-weight: bold; + height: 180px; + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: space-between; + text-align: center; + align-items: center } + +.score-result>* { + flex: 1 1 80px; +} + +.box { + padding: 2px; + width: 165px; + height: 85px; + world-wrap: break-word; + border: 1px #e9cca7 solid; + border-radius: 10px; +} + +.box--ability { + paddin-top: 25px; + padding-left: 2px; + padding-right: 2px; + padding-bottom: 2px; + height: 170px; + width: 165px; + world-wrap: break-word; + border: 1px #e9cca7 solid; + border-radius: 10px; +} + +.box--ability > div { + padding-top: 40%; +} + +@media (max-width: 365px) { + .content-throw-dialog { + height: 350px; + } + .radio-button { + padding: 5%; + font-size: 12px; + } + #main { + width: 320px; + } + .score-result { + font-size: 14px; + } + .box { + width: 100px; + height: 85px; + } + + .box--ability { + height: 170px; + width: 100px; + } +} + +@media (min-width: 365px) and (max-width: 468px) { + #main { + width: 340px; + } + .score-result { + font-size: 15px; + } + .box { + width: 110px; + height: 85px; + } + + .box--ability { + height: 170px; + width: 110px; + } +} + +@media (min-width: 468px) and (max-width: 768px) { + #main { + width: 410px; + } + .score-result { + font-size: 15px; + } + .box { + width: 120px; + height: 85px; + } + + .box--ability { + height: 170px; + width: 120px; + } +} + +@media (min-width: 768px) { + #main { + width: 480px; + } +} + + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html index eb11727..3c66a85 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/throws/throw-primary-ability/throw-primary-ability.component.html @@ -19,13 +19,18 @@ Hidden throw for Game Master - +
Your score has been send to Game Master
-
Your roll result is: {{score}}
-
Your roll with modification is: {{score+abilityMod}}
+
Your roll result is:

{{score}}

+
Your roll with modification is:

{{score+abilityMod}}

+
+
+ Ability value:

{{abilityValue}}

+
+