Added GTK to process path, fixed a bug and minor edits
This commit is contained in:
parent
8ca2f16686
commit
910f9a1abc
9 changed files with 29 additions and 86 deletions
|
@ -94,7 +94,7 @@ namespace Ryujinx
|
||||||
|
|
||||||
byte[] IconData = Read(AssetOffset + IconOffset, (int)IconSize);
|
byte[] IconData = Read(AssetOffset + IconOffset, (int)IconSize);
|
||||||
|
|
||||||
return new Gdk.Pixbuf(IconData, 50, 50);
|
return new Gdk.Pixbuf(IconData, 75, 75);
|
||||||
}
|
}
|
||||||
else { return RyujinxROMIcon; }
|
else { return RyujinxROMIcon; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
using Gtk;
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Ryujinx
|
|
||||||
{
|
|
||||||
public class ControlSettings
|
|
||||||
{
|
|
||||||
public static void ControlSettingsMenu()
|
|
||||||
{
|
|
||||||
Window CSWin = new Window(WindowType.Toplevel);
|
|
||||||
CSWin.Title = "Control Settings";
|
|
||||||
CSWin.Icon = new Gdk.Pixbuf("./ryujinxIcon.png");
|
|
||||||
CSWin.Resizable = false;
|
|
||||||
CSWin.WindowPosition = WindowPosition.Center;
|
|
||||||
CSWin.SetDefaultSize(854, 360);
|
|
||||||
|
|
||||||
VBox box = new VBox(false, 2);
|
|
||||||
|
|
||||||
//settings stuff will replace this block
|
|
||||||
Label myLabel = new Label { Text = "Control Settings" };
|
|
||||||
box.PackStart(myLabel, true, true, 3);
|
|
||||||
|
|
||||||
HBox ButtonBox = new HBox(true, 3);
|
|
||||||
Alignment BoxAlign = new Alignment(1, 0, 0, 0);
|
|
||||||
|
|
||||||
Button Save = new Button("Save");
|
|
||||||
Save.Pressed += (o, args) => Save_Pressed(o, args, CSWin);
|
|
||||||
ButtonBox.Add(Save);
|
|
||||||
|
|
||||||
Button Cancel = new Button("Cancel");
|
|
||||||
Cancel.Pressed += (o, args) => Cancel_Pressed(o, args, CSWin);
|
|
||||||
ButtonBox.Add(Cancel);
|
|
||||||
|
|
||||||
BoxAlign.SetPadding(0, 5, 0, 7);
|
|
||||||
BoxAlign.Add(ButtonBox);
|
|
||||||
box.PackStart(BoxAlign, false, false, 3);
|
|
||||||
|
|
||||||
CSWin.Add(box);
|
|
||||||
CSWin.ShowAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Save_Pressed(object o, EventArgs args, Window window)
|
|
||||||
{
|
|
||||||
//save settings stuff will go here
|
|
||||||
window.Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Cancel_Pressed(object o, EventArgs args, Window window)
|
|
||||||
{
|
|
||||||
window.Destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -29,8 +29,8 @@ namespace Ryujinx
|
||||||
[GUI] CheckButton CustThemeToggle;
|
[GUI] CheckButton CustThemeToggle;
|
||||||
[GUI] Entry CustThemeDir;
|
[GUI] Entry CustThemeDir;
|
||||||
[GUI] TextView GameDirsBox;
|
[GUI] TextView GameDirsBox;
|
||||||
[GUI] Button SaveButton;
|
[GUI] ToggleButton SaveToggle;
|
||||||
[GUI] Button CancelButton;
|
[GUI] ToggleButton CloseToggle;
|
||||||
|
|
||||||
public static void ConfigureSettings(Configuration Instance) { SwitchConfig = Instance; }
|
public static void ConfigureSettings(Configuration Instance) { SwitchConfig = Instance; }
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ namespace Ryujinx
|
||||||
|
|
||||||
builder.Autoconnect(this);
|
builder.Autoconnect(this);
|
||||||
|
|
||||||
SaveButton.Activated += SaveButton_Activated;
|
SaveToggle.Toggled += SaveToggle_Activated;
|
||||||
CancelButton.Activated += CancelButton_Activated;
|
CloseToggle.Toggled += CloseToggle_Activated;
|
||||||
CustThemeToggle.Clicked += CustThemeToggle_Activated;
|
CustThemeToggle.Clicked += CustThemeToggle_Activated;
|
||||||
|
|
||||||
if (SwitchConfig.LoggingEnableError) { ErrorLogToggle.Click(); }
|
if (SwitchConfig.LoggingEnableError) { ErrorLogToggle.Click(); }
|
||||||
|
@ -69,23 +69,19 @@ namespace Ryujinx
|
||||||
}
|
}
|
||||||
|
|
||||||
//Events
|
//Events
|
||||||
private void SaveButton_Activated(object obj, EventArgs args)
|
|
||||||
{
|
|
||||||
//Saving code is about to make this a BIG boi
|
|
||||||
|
|
||||||
File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text);
|
|
||||||
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CancelButton_Activated(object obj, EventArgs args)
|
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CustThemeToggle_Activated(object obj, EventArgs args)
|
private void CustThemeToggle_Activated(object obj, EventArgs args)
|
||||||
{
|
{
|
||||||
if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; } else { CustThemeDir.Sensitive = true; }
|
if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; } else { CustThemeDir.Sensitive = true; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CloseToggle_Activated(object obj, EventArgs args)
|
||||||
|
{
|
||||||
|
Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveToggle_Activated(object obj, EventArgs args)
|
||||||
|
{
|
||||||
|
File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -404,8 +404,8 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="SaveButton">
|
<object class="GtkToggleButton" id="SaveToggle">
|
||||||
<property name="label" translatable="yes">Save</property>
|
<property name="label" translatable="yes">Toggle to Save</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
|
@ -417,8 +417,8 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="CancelButton">
|
<object class="GtkToggleButton" id="CloseToggle">
|
||||||
<property name="label" translatable="yes">Cancel</property>
|
<property name="label" translatable="yes">Toggle to Close</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
|
|
|
@ -16,6 +16,7 @@ namespace Ryujinx
|
||||||
|
|
||||||
//UI Controls
|
//UI Controls
|
||||||
[GUI] MenuItem NFC;
|
[GUI] MenuItem NFC;
|
||||||
|
[GUI] MenuItem ControlSettingsMenu;
|
||||||
[GUI] TreeView GameTable;
|
[GUI] TreeView GameTable;
|
||||||
|
|
||||||
public MainMenu(HLE.Switch _device, Application _gtkapp) : this(new Builder("Ryujinx.MainMenu.glade"), _device, _gtkapp) { }
|
public MainMenu(HLE.Switch _device, Application _gtkapp) : this(new Builder("Ryujinx.MainMenu.glade"), _device, _gtkapp) { }
|
||||||
|
@ -41,6 +42,7 @@ namespace Ryujinx
|
||||||
|
|
||||||
//disable some buttons
|
//disable some buttons
|
||||||
NFC.Sensitive = false;
|
NFC.Sensitive = false;
|
||||||
|
ControlSettingsMenu.Sensitive = false;
|
||||||
|
|
||||||
//Games grid thing
|
//Games grid thing
|
||||||
GameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
|
GameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
|
||||||
|
@ -203,11 +205,6 @@ namespace Ryujinx
|
||||||
GSWin.Show();
|
GSWin.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Control_Settings_Pressed(object o, EventArgs args)
|
|
||||||
{
|
|
||||||
ControlSettings.ControlSettingsMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NFC_Pressed(object o, EventArgs args)
|
private void NFC_Pressed(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">Control Settings</property>
|
<property name="label" translatable="yes">Control Settings</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<signal name="activate" handler="Control_Settings_Pressed" swapped="no"/>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -8,7 +8,6 @@ using Ryujinx.Profiler;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Ryujinx
|
namespace Ryujinx
|
||||||
{
|
{
|
||||||
|
@ -24,6 +23,8 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
Console.Title = "Ryujinx Console";
|
Console.Title = "Ryujinx Console";
|
||||||
|
|
||||||
|
Environment.SetEnvironmentVariable("Path", $"{new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).Parent}\\bin;{Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine)}");
|
||||||
|
|
||||||
IGalRenderer renderer = new OglRenderer();
|
IGalRenderer renderer = new OglRenderer();
|
||||||
|
|
||||||
IAalOutput audioOut = InitializeAudioEngine();
|
IAalOutput audioOut = InitializeAudioEngine();
|
||||||
|
|
|
@ -67,6 +67,11 @@ button {
|
||||||
color: #F4F6F7;
|
color: #F4F6F7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filechooser #pathbarbox {
|
||||||
|
background-color: #272b2e;
|
||||||
|
border-bottom: 1px solid #595c5f;
|
||||||
|
}
|
||||||
|
|
||||||
scrollbar {
|
scrollbar {
|
||||||
-GtkScrollbar-has-backward-stepper: false;
|
-GtkScrollbar-has-backward-stepper: false;
|
||||||
-GtkScrollbar-has-forward-stepper: false;
|
-GtkScrollbar-has-forward-stepper: false;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 4.5 KiB |
Loading…
Add table
Add a link
Reference in a new issue