-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #20, small changes to debug console; release 0.0.4.147 ready
- Loading branch information
1 parent
9a11c61
commit b4bb4ba
Showing
14 changed files
with
396 additions
and
15 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Window x:Class="Osmo.ConsoleWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:Osmo" | ||
xmlns:ui="clr-namespace:Osmo.UI" | ||
mc:Ignorable="d" | ||
Title="Console" Height="450" Width="800" WindowStyle="None" Loaded="Window_Loaded" Closing="Window_Closing"> | ||
<ui:DebugConsole IsWindowMode="True"/> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Osmo.UI; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace Osmo | ||
{ | ||
/// <summary> | ||
/// Interaction logic for ConsoleWindow.xaml | ||
/// </summary> | ||
public partial class ConsoleWindow : Window | ||
{ | ||
public ConsoleWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
DebugConsole.Instance.Visibility = Visibility.Collapsed; | ||
} | ||
|
||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) | ||
{ | ||
DebugConsole.Instance.Visibility = Visibility.Visible; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Osmo.Core | ||
{ | ||
class ConsoleHistory | ||
{ | ||
private List<string> history; | ||
private int capacity; | ||
private int index = -1; | ||
|
||
public ConsoleHistory(int capacity) | ||
{ | ||
this.capacity = capacity; | ||
history = new List<string>(capacity); | ||
} | ||
|
||
public void Push(string command) | ||
{ | ||
history.Insert(0, command); | ||
index = -1; | ||
|
||
if (history.Count > capacity) | ||
history.RemoveAt(capacity - 1); | ||
} | ||
|
||
public string Peek(bool isUp) | ||
{ | ||
if (isUp) | ||
{ | ||
if (index < history.Count - 1) | ||
index++; | ||
|
||
|
||
if (index > -1) | ||
return history[index]; | ||
else | ||
return ""; | ||
} | ||
else | ||
{ | ||
if (index > 0) | ||
{ | ||
index--; | ||
return history[index]; | ||
} | ||
else | ||
{ | ||
index = -1; | ||
return ""; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== Console stuff | ||
clear Clears the console | ||
testMessages Writes all types of messages into the console | ||
|
||
=== Log management === | ||
wipeLog Delete the log.txt and generate a new one | ||
wipeCrashLogs Delete all crash logs | ||
wipeLogFolder Delete all logs inside the "Logs" folder | ||
openLog Open the log.txt in your default editor | ||
|
||
=== Configuration files | ||
listProfiles Return a list of all profile names | ||
printConfig Print the configuration for the current profile into the console | ||
printConfig [ProfileName] Print the configuration for a specific profile into the console | ||
openConfig Open the configuration for the current profile in your default editor | ||
openConfig [ProfileName] Open the configuration for a specific profile in your default editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.