-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add common gender display RenderFragments
- Loading branch information
1 parent
2c83a20
commit ab11602
Showing
21 changed files
with
140 additions
and
62 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@code { | ||
public static RenderFragment TypeSummary(byte type1, byte type2) => | ||
@<MudStack Row="@true" | ||
Class="my-2" | ||
AlignItems="@AlignItems.Center"> | ||
<MudText> | ||
Type: | ||
</MudText> | ||
<MudImage Src="@SpriteHelper.GetTypeWideSpriteFileName(type1)" | ||
Alt="@GameInfo.Strings.Types[type1]" | ||
title="@GameInfo.Strings.Types[type1]" | ||
ObjectFit="@ObjectFit.Contain" | ||
ObjectPosition="@ObjectPosition.Center" /> | ||
@if (type1 != type2) | ||
{ | ||
<MudImage Src="@SpriteHelper.GetTypeWideSpriteFileName(type2)" | ||
Alt="@GameInfo.Strings.Types[type2]" | ||
title="@GameInfo.Strings.Types[type2]" | ||
ObjectFit="@ObjectFit.Contain" | ||
ObjectPosition="@ObjectPosition.Center" /> | ||
} | ||
</MudStack>; | ||
|
||
public static RenderFragment TeraTypeSummary(byte type) => | ||
@<MudStack Row="@true" | ||
Class="my-2" | ||
AlignItems="@AlignItems.Center"> | ||
<MudText> | ||
Tera Type: | ||
</MudText> | ||
<MudImage Src="@SpriteHelper.GetTypeGemSpriteFileName(type)" | ||
Alt="@GameInfo.Strings.Types[type]" | ||
title="@GameInfo.Strings.Types[type]" | ||
ObjectFit="@ObjectFit.Contain" | ||
ObjectPosition="@ObjectPosition.Center" | ||
Width="30" /> | ||
</MudStack>; | ||
|
||
public static RenderFragment GenderDisplayIcon(int gender) | ||
{ | ||
var icon = gender switch | ||
{ | ||
0 => Icons.Material.Filled.Male, | ||
1 => Icons.Material.Filled.Female, | ||
_ => string.Empty, | ||
}; | ||
var color = gender switch | ||
{ | ||
0 => Colors.Blue.Default, | ||
1 => Colors.Red.Default, | ||
_ => string.Empty, | ||
}; | ||
return @<MudIcon Icon="@icon" Style="@($"color: {color};")" />; | ||
} | ||
|
||
public static RenderFragment GenderDisplayAscii(int gender) | ||
{ | ||
var color = gender switch | ||
{ | ||
0 => Colors.Blue.Default, | ||
1 => Colors.Red.Default, | ||
_ => string.Empty, | ||
}; | ||
return @<MudText Style="@($"color: { color}; ")">@GameInfo.GenderSymbolASCII[gender]</MudText>; | ||
} | ||
|
||
public static RenderFragment GenderDisplay(int gender) => | ||
@<MudStack Row="@true"> | ||
@GenderDisplayIcon(gender) | ||
@GenderDisplayAscii(gender) | ||
</MudStack>; | ||
} |
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
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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<MudText> | ||
@inherits BasePkmdsComponent | ||
|
||
<MudText> | ||
Feature not implemented. | ||
</MudText> |
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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@inherits BasePkmdsComponent | ||
|
||
@if (AppState.SaveFile is { Gender: 0 or 1 } saveFile) | ||
{ | ||
var gender = saveFile.Gender; | ||
@Display(saveFile, gender) | ||
} | ||
|
||
@code { | ||
private static RenderFragment Display(SaveFile saveFile, int gender) => | ||
@<MudStack Row="@true" Spacing="1"> | ||
<span>@saveFile.OT </span> | ||
@GenderDisplayIcon(gender) | ||
<span>(@saveFile.DisplayTID</span> | ||
<span>, @saveFile.Version</span> | ||
<span>, @saveFile.PlayTimeString)</span> | ||
</MudStack>; | ||
} |
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