Browse Source

feat(Search) Search hotkey now working. CMD + K

main
Jonathan McCaffrey 4 years ago
parent
commit
ba2eeec13f
  1. 16
      Components/Components.csproj
  2. 32
      Components/Form/FormNumberComponent.razor
  3. 5
      Components/Form/FormTextComponent.razor
  4. 16
      Components/Inputs/SearchButtonComponent.razor
  5. 38
      Components/Navigation/DesktopNavComponent.razor
  6. 4
      Components/Navigation/DesktopNavLinkComponent.razor
  7. 2
      Contexts/Contexts.csproj
  8. 10
      IGP/App.razor
  9. BIN
      IGP/Database.db
  10. 24
      IGP/Dialog/SearchDialogComponent.razor
  11. 18
      IGP/IGP.csproj
  12. 2
      IGP/Index.razor
  13. 5
      IGP/PageLayout.razor
  14. 27
      IGP/Portals/SearchPortal.razor
  15. 6
      IGP/wwwroot/content/docs/cheat-sheet.md
  16. 5
      IGP/wwwroot/content/docs/project-data.md
  17. 5
      IGP/wwwroot/content/docs/setup.md
  18. 5
      IGP/wwwroot/content/notes/coop/holdout.md
  19. 9
      IGP/wwwroot/content/notes/settings/hotkeys.md
  20. 5
      IGP/wwwroot/content/notes/the-basics/armor-types.md
  21. 6
      IGP/wwwroot/content/notes/the-basics/economy-overview.md
  22. 6
      IGP/wwwroot/content/notes/the-basics/families-factions-and-immortal-vanguards.md
  23. 6
      IGP/wwwroot/content/notes/the-basics/immortal-spells-and-pyre.md
  24. 5
      IGP/wwwroot/content/notes/the-basics/timing-and-scouting.md
  25. 2
      IGP/wwwroot/generated/GitChangeModels.json
  26. 2
      IGP/wwwroot/generated/GitPatchModels.json
  27. 15
      IGP/wwwroot/index.html
  28. 12
      IGP_Convert/IGP_Convert.csproj
  29. 8
      Model/Model.csproj
  30. 19
      Model/Notes/NoteContentModel.cs
  31. 2
      Services/IServices.cs
  32. 5
      Services/Immortal/BuildOrderService.cs
  33. 7
      Services/Immortal/EconomyService.cs
  34. 4
      Services/Services.csproj
  35. 3
      Services/Website/EntityDialogService.cs
  36. 43
      Services/Website/SearchService.cs

16
Components/Components.csproj

@ -15,24 +15,24 @@
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
<SupportedPlatform Include="browser"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Markdig" Version="0.28.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Markdig" Version="0.28.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-preview.2.22153.2"/>
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Inputs\" />
<Folder Include="Inputs\"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Services\Services.csproj" />
<ProjectReference Include="..\Model\Model.csproj"/>
<ProjectReference Include="..\Services\Services.csproj"/>
</ItemGroup>
<ItemGroup>
<None Remove="Inputs\" />
<None Remove="Inputs\"/>
</ItemGroup>
</Project>

32
Components/Form/FormNumberComponent.razor

@ -48,25 +48,25 @@
void OnInputChanged(ChangeEventArgs changeEventArgs)
{
int valueWas = Value;
int newValue = int.Parse(changeEventArgs.Value!.ToString()!);
var valueWas = Value;
var newValue = int.Parse(changeEventArgs.Value!.ToString()!);
if (newValue > Max)
{
newValue = Max;
}
if (newValue > Max)
{
newValue = Max;
}
if (newValue < Min)
{
newValue = Min;
}
if (newValue < Min)
{
newValue = Min;
}
if (valueWas != newValue)
{
Value = newValue;
changeEventArgs.Value = newValue;
OnChange.InvokeAsync(changeEventArgs);
}
if (valueWas != newValue)
{
Value = newValue;
changeEventArgs.Value = newValue;
OnChange.InvokeAsync(changeEventArgs);
}
}
[Parameter]

5
Components/Form/FormTextComponent.razor

@ -11,7 +11,7 @@
placeholder="@Placeholder"
type="text"
value="@Value"
id="@labelId"
id="@Id"
@oninput="OnChange"
@onchange="OnChange"/>
</div>
@ -51,6 +51,9 @@
@code {
[Parameter]
public string Id { get; set; } = "";
[Parameter]
public string Label { get; set; } = "";

16
Components/Inputs/SearchButtonComponent.razor

@ -1,5 +1,4 @@
@using System.Runtime.InteropServices
@inject ISearchService searchService
@inject ISearchService searchService
@inject NavigationManager navigationManager
@inject IJSRuntime jsRuntime
@ -7,13 +6,9 @@
<div class="searchText">
Search...
</div>
@if (false)
{
<div class="searchHotkey">
@CommandKey + K
</div>
}
<div class="searchHotkey">
@CommandKey + K
</div>
</button>
<style>
@ -35,6 +30,7 @@
.searchHotkey {
padding: 2px;
background-color: var(--info);
border: 2px solid var(--primary-border);
}
@ -42,6 +38,7 @@
@code {
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;
@ -58,4 +55,5 @@
{
userAgent = await jsRuntime.InvokeAsync<string>("getUserAgent");
}
}

38
Components/Navigation/DesktopNavComponent.razor

@ -17,31 +17,31 @@
</NavLink>
<div class="sectionNavs">
@foreach (var webSection in WebSections)
{
var isSelected = navigationService.GetNavigationSectionId().Equals(webSection.Id);
var sectionButtonStyle = "sectionButton";
if (isSelected)
@foreach (var webSection in WebSections)
{
sectionButtonStyle += " sectionButtonSelected";
}
var isSelected = navigationService.GetNavigationSectionId().Equals(webSection.Id);
var sectionButtonStyle = "sectionButton";
if (isSelected)
{
sectionButtonStyle += " sectionButtonSelected";
}
<div class="sectionNav">
<button onclick="@(() => { MenuClicked(webSection.Id); })" class="@sectionButtonStyle">@webSection.Name</button>
<div class="sectionNav">
<button onclick="@(() => { MenuClicked(webSection.Id); })" class="@sectionButtonStyle">@webSection.Name</button>
@if (isSelected)
{
<div class="navMenuPosition">
<div class="navMenuContainer">
<DesktopNavSectionComponent Section=webSection />
@if (isSelected)
{
<div class="navMenuPosition">
<div class="navMenuContainer">
<DesktopNavSectionComponent Section=webSection/>
</div>
</div>
</div>
}
</div>
}
}
</div>
}
</div>
<SearchButtonComponent />
<SearchButtonComponent/>
</div>
</div>

4
Components/Navigation/DesktopNavLinkComponent.razor

@ -11,9 +11,7 @@
}
else
{
<NavLink @onclick="() => {
navigationService.ChangeNavigationState(NavigationStateType.Default);
navigationService.ChangeNavigationSectionId(-1); }" href="@Page.Href" class="desktopNavLink">
<NavLink @onclick="() => { navigationService.ChangeNavigationState(NavigationStateType.Default); navigationService.ChangeNavigationSectionId(-1); }" href="@Page.Href" class="desktopNavLink">
<div class="navName">
@Page.Name
</div>

2
Contexts/Contexts.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.2.22153.1"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-preview.2.22153.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

10
IGP/App.razor

@ -15,7 +15,8 @@
<EntityDialogPortal/>
<ToastPortal/>
<SearchPortal />
<SearchPortal/>
<style>
a {
@ -68,11 +69,4 @@
@code {
#if NO_SQL
#else
[Inject]
DatabaseContext Database { get; set; }
#endif
}

BIN
IGP/Database.db

Binary file not shown.

24
IGP/Dialog/SearchDialogComponent.razor

@ -5,7 +5,7 @@
@inject NavigationManager navigationManager
@if (searchService.IsLoaded())
@if (searchService.IsLoaded() && searchService.IsVisible)
{
<div class="searchBackground" onclick="@CloseDialog">
<div class="searchContainer"
@ -13,7 +13,7 @@
@onclick:stopPropagation="true">
<FormLayoutComponent>
<FormTextComponent Placeholder="Search..." OnChange="SearchChanged"></FormTextComponent>
<FormTextComponent Id="search-input-box" Placeholder="Search..." OnChange="SearchChanged"></FormTextComponent>
</FormLayoutComponent>
<div class="searchBox">
@ -30,16 +30,14 @@
@searchSection.Key
</div>
<div class="searchContents">
@foreach (var searchPoint in searchPoints)
{
<button class="searchLink @searchPoint.PointType.ToLower()" @onclick="() => OnSearch(searchPoint)">@searchPoint.Title</button>
}
@foreach (var searchPoint in searchPoints)
{
<button class="searchLink @searchPoint.PointType.ToLower()" @onclick="() => OnSearch(searchPoint)">@searchPoint.Title</button>
}
</div>
</div>
}
}
}
</div>
@ -110,7 +108,6 @@
}
</style>
}
@ -125,11 +122,16 @@
searchService.Subscribe(OnSearchChanged);
}
private System.Threading.Timer timer = null!;
private void OnSearchChanged()
{
if (searchService.IsVisible)
{
jsRuntime.InvokeVoidAsync("SetFocusToElement", "search-dialog-input");
timer = new System.Threading.Timer(_ =>
{
jsRuntime.InvokeVoidAsync("SetFocusToElement", "search-input-box");
InvokeAsync(StateHasChanged);
}, null, 1, 1);
}
}
@ -149,7 +151,6 @@
{
if (url.Contains("#"))
{
navigationManager.NavigateTo(url,
navigationManager.Uri.Split("#").First().Contains(url.Split("#").First()));
}
@ -157,7 +158,6 @@
{
navigationManager.NavigateTo(url);
}
}
private void SearchChanged(ChangeEventArgs obj)

18
IGP/IGP.csproj

@ -20,10 +20,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Markdig" Version="0.28.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-preview.2.22153.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Markdig" Version="0.28.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-preview.2.22153.2"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-preview.2.22153.2" PrivateAssets="all"/>
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2"/>
<!--
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.0-preview.2.22153.1" />
@ -32,17 +32,17 @@
</ItemGroup>
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Components\Components.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Services\Services.csproj" />
<ProjectReference Include="..\Components\Components.csproj"/>
<ProjectReference Include="..\Model\Model.csproj"/>
<ProjectReference Include="..\Services\Services.csproj"/>
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\generated" />
<Folder Include="wwwroot\generated"/>
</ItemGroup>
<ItemGroup>

2
IGP/Index.razor

@ -3,7 +3,7 @@
@layout PageLayout
<DevOnlyComponent>
<SearchButtonComponent />
<SearchButtonComponent/>
</DevOnlyComponent>
<HomePage/>

5
IGP/PageLayout.razor

@ -41,17 +41,16 @@
await webService.Load();
await Focus();
}
private async Task Focus()
private async Task Focus()
{
// await jsRuntime.InvokeVoidAsync("SetFocusToElement", pageContents);
}
protected override async void OnAfterRender(bool firstRender)
{
// await jsRuntime.InvokeVoidAsync("SetFocusToElement", pageContents);
// await jsRuntime.InvokeVoidAsync("SetFocusToElement", pageContents);
}
void IDisposable.Dispose()

27
IGP/Portals/SearchPortal.razor

@ -1,13 +1,12 @@
@implements IDisposable;
@inject ISearchService searchService
@inject IJSRuntime jsRuntime
@if (searchService.IsVisible)
{
<SearchDialogComponent></SearchDialogComponent>
}
<SearchDialogComponent></SearchDialogComponent>
@code {
private string test = "Q";
protected override void OnInitialized()
{
@ -17,8 +16,11 @@
protected override async Task OnInitializedAsync()
{
await searchService.Load();
await jsRuntime.InvokeVoidAsync("SetDotnetReference", DotNetObjectReference.Create(this));
}
public void Dispose()
{
searchService.Unsubscribe(OnUpdate);
@ -28,4 +30,21 @@
{
StateHasChanged();
}
[JSInvokable("OnKeyPress")]
public async Task OnKeyPress(string code, bool ctrlKey, bool shiftKey, bool altKey, bool metaKey)
{
if (code.ToLower().Equals("k") && (ctrlKey || shiftKey || altKey || metaKey))
{
if (searchService.IsVisible)
{
searchService.Hide();
}
else
{
searchService.Show();
}
}
}
}

6
IGP/wwwroot/content/docs/cheat-sheet.md

@ -1,8 +1,6 @@
---
title: Cheat Sheet
summary: Handy links or quick information on this project.
created_date: 2022-04-11
updated_date: 2022-04-11
title: Cheat Sheet summary: Handy links or quick information on this project. created_date: 2022-04-11 updated_date:
2022-04-11
---
# Overview

5
IGP/wwwroot/content/docs/project-data.md

@ -1,8 +1,5 @@
---
title: Project Data
summary: Using data in this project.
created_date: 2022-04-11
updated_date: 2022-04-11
title: Project Data summary: Using data in this project. created_date: 2022-04-11 updated_date: 2022-04-11
---
# Overview

5
IGP/wwwroot/content/docs/setup.md

@ -1,8 +1,5 @@
---
title: Setup
summary: Get set up on developing this web project.
created_date: 3/30/2022
updated_date: 4/7/2022
title: Setup summary: Get set up on developing this web project. created_date: 3/30/2022 updated_date: 4/7/2022
---
# Overview

5
IGP/wwwroot/content/notes/coop/holdout.md

@ -1,8 +1,5 @@
---
title: Holdout
summary: First coop test map in pre-alpha.
created_date: 2/18/2022
updated_date: 2/18/2022
title: Holdout summary: First coop test map in pre-alpha. created_date: 2/18/2022 updated_date: 2/18/2022
---
Information contained in this note is based on this <a href="https://www.youtube.com/watch?v=XkAgOCIz3DE">YouTube,

9
IGP/wwwroot/content/notes/settings/hotkeys.md

@ -1,8 +1,6 @@
---
title: Custom HotKey Setup
summary: Customize your hotkeys in the pre-alpha.
created_date: 4/13/2022
updated_date: 4/13/2022
title: Custom HotKey Setup summary: Customize your hotkeys in the pre-alpha. created_date: 4/13/2022 updated_date:
4/13/2022
---
In the pre-alpha, IGP comes with some Unreal default hotkey setup.
@ -97,7 +95,8 @@ You can notice a single line of this file can be broken down like this.
`ActionMappings=(ActionName="AttackMove",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=A)`
- `ActionMappings=(***)`: Indicates content is an action mapping. i.e. a hotkey
- `ActionName="AttackMove"`: Indicates the name of the selected action. Here, we are using the `AttackMove` move action, that forces your selected army to attack.
- `ActionName="AttackMove"`: Indicates the name of the selected action. Here, we are using the `AttackMove` move action,
that forces your selected army to attack.
- `Key=A`: Indicates key being mapped to the action. Set to `Key=Tab` to require the Tab key to be pressed instead, to
perform the `AttackMove` action.
- `bShift=False`: Indicates that the Shift key is not held. Set to `bShift=True` to require a shift key held to

5
IGP/wwwroot/content/notes/the-basics/armor-types.md

@ -1,8 +1,5 @@
---
title: Armor Types
summary: Heavy, Medium, and Light. What does it mean?
created_date: 4/13/2000
updated_date: 4/13/2000
title: Armor Types summary: Heavy, Medium, and Light. What does it mean? created_date: 4/13/2000 updated_date: 4/13/2000
---
## Armor Types

6
IGP/wwwroot/content/notes/the-basics/economy-overview.md

@ -1,6 +1,4 @@
---
title: Economy Overview
summary: Alloy, Ether and Supply. Don't forget to expand!
created_date: 1/01/2000
updated_date: 1/01/2000
title: Economy Overview summary: Alloy, Ether and Supply. Don't forget to expand!
created_date: 1/01/2000 updated_date: 1/01/2000
---

6
IGP/wwwroot/content/notes/the-basics/families-factions-and-immortal-vanguards.md

@ -1,6 +1,4 @@
---
title: Families, Factions, and Immortal Vanguards
summary: How IMMORTAL: Gates of Pyre handle your army selection choices
created_date: 1/01/2000
updated_date: 1/01/2000
title: Families, Factions, and Immortal Vanguards summary: How IMMORTAL: Gates of Pyre handle your army selection
choices created_date: 1/01/2000 updated_date: 1/01/2000
---

6
IGP/wwwroot/content/notes/the-basics/immortal-spells-and-pyre.md

@ -1,8 +1,6 @@
---
title: Immortals Spells and Pyre
summary: Customize your hotkeys in the pre-alpha.
created_date: 1/01/2000
updated_date: 1/01/2000
title: Immortals Spells and Pyre summary: Customize your hotkeys in the pre-alpha. created_date: 1/01/2000 updated_date:
1/01/2000
---
## What are Immortals

5
IGP/wwwroot/content/notes/the-basics/timing-and-scouting.md

@ -1,8 +1,5 @@
---
title: Timing and Scouting
summary: Knowing is half the battle.
created_date: 1/01/2000
updated_date: 1/01/2000
title: Timing and Scouting summary: Knowing is half the battle. created_date: 1/01/2000 updated_date: 1/01/2000
---
## Timing

2
IGP/wwwroot/generated/GitChangeModels.json

File diff suppressed because one or more lines are too long

2
IGP/wwwroot/generated/GitPatchModels.json

@ -1 +1 @@
[{"Id":1,"Name":"Database UX Patch","Date":"2022-03-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":2,"Name":"Thrum Stats Hotfix","Date":"2022-03-12T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":3,"Name":"Memory Tester Patch","Date":"2022-03-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":4,"Name":"Hide Pyre Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":5,"Name":"Stream Patch","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":6,"Name":"Agile UI Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":7,"Name":"Armor Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":8,"Name":"Home Page Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":9,"Name":"Mobile Menu Hotfix 2","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":10,"Name":"Mobile Menu Hotfix","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":11,"Name":"Mobile Menu Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":12,"Name":"0.0.6.8375a Patch","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":13,"Name":"Google Tracking Hotfix","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":14,"Name":"Privacy Policy Patch","Date":"2022-02-17T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":15,"Name":"Home Page Quick Hotfix","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":16,"Name":"Early Agile Patch","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":17,"Name":"Form Text Rendering Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":18,"Name":"Reducing Timing Interval Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":19,"Name":"Changelog Patch","Date":"2022-02-14T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":20,"Name":"SQL Patch","Date":"2022-03-26T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":21,"Name":"Stream Patch","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":22,"Name":"0.0.6.8900a Patch","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":23,"Name":"Database Links Patch","Date":"2022-04-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":24,"Name":"Open Source Patch","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":25,"Name":"Stream Patch","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":26,"Name":"Notes/Docs Patch","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":27,"Name":"Stream Patch","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":28,"Name":"Passive Patch","Date":"2022-04-12T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":29,"Name":"0.0.6.9121a Patch","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":30,"Name":"Stream Patch","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":31,"Name":"BuildCalc Hotfix","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":32,"Name":"Search Path","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"}]
[{"Id":1,"Name":"Database UX Patch","Date":"2022-03-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":2,"Name":"Thrum Stats Hotfix","Date":"2022-03-12T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":3,"Name":"Memory Tester Patch","Date":"2022-03-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":4,"Name":"Hide Pyre Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":5,"Name":"Stream Patch","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":6,"Name":"Agile UI Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":7,"Name":"Armor Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":8,"Name":"Home Page Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":9,"Name":"Mobile Menu Hotfix 2","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":10,"Name":"Mobile Menu Hotfix","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":11,"Name":"Mobile Menu Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":12,"Name":"0.0.6.8375a Patch","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":13,"Name":"Google Tracking Hotfix","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":14,"Name":"Privacy Policy Patch","Date":"2022-02-17T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":15,"Name":"Home Page Quick Hotfix","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":16,"Name":"Early Agile Patch","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":17,"Name":"Form Text Rendering Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":18,"Name":"Reducing Timing Interval Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":19,"Name":"Changelog Patch","Date":"2022-02-14T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":20,"Name":"SQL Patch","Date":"2022-03-26T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":21,"Name":"Stream Patch","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":22,"Name":"0.0.6.8900a Patch","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":23,"Name":"Database Links Patch","Date":"2022-04-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":24,"Name":"Open Source Patch","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":25,"Name":"Stream Patch","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":26,"Name":"Notes/Docs Patch","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":27,"Name":"Stream Patch","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":28,"Name":"Passive Patch","Date":"2022-04-12T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":29,"Name":"0.0.6.9121a Patch","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":30,"Name":"Stream Patch","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":31,"Name":"BuildCalc Hotfix","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":32,"Name":"Search Patch","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":33,"Name":"Search Hotfix","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"}]

15
IGP/wwwroot/index.html

@ -12,8 +12,8 @@
<link href="css/app.css" rel="stylesheet"/>
<link href="IGP.styles.css" rel="stylesheet"/>
<link href="manifest.json" rel="manifest" />
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
<link href="manifest.json" rel="manifest"/>
<link href="icon-512.png" rel="apple-touch-icon" sizes="512x512"/>
</head>
<body style="background-color: #161618; color: white;">
@ -37,14 +37,21 @@
});
</script>
<script>
window.DotNetReference = null;
window.SetDotnetReference = function (dotnetReference) {
window.DotNetReference = dotnetReference;
};
window.getUserAgent = () => {
return navigator.userAgent;
};
</script>
<script>
window.SetFocusToElement = (elementId) => {
document.getElementById(elementId).focus();
};
document.addEventListener("keydown", function (e) {
DotNetReference?.invokeMethodAsync('OnKeyPress', e.key, e.ctrlKey, e.shiftKey, e.altKey, e.metaKey)
});
</script>
<script>navigator.serviceWorker.register('service-worker.js');</script>

12
IGP_Convert/IGP_Convert.csproj

@ -8,17 +8,17 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Contexts\Contexts.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.0-preview.2.22153.1" />
<ProjectReference Include="..\Contexts\Contexts.csproj"/>
<ProjectReference Include="..\Model\Model.csproj"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.0-preview.2.22153.1"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.2.22153.1"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0-preview.2.22153.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-preview.2.22153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.2.22153.1"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-preview.2.22153.1"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0-preview.2.22153.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

8
Model/Model.csproj

@ -3,14 +3,6 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="_PaperWork\**"/>
<EmbeddedResource Remove="_PaperWork\**"/>
<None Remove="_PaperWork\**"/>
<None Remove="Immortal\MemoryTester\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="YamlDotNet" Version="11.2.1"/>

19
Model/Notes/NoteContentModel.cs

@ -26,19 +26,24 @@ public class NoteContentModel
public string Content { get; set; }
[NotMapped]
public virtual string LoadedContent { get; set; }
[NotMapped] public virtual string LoadedContent { get; set; }
public string IsHidden { get; set; } = "False";
public string IsPreAlpha { get; set; } = "True";
[NotMapped]
public virtual ICollection<NoteContentModel> NoteContentModels { get; set; } = new List<NoteContentModel>();
[NotMapped] public virtual NoteContentModel Parent { get; set; }
[NotMapped] public virtual int PageOrder { get; set; }
public List<SearchPointModel> GetHeaders()
{
var regex = new Regex(@"^#* (.*)$", RegexOptions.Multiline);
var listOfMatches = regex.Matches(LoadedContent);
List<SearchPointModel> foundHeaders = new List<SearchPointModel>();
var foundHeaders = new List<SearchPointModel>();
foreach (var capture in listOfMatches)
{
@ -49,19 +54,13 @@ public class NoteContentModel
cleanUp = cleanUp.Replace("\"", "");
cleanUp = cleanUp.Trim();
cleanUp = cleanUp.Replace(" ", "-");
foundHeaders.Add(new SearchPointModel(){ Title = capture.ToString().Trim(), Href = cleanUp});
foundHeaders.Add(new SearchPointModel { Title = capture.ToString().Trim(), Href = cleanUp });
Console.WriteLine($"Capture: {cleanUp}");
}
return foundHeaders;
}
[NotMapped]
public virtual ICollection<NoteContentModel> NoteContentModels { get; set; } = new List<NoteContentModel>();
[NotMapped] public virtual NoteContentModel Parent { get; set; }
[NotMapped] public virtual int PageOrder { get; set; }
private string GetLink()
{

2
Services/IServices.cs

@ -90,7 +90,7 @@ public interface IAgileService
public void Unsubscribe(Action? action);
public void Update();
public Task Load();
public Task Load();
public bool IsLoaded();
}

5
Services/Immortal/BuildOrderService.cs

@ -13,14 +13,15 @@ namespace Services.Immortal;
public class BuildOrderService : IBuildOrderService
{
private BuildOrderModel buildOrder = new();
public int BuildingInputDelay { get; set; } = 2;
private int lastInterval = 0;
private int lastInterval;
public BuildOrderService()
{
Reset();
}
public int BuildingInputDelay { get; set; } = 2;
public Dictionary<int, List<EntityModel>> StartedOrders => buildOrder.StartedOrders;
public Dictionary<int, List<EntityModel>> CompletedOrders => buildOrder.CompletedOrders;
public Dictionary<string, int> UniqueCompletedTimes => buildOrder.UniqueCompletedTimes;

7
Services/Immortal/EconomyService.cs

@ -1,8 +1,6 @@
using Model.Economy;
using Model.Entity;
using Model.Feedback;
using Model.Types;
using Services.Website;
namespace Services.Immortal;
@ -159,10 +157,7 @@ public class EconomyService : IEconomyService
public EconomyModel GetEconomy(int atInterval)
{
if (atInterval >= economyOverTime.Count)
{
return economyOverTime.Last();
}
if (atInterval >= economyOverTime.Count) return economyOverTime.Last();
return economyOverTime[atInterval];
}

4
Services/Services.csproj

@ -15,11 +15,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="YamlDotNet" Version="11.2.1" />
<PackageReference Include="YamlDotNet" Version="11.2.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Model\Model.csproj"/>
</ItemGroup>
</Project>

3
Services/Website/EntityDialogService.cs

@ -3,9 +3,8 @@
//TODO Move to a database folder, with EntityService, EntityFilterService
public class EntityDialogService : IEntityDialogService
{
private string? entityId;
private readonly List<string> history = new();
private string? entityId;
public void Subscribe(Action action)
{

43
Services/Website/SearchService.cs

@ -1,23 +1,20 @@
using Model.Entity.Data;
using Model.Feedback;
using Model.Website;
namespace Services.Website;
public class SearchService : ISearchService
{
private readonly IDocumentationService documentationService;
private bool isLoaded = false;
public List<SearchPointModel> SearchPoints { get; set; } = new();
public Dictionary<string, List<SearchPointModel>> Searches { get; set; } = new();
private bool isLoaded;
private readonly INoteService noteService;
private IWebsiteService websiteService;
private INoteService noteService;
private IDocumentationService documentationService;
private readonly IWebsiteService websiteService;
public SearchService(IWebsiteService websiteService, INoteService noteService, IDocumentationService documentationService)
public SearchService(IWebsiteService websiteService, INoteService noteService,
IDocumentationService documentationService)
{
this.websiteService = websiteService;
this.noteService = noteService;
@ -26,6 +23,10 @@ public class SearchService : ISearchService
// All Unit Data
}
public List<SearchPointModel> SearchPoints { get; set; } = new();
public Dictionary<string, List<SearchPointModel>> Searches { get; set; } = new();
public bool IsVisible { get; set; }
public void Subscribe(Action action)
@ -56,9 +57,11 @@ public class SearchService : ISearchService
foreach (var webPage in websiteService.WebPageModels)
{
SearchPoints.Add(new SearchPointModel{ Title = webPage.Name,
SearchPoints.Add(new SearchPointModel
{
Title = webPage.Name,
PointType = "WebPage",
Href=webPage.Href
Href = webPage.Href
});
Searches["Pages"].Add(SearchPoints.Last());
@ -66,17 +69,20 @@ public class SearchService : ISearchService
foreach (var note in noteService.NoteContentModels)
{
SearchPoints.Add(new SearchPointModel(){ Title = note.Name,
PointType = "Note", Href = note.GetNoteLink()});
SearchPoints.Add(new SearchPointModel
{
Title = note.Name,
PointType = "Note", Href = note.GetNoteLink()
});
Searches["Notes"].Add(SearchPoints.Last());
}
foreach (var entity in DATA.Get().Values)
{
SearchPoints.Add(new SearchPointModel(){
SearchPoints.Add(new SearchPointModel
{
Title = entity.Info().Name,
Tags = $"{entity.EntityType},{entity.Descriptive}",
PointType = "Entity",
@ -89,8 +95,11 @@ public class SearchService : ISearchService
foreach (var doc in documentationService.DocContentModels)
{
SearchPoints.Add(new SearchPointModel { Title = doc.Name,
PointType = "Document", Href = doc.GetDocLink()});
SearchPoints.Add(new SearchPointModel
{
Title = doc.Name,
PointType = "Document", Href = doc.GetDocLink()
});
Searches["Documents"].Add(SearchPoints.Last());
}

Loading…
Cancel
Save