mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-10 07:19:24 +01:00
1439973204
Added Press/Toggle Key to Special Actions, you can hold a trigger to hold a key or toggle a key with one set of buttons, and untoggle it by pressing or releasing another set of buttons Added Disconnect BT to Special Actions, PS+Options to d/c is now added to Special actions and can be enabled for each profile. You can now set Disconnect BT to any control(s) and how long you need to hold the control(s) to take affect Added Partial German Translation (Thanks Michél) Added 95% Finished Russian Translation (Thanks overclockers.ru members: KoNoRIMCI & Sr_psycho) Added Partial Italian Translation (Thanks Giulio) Updates to the translations sheets, they should now have every bit of text in DS4Windows, minus the controls of the controller English Spelling fixes Main/Starting tab only shows info for connected controllers, and context menu only shows options for connected controllers. Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now scrolls smoothly Slightly reworked analog mouse movement + mouse acceleration (not as janky anymore) When starting DS4Windows, if no controllers are connected, DS4Windows defaults to the profile tab Certain log warnings (Like unable to get controller exclusively) shows up in red Easter egg: try pressing a few buttons in sequence while in the log tab Fixed Start Profile with TP off being unchecked next time a profile is opened Other minor Bug Fixes, such as clearing the log then moving to a new tab crashing DS4W
103 lines
3.5 KiB
C#
103 lines
3.5 KiB
C#
using DS4Control;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Xml;
|
|
|
|
namespace DS4Windows
|
|
{
|
|
public partial class SaveWhere : Form
|
|
{
|
|
private bool multisaves;
|
|
string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
|
|
public SaveWhere(bool multisavespots)
|
|
{
|
|
InitializeComponent();
|
|
Icon = Properties.Resources.DS4W;
|
|
multisaves = multisavespots;
|
|
lbMultiSaves.Visible = multisaves;
|
|
cBDeleteOther.Visible = multisaves;
|
|
if (multisaves)
|
|
lbPickWhere.Text += Properties.Resources.OtherFileLocation;
|
|
if (Global.AdminNeeded())
|
|
bnPrgmFolder.Enabled = false;
|
|
}
|
|
|
|
private void bnPrgmFolder_Click(object sender, EventArgs e)
|
|
{
|
|
Global.SaveWhere(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName);
|
|
if (multisaves && !cBDeleteOther.Checked)
|
|
{
|
|
try { Directory.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows", true); }
|
|
catch { }
|
|
}
|
|
else if (!multisaves)
|
|
Save(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + "\\Profiles.xml");
|
|
Close();
|
|
}
|
|
|
|
private void bnAppdataFolder_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
if (multisaves && !cBDeleteOther.Checked)
|
|
try
|
|
{
|
|
Directory.Delete(exepath + "\\Profiles", true);
|
|
File.Delete(exepath + "\\Profiles.xml");
|
|
File.Delete(exepath + "\\Auto Profiles.xml");
|
|
}
|
|
catch (UnauthorizedAccessException) { MessageBox.Show("Cannot Delete old settings, please manaully delete", "DS4Windows"); }
|
|
else if (!multisaves)
|
|
Save(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows\\Profiles.xml");
|
|
Global.SaveWhere(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows");
|
|
Close();
|
|
}
|
|
|
|
public bool Save(String path)
|
|
{
|
|
Boolean Saved = true;
|
|
XmlDocument m_Xdoc = new XmlDocument();
|
|
try
|
|
{
|
|
XmlNode Node;
|
|
|
|
m_Xdoc.RemoveAll();
|
|
|
|
Node = m_Xdoc.CreateXmlDeclaration("1.0", "utf-8", String.Empty);
|
|
m_Xdoc.AppendChild(Node);
|
|
|
|
Node = m_Xdoc.CreateComment(String.Format(" Profile Configuration Data. {0} ", DateTime.Now));
|
|
m_Xdoc.AppendChild(Node);
|
|
|
|
Node = m_Xdoc.CreateWhitespace("\r\n");
|
|
m_Xdoc.AppendChild(Node);
|
|
|
|
Node = m_Xdoc.CreateNode(XmlNodeType.Element, "Profile", null);
|
|
|
|
m_Xdoc.AppendChild(Node);
|
|
|
|
m_Xdoc.Save(path);
|
|
}
|
|
catch { Saved = false; }
|
|
|
|
return Saved;
|
|
}
|
|
|
|
private void SaveWhere_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
if (String.IsNullOrEmpty(Global.appdatapath))
|
|
if (MessageBox.Show(Properties.Resources.ALocactionNeeded, Properties.Resources.CloseDS4W,
|
|
MessageBoxButtons.YesNo) == DialogResult.No)
|
|
e.Cancel = true;
|
|
}
|
|
}
|
|
}
|