37 lines
888 B
Plaintext
37 lines
888 B
Plaintext
|
@implements IDisposable
|
||
|
|
||
|
@inject OpenBirchConsole console
|
||
|
|
||
|
<div>
|
||
|
@for (int i = 0; i < console.history.Count; i++)
|
||
|
{
|
||
|
int temp = i;
|
||
|
ConsoleLine line = console.history[temp];
|
||
|
@if (line.source == ConsoleSource.User)
|
||
|
{
|
||
|
<MudText Align="Align.Start" Class="user-text"><MudText Style="color: #575279;" Inline="true">></MudText><b> @(' ' + line.text)</b></MudText>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<MudText Align="Align.Start" Class="openbirch-text"><i>@line.text</i></MudText>
|
||
|
<br />
|
||
|
}
|
||
|
}
|
||
|
</div>
|
||
|
|
||
|
@code {
|
||
|
protected override void OnInitialized()
|
||
|
{
|
||
|
OpenBirchConsole.OnLinesChanged += updateComp;
|
||
|
}
|
||
|
|
||
|
public void Dispose()
|
||
|
{
|
||
|
OpenBirchConsole.OnLinesChanged -= updateComp;
|
||
|
}
|
||
|
|
||
|
void updateComp(List<ConsoleLine> _)
|
||
|
{
|
||
|
InvokeAsync(StateHasChanged);
|
||
|
}
|
||
|
}
|