Skip to content

Commit

Permalink
Added a link to the wiki, can roll dice independently
Browse files Browse the repository at this point in the history
  • Loading branch information
qkmaxware committed May 1, 2021
1 parent 1050ef5 commit 0185470
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions TrekSharp.AdventureTools/Shared/Dice3d/BaseDice.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@code {
[Parameter] public Action OnDiceRoll {get; set;}
public virtual int NumericCount => 0;
public virtual int EffectCount => 0;

Expand Down
3 changes: 2 additions & 1 deletion TrekSharp.AdventureTools/Shared/Dice3d/DiceChallenge.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits BaseDice

<div class="d6 @CssClass">
<div class="d6 @CssClass" @onclick=Roll>
<div class="face face-1">
<img src="assets/challenge-1.png" width="42" height="42"/>
</div>
Expand Down Expand Up @@ -31,5 +31,6 @@
public override void Roll() {
dice.Roll();
StateHasChanged();
OnDiceRoll?.Invoke();
}
}
3 changes: 2 additions & 1 deletion TrekSharp.AdventureTools/Shared/Dice3d/DiceD20.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits BaseDice

<div class="d20 @CssClass">
<div class="d20 @CssClass" @onclick=Roll>
<div class="face face-1"></div>
<div class="face face-2"></div>
<div class="face face-3"></div>
Expand Down Expand Up @@ -36,5 +36,6 @@
public override void Roll() {
dice.Roll();
StateHasChanged();
OnDiceRoll?.Invoke();
}
}
3 changes: 2 additions & 1 deletion TrekSharp.AdventureTools/Shared/Dice3d/DiceD6.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits BaseDice

<div class="d6 @CssClass">
<div class="d6 @CssClass" @onclick=Roll>
<div class="face face-1">1</div>
<div class="face face-2">2</div>
<div class="face face-3">3</div>
Expand All @@ -22,5 +22,6 @@
public override void Roll() {
dice.Roll();
StateHasChanged();
OnDiceRoll?.Invoke();
}
}
16 changes: 8 additions & 8 deletions TrekSharp.AdventureTools/Shared/DiceRoller.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
</div>

<div class="w3-row w3-padding lcars-primary lcars-elbow-left lcars-elbow-right w3-margin-left w3-margin-right">
<div class="w3-col s6 w3-text-white">
<button class="w3-button w3-display-container" style="padding:4px;" @onclick=AddChallengeDie>
<div class="w3-col s7 w3-text-white">
<button class="w3-button w3-display-container" style="padding:4px 4px;" @onclick=AddChallengeDie>
<img src="assets/d6.png" width=40 height=40 />
<img class="w3-display-middle" src="assets/challenge-effect.png" width="40" height="40">
</button>
<button class="w3-button w3-display-container" style="padding:4px;" @onclick=AddD6>
<button class="w3-button w3-display-container" style="padding:4px 4px;" @onclick=AddD6>
<img src="assets/d6.png" width=40 height=40 />
<div class="w3-display-middle">
6
</div>
</button>
<button class="w3-button w3-display-container" style="padding:4px;" @onclick=AddTaskDie>
<button class="w3-button w3-display-container" style="padding:4px 4px;" @onclick=AddTaskDie>
<img src="assets/d20.png" width=40 height=40 />
<div class="w3-display-middle">
20
</div>
</button>
</div>
<div class="w3-col s6 w3-right-align">
<div class="w3-col s5 w3-right-align">
<button class="w3-button w3-round-xxlarge w3-red" @onclick=rerollAll>
Roll
<button class="w3-button w3-circle w3-dark-grey" @onclick=clear>
Expand All @@ -44,11 +44,11 @@
@foreach (var die in this.dices) {
<div style="padding: 8px; display: inline-block;">
@if (die is ChallengeDice cd) {
<DiceChallenge dice=cd></DiceChallenge>
<DiceChallenge dice=cd OnDiceRoll=StateHasChanged></DiceChallenge>
} else if (die is D6 d6) {
<DiceD6 dice=d6></DiceD6>
<DiceD6 dice=d6 OnDiceRoll=StateHasChanged></DiceD6>
} else if (die is D20 d20) {
<DiceD20 dice=d20></DiceD20>
<DiceD20 dice=d20 OnDiceRoll=StateHasChanged></DiceD20>
}
</div>
}
Expand Down
10 changes: 9 additions & 1 deletion TrekSharp.AdventureTools/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,18 @@
>
<img src="assets/load.png" width="32" height="32">
</button>
<a
href="https://github.com/qkmaxware/TrekSharp/wiki"
target="_blank"
style="border: 0; padding: 0; background-color: inherit; text-decoration: none; margin-left: 12px;"
title="Get Help"
>
<img src="assets/help.png" width="32" height="32">
</a>
<a
href="https://github.com/qkmaxware/TrekSharp"
target="_blank"
style="border: 0; padding: 0; background-color: inherit;"
style="border: 0; padding: 0; background-color: inherit; text-decoration: none;"
title="Contribute"
>
<img src="assets/github.png" width="32" height="32">
Expand Down
Binary file added TrekSharp.AdventureTools/wwwroot/assets/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion TrekSharp.AdventureTools/wwwroot/css/dice.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
font-weight: bold;
color: white;
text-align: center;
background: black; opacity: 1;
background: rgb(34, 34, 34);
}

.d6 .face-1 { transform: rotateY( 0deg) translateZ(var(--d6-half-size)); }
Expand Down

0 comments on commit 0185470

Please sign in to comment.