Skip to content

Commit

Permalink
Merge pull request #21 from WaterKH/develop_0.1.2
Browse files Browse the repository at this point in the history
Develop 0.1.2
  • Loading branch information
WaterKH authored Oct 4, 2021
2 parents 6e1943b + af1642f commit e1f485c
Show file tree
Hide file tree
Showing 39 changed files with 4,800 additions and 75 deletions.
36 changes: 30 additions & 6 deletions ReChart/Components/ReChartSection/BossBattle/BossChart.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.BossBattle;
@using ReChart.Logic;
@using ReChart.Services;
@using ReChart.Interfaces;
Expand Down Expand Up @@ -77,11 +78,11 @@
</div>
}

@foreach (var beat in this.BeatService.CurrentBeats)
@for (int i = 0; i < this.BeatService.CurrentBeats.Count; ++i)
{
if (beat != null)
if (this.BeatService.CurrentBeats[i] != null)
{
<div style="display: inline-block; position: relative; float: left; background-color: @(beat.Color == System.Drawing.Color.MediumPurple ? "mediumpurple" : "purple"); width: 2pt; height: 15vh; left: @(beat.Location.X)px; top: -15vh;"></div>
<div style="display: inline-block; position: relative; float: left; background-color: @(this.BeatService.CurrentBeats[i].Color == System.Drawing.Color.MediumPurple ? "mediumpurple" : "purple"); width: 2px; height: 100vh; left: @(this.BeatService.CurrentBeats[i].Location.X - (2 * i))px; top: -100vh;"></div>
}
}
</div>
Expand All @@ -100,6 +101,8 @@
<NoteChoices Title="Boss Notes" Type="BossNote" ImageTypes="@this.AllNoteTypes" @bind-ActiveNote="this.SelectedNoteType" SelectedNoteTypeChanged="this.SelectedNoteTypeChanged" />
<br />
<NoteChoices Title="Performer Notes" Type="PerformerNote" ImageTypes="@this.AllPerformerTypes" @bind-ActiveNote="this.SelectedNoteType" SelectedNoteTypeChanged="this.SelectedNoteTypeChanged" />
<br />
<NoteChoices Title="Tempo Note" Type="TempoNote" ImageTypes="@this.TempoNoteTypes" @bind-ActiveNote="this.SelectedNoteType" SelectedNoteTypeChanged="this.SelectedNoteTypeChanged" />
</div>
</div>
</div>
Expand Down Expand Up @@ -153,6 +156,7 @@
public Dictionary<string, string> AllNoteTypes { get; set; }
public Dictionary<string, string> SwipeDirections { get; set; }
public Dictionary<string, string> AllPerformerTypes { get; set; }
public Dictionary<string, string> TempoNoteTypes { get; set; }

public int QuickPlaceTime { get; set; }
public BossLane QuickPlaceLane { get; set; }
Expand Down Expand Up @@ -191,6 +195,11 @@
{ "DarkZone", Utilities.GetImage("DarkZone") }
};

this.TempoNoteTypes = new Dictionary<string, string>
{
{ "Tempo", "/images/ReChart/BossBattle.png" }
};

this.SwipeDirections = new Dictionary<string, string>
{
{ "Up", Utilities.GetImage(BossNoteType.Swipe) },
Expand All @@ -200,7 +209,7 @@
};

this.ChartDisplays = new Dictionary<string, bool>
{
{
{ "Notes", true },
{ "Performers", true },
{ "DarkZones", true },
Expand Down Expand Up @@ -427,6 +436,9 @@

protected void SelectedNoteTypeChanged(string type)
{
if (type == "Cancel")
type = string.Empty;

this.SelectedNoteType = type;
this.ChartReference.FocusAsync();

Expand All @@ -440,6 +452,8 @@
this.PlaceholderDisplayNote.Image = this.AllNoteTypes[type];
else if (this.AllPerformerTypes.ContainsKey(type))
this.PlaceholderDisplayNote.Image = this.AllPerformerTypes[type];
else if (this.TempoNoteTypes.ContainsKey(type))
this.PlaceholderDisplayNote.Image = this.TempoNoteTypes[type];
}
}

Expand All @@ -462,6 +476,14 @@
// Add to display notes
this.DisplayNotes["PerformerNote"].Add(new BossNoteDisplay { HitTime = time, Lane = lane, NoteIndex = this.DisplayNotes["PerformerNote"].Count, Image = Utilities.GetImage(performerType) });
}
else if (modelType == "Tempo")
{
// Add to song notes
this.BossChartService.AddBossTempo(this.Difficulty, time, 500);

// Add to display notes
this.DisplayNotes["Tempo"].Add(new BossNoteDisplay { HitTime = time, Lane = BossLane.PlayerTop, NoteIndex = this.DisplayNotes["Tempo"].Count, Image = this.TempoNoteTypes["Tempo"] });
}
}

protected void MouseOverChart(MouseEventArgs mouseEventArgs, BossLane lane)
Expand All @@ -477,6 +499,8 @@
this.PlaceholderDisplayNote.Image = this.AllNoteTypes[this.SelectedNoteType];
else if (this.AllPerformerTypes.ContainsKey(this.SelectedNoteType))
this.PlaceholderDisplayNote.Image = this.AllPerformerTypes[this.SelectedNoteType];
else if (this.TempoNoteTypes.ContainsKey(this.SelectedNoteType))
this.PlaceholderDisplayNote.Image = this.TempoNoteTypes[this.SelectedNoteType];
}

this.PlaceholderDisplayNote.HitTime = ((int)mouseEventArgs.OffsetX) - 35;
Expand Down Expand Up @@ -538,7 +562,7 @@
public void ClearChart()
{
this.DisplayNotes = new Dictionary<string, List<BossNoteDisplay>>
{
{
{ "BossNote", new List<BossNoteDisplay>() },
{ "PerformerNote", new List<BossNoteDisplay>() },
{ "Tempo", new List<BossNoteDisplay>() },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@using MoMMusicAnalysis
@using MoMMusicAnalysis.Song.BossBattle

<div id="@this.Lane.ToString()" class="rechart-lane" style="width: @(this.Length)px; height: 2pt; top: 15pt; float: left; position: relative;" @ondrop="InvokeOnDropNote" @ondragover="InvokeOnDragNote" @ondragover:preventDefault="true">
@ChildContent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.BossBattle;
@using ReChart.Interfaces;

@inject IBossChartService BossChartService
Expand Down Expand Up @@ -34,7 +35,7 @@


public BossDarkZone DarkZone;
private BossDarkZone DarkZoneCopy{ get; set; }
private BossDarkZone DarkZoneCopy { get; set; }


protected override void OnInitialized()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.BossBattle;
@using ReChart.Interfaces;

@inject IBossChartService BossChartService
Expand Down Expand Up @@ -67,7 +68,7 @@
<button @onclick="DeleteBossNote" class="btn btn-danger">Delete</button>
<button @onclick="@(async () => await this.ModalInstance.CancelAsync())" class="btn btn-secondary" style="float: right;">Cancel</button>
</div>


@code {

Expand All @@ -93,13 +94,13 @@
this.BossNoteCopy = this.BossNote.Copy();

this.SelectedNoteType = this.BossNote.BossNoteType.ToString();

this.BossNoteCopyChanged();
}

private async Task SaveBossNote()
{
this.BossChartService.SaveBossNote(ref this.BossNote, this.BossNoteCopy);
this.BossChartService.SaveBossNote(this.Difficulty, ref this.BossNote, this.BossNoteCopy);

await this.ModalInstance.CloseAsync(ModalResult.Ok<BossNote>(this.BossNote));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.BossBattle;
@using ReChart.Interfaces;

@inject IBossChartService BossChartService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.BossBattle;
@using ReChart.Interfaces;

@inject IBossChartService BossChartService
Expand Down Expand Up @@ -29,7 +30,7 @@


public TimeShift<BossLane> Tempo;
private TimeShift<BossLane> TempoCopy{ get; set; }
private TimeShift<BossLane> TempoCopy { get; set; }


protected override void OnInitialized()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.FieldBattle;
@using ReChart.ViewModels.ReChart;
@using ReChart.Interfaces;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.FieldBattle;
@using ReChart.Logic;
@using ReChart.Interfaces;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.FieldBattle;
@using ReChart.Interfaces;

@inject IFieldChartService FieldChartService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.FieldBattle;
@using ReChart.Interfaces;

@inject IFieldChartService FieldChartService
Expand Down Expand Up @@ -29,7 +30,7 @@


public TimeShift<FieldLane> Tempo;
private TimeShift<FieldLane> TempoCopy{ get; set; }
private TimeShift<FieldLane> TempoCopy { get; set; }


// NOTE Don't allow Changing of AssetModelType - This is handled by the FieldNote
Expand Down
38 changes: 31 additions & 7 deletions ReChart/Components/ReChartSection/FieldBattle/FieldChart.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.FieldBattle;
@using ReChart.Logic;
@using ReChart.Services;
@using ReChart.Interfaces;
Expand Down Expand Up @@ -80,11 +81,11 @@
</div>
}

@foreach (var beat in this.BeatService.CurrentBeats)
@for (int i = 0; i < this.BeatService.CurrentBeats.Count; ++i)
{
if (beat != null)
if (this.BeatService.CurrentBeats[i] != null)
{
<div style="display: inline-block; position: relative; float: left; background-color: @(beat.Color == System.Drawing.Color.MediumPurple ? "mediumpurple" : "purple"); width: 2pt; height: 100vh; left: @(beat.Location.X)px; top: -100vh;"></div>
<div style="display: inline-block; position: relative; float: left; background-color: @(this.BeatService.CurrentBeats[i].Color == System.Drawing.Color.MediumPurple ? "mediumpurple" : "purple"); width: 2px; height: 100vh; left: @(this.BeatService.CurrentBeats[i].Location.X - (2 * i))px; top: -100vh;"></div>
}
}
</div>
Expand All @@ -103,6 +104,8 @@
<NoteChoices Title="Field Notes" Type="FieldNote" ImageTypes="@this.AllNoteTypes" @bind-ActiveNote="this.SelectedNoteType" SelectedNoteTypeChanged="this.SelectedNoteTypeChanged" />
<br />
<NoteChoices Title="Performer Notes" Type="PerformerNote" ImageTypes="@this.AllPerformerTypes" @bind-ActiveNote="this.SelectedNoteType" SelectedNoteTypeChanged="this.SelectedNoteTypeChanged" />
<br />
<NoteChoices Title="Tempo Note" Type="TempoNote" ImageTypes="@this.TempoNoteTypes" @bind-ActiveNote="this.SelectedNoteType" SelectedNoteTypeChanged="this.SelectedNoteTypeChanged" />
</div>
</div>
</div>
Expand Down Expand Up @@ -156,6 +159,7 @@
public Dictionary<string, string> AllNoteTypes { get; set; }
//public Dictionary<string, string> AllAssetTypes { get; set; }
public Dictionary<string, string> AllPerformerTypes { get; set; }
public Dictionary<string, string> TempoNoteTypes { get; set; }

public int QuickPlaceTime { get; set; }
public FieldLane QuickPlaceLane { get; set; }
Expand Down Expand Up @@ -185,7 +189,7 @@
this.length = this.DisplayNotes["FieldNote"].Count > 0 ? this.DisplayNotes["FieldNote"][^1].HitTime : 5000;

this.AllNoteTypes = new Dictionary<string, string>
{
{
{ "CommonEnemy", Utilities.GetImage(FieldModelType.CommonEnemy, 0, 0) },
{ "AerialCommonEnemy", Utilities.GetImage(FieldModelType.AerialCommonEnemy, 0, 0) },
{ "UncommonEnemy", Utilities.GetImage(FieldModelType.UncommonEnemy, 0, 0) },
Expand All @@ -208,6 +212,11 @@
{ "CrystalTeamHeal", Utilities.GetImage(FieldModelType.CrystalTeamHeal, 1, 0) }
};

this.TempoNoteTypes = new Dictionary<string, string>
{
{ "Tempo", "/images/ReChart/FieldBattle.png" }
};

//this.AllAssetTypes = new Dictionary<string, string>
//{
// { "AerialCommonArrow", Utilities.GetImage(FieldAssetType.AerialCommonArrow) },
Expand All @@ -218,7 +227,7 @@
//};
this.ChartDisplays = new Dictionary<string, bool>
{
{
{ "Notes", true },
{ "Assets", true },
{ "Performers", true },
Expand Down Expand Up @@ -426,6 +435,9 @@

protected void SelectedNoteTypeChanged(string type)
{
if (type == "Cancel")
type = string.Empty;

this.SelectedNoteType = type;
this.ChartReference.FocusAsync();

Expand All @@ -439,6 +451,8 @@
this.PlaceholderDisplayNote.Image = this.AllNoteTypes[type];
else if (this.AllPerformerTypes.ContainsKey(type))
this.PlaceholderDisplayNote.Image = this.AllPerformerTypes[type];
else if (this.TempoNoteTypes.ContainsKey(type))
this.PlaceholderDisplayNote.Image = this.TempoNoteTypes[type];
}
}

Expand All @@ -461,6 +475,14 @@
// Add to display notes
this.DisplayNotes["PerformerNote"].Add(new FieldNoteDisplay { HitTime = time, Lane = lane, NoteIndex = this.DisplayNotes["PerformerNote"].Count, Image = Utilities.GetImage(performerType) });
}
else if (modelType == "Tempo")
{
// Add to song notes
this.FieldChartService.AddFieldTempo(this.Difficulty, time, 500);

// Add to display notes
this.DisplayNotes["Tempo"].Add(new FieldNoteDisplay { HitTime = time, Lane = FieldLane.OutOfMapLeft, NoteIndex = this.DisplayNotes["Tempo"].Count, Image = this.TempoNoteTypes["Tempo"] });
}
}

protected void MouseOverChart(MouseEventArgs mouseEventArgs, FieldLane lane)
Expand All @@ -476,6 +498,8 @@
this.PlaceholderDisplayNote.Image = this.AllNoteTypes[this.SelectedNoteType];
else if (this.AllPerformerTypes.ContainsKey(this.SelectedNoteType))
this.PlaceholderDisplayNote.Image = this.AllPerformerTypes[this.SelectedNoteType];
else if (this.TempoNoteTypes.ContainsKey(this.SelectedNoteType))
this.PlaceholderDisplayNote.Image = this.TempoNoteTypes[this.SelectedNoteType];
}

this.PlaceholderDisplayNote.HitTime = ((int)mouseEventArgs.OffsetX) - 35;
Expand Down Expand Up @@ -537,7 +561,7 @@
public void ClearChart()
{
this.DisplayNotes = new Dictionary<string, List<FieldNoteDisplay>>
{
{
{ "FieldNote", new List<FieldNoteDisplay>() },
{ "FieldAsset", new List<FieldNoteDisplay>() },
{ "PerformerNote", new List<FieldNoteDisplay>() },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@using MoMMusicAnalysis
@using MoMMusicAnalysis.Song.FieldBattle
@using ReChart.ViewModels.ReChart

<div id="@this.Lane.ToString()" class="rechart-lane" style="width: @(this.Length)px; height: 2pt; top: 15pt; float: left; position: relative;" @ondrop="InvokeOnDropNote" @ondragover="InvokeOnDragNote" @ondragover:preventDefault="true">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.MemoryDive;
@using ReChart.Interfaces;

@inject IMemoryChartService MemoryChartService
Expand Down Expand Up @@ -67,7 +68,7 @@
<button @onclick="DeleteMemoryNote" class="btn btn-danger">Delete</button>
<button @onclick="@(async () => await this.ModalInstance.CancelAsync())" class="btn btn-secondary" style="float: right;">Cancel</button>
</div>


@code {

Expand All @@ -93,13 +94,13 @@
this.MemoryNoteCopy = this.MemoryNote.Copy();

this.SelectedNoteType = this.MemoryNote.MemoryNoteType.ToString();

this.MemoryNoteCopyChanged();
}

private async Task SaveMemoryNote()
{
this.MemoryChartService.SaveMemoryNote(ref this.MemoryNote, this.MemoryNoteCopy);
this.MemoryChartService.SaveMemoryNote(this.Difficulty, ref this.MemoryNote, this.MemoryNoteCopy);

await this.ModalInstance.CloseAsync(ModalResult.Ok<MemoryNote>(this.MemoryNote));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using MoMMusicAnalysis;
@using MoMMusicAnalysis.Song;
@using MoMMusicAnalysis.Song.MemoryDive;
@using ReChart.Interfaces;

@inject IMemoryChartService MemoryChartService
Expand Down
Loading

0 comments on commit e1f485c

Please sign in to comment.