Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b165de7a9 | |||
| 814f3a3858 | |||
| 7c00c14d9e | |||
| 9323e7a1a6 | |||
| 0c820ac973 | |||
| 02cae92797 | |||
| c1f041b4f6 | |||
| 2625992014 | |||
| 377a041afa | |||
| 6e58c63082 | |||
| 0feac0f0a0 | |||
| 46150d3a69 | |||
| 85834466f1 | |||
| 7da6f554a8 | |||
| dc0395c7d3 | |||
| 026aebd5ad | |||
| 3974fcfb91 | |||
| 410e7e23b7 | |||
| 6655cdeee7 | |||
| 1f7a0819fc | |||
| 73f29cea08 | |||
| b63d8330f7 | |||
| ad7aabd9e0 | |||
| 7680fae30b | |||
| 9e9b25ae6f | |||
| cf3f6e647b | |||
| c0ea4a094e | |||
| 1bc78306b8 | |||
| 826717c47f | |||
| a5964a68f8 | |||
| 424fdd248a | |||
| 7ca2f82ad7 | |||
| fd20f8ca7d | |||
| 5d4f141580 | |||
| 2baa295e1f | |||
| b8d2210cc5 | |||
| 8b5d5a05e4 | |||
| 02d6e2f5e9 | |||
| 22d245972c | |||
| c95ee06449 | |||
| df5c5480d8 | |||
| e641189c9d | |||
| 071d2f5e35 | |||
| ff4941d38c | |||
| 4b2fe6d551 | |||
| b02232855d | |||
| f5e8984ab8 | |||
| 2ac56f9672 | |||
| e464b9ecab | |||
| 720a99991f | |||
| 80f44c3931 | |||
| db48f05686 | |||
| e90621c2fd | |||
| 2246847145 | |||
| 3d10256b9f | |||
| 1f71062691 | |||
| 831512a64b | |||
| 8f203b2ba1 | |||
| d320476084 | |||
| e28f74b354 | |||
| 764192891c | |||
| b653a00238 | |||
| 25776b3b00 | |||
| cacbe6979e | |||
| e820457176 | |||
| 38ff4e3e89 | |||
| 65ab4bcf05 | |||
| 0bb95ee9a6 | |||
| f084aedb0b | |||
| 079ced6af7 | |||
| 730bff71ef | |||
| 01d8b383e1 | |||
| 83ee8c3ae4 |
@@ -25,7 +25,7 @@ jobs:
|
|||||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_MUD_04916B210 }}
|
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_MUD_04916B210 }}
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
action: "upload"
|
action: "upload"
|
||||||
app_location: "IGP"
|
app_location: "Web"
|
||||||
api_location: ""
|
api_location: ""
|
||||||
output_location: "./wwwroot"
|
output_location: "./wwwroot"
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_COAST_0F8B08010 }}
|
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_COAST_0F8B08010 }}
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
action: "upload"
|
action: "upload"
|
||||||
app_location: "IGP"
|
app_location: "Web"
|
||||||
api_location: ""
|
api_location: ""
|
||||||
output_location: "./wwwroot"
|
output_location: "./wwwroot"
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ DocProject/Help/html
|
|||||||
|
|
||||||
# Click-Once directory
|
# Click-Once directory
|
||||||
publish/
|
publish/
|
||||||
|
publish_release/
|
||||||
|
|
||||||
# Publish Web Output
|
# Publish Web Output
|
||||||
*.[Pp]ublish.xml
|
*.[Pp]ublish.xml
|
||||||
@@ -264,3 +265,6 @@ __pycache__/
|
|||||||
|
|
||||||
**/.vs/
|
**/.vs/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|
||||||
|
publish_release/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
3.0
|
||||||
Vendored
+3
-3
@@ -7,7 +7,7 @@
|
|||||||
"type": "process",
|
"type": "process",
|
||||||
"args": [
|
"args": [
|
||||||
"build",
|
"build",
|
||||||
"${workspaceFolder}/IGP/IGP.csproj",
|
"${workspaceFolder}/Web/Web.csproj",
|
||||||
"/property:GenerateFullPaths=true",
|
"/property:GenerateFullPaths=true",
|
||||||
"/consoleloggerparameters:NoSummary"
|
"/consoleloggerparameters:NoSummary"
|
||||||
],
|
],
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"type": "process",
|
"type": "process",
|
||||||
"args": [
|
"args": [
|
||||||
"publish",
|
"publish",
|
||||||
"${workspaceFolder}/IGP/IGP.csproj",
|
"${workspaceFolder}/Web/Web.csproj",
|
||||||
"/property:GenerateFullPaths=true",
|
"/property:GenerateFullPaths=true",
|
||||||
"/consoleloggerparameters:NoSummary"
|
"/consoleloggerparameters:NoSummary"
|
||||||
],
|
],
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"watch",
|
"watch",
|
||||||
"run",
|
"run",
|
||||||
"--project",
|
"--project",
|
||||||
"${workspaceFolder}/IGP/IGP.csproj"
|
"${workspaceFolder}/Web/Web.csproj"
|
||||||
],
|
],
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<RootNamespace>API</RootNamespace>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="HotChocolate.AspNetCore" Version="16.1.2"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,254 @@
|
|||||||
|
using Model.Entity;
|
||||||
|
using Model.Entity.Parts;
|
||||||
|
|
||||||
|
namespace API.GraphQL.Types;
|
||||||
|
|
||||||
|
public class EntityGraphType : ObjectType<EntityModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Name("Entity");
|
||||||
|
|
||||||
|
descriptor.Field(e => e.DataType).Name("id");
|
||||||
|
descriptor.Field(e => e.EntityType).Name("type");
|
||||||
|
descriptor.Field(e => e.IsSpeculative);
|
||||||
|
descriptor.Field(e => e.Descriptive).Name("descriptiveType");
|
||||||
|
|
||||||
|
descriptor.Ignore(e => e.EntityParts);
|
||||||
|
|
||||||
|
descriptor.Field("name")
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().GetName());
|
||||||
|
|
||||||
|
descriptor.Field("factionName")
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().GetFaction());
|
||||||
|
|
||||||
|
descriptor.Field("info")
|
||||||
|
.Type<EntityInfoGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Info());
|
||||||
|
|
||||||
|
descriptor.Field("production")
|
||||||
|
.Type<EntityProductionGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Production());
|
||||||
|
|
||||||
|
descriptor.Field("supply")
|
||||||
|
.Type<EntitySupplyGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Supply());
|
||||||
|
|
||||||
|
descriptor.Field("tier")
|
||||||
|
.Type<EntityTierGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Tier());
|
||||||
|
|
||||||
|
descriptor.Field("movement")
|
||||||
|
.Type<EntityMovementGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Movement());
|
||||||
|
|
||||||
|
descriptor.Field("vitality")
|
||||||
|
.Type<EntityVitalityGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Vitality());
|
||||||
|
|
||||||
|
descriptor.Field("requirements")
|
||||||
|
.Type<ListType<EntityRequirementGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Requirements());
|
||||||
|
|
||||||
|
descriptor.Field("weapons")
|
||||||
|
.Type<ListType<EntityWeaponGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Weapons());
|
||||||
|
|
||||||
|
descriptor.Field("hotkey")
|
||||||
|
.Type<EntityHotkeyGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Hotkey());
|
||||||
|
|
||||||
|
descriptor.Field("faction")
|
||||||
|
.Type<EntityFactionGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Faction());
|
||||||
|
|
||||||
|
descriptor.Field("harvest")
|
||||||
|
.Type<EntityHarvestGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Harvest());
|
||||||
|
|
||||||
|
descriptor.Field("idAbilities")
|
||||||
|
.Type<ListType<EntityIdReferenceGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().IdAbilities());
|
||||||
|
|
||||||
|
descriptor.Field("idArmies")
|
||||||
|
.Type<ListType<EntityIdReferenceGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().IdArmies());
|
||||||
|
|
||||||
|
descriptor.Field("idPassives")
|
||||||
|
.Type<ListType<EntityIdReferenceGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().IdPassives());
|
||||||
|
|
||||||
|
descriptor.Field("idUpgrades")
|
||||||
|
.Type<ListType<EntityIdReferenceGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().IdUpgrades());
|
||||||
|
|
||||||
|
descriptor.Field("idVanguards")
|
||||||
|
.Type<ListType<EntityIdReferenceGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().IdVanguards());
|
||||||
|
|
||||||
|
descriptor.Field("idPyreSpells")
|
||||||
|
.Type<ListType<EntityIdReferenceGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().IdPyreSpells());
|
||||||
|
|
||||||
|
descriptor.Field("mechanics")
|
||||||
|
.Type<ListType<EntityMechanicGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Mechanics());
|
||||||
|
|
||||||
|
descriptor.Field("passives")
|
||||||
|
.Type<ListType<EntityNamedDescGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Passives());
|
||||||
|
|
||||||
|
descriptor.Field("strategies")
|
||||||
|
.Type<ListType<EntityStrategyGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Strategies());
|
||||||
|
|
||||||
|
descriptor.Field("replaceds")
|
||||||
|
.Type<ListType<EntityVanguardReplacedGraphType>>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().Replaceds());
|
||||||
|
|
||||||
|
descriptor.Field("vanguardAdded")
|
||||||
|
.Type<EntityVanguardAddedGraphType>()
|
||||||
|
.Resolve(ctx => ctx.Parent<EntityModel>().VanguardAdded());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityInfoGraphType : ObjectType<EntityInfoModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityInfoModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
descriptor.Field(e => e.Name);
|
||||||
|
descriptor.Field(e => e.Descriptive).Name("descriptiveType");
|
||||||
|
descriptor.Field(e => e.Description);
|
||||||
|
descriptor.Field(e => e.Notes);
|
||||||
|
descriptor.Field(e => e.FlavorText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityProductionGraphType : ObjectType<EntityProductionModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityProductionModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntitySupplyGraphType : ObjectType<EntitySupplyModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntitySupplyModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityTierGraphType : ObjectType<EntityTierModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityTierModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityMovementGraphType : ObjectType<EntityMovementModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityMovementModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityVitalityGraphType : ObjectType<EntityVitalityModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityVitalityModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityRequirementGraphType : ObjectType<EntityRequirementModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityRequirementModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityWeaponGraphType : ObjectType<EntityWeaponModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityWeaponModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityHotkeyGraphType : ObjectType<EntityHotkeyModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityHotkeyModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityFactionGraphType : ObjectType<EntityFactionModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityFactionModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityHarvestGraphType : ObjectType<EntityHarvestModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityHarvestModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityIdReferenceGraphType : ObjectType<EntityIdAbilityModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityIdAbilityModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityMechanicGraphType : ObjectType<EntityMechanicModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityMechanicModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityNamedDescGraphType : ObjectType<EntityPassiveModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityPassiveModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityStrategyGraphType : ObjectType<EntityStrategyModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityStrategyModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityVanguardReplacedGraphType : ObjectType<EntityVanguardReplacedModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityVanguardReplacedModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityVanguardAddedGraphType : ObjectType<EntityVanguardAddedModel>
|
||||||
|
{
|
||||||
|
protected override void Configure(IObjectTypeDescriptor<EntityVanguardAddedModel> descriptor)
|
||||||
|
{
|
||||||
|
descriptor.Ignore(e => e.Parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using API.GraphQL.Types;
|
||||||
|
using Model.Entity.Data;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
builder.Services
|
||||||
|
.AddGraphQLServer()
|
||||||
|
.AddQueryType(d =>
|
||||||
|
{
|
||||||
|
d.Name("Query");
|
||||||
|
|
||||||
|
d.Field("entities")
|
||||||
|
.Type<NonNullType<ListType<NonNullType<EntityGraphType>>>>()
|
||||||
|
.Resolve(ctx => EntityData.Get().Values.ToList());
|
||||||
|
|
||||||
|
d.Field("entity")
|
||||||
|
.Type<EntityGraphType>()
|
||||||
|
.Argument("id", a => a.Type<NonNullType<StringType>>())
|
||||||
|
.Resolve(ctx =>
|
||||||
|
{
|
||||||
|
var id = ctx.ArgumentValue<string>("id");
|
||||||
|
EntityData.Get().TryGetValue(id, out var entity);
|
||||||
|
return entity;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.AddType<EntityGraphType>();
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.MapGraphQL();
|
||||||
|
|
||||||
|
app.Run();
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<RootNamespace>IGP.Calculator.Cli</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Services\Services.csproj"/>
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
+155
@@ -0,0 +1,155 @@
|
|||||||
|
using IGP.Calculator.Cli.Services;
|
||||||
|
using Model.Entity;
|
||||||
|
using Model.Entity.Data;
|
||||||
|
using Services.Immortal;
|
||||||
|
using Services.Website;
|
||||||
|
|
||||||
|
var faction = DataType.FACTION_QRath;
|
||||||
|
var immortal = DataType.IMMORTAL_Orzum;
|
||||||
|
var attackTime = 1500;
|
||||||
|
var entityNames = new List<string>();
|
||||||
|
|
||||||
|
for (var i = 0; i < args.Length; i++)
|
||||||
|
switch (args[i].ToLower())
|
||||||
|
{
|
||||||
|
case "--faction" when i + 1 < args.Length:
|
||||||
|
var f = args[++i].ToLower();
|
||||||
|
faction = f switch
|
||||||
|
{
|
||||||
|
"qrath" => DataType.FACTION_QRath,
|
||||||
|
"aru" => DataType.FACTION_Aru,
|
||||||
|
_ => throw new Exception($"Unknown faction '{args[i]}'. Use QRath or Aru.")
|
||||||
|
};
|
||||||
|
immortal = f switch
|
||||||
|
{
|
||||||
|
"qrath" => DataType.IMMORTAL_Orzum,
|
||||||
|
"aru" => DataType.IMMORTAL_Mala,
|
||||||
|
_ => immortal
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "--immortal" when i + 1 < args.Length:
|
||||||
|
var im = args[++i];
|
||||||
|
immortal = im switch
|
||||||
|
{
|
||||||
|
nameof(DataType.IMMORTAL_Orzum) => DataType.IMMORTAL_Orzum,
|
||||||
|
nameof(DataType.IMMORTAL_Ajari) => DataType.IMMORTAL_Ajari,
|
||||||
|
nameof(DataType.IMMORTAL_Atzlan) => DataType.IMMORTAL_Atzlan,
|
||||||
|
nameof(DataType.IMMORTAL_Mala) => DataType.IMMORTAL_Mala,
|
||||||
|
nameof(DataType.IMMORTAL_Xol) => DataType.IMMORTAL_Xol,
|
||||||
|
_ => throw new Exception($"Unknown immortal '{im}'.")
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "--attack-time" or "-a" when i + 1 < args.Length:
|
||||||
|
attackTime = int.Parse(args[++i]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
entityNames.Add(args[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var toastService = new ToastService();
|
||||||
|
var storageService = new NullStorageService();
|
||||||
|
var timingService = new TimingService(storageService);
|
||||||
|
timingService.SetAttackTime(attackTime);
|
||||||
|
var buildOrderService = new BuildOrderService(toastService, timingService);
|
||||||
|
var economyService = new EconomyService();
|
||||||
|
|
||||||
|
buildOrderService.Reset(faction);
|
||||||
|
economyService.Calculate(buildOrderService, timingService, 0);
|
||||||
|
|
||||||
|
Console.WriteLine($"Faction: {(faction == DataType.FACTION_QRath ? "Q'Rath" : "Aru")}");
|
||||||
|
Console.WriteLine($"Immortal: {immortal.Replace("IMMORTAL_", "")}");
|
||||||
|
Console.WriteLine($"Attack Time: {attackTime}s");
|
||||||
|
Console.WriteLine(new string('-', 50));
|
||||||
|
|
||||||
|
foreach (var name in entityNames)
|
||||||
|
{
|
||||||
|
if (name.StartsWith("wait ", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var seconds = int.Parse(name[5..]);
|
||||||
|
buildOrderService.AddWait(seconds);
|
||||||
|
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||||
|
Console.WriteLine($" Wait {seconds}s -> now at interval {buildOrderService.GetLastRequestInterval()}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.StartsWith("waitto ", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var interval = int.Parse(name[7..]);
|
||||||
|
buildOrderService.AddWaitTo(interval);
|
||||||
|
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||||
|
Console.WriteLine($" Wait to {interval}s -> now at interval {buildOrderService.GetLastRequestInterval()}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var entity = FindEntity(name, faction, immortal);
|
||||||
|
if (entity == null)
|
||||||
|
{
|
||||||
|
Console.WriteLine($" ERROR: '{name}' not found for this faction/immortal.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var beforeInterval = buildOrderService.GetLastRequestInterval();
|
||||||
|
var added = buildOrderService.Add(entity, economyService);
|
||||||
|
if (added)
|
||||||
|
{
|
||||||
|
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||||
|
var startedAt = buildOrderService.GetLastRequestInterval();
|
||||||
|
var production = entity.Production();
|
||||||
|
var completedAt = production != null ? startedAt + production.BuildTime : startedAt;
|
||||||
|
var cost = production != null
|
||||||
|
? $" [{production.Alloy}a/{production.Ether}e/{production.Pyre}p, {production.BuildTime}s]"
|
||||||
|
: "";
|
||||||
|
Console.WriteLine($" {entity.GetName(),-25} start={startedAt,4}s done={completedAt,4}s{cost}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($" ERROR: Could not add '{name}'.");
|
||||||
|
var toasts = toastService.GetToasts();
|
||||||
|
if (toasts.Count > 0)
|
||||||
|
{
|
||||||
|
var lastToast = toasts[0];
|
||||||
|
Console.WriteLine($" Reason: {lastToast.Title} - {lastToast.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(new string('-', 50));
|
||||||
|
|
||||||
|
var lastInterval = buildOrderService.GetLastRequestInterval();
|
||||||
|
var finalEconomy = economyService.GetEconomy(timingService.GetAttackTime());
|
||||||
|
var lastEconomy = economyService.GetEconomy(lastInterval);
|
||||||
|
|
||||||
|
Console.WriteLine($"Army Attacking At: {timingService.GetAttackTime()}s");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine($"At attack time ({timingService.GetAttackTime()}s):");
|
||||||
|
Console.WriteLine($" Alloy: {finalEconomy.Alloy,10:F1}");
|
||||||
|
Console.WriteLine($" Ether: {finalEconomy.Ether,10:F1}");
|
||||||
|
Console.WriteLine($" Pyre: {finalEconomy.Pyre,10:F1}");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine($"At last build action ({lastInterval}s):");
|
||||||
|
Console.WriteLine($" Alloy: {lastEconomy.Alloy,10:F1}");
|
||||||
|
Console.WriteLine($" Ether: {lastEconomy.Ether,10:F1}");
|
||||||
|
Console.WriteLine($" Pyre: {lastEconomy.Pyre,10:F1}");
|
||||||
|
|
||||||
|
static EntityModel? FindEntity(string name, string faction, string immortal)
|
||||||
|
{
|
||||||
|
var candidates = EntityModel.GetList()
|
||||||
|
.Where(e => e.Info()?.Name?.Equals(name, StringComparison.OrdinalIgnoreCase) == true)
|
||||||
|
.Where(e => e.Faction()?.Faction == faction)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (candidates.Count == 0)
|
||||||
|
candidates = EntityModel.GetList()
|
||||||
|
.Where(e => e.Info()?.Name?.Equals(name, StringComparison.OrdinalIgnoreCase) == true)
|
||||||
|
.Where(e => e.Faction() == null || e.Faction()!.Faction == DataType.FACTION_Neutral)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (candidates.Count == 0) return null;
|
||||||
|
if (candidates.Count == 1) return candidates[0];
|
||||||
|
|
||||||
|
var vanguardMatch = candidates.FirstOrDefault(e => e.VanguardAdded()?.ImmortalId == immortal);
|
||||||
|
if (vanguardMatch != null) return vanguardMatch;
|
||||||
|
|
||||||
|
return candidates.FirstOrDefault(e => e.VanguardAdded() == null);
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using Services;
|
||||||
|
|
||||||
|
namespace IGP.Calculator.Cli.Services;
|
||||||
|
|
||||||
|
public class NullStorageService : IStorageService
|
||||||
|
{
|
||||||
|
private readonly Dictionary<string, object?> _store = new();
|
||||||
|
|
||||||
|
public void Subscribe(Action action)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Unsubscribe(Action action)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public T GetValue<T>(string forKey)
|
||||||
|
{
|
||||||
|
if (_store.TryGetValue(forKey, out var value) && value is T typed)
|
||||||
|
return typed;
|
||||||
|
return default!;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetValue<T>(string key, T value)
|
||||||
|
{
|
||||||
|
_store[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task Load()
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<RootNamespace>Components</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
@@ -15,24 +16,24 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<SupportedPlatform Include="browser" />
|
<SupportedPlatform Include="browser"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Markdig" Version="0.28.1" />
|
<PackageReference Include="Markdig" Version="0.28.1"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.8" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.14"/>
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.7.22376.6" />
|
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.14"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Inputs\" />
|
<Folder Include="Inputs\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Model\Model.csproj" />
|
<ProjectReference Include="..\Model\Model.csproj"/>
|
||||||
<ProjectReference Include="..\Services\Services.csproj" />
|
<ProjectReference Include="..\Services\Services.csproj"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Inputs\" />
|
<None Remove="Inputs\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -13,15 +13,14 @@
|
|||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
.code::-webkit-scrollbar {
|
.code::-webkit-scrollbar {
|
||||||
height: 0;
|
height: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.devOnlyTitle {
|
.devOnlyTitle {
|
||||||
background-color: rgba(20,20,20,0.75);
|
background-color: rgba(20, 20, 20, 0.75);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
color: orange;
|
color: orange;
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
@@ -30,14 +30,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.devOnlyContent {
|
.devOnlyContent {
|
||||||
background-color: rgba(20,20,20,0.75);
|
background-color: rgba(20, 20, 20, 0.75);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.devOnlyTitleContainer {
|
.devOnlyTitleContainer {
|
||||||
background: repeating-linear-gradient( 45deg, blue, blue 50px, orange 51px, orange 100px);
|
background: repeating-linear-gradient(45deg, blue, blue 50px, orange 51px, orange 100px);
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-left: 6px dashed orange;
|
border-left: 6px dashed orange;
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
.devOnlyContentContainer {
|
.devOnlyContentContainer {
|
||||||
border: 6px dashed orange;
|
border: 6px dashed orange;
|
||||||
background: repeating-linear-gradient( 45deg, blue, blue 50px, orange 51px, orange 100px);
|
background: repeating-linear-gradient(45deg, blue, blue 50px, orange 51px, orange 100px);
|
||||||
box-shadow: 5px 5px 5px blue;
|
box-shadow: 5px 5px 5px blue;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
@@ -58,11 +58,9 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Inject]
|
[Inject] NavigationManager NavigationManager { get; set; } = default!;
|
||||||
NavigationManager NavigationManager { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
bool isOnDev;
|
bool isOnDev;
|
||||||
|
|
||||||
|
|||||||
@@ -69,10 +69,8 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Title { get; set; } = default!;
|
||||||
public string Title { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
@inject IGlossaryService glossaryService
|
||||||
|
|
||||||
|
@if (TermId != null)
|
||||||
|
{
|
||||||
|
var term = glossaryService.GetTerm(TermId);
|
||||||
|
if (term != null)
|
||||||
|
{
|
||||||
|
<div class="glossaryTooltipWrapper">
|
||||||
|
<div class="glossaryTooltipContent">
|
||||||
|
<div class="glossaryTooltipHeader">
|
||||||
|
<span class="glossaryTooltipTerm">@term.Term</span>
|
||||||
|
<span class="glossaryTooltipCategory">@term.Category</span>
|
||||||
|
</div>
|
||||||
|
<div class="glossaryTooltipBody">
|
||||||
|
@term.ShortDefinition
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ChildContent
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.glossaryTooltipWrapper {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryTooltipContent {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
width: 400px;
|
||||||
|
max-width: 93vw;
|
||||||
|
bottom: 100%;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
z-index: 2147483647;
|
||||||
|
background-color: var(--info-secondary);
|
||||||
|
border: 1px solid var(--info-secondary-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryTooltipWrapper:hover .glossaryTooltipContent {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryTooltipHeader {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryTooltipTerm {
|
||||||
|
font-weight: 800;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryTooltipCategory {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryTooltipBody {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@media only screen and (max-width: 1025px) {
|
||||||
|
.glossaryTooltipContent {
|
||||||
|
margin: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
|
|
||||||
|
[Parameter] public string TermId { get; set; } = default!;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
z-index: 2147483647;
|
z-index: 2147483647;
|
||||||
|
|
||||||
background-color: var(--info-secondary);
|
background-color: var(--info-secondary);
|
||||||
border: 1px solid var(--info-secondary-border);
|
border: 1px solid var(--info-secondary-border);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
|
||||||
box-shadow: 0 3px 8px rgba(0,0,0,0.5);
|
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -55,13 +55,10 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string InfoText { get; set; } = default!;
|
||||||
public string InfoText { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public int? Margin { get; set; }
|
||||||
public int? Margin { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -70,13 +70,13 @@
|
|||||||
.makingOfContainer summary {
|
.makingOfContainer summary {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background-color: rgba(0,0,0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.shownCode {
|
.shownCode {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background-color: rgba(0,0,0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.makingOfContainer details[open] .shownCode {
|
.makingOfContainer details[open] .shownCode {
|
||||||
@@ -97,20 +97,15 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Title { get; set; } = default!;
|
||||||
public RenderFragment Title { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Description { get; set; } = default!;
|
||||||
public RenderFragment Description { get; set; } = default!;
|
|
||||||
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Example { get; set; } = default!;
|
||||||
public RenderFragment Example { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Usage { get; set; } = default!;
|
||||||
public RenderFragment Usage { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Code { get; set; } = default!;
|
||||||
public RenderFragment Code { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,24 +9,22 @@
|
|||||||
<style>
|
<style>
|
||||||
.makingOfSection {
|
.makingOfSection {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: rgba(0,0,0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
padding: 25px;
|
padding: 25px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 2px black dashed;
|
border: 2px black dashed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.makingOfSection > summary {
|
.makingOfSection > summary {
|
||||||
font-size: 3.4em;
|
font-size: 3.4em;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Title { get; set; } = default!;
|
||||||
public string Title { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -18,10 +18,8 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Title { get; set; } = default!;
|
||||||
public string Title { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -52,13 +52,10 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? Title { get; set; }
|
||||||
public RenderFragment? Title { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? Message { get; set; }
|
||||||
public RenderFragment? Message { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Type { get; set; } = SeverityType.Warning;
|
||||||
public string Type { get; set; } = SeverityType.Warning;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.toastContainer {
|
.toastContainer {
|
||||||
border: 4px solid;
|
border: 4px solid;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -58,11 +58,10 @@ else
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public ToastModel? Toast { get; set; }
|
||||||
public ToastModel? Toast { get; set; } = default!;
|
|
||||||
|
|
||||||
private float removalTime = 1300;
|
private readonly float removalTime = 1300;
|
||||||
private float fadeoutTime = 1200;
|
private readonly float fadeoutTime = 1200;
|
||||||
|
|
||||||
private float Opacity()
|
private float Opacity()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,20 +51,15 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Label { get; set; } = "";
|
||||||
public string Label { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Info { get; set; } = "";
|
||||||
public string Info { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool ReadOnly { get; set; }
|
||||||
public bool ReadOnly { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool Value { get; set; }
|
||||||
public bool Value { get; set; }
|
|
||||||
|
|
||||||
private string labelId = "";
|
private string labelId = "";
|
||||||
|
|
||||||
|
|||||||
@@ -35,23 +35,18 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
//TODO Clean up
|
//TODO Clean up
|
||||||
[Parameter]
|
[Parameter] public string Label { get; set; } = default!;
|
||||||
public string Label { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Info { get; set; } = default!;
|
||||||
public string Info { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? Display { get; set; }
|
||||||
public RenderFragment? Display { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool? ReadOnly { get; set; }
|
||||||
public bool? ReadOnly { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string? Value { get; set; }
|
||||||
public string? Value { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
<div class="escapeCodeContainer">
|
<div class="escapeCodeContainer">
|
||||||
<textarea style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;"
|
<textarea style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;"
|
||||||
rows="8"
|
rows="8"
|
||||||
@onchange="OnChange" />
|
@onchange="OnChange"/>
|
||||||
|
|
||||||
<textarea style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;"
|
<textarea style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;"
|
||||||
rows="8"
|
rows="8"
|
||||||
@bind="Output" />
|
@bind="Output"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@using Model.MemoryTester
|
@using Model.MemoryTester
|
||||||
@using Services.Immortal
|
|
||||||
@implements IDisposable
|
@implements IDisposable
|
||||||
|
|
||||||
@inject IMemoryTesterService MemoryTesterService
|
@inject IMemoryTesterService MemoryTesterService
|
||||||
@@ -13,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
<div>
|
<div>
|
||||||
<input readonly="@MemoryQuestion.IsRevealed"
|
<input readonly="@MemoryQuestion.IsRevealed"
|
||||||
class="formTextInput @(MemoryQuestion.IsRevealed ? "revealed" : IsSubmitted == false ? "guess" : int.Parse(guess ?? string.Empty) == MemoryQuestion.Answer ? "correct" : "wrong")"
|
class="formTextInput @(MemoryQuestion.IsRevealed ? "revealed" : !IsSubmitted ? "guess" : int.Parse(guess ?? string.Empty) == MemoryQuestion.Answer ? "correct" : "wrong")"
|
||||||
placeholder="guess..."
|
placeholder="guess..."
|
||||||
type="number"
|
type="number"
|
||||||
value="@guess"
|
value="@guess"
|
||||||
@@ -73,20 +72,15 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Label { get; set; } = "";
|
||||||
public string Label { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Info { get; set; } = "";
|
||||||
public string Info { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<AnswerEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<AnswerEventArgs> OnChange { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public MemoryQuestionModel MemoryQuestion { get; set; } = default!;
|
||||||
public MemoryQuestionModel MemoryQuestion { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool IsSubmitted { get; set; }
|
||||||
public bool IsSubmitted { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
private string? guess = "";
|
private string? guess = "";
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -38,17 +38,13 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? FormLabelComponent { get; set; }
|
||||||
public RenderFragment? FormLabelComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Id { get; set; } = default!;
|
||||||
public string Id { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? FormInfoComponent { get; set; }
|
||||||
public RenderFragment? FormInfoComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
void OnInputChanged(ChangeEventArgs changeEventArgs)
|
void OnInputChanged(ChangeEventArgs changeEventArgs)
|
||||||
{
|
{
|
||||||
@@ -73,16 +69,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool ReadOnly { get; set; }
|
||||||
public bool ReadOnly { get; set; } = false;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public int Value { get; set; }
|
||||||
public int Value { get; set; } = 0;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public int Min { get; set; }
|
||||||
public int Min { get; set; } = 0;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public int Max { get; set; } = 2048;
|
||||||
public int Max { get; set; } = 2048;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,16 +17,12 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? FormLabelComponent { get; set; }
|
||||||
public RenderFragment? FormLabelComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? FormInfoComponent { get; set; }
|
||||||
public RenderFragment? FormInfoComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
type="text"
|
type="text"
|
||||||
rows="@Rows"
|
rows="@Rows"
|
||||||
value="@Value"
|
value="@Value"
|
||||||
@onchange="OnChange" />
|
@onchange="OnChange"/>
|
||||||
</div>
|
</div>
|
||||||
@if (Info != "")
|
@if (Info != "")
|
||||||
{
|
{
|
||||||
@@ -56,32 +56,23 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? FormLabelComponent { get; set; }
|
||||||
public RenderFragment? FormLabelComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? FormInfoComponent { get; set; }
|
||||||
public RenderFragment? FormInfoComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool? ReadOnly { get; set; }
|
||||||
public bool? ReadOnly { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string? Value { get; set; }
|
||||||
public string? Value { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public int Rows { get; set; } = 4;
|
||||||
public int Rows { get; set; } = 4;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Label { get; set; } = "";
|
||||||
public string Label { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Info { get; set; } = "";
|
||||||
public string Info { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Placeholder { get; set; } = "";
|
||||||
public string Placeholder { get; set; } = "";
|
|
||||||
|
|
||||||
private string labelId = "";
|
private string labelId = "";
|
||||||
|
|
||||||
|
|||||||
@@ -52,34 +52,25 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Id { get; set; } = "";
|
||||||
public string Id { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Label { get; set; } = "";
|
||||||
public string Label { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Info { get; set; } = "";
|
||||||
public string Info { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Placeholder { get; set; } = "";
|
||||||
public string Placeholder { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnInput { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnInput { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback OnFocus { get; set; }
|
||||||
public EventCallback OnFocus { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool ReadOnly { get; set; }
|
||||||
public bool ReadOnly { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Value { get; set; } = "";
|
||||||
public string Value { get; set; } = "";
|
|
||||||
|
|
||||||
private string labelId = "";
|
private string labelId = "";
|
||||||
|
|
||||||
|
|||||||
@@ -46,72 +46,67 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.switch {
|
.switch {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
top: 4px;
|
top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.switch input {
|
.switch input {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider {
|
.slider {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: var(--paper-border);
|
background-color: var(--paper-border);
|
||||||
-webkit-transition: .4s;
|
-webkit-transition: .4s;
|
||||||
transition: .4s;
|
transition: .4s;
|
||||||
border-radius: 34px;
|
border-radius: 34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider:before {
|
.slider:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
content: "";
|
content: "";
|
||||||
height: 26px;
|
height: 26px;
|
||||||
width: 26px;
|
width: 26px;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
bottom: 4px;
|
bottom: 4px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
-webkit-transition: .4s;
|
-webkit-transition: .4s;
|
||||||
transition: .4s;
|
transition: .4s;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checked + .slider {
|
.checked + .slider {
|
||||||
background-color: #7838df;
|
background-color: #7838df;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checked + .slider:before {
|
.checked + .slider:before {
|
||||||
-webkit-transform: translateX(26px);
|
-webkit-transform: translateX(26px);
|
||||||
-ms-transform: translateX(26px);
|
-ms-transform: translateX(26px);
|
||||||
transform: translateX(26px);
|
transform: translateX(26px);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Label { get; set; } = "";
|
||||||
public string Label { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Info { get; set; } = "";
|
||||||
public string Info { get; set; } = "";
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
||||||
public EventCallback<ChangeEventArgs> OnChange { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool ReadOnly { get; set; }
|
||||||
public bool ReadOnly { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public bool Value { get; set; }
|
||||||
public bool Value { get; set; }
|
|
||||||
|
|
||||||
private string labelId = "";
|
private string labelId = "";
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,8 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? InfoQuestionComponent { get; set; }
|
||||||
public RenderFragment? InfoQuestionComponent { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? InfoAnswerComponent { get; set; }
|
||||||
public RenderFragment? InfoAnswerComponent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -19,31 +19,28 @@
|
|||||||
background-color: var(--secondary);
|
background-color: var(--secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.@MyButtonType.Primary.ToString().ToLower():hover {
|
.@MyButtonType.Primary.ToString().ToLower():hover {
|
||||||
background-color: var(--primary-hover);
|
background-color: var(--primary-hover);
|
||||||
border-color: var(--primary-border-hover);
|
border-color: var(--primary-border-hover);
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.@MyButtonType.Secondary.ToString().ToLower():hover {
|
.@MyButtonType.Secondary.ToString().ToLower():hover {
|
||||||
background-color: var(--secondary-hover);
|
background-color: var(--secondary-hover);
|
||||||
border-color: var(--secondary-border-hover);
|
border-color: var(--secondary-border-hover);
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<EventArgs> OnClick { get; set; }
|
||||||
public EventCallback<EventArgs> OnClick { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public MyButtonType MyButtonType { get; set; }
|
||||||
public MyButtonType MyButtonType { get; set; } = default!;
|
|
||||||
|
|
||||||
private void ButtonClicked(EventArgs eventArgs)
|
private void ButtonClicked(EventArgs eventArgs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,76 +7,75 @@
|
|||||||
{
|
{
|
||||||
styleClass = "selected";
|
styleClass = "selected";
|
||||||
}
|
}
|
||||||
|
|
||||||
<button @onclick="@(e => OnChangeChoice(choice))" class="groupChoiceButton @styleClass">@choice</button>
|
<button @onclick="@(e => OnChangeChoice(choice))" class="groupChoiceButton @styleClass">@choice</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
.groupButtonContainerContainer {
|
.groupButtonContainerContainer {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
justify-items: flex-start;
|
justify-items: flex-start;
|
||||||
}
|
}
|
||||||
.groupButtonContainer {
|
|
||||||
display: flex;
|
|
||||||
background-color: var(--background);
|
|
||||||
gap: 2px;
|
|
||||||
margin-right: auto;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.groupChoiceButton {
|
.groupButtonContainer {
|
||||||
background-color: var(--primary);
|
display: flex;
|
||||||
color: white;
|
background-color: var(--background);
|
||||||
padding: 12px;
|
gap: 2px;
|
||||||
border: 1px solid var(--primary);
|
margin-right: auto;
|
||||||
}
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.groupChoiceButton:hover {
|
.groupChoiceButton {
|
||||||
background-color: var(--primary-hover);
|
background-color: var(--primary);
|
||||||
border-color: var(--primary-border-hover);
|
color: white;
|
||||||
}
|
padding: 12px;
|
||||||
|
border: 1px solid var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
.selected {
|
.groupChoiceButton:hover {
|
||||||
background-color: var(--secondary);
|
background-color: var(--primary-hover);
|
||||||
color: white;
|
border-color: var(--primary-border-hover);
|
||||||
font-style: normal;
|
}
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected:hover {
|
.selected {
|
||||||
background-color: var(--secondary-hover);
|
background-color: var(--secondary);
|
||||||
border-color: var(--secondary-border-hover);
|
color: white;
|
||||||
}
|
font-style: normal;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected:hover {
|
||||||
|
background-color: var(--secondary-hover);
|
||||||
|
border-color: var(--secondary-border-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.groupButtonContainer .groupChoiceButton:first-child {
|
.groupButtonContainer .groupChoiceButton:first-child {
|
||||||
border-top-left-radius: 8px;
|
border-top-left-radius: 8px;
|
||||||
border-bottom-left-radius: 8px;
|
border-bottom-left-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.groupButtonContainer .groupChoiceButton:last-child {
|
.groupButtonContainer .groupChoiceButton:last-child {
|
||||||
border-top-right-radius: 8px;
|
border-top-right-radius: 8px;
|
||||||
border-bottom-right-radius: 8px;
|
border-bottom-right-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Choice { get; set; } = default!;
|
||||||
public string Choice { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public List<string> Choices { get; set; } = default!;
|
||||||
public List<string> Choices { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public EventCallback<string> OnClick { get; set; }
|
||||||
public EventCallback<string> OnClick { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Href { get; set; } = "";
|
||||||
public string Href { get; set; } = "";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Href { get; set; } = "";
|
||||||
public string Href { get; set; } = "";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -14,10 +14,9 @@ else
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string EntityId { get; set; } = default!;
|
||||||
public string EntityId { get; set; } = default!;
|
|
||||||
|
|
||||||
private EntityModel Entity => DATA.Get()[EntityId];
|
private EntityModel Entity => EntityData.Get()[EntityId];
|
||||||
|
|
||||||
void EntityLabelClicked()
|
void EntityLabelClicked()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@inject IGlossaryService glossaryService
|
||||||
|
@inject IGlossaryDialogService glossaryDialogService
|
||||||
|
|
||||||
|
@if (TermId == null)
|
||||||
|
{
|
||||||
|
<span>Missing term</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var term = glossaryService.GetTerm(TermId);
|
||||||
|
if (term != null)
|
||||||
|
{
|
||||||
|
<button class="glossaryLabel @term.Category.ToLowerInvariant()" @onclick="TermLabelClicked"
|
||||||
|
title="@term.ShortDefinition">
|
||||||
|
@term.Term
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
[Parameter] public string TermId { get; set; } = default!;
|
||||||
|
|
||||||
|
void TermLabelClicked()
|
||||||
|
{
|
||||||
|
glossaryDialogService.AddDialog(TermId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
.glossaryLabel {
|
||||||
|
font-weight: bolder;
|
||||||
|
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2);
|
||||||
|
padding-right: 4px;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
text-decoration: underline;
|
||||||
|
text-decoration-style: dotted;
|
||||||
|
text-underline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glossaryLabel:hover {
|
||||||
|
background-color: var(--primary-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.resource {
|
||||||
|
color: gold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mechanic {
|
||||||
|
color: #8fc5ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.faction {
|
||||||
|
color: #da4e4e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role {
|
||||||
|
color: #87aa87;
|
||||||
|
}
|
||||||
@@ -24,12 +24,10 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Href { get; set; } = "";
|
||||||
public string Href { get; set; } = "";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -30,26 +30,24 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchHotkey {
|
.searchHotkey {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
background-color: rgba(255,255,255,0.05);
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
border: 2px solid rgba(255,255,255,0.25);
|
border: 2px solid rgba(255, 255, 255, 0.25);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Id { get; set; } = default!;
|
||||||
public string Id { get; set; } = default!;
|
|
||||||
|
|
||||||
private string _userAgent = "";
|
private string _userAgent = "";
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,11 +29,9 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string Id { get; set; } = default!;
|
||||||
public string Id { get; set; } = default!;
|
|
||||||
|
|
||||||
private void ButtonClicked(EventArgs eventArgs)
|
private void ButtonClicked(EventArgs eventArgs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@media only screen and (min-width: 1024px) {
|
@@media only screen and (min-width: 1024px) {
|
||||||
.lrg_container {
|
.lrg_container {
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
@@ -34,7 +33,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@media only screen and (min-width: 1024px) {
|
@@media only screen and (min-width: 1024px) {
|
||||||
.med_container {
|
.med_container {
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
|
|
||||||
grid-template-columns: 412px 1fr;
|
grid-template-columns: 412px 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layoutSidebar {
|
.layoutSidebar {
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@media only screen and (min-width: 1024px) {
|
@@media only screen and (min-width: 1024px) {
|
||||||
.layoutWithSidebar {
|
.layoutWithSidebar {
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
@@ -50,10 +49,8 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Sidebar { get; set; } = default!;
|
||||||
public RenderFragment Sidebar { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Content { get; set; } = default!;
|
||||||
public RenderFragment Content { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,9 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Inject]
|
[Inject] protected HttpClient Http { get; set; } = default!;
|
||||||
protected HttpClient Http { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public string MarkdownFileName { get; set; } = default!;
|
||||||
public string MarkdownFileName { get; set; } = default!;
|
|
||||||
|
|
||||||
private string MarkdownText { get; set; } = "";
|
private string MarkdownText { get; set; } = "";
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.clickOffBackground.clickOffVisible {
|
.clickOffBackground.clickOffVisible {
|
||||||
visibility:visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sectionButton {
|
.sectionButton {
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
background-color: rgba(255,255,255,0.1);
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.menuHeader {
|
.menuHeader {
|
||||||
@@ -106,11 +106,11 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sectionNav {
|
.sectionNav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.websiteTitle {
|
.websiteTitle {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -119,11 +119,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navMenuPosition {
|
.navMenuPosition {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 18px;
|
top: 18px;
|
||||||
left: calc(-50% + -330px / 2);
|
left: calc(-50% + -330px / 2);
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navMenuContainer {
|
.navMenuContainer {
|
||||||
@@ -166,11 +166,9 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public List<WebSectionModel> WebSections { get; set; } = default!;
|
||||||
public List<WebSectionModel> WebSections { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public List<WebPageModel> WebPages { get; set; } = default!;
|
||||||
public List<WebPageModel> WebPages { get; set; } = default!;
|
|
||||||
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
|
|||||||
@@ -12,7 +12,9 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<NavLink target="@Links.GetTarget(Page.Href)" @onclick="() => { NavigationService.ChangeNavigationState(NavigationStateType.Default); NavigationService.ChangeNavigationSectionId(-1); }" href="@Page.Href" class="desktopNavLink">
|
<NavLink target="@Links.GetTarget(Page.Href)"
|
||||||
|
@onclick="() => { NavigationService.ChangeNavigationState(NavigationStateType.Default); NavigationService.ChangeNavigationSectionId(-1); }"
|
||||||
|
href="@Page.Href" class="desktopNavLink">
|
||||||
<div class="navName">
|
<div class="navName">
|
||||||
@Page.Name
|
@Page.Name
|
||||||
</div>
|
</div>
|
||||||
@@ -50,11 +52,11 @@ else
|
|||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.desktopNavLink:hover {
|
.desktopNavLink:hover {
|
||||||
color: #8EC3FF;
|
color: #8EC3FF;
|
||||||
background-color: var(--primary-hover);
|
background-color: var(--primary-hover);
|
||||||
border-color: var(--primary-border-hover);
|
border-color: var(--primary-border-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.navSelected {
|
.navSelected {
|
||||||
background-color: var(--primary-hover);
|
background-color: var(--primary-hover);
|
||||||
@@ -65,10 +67,9 @@ else
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public WebPageModel Page { get; set; } = default!;
|
||||||
public WebPageModel Page { get; set; } = default!;
|
|
||||||
|
|
||||||
bool isOnPage = false;
|
bool isOnPage;
|
||||||
|
|
||||||
protected override Task OnParametersSetAsync()
|
protected override Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
<DesktopNavLinkComponent Page=childPage></DesktopNavLinkComponent>
|
<DesktopNavLinkComponent Page=childPage></DesktopNavLinkComponent>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -24,7 +25,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public WebSectionModel Section { get; set; } = default!;
|
||||||
public WebSectionModel Section { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
<div class="mobileNavSectionsContainer">
|
<div class="mobileNavSectionsContainer">
|
||||||
@foreach (var webSection in WebSections)
|
@foreach (var webSection in WebSections)
|
||||||
{
|
{
|
||||||
<div class="mobileNavSectionButton" @onclick="() => OnSectionClicked(webSection)" @onclick:preventDefault="true" @onclick:stopPropagation="true">
|
<div class="mobileNavSectionButton" @onclick="() => OnSectionClicked(webSection)"
|
||||||
|
@onclick:preventDefault="true" @onclick:stopPropagation="true">
|
||||||
<div class="mobileNavSectionButtonText">
|
<div class="mobileNavSectionButtonText">
|
||||||
<i class="fa-solid @webSection.Icon" style="font-size: 28px;"></i>
|
<i class="fa-solid @webSection.Icon" style="font-size: 28px;"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -11,7 +12,8 @@
|
|||||||
<SearchIconButtonComponent/>
|
<SearchIconButtonComponent/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fullPageButton @(selectedSection != null)" @onclick="OnPageClicked" @onclick:stopPropagation="false" @onclick:preventDefault="false">
|
<div class="fullPageButton @(selectedSection != null)" @onclick="OnPageClicked" @onclick:stopPropagation="false"
|
||||||
|
@onclick:preventDefault="false">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (selectedSection != null)
|
@if (selectedSection != null)
|
||||||
@@ -27,7 +29,9 @@
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
<div class="mobileNavPageButton" @onclick="() => OnPageLinkClicked(webPage)" @onclick:preventDefault="true" @onclick:stopPropagation="true">
|
|
||||||
|
<div class="mobileNavPageButton" @onclick="() => OnPageLinkClicked(webPage)"
|
||||||
|
@onclick:preventDefault="true" @onclick:stopPropagation="true">
|
||||||
<div class="mobileNavPageButtonText">
|
<div class="mobileNavPageButtonText">
|
||||||
@webPage.Name
|
@webPage.Name
|
||||||
</div>
|
</div>
|
||||||
@@ -45,7 +49,7 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
display: none;
|
display: none;
|
||||||
background-color: rgba(0,0,0,0.6);
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fullPageButton.True {
|
.fullPageButton.True {
|
||||||
@@ -53,11 +57,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.mobileFooter {
|
.mobileFooter {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-color: rgba(0,0,0,1);
|
background-color: rgba(0, 0, 0, 1);
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
display: none;
|
display: none;
|
||||||
@@ -109,10 +111,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.mobileNavPageButton:hover {
|
.mobileNavPageButton:hover {
|
||||||
background-color: var(--primary-hover);
|
background-color: var(--primary-hover);
|
||||||
border-color: var(--primary-border-hover);
|
border-color: var(--primary-border-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.mobileNavSectionButton:hover {
|
.mobileNavSectionButton:hover {
|
||||||
@@ -143,11 +145,9 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
#if NO_SQL
|
#if NO_SQL
|
||||||
[Parameter]
|
[Parameter] public List<WebSectionModel> WebSections { get; set; } = default!;
|
||||||
public List<WebSectionModel> WebSections { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public List<WebPageModel> WebPages { get; set; } = default!;
|
||||||
public List<WebPageModel> WebPages { get; set; } = default!;
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
[Parameter]
|
[Parameter]
|
||||||
@@ -157,8 +157,7 @@
|
|||||||
public DbSet<WebPageModel> WebPages { get; set; }
|
public DbSet<WebPageModel> WebPages { get; set; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[Inject]
|
[Inject] public NavigationManager NavigationManager { get; set; } = default!;
|
||||||
public NavigationManager NavigationManager { get; set; } = default!;
|
|
||||||
|
|
||||||
|
|
||||||
private WebSectionModel? selectedSection;
|
private WebSectionModel? selectedSection;
|
||||||
|
|||||||
@@ -17,7 +17,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="fullPageButton @navOpen" @onclick="OnNavClicked" @onclick:stopPropagation="false" @onclick:preventDefault="false">
|
<div class="fullPageButton @navOpen" @onclick="OnNavClicked" @onclick:stopPropagation="false"
|
||||||
|
@onclick:preventDefault="false">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
<NavLink href="@webPage.Href" class="tabletNavItem" @onclick="OnPageClicked">
|
<NavLink href="@webPage.Href" class="tabletNavItem" @onclick="OnPageClicked">
|
||||||
@webPage.Name
|
@webPage.Name
|
||||||
</NavLink>
|
</NavLink>
|
||||||
@@ -58,12 +60,12 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
display: none;
|
display: none;
|
||||||
background-color: rgba(0,0,0,0.6);
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fullPageButton.True {
|
.fullPageButton.True {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tablet {
|
.tablet {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -71,7 +73,7 @@
|
|||||||
|
|
||||||
.tabletNav {
|
.tabletNav {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-color: rgba(30,30,30,0.98);
|
background-color: rgba(30, 30, 30, 0.98);
|
||||||
display: none;
|
display: none;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
@@ -108,7 +110,7 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
background-color: var(--accent);
|
background-color: var(--accent);
|
||||||
border-bottom: 4px solid rgba(0,0,0,0.95);
|
border-bottom: 4px solid rgba(0, 0, 0, 0.95);
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,16 +127,16 @@
|
|||||||
|
|
||||||
.tabletButton {
|
.tabletButton {
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
background-color: rgba(0,0,0,0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabletButton:hover {
|
.tabletButton:hover {
|
||||||
background-color: rgba(0,0,0,0.7);
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@media only screen and (max-width: 1025px) {
|
@@media only screen and (max-width: 1025px) {
|
||||||
@@ -153,11 +155,9 @@
|
|||||||
@code {
|
@code {
|
||||||
|
|
||||||
#if NO_SQL
|
#if NO_SQL
|
||||||
[Parameter]
|
[Parameter] public List<WebSectionModel> WebSections { get; set; } = default!;
|
||||||
public List<WebSectionModel> WebSections { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public List<WebPageModel> WebPages { get; set; } = default!;
|
||||||
public List<WebPageModel> WebPages { get; set; } = default!;
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
[Parameter]
|
[Parameter]
|
||||||
|
|||||||
@@ -5,14 +5,11 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public WebDeploymentType DeploymentType { get; set; }
|
||||||
public WebDeploymentType DeploymentType { get; set; }
|
|
||||||
|
|
||||||
[Inject]
|
[Inject] public NavigationManager MyNavigationManager { get; set; } = default!;
|
||||||
public NavigationManager MyNavigationManager { get; set; } = default!;
|
|
||||||
|
|
||||||
bool isDisplayable;
|
bool isDisplayable;
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,9 @@ else
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
[Inject]
|
[Inject] public NavigationManager MyNavigationManager { get; set; } = default!;
|
||||||
public NavigationManager MyNavigationManager { get; set; } = default!;
|
|
||||||
|
|
||||||
bool isDisplayable;
|
bool isDisplayable;
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,6 @@
|
|||||||
@inject IVariableService VariableService
|
<div class="footerContainer" xmlns="http://www.w3.org/1999/html">
|
||||||
|
|
||||||
<div class="footerContainer" xmlns="http://www.w3.org/1999/html">
|
|
||||||
<div class="footerSocials">
|
|
||||||
|
|
||||||
<a class="footerIcon" href="https://github.com/JonathanMcCaffrey/IGP-Fan-Reference/discussions" target="_blank">
|
|
||||||
<i class="fa-brands fa-github"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a class="footerIcon" href="mailto:igpfanreference@jonathanmccaffrey.com" target="_blank">
|
|
||||||
<i class="fa-solid fa-envelope"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a class="footerIcon" href="https://discord.gg/uMq8bMGeeN" target="_blank">
|
|
||||||
<i class="fa-brands fa-discord"></i>
|
|
||||||
</a>
|
|
||||||
<a class="footerIcon" href="https://www.youtube.com/channel/UCQx88d5C12yp4l7uszNYrdQ" target="_blank">
|
|
||||||
<i class="fa-brands fa-youtube"></i>
|
|
||||||
</a>
|
|
||||||
<a class="footerIcon" href="https://www.twitch.tv/jonathanmccaffrey" target="_blank">
|
|
||||||
<i class="fa-brands fa-twitch"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="footerDivider"></div>
|
<div class="footerDivider"></div>
|
||||||
|
|
||||||
<div class="footerLastUpdated">Website updated <a href="https://github.com/JonathanMcCaffrey/IGP-Fan-Reference/commits/main"><b>@VariableService.Variables["LastUpdated"]</b></a></div>
|
|
||||||
|
|
||||||
<div class="footerDisclaimer">
|
<div class="footerDisclaimer">
|
||||||
This website is fan-made and not affiliated with <b>SunSpear Games</b> in any way.
|
This website is fan-made and not affiliated with <b>SunSpear Games</b> in any way.
|
||||||
</div>
|
</div>
|
||||||
@@ -36,20 +11,19 @@
|
|||||||
.footerIcon {
|
.footerIcon {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
background-color: rgba(255,255,255,0.05);
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
border: 2px solid rgba(255,255,255,0.1);
|
border: 2px solid rgba(255, 255, 255, 0.1);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footerIcon:hover {
|
.footerIcon:hover {
|
||||||
color: #8fc5ff;
|
color: #8fc5ff;
|
||||||
background-color: rgba(200,200,255,0.1);
|
background-color: rgba(200, 200, 255, 0.1);
|
||||||
border: 2px solid rgba(140,140,255,0.4);
|
border: 2px solid rgba(140, 140, 255, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.footerContainer {
|
.footerContainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -69,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.footerDivider {
|
.footerDivider {
|
||||||
background-color: rgba(255,255,255,0.12);
|
background-color: rgba(255, 255, 255, 0.12);
|
||||||
height: 1px;
|
height: 1px;
|
||||||
width: 128px;
|
width: 128px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|||||||
@@ -10,10 +10,8 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Dividee { get; set; } = default!;
|
||||||
public RenderFragment Dividee { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment Divider { get; set; } = default!;
|
||||||
public RenderFragment Divider { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<div style="display:flex; flex-direction:column; align-items:center;padding-right: 12px;padding-left: 4px; font-family:monospace">
|
<div
|
||||||
|
style="display:flex; flex-direction:column; align-items:center;padding-right: 12px;padding-left: 4px; font-family:monospace">
|
||||||
<div style="height: 0px;display:flex; flex-direction:row; ">
|
<div style="height: 0px;display:flex; flex-direction:row; ">
|
||||||
<div style="font-size: 18px; height: 0px;">
|
<div style="font-size: 18px; height: 0px;">
|
||||||
∑
|
∑
|
||||||
@@ -12,13 +13,10 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment LoopEnd { get; set; } = default!;
|
||||||
public RenderFragment LoopEnd { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment LoopStart { get; set; } = default!;
|
||||||
public RenderFragment LoopStart { get; set; } = default!;
|
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment IndexSymbol { get; set; } = default!;
|
||||||
public RenderFragment IndexSymbol { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
u {
|
u {
|
||||||
text-decoration-color: inherit;
|
text-decoration-color: inherit;
|
||||||
text-decoration-thickness:1px;
|
text-decoration-thickness: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spoiler:hover {
|
.spoiler:hover {
|
||||||
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
|
||||||
public RenderFragment ChildContent { get; set; } = default!;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
@inject IEntityDialogService entityDialogService
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
|
<div class="techTreeContainer" @ref="containerRef">
|
||||||
|
<svg class="techTreeSvg" width="@svgWidth" height="@svgHeight">
|
||||||
|
<!-- Edges -->
|
||||||
|
@foreach (var edge in Graph.Edges)
|
||||||
|
{
|
||||||
|
var source = Graph.Nodes.FirstOrDefault(n => n.Id == edge.SourceId);
|
||||||
|
var target = Graph.Nodes.FirstOrDefault(n => n.Id == edge.TargetId);
|
||||||
|
if (source != null && target != null)
|
||||||
|
{
|
||||||
|
var color = EdgeColor(edge.EdgeType);
|
||||||
|
var strokeWidth = edge.EdgeType == TechTreeEdgeType.Produces ? "2.5" : "1.5";
|
||||||
|
var strokeDash = edge.EdgeType == TechTreeEdgeType.RequiresProduction || edge.EdgeType == TechTreeEdgeType.RequiresResearch ? "6,3" : "";
|
||||||
|
strokeDash = edge.EdgeType == TechTreeEdgeType.Morph ? "2,2" : strokeDash;
|
||||||
|
|
||||||
|
<line x1="@(source.X + nodeWidth / 2)" y1="@(source.Y + nodeHeight / 2)"
|
||||||
|
x2="@(target.X + nodeWidth / 2)" y2="@(target.Y + nodeHeight / 2)"
|
||||||
|
stroke="@color" stroke-width="@strokeWidth"
|
||||||
|
stroke-dasharray="@strokeDash"
|
||||||
|
marker-end="url(#arrowhead-@(edge.EdgeType))"/>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<!-- Arrowhead markers -->
|
||||||
|
<defs>
|
||||||
|
@foreach (var edgeType in Graph.Edges.Select(e => e.EdgeType).Distinct())
|
||||||
|
{
|
||||||
|
<marker id="arrowhead-@edgeType" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
|
||||||
|
<polygon points="0 0, 10 3.5, 0 7" fill="@EdgeColor(edgeType)"/>
|
||||||
|
</marker>
|
||||||
|
}
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<!-- Nodes -->
|
||||||
|
@foreach (var node in Graph.Nodes)
|
||||||
|
{
|
||||||
|
var color = NodeColor(node.Descriptive);
|
||||||
|
var isHighlighted = HighlightEntityId == node.Id;
|
||||||
|
|
||||||
|
<g class="techTreeNode" @onclick="() => OnNodeClick(node.Id)">
|
||||||
|
<rect x="@node.X" y="@node.Y" width="@nodeWidth" height="@nodeHeight" rx="6"
|
||||||
|
fill="var(--paper)" stroke="@color" stroke-width="@(isHighlighted ? 3 : 1.5)"
|
||||||
|
class="@(isHighlighted ? "highlighted" : "")"/>
|
||||||
|
<text x="@(node.X + nodeWidth / 2)" y="@(node.Y + nodeHeight / 2)"
|
||||||
|
text-anchor="middle" dominant-baseline="central"
|
||||||
|
fill="white" font-size="12" font-weight="600">
|
||||||
|
@TruncateText(node.Name, 20)
|
||||||
|
</text>
|
||||||
|
<title>@node.Name (@node.EntityType)</title>
|
||||||
|
</g>
|
||||||
|
}
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.techTreeContainer {
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
border: 2px solid var(--paper-border);
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: var(--background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.techTreeSvg {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.techTreeNode {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.techTreeNode rect {
|
||||||
|
transition: stroke-width 0.15s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.techTreeNode rect.highlighted {
|
||||||
|
filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
|
||||||
|
}
|
||||||
|
|
||||||
|
.techTreeNode:hover rect {
|
||||||
|
stroke-width: 3;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
[Parameter] public TechTreeGraphModel Graph { get; set; } = new();
|
||||||
|
|
||||||
|
[Parameter] public string? HighlightEntityId { get; set; }
|
||||||
|
|
||||||
|
[Parameter] public EventCallback<string> OnEntitySelected { get; set; }
|
||||||
|
|
||||||
|
private ElementReference containerRef;
|
||||||
|
private const float nodeWidth = 140;
|
||||||
|
private const float nodeHeight = 36;
|
||||||
|
private const float horizontalSpacing = 60;
|
||||||
|
private const float verticalSpacing = 30;
|
||||||
|
private const float topPadding = 40;
|
||||||
|
private const float leftPadding = 40;
|
||||||
|
|
||||||
|
private float svgWidth = 800;
|
||||||
|
private float svgHeight = 600;
|
||||||
|
|
||||||
|
protected override void OnParametersSet()
|
||||||
|
{
|
||||||
|
ComputeLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ComputeLayout()
|
||||||
|
{
|
||||||
|
if (Graph.Nodes.Count == 0) return;
|
||||||
|
|
||||||
|
var layers = Graph.Nodes.GroupBy(n => n.Layer)
|
||||||
|
.OrderBy(g => g.Key)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// Simple layered layout: left to right (layers are columns)
|
||||||
|
for (var layerIdx = 0; layerIdx < layers.Count; layerIdx++)
|
||||||
|
{
|
||||||
|
var layerNodes = layers.ElementAt(layerIdx).OrderBy(n => n.Name).ToList();
|
||||||
|
var layerHeight = layerNodes.Count * (nodeHeight + verticalSpacing) - verticalSpacing;
|
||||||
|
|
||||||
|
for (var nodeIdx = 0; nodeIdx < layerNodes.Count; nodeIdx++)
|
||||||
|
{
|
||||||
|
var node = layerNodes[nodeIdx];
|
||||||
|
node.X = leftPadding + layerIdx * (nodeWidth + horizontalSpacing);
|
||||||
|
node.Y = topPadding + nodeIdx * (nodeHeight + verticalSpacing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
svgWidth = layers.Count * (nodeWidth + horizontalSpacing) + leftPadding + 100;
|
||||||
|
svgHeight = layers.Max(g => g.Count()) * (nodeHeight + verticalSpacing) + topPadding + 80;
|
||||||
|
|
||||||
|
if (svgWidth < 800) svgWidth = 800;
|
||||||
|
if (svgHeight < 400) svgHeight = 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnNodeClick(string entityId)
|
||||||
|
{
|
||||||
|
entityDialogService.AddDialog(entityId);
|
||||||
|
OnEntitySelected.InvokeAsync(entityId);
|
||||||
|
}
|
||||||
|
|
||||||
|
string NodeColor(string descriptive)
|
||||||
|
{
|
||||||
|
return descriptive.ToLowerInvariant() switch
|
||||||
|
{
|
||||||
|
"frontliner" => "#ff6b6b",
|
||||||
|
"skirmisher" => "#ffa502",
|
||||||
|
"support" => "#2ed573",
|
||||||
|
"generalist" => "#1e90ff",
|
||||||
|
"worker" => "#ffd43b",
|
||||||
|
"stronghold" => "#ff4757",
|
||||||
|
"upgrade" => "#a55eea",
|
||||||
|
"technology" => "#a55eea",
|
||||||
|
_ => "#8fc5ff"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
string EdgeColor(string edgeType)
|
||||||
|
{
|
||||||
|
return edgeType switch
|
||||||
|
{
|
||||||
|
"Produces" => "#2ed573",
|
||||||
|
"RequiresProduction" => "#ffa502",
|
||||||
|
"RequiresResearch" => "#a55eea",
|
||||||
|
"Morph" => "#ff6b6b",
|
||||||
|
"Upgrades" => "#1e90ff",
|
||||||
|
_ => "#666"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
string TruncateText(string text, int maxLength)
|
||||||
|
{
|
||||||
|
return text.Length <= maxLength ? text : text.Substring(0, maxLength - 3) + "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,9 +4,13 @@
|
|||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@using Model.Feedback
|
@using Model.Feedback
|
||||||
|
@using Model.Glossary
|
||||||
|
@using Model.TechTree
|
||||||
@using Model.Website
|
@using Model.Website
|
||||||
@using Model.Website.Enums
|
@using Model.Website.Enums
|
||||||
@using Services
|
@using Services
|
||||||
|
@using Services.Immortal
|
||||||
|
@using Services.Website
|
||||||
@using System.Net.Http
|
@using System.Net.Http
|
||||||
@using System.Net.Http.Json
|
@using System.Net.Http.Json
|
||||||
@using System.Text
|
@using System.Text
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
|
||||||
<DefineConstants>TRACE;</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
|
||||||
<DefineConstants>TRACE;</DefineConstants>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.8" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.8">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Model\Model.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#if NO_SQL
|
|
||||||
#else
|
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Model;
|
|
||||||
using Model.Doc;
|
|
||||||
using Model.Git;
|
|
||||||
using Model.Notes;
|
|
||||||
using Model.Website;
|
|
||||||
using Model.Work.Tasks;
|
|
||||||
|
|
||||||
namespace Contexts;
|
|
||||||
|
|
||||||
public class DatabaseContext : DbContext
|
|
||||||
{
|
|
||||||
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
|
|
||||||
{
|
|
||||||
Database.EnsureCreated();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DbSet<AgileSprintModel> AgileSprintModels { get; set; } = default!;
|
|
||||||
public DbSet<AgileTaskModel> AgileTaskModels { get; set; } = default!;
|
|
||||||
public DbSet<GitChangeModel> GitChangeModels { get; set; } = default!;
|
|
||||||
public DbSet<GitPatchModel> GitPatchModels { get; set; } = default!;
|
|
||||||
public DbSet<WebPageModel> WebPageModels { get; set; } = default!;
|
|
||||||
public DbSet<WebSectionModel> WebSectionModels { get; set; } = default!;
|
|
||||||
public DbSet<DocContentModel> DocContentModels { get; set; } = default!;
|
|
||||||
public DbSet<DocConnectionModel> DocConnectionModels { get; set; } = default!;
|
|
||||||
public DbSet<DocSectionModel> DocSectionModels { get; set; } = default!;
|
|
||||||
public DbSet<NoteContentModel> NoteContentModels { get; set; } = default!;
|
|
||||||
public DbSet<NoteConnectionModel> NoteConnectionModels { get; set; } = default!;
|
|
||||||
public DbSet<NoteSectionModel> NoteSectionModels { get; set; } = default!;
|
|
||||||
public DbSet<Variable> Variables { get; set; } = default!;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="Device.App">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
|
||||||
|
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
namespace Device;
|
||||||
|
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Window CreateWindow(IActivationState? activationState)
|
||||||
|
{
|
||||||
|
return new Window(new AppShell());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<Shell
|
||||||
|
x:Class="Device.AppShell"
|
||||||
|
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:Device"
|
||||||
|
Title="Device">
|
||||||
|
|
||||||
|
<ShellContent
|
||||||
|
Title="Home"
|
||||||
|
ContentTemplate="{DataTemplate local:MainPage}"
|
||||||
|
Route="MainPage" />
|
||||||
|
|
||||||
|
</Shell>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Device;
|
||||||
|
|
||||||
|
public partial class AppShell : Shell
|
||||||
|
{
|
||||||
|
public AppShell()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net10.0-android</TargetFrameworks>
|
||||||
|
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
|
||||||
|
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
|
||||||
|
<ProjectRuntimeIdentifier Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">win-x64</ProjectRuntimeIdentifier>
|
||||||
|
|
||||||
|
<!-- Note for MacCatalyst:
|
||||||
|
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
||||||
|
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
|
||||||
|
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
|
||||||
|
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
|
||||||
|
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||||
|
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>Device</RootNamespace>
|
||||||
|
<UseMaui>true</UseMaui>
|
||||||
|
<SingleProject>true</SingleProject>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<!-- Enable XAML source generation for faster build times and improved performance.
|
||||||
|
This generates C# code from XAML at compile time instead of runtime inflation.
|
||||||
|
To disable, remove this line.
|
||||||
|
For individual files, you can override by setting Inflator metadata:
|
||||||
|
<MauiXaml Update="MyPage.xaml" Inflator="Default" /> (reverts to defaults: Runtime for Debug, XamlC for Release)
|
||||||
|
<MauiXaml Update="MyPage.xaml" Inflator="Runtime" /> (force runtime inflation) -->
|
||||||
|
<MauiXamlInflator>SourceGen</MauiXamlInflator>
|
||||||
|
|
||||||
|
<!-- Display name -->
|
||||||
|
<ApplicationTitle>Device</ApplicationTitle>
|
||||||
|
|
||||||
|
<!-- App Identifier -->
|
||||||
|
<ApplicationId>com.companyname.device</ApplicationId>
|
||||||
|
|
||||||
|
<!-- Versions -->
|
||||||
|
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||||
|
<ApplicationVersion>1</ApplicationVersion>
|
||||||
|
|
||||||
|
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
||||||
|
<WindowsPackageType>None</WindowsPackageType>
|
||||||
|
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||||
|
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<!-- App Icon -->
|
||||||
|
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4"/>
|
||||||
|
|
||||||
|
<!-- Splash Screen -->
|
||||||
|
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128"/>
|
||||||
|
|
||||||
|
<!-- Images -->
|
||||||
|
<MauiImage Include="Resources\Images\*"/>
|
||||||
|
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185"/>
|
||||||
|
|
||||||
|
<!-- Custom Fonts -->
|
||||||
|
<MauiFont Include="Resources\Fonts\*"/>
|
||||||
|
|
||||||
|
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
|
||||||
|
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)"/>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0"/>
|
||||||
|
<PackageReference Include="MudBlazor" Version="9.2.0"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Components\Components.csproj"/>
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj"/>
|
||||||
|
<ProjectReference Include="..\Pages\Pages.csproj"/>
|
||||||
|
<ProjectReference Include="..\Services\Services.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:Device"
|
||||||
|
x:Class="Device.MainPage">
|
||||||
|
|
||||||
|
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/device.html">
|
||||||
|
<BlazorWebView.RootComponents>
|
||||||
|
<RootComponent Selector="#app" ComponentType="{x:Type local:MainRazor}" />
|
||||||
|
</BlazorWebView.RootComponents>
|
||||||
|
</BlazorWebView>
|
||||||
|
|
||||||
|
</ContentPage>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Device;
|
||||||
|
|
||||||
|
public partial class MainPage : ContentPage
|
||||||
|
{
|
||||||
|
public MainPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
@inject IGlossaryDialogService GlossaryDialogService
|
||||||
|
@inject IJSRuntime JsRuntime
|
||||||
|
|
||||||
|
<MudThemeProvider IsDarkMode="true"/>
|
||||||
|
<MudDialogProvider/>
|
||||||
|
<MudSnackbarProvider/>
|
||||||
|
|
||||||
|
<Router AppAssembly="@typeof(HomePage).Assembly">
|
||||||
|
<Found Context="routeData">
|
||||||
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
|
||||||
|
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
|
||||||
|
</Found>
|
||||||
|
<NotFound>
|
||||||
|
<PageTitle>Not found</PageTitle>
|
||||||
|
<LayoutView Layout="@typeof(MainLayout)">
|
||||||
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||||
|
</LayoutView>
|
||||||
|
</NotFound>
|
||||||
|
</Router>
|
||||||
|
|
||||||
|
<EntityDialogPortal/>
|
||||||
|
<GlossaryDialogPortal/>
|
||||||
|
<ToastPortal/>
|
||||||
|
<SearchPortal/>
|
||||||
|
<ConfirmationDialogPortal/>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (firstRender)
|
||||||
|
{
|
||||||
|
await JsRuntime.InvokeVoidAsync("glossaryInterop.init", DotNetObjectReference.Create(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JSInvokable]
|
||||||
|
public void OpenGlossaryTerm(string termId)
|
||||||
|
{
|
||||||
|
GlossaryDialogService.AddDialog(termId);
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using Blazored.LocalStorage;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using MudBlazor.Services;
|
||||||
|
using Services;
|
||||||
|
using Services.Development;
|
||||||
|
using Services.Immortal;
|
||||||
|
using Services.Website;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
public static class MauiProgram
|
||||||
|
{
|
||||||
|
public static MauiApp CreateMauiApp()
|
||||||
|
{
|
||||||
|
var builder = MauiApp.CreateBuilder();
|
||||||
|
builder
|
||||||
|
.UseMauiApp<App>()
|
||||||
|
.ConfigureFonts(fonts =>
|
||||||
|
{
|
||||||
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||||
|
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
||||||
|
});
|
||||||
|
|
||||||
|
#pragma warning disable CA1416 // BlazorWebView requires Android 23+, project targets 21+
|
||||||
|
builder.Services.AddMauiBlazorWebView();
|
||||||
|
#pragma warning restore CA1416
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||||
|
builder.Logging.AddDebug();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
builder.Services.AddLocalization();
|
||||||
|
|
||||||
|
builder.Services.AddBlazoredLocalStorage(config =>
|
||||||
|
{
|
||||||
|
config.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase;
|
||||||
|
config.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
|
||||||
|
config.JsonSerializerOptions.IgnoreReadOnlyProperties = true;
|
||||||
|
config.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
|
||||||
|
config.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
|
||||||
|
config.JsonSerializerOptions.ReadCommentHandling = JsonCommentHandling.Skip;
|
||||||
|
config.JsonSerializerOptions.WriteIndented = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
builder.Services.AddScoped<INavigationService, NavigationService>();
|
||||||
|
builder.Services.AddScoped<IKeyService, KeyService>();
|
||||||
|
builder.Services.AddScoped<IImmortalSelectionService, ImmortalSelectionService>();
|
||||||
|
builder.Services.AddScoped<IBuildComparisonService, DeprecatedBuildComparisionService>();
|
||||||
|
builder.Services.AddScoped<IBuildOrderService, BuildOrderService>();
|
||||||
|
builder.Services.AddScoped<IEconomyService, EconomyService>();
|
||||||
|
builder.Services.AddScoped<ITimingService, TimingService>();
|
||||||
|
builder.Services.AddScoped<IMemoryTesterService, MemoryTesterService>();
|
||||||
|
builder.Services.AddScoped<IEntityFilterService, EntityFilterService>();
|
||||||
|
builder.Services.AddScoped<IEntityDisplayService, EntityDisplayService>();
|
||||||
|
builder.Services.AddScoped<IEntityDialogService, EntityDialogService>();
|
||||||
|
builder.Services.AddScoped<IGlossaryService, GlossaryService>();
|
||||||
|
builder.Services.AddScoped<IGlossaryDialogService, GlossaryDialogService>();
|
||||||
|
builder.Services.AddScoped<IToastService, ToastService>();
|
||||||
|
builder.Services.AddScoped<INoteService, NoteService>();
|
||||||
|
builder.Services.AddScoped<ISearchService, SearchService>();
|
||||||
|
builder.Services.AddScoped<IStorageService, StorageService>();
|
||||||
|
builder.Services.AddScoped<IPermissionService, PermissionService>();
|
||||||
|
builder.Services.AddScoped<IEconomyComparisonService, EconomyComparisionService>();
|
||||||
|
builder.Services.AddScoped<IDataCollectionService, DataCollectionService>();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<IMyDialogService, MyDialogService>();
|
||||||
|
builder.Services.AddScoped<TechTreeService>();
|
||||||
|
|
||||||
|
builder.Services.AddMudServices();
|
||||||
|
|
||||||
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://0.0.0.0") });
|
||||||
|
|
||||||
|
return builder.Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round"
|
||||||
|
android:supportsRtl="true"></application>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using Android.App;
|
||||||
|
using Android.Content.PM;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop,
|
||||||
|
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode |
|
||||||
|
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
||||||
|
public class MainActivity : MauiAppCompatActivity
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using Android.App;
|
||||||
|
using Android.Runtime;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
[Application]
|
||||||
|
public class MainApplication : MauiApplication
|
||||||
|
{
|
||||||
|
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
|
||||||
|
: base(handle, ownership)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override MauiApp CreateMauiApp()
|
||||||
|
{
|
||||||
|
return MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="colorPrimary">#512BD4</color>
|
||||||
|
<color name="colorPrimaryDark">#2B0B98</color>
|
||||||
|
<color name="colorAccent">#2B0B98</color>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Foundation;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
[Register("AppDelegate")]
|
||||||
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
|
{
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
|
||||||
|
<dict>
|
||||||
|
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. -->
|
||||||
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. -->
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<!-- The Mac App Store requires you specify if the app uses encryption. -->
|
||||||
|
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
|
||||||
|
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
|
||||||
|
<!-- Please indicate <true/> or <false/> here. -->
|
||||||
|
|
||||||
|
<!-- Specify the category for your app here. -->
|
||||||
|
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
|
||||||
|
<!-- <key>LSApplicationCategoryType</key> -->
|
||||||
|
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>2</integer>
|
||||||
|
</array>
|
||||||
|
<key>LSApplicationCategoryType</key>
|
||||||
|
<string>public.app-category.lifestyle</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>XSAppIconAssets</key>
|
||||||
|
<string>Assets.xcassets/appicon.appiconset</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using ObjCRuntime;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
// This is the main entry point of the application.
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||||
|
// you can specify it here.
|
||||||
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<maui:MauiWinUIApplication
|
||||||
|
x:Class="Device.WinUI.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:maui="using:Microsoft.Maui"
|
||||||
|
xmlns:local="using:Device.WinUI">
|
||||||
|
|
||||||
|
</maui:MauiWinUIApplication>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace Device.WinUI;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides application-specific behavior to supplement the default Application class.
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : MauiWinUIApplication
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the singleton application object. This is the first line of authored code
|
||||||
|
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||||
|
/// </summary>
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Package
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
|
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||||
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
IgnorableNamespaces="uap rescap">
|
||||||
|
|
||||||
|
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0"/>
|
||||||
|
|
||||||
|
<mp:PhoneIdentity PhoneProductId="034A3819-8402-48FB-850F-9B134D4D5787"
|
||||||
|
PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>$placeholder$</DisplayName>
|
||||||
|
<PublisherDisplayName>User Name</PublisherDisplayName>
|
||||||
|
<Logo>$placeholder$.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0"/>
|
||||||
|
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0"/>
|
||||||
|
</Dependencies>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="x-generate"/>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
|
<Applications>
|
||||||
|
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
|
||||||
|
<uap:VisualElements
|
||||||
|
DisplayName="$placeholder$"
|
||||||
|
Description="$placeholder$"
|
||||||
|
Square150x150Logo="$placeholder$.png"
|
||||||
|
Square44x44Logo="$placeholder$.png"
|
||||||
|
BackgroundColor="transparent">
|
||||||
|
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png"
|
||||||
|
Square310x310Logo="$placeholder$.png"/>
|
||||||
|
<uap:SplashScreen Image="$placeholder$.png"/>
|
||||||
|
</uap:VisualElements>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
|
<Capabilities>
|
||||||
|
<rescap:Capability Name="runFullTrust"/>
|
||||||
|
</Capabilities>
|
||||||
|
|
||||||
|
</Package>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="Device.WinUI.app"/>
|
||||||
|
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<!-- The combination of below two tags have the following effect:
|
||||||
|
1) Per-Monitor for >= Windows 10 Anniversary Update
|
||||||
|
2) System < Windows 10 Anniversary Update
|
||||||
|
-->
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
|
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor
|
||||||
|
</dpiAwareness>
|
||||||
|
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
</assembly>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Foundation;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
[Register("AppDelegate")]
|
||||||
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
|
{
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>1</integer>
|
||||||
|
<integer>2</integer>
|
||||||
|
</array>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>XSAppIconAssets</key>
|
||||||
|
<string>Assets.xcassets/appicon.appiconset</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using ObjCRuntime;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
|
namespace Device;
|
||||||
|
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
// This is the main entry point of the application.
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||||
|
// you can specify it here.
|
||||||
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
This is the minimum required version of the Apple Privacy Manifest for .NET MAUI apps.
|
||||||
|
The contents below are needed because of APIs that are used in the .NET framework and .NET MAUI SDK.
|
||||||
|
|
||||||
|
You are responsible for adding extra entries as needed for your application.
|
||||||
|
|
||||||
|
More information: https://aka.ms/maui-privacy-manifest
|
||||||
|
-->
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPITypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPIType</key>
|
||||||
|
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||||
|
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||||
|
<array>
|
||||||
|
<string>C617.1</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPIType</key>
|
||||||
|
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
||||||
|
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||||
|
<array>
|
||||||
|
<string>35F9.1</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPIType</key>
|
||||||
|
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
|
||||||
|
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||||
|
<array>
|
||||||
|
<string>E174.1</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<!--
|
||||||
|
The entry below is only needed when you're using the Preferences API in your app.
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPIType</key>
|
||||||
|
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||||
|
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||||
|
<array>
|
||||||
|
<string>CA92.1</string>
|
||||||
|
</array>
|
||||||
|
</dict> -->
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"Windows Machine": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"nativeDebugging": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user