Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DarkScript3.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkScript3", "DarkScript3\DarkScript3.csproj", "{26132F38-F7FC-465D-8044-4D45B5F79264}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoulsFormats", "..\SoulsFormats\SoulsFormats\SoulsFormats.csproj", "{580C3981-F179-4F17-858A-9469023BAF44}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoulsFormats", "SoulsFormats\SoulsFormats\SoulsFormats.csproj", "{580C3981-F179-4F17-858A-9469023BAF44}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoapstoneLib", "..\SoapstoneLib\SoapstoneLib\SoapstoneLib.csproj", "{7ADA6E29-EE8A-4829-A2D5-9C7B42D43601}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoapstoneLib", "SoapstoneLib\SoapstoneLib\SoapstoneLib.csproj", "{7ADA6E29-EE8A-4829-A2D5-9C7B42D43601}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 3 additions & 3 deletions DarkScript3/DarkScript3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\darkscriptico1.ico</ApplicationIcon>
<PublishSingleFile>true</PublishSingleFile>
Expand All @@ -25,8 +25,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\SoapstoneLib\SoapstoneLib\SoapstoneLib.csproj" />
<ProjectReference Include="..\..\SoulsFormats\SoulsFormats\SoulsFormats.csproj" />
<ProjectReference Include="..\SoapstoneLib\SoapstoneLib\SoapstoneLib.csproj" />
<ProjectReference Include="..\SoulsFormats\SoulsFormats\SoulsFormats.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 13 additions & 1 deletion DarkScript3/EditorGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ private void OnOutOfBoundsToolTip(Point p)

private void Editor_ToolTipNeeded(object sender, ToolTipNeededEventArgs e)
{
if (!Properties.Settings.Default.DisplayTooltips)
{
return;
}

if (PreventHoverMousePosition != null)
{
if (MousePosition.Equals(PreventHoverMousePosition))
Expand Down Expand Up @@ -530,7 +535,14 @@ void showData(SoapstoneMetadata.DisplayData data)
string text = data.Desc;
if ((data is SoapstoneMetadata.EntityData ent && ent.Type != "Self") || data is SoapstoneMetadata.EntryData)
{
text += "\nRight-click tooltip to open in DSMapStudio";
var name = "DSMapStudio";

if (DarkScript3.Properties.Settings.Default.UseSoapstoneSmithbox)
{
name = "Smithbox";
}

text += $"\nRight-click tooltip to open in {name}";
}
ShowTip(text, p, data: data);
}
Expand Down
953 changes: 462 additions & 491 deletions DarkScript3/GUI.Designer.cs

Large diffs are not rendered by default.

100 changes: 88 additions & 12 deletions DarkScript3/GUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ private void GUI_Load(object sender, EventArgs e)
SharedControls.SetGlobalFont(TextStyles.Font);
// Ad-hoc way of doing settings, as tool menus (TODO: find something more permanent?)
// Note this may call CheckChanged, which could have side effects
showTooltipsToolStripMenuItem.Checked = Settings.Default.DisplayTooltips;
showArgumentsInTooltipToolStripMenuItem.Checked = Settings.Default.ArgTooltip;
showArgumentsInPanelToolStripMenuItem.Checked = Settings.Default.ArgDocbox;
connectToolStripMenuItem.Checked = Settings.Default.UseSoapstone;

connectToolStripMenuItem.Checked = Settings.Default.UseSoapstoneDSMS;
useSmithboxForMetadataToolStripMenuItem.Checked = Settings.Default.UseSoapstoneSmithbox;

// Update versions
string previousVersion = Settings.Default.Version;
if (!string.IsNullOrEmpty(previousVersion))
Expand Down Expand Up @@ -908,7 +912,15 @@ private void FileBrowserContextMenu_Opening(object sender, CancelEventArgs e)
if (gameStr != null)
{
string mapName = tag.BaseName.Split('.')[0];
ToolStripMenuItem mapItem = new ToolStripMenuItem($"Load {mapName} in DSMapStudio");

var name = "DSMapStudio";

if (DarkScript3.Properties.Settings.Default.UseSoapstoneSmithbox)
{
name = "Smithbox";
}

ToolStripMenuItem mapItem = new ToolStripMenuItem($"Load {mapName} in {name}");
mapItem.Click += async (sender, e) => await OpenFileBrowserMap(gameStr, mapName);
FileBrowserContextMenu.Items.Add(mapItem);
}
Expand Down Expand Up @@ -1173,6 +1185,11 @@ private void checkForDarkScript3UpdatesToolStripMenuItem_Click(object sender, Ev
{
OpenURL("https://github.com/AinTunez/DarkScript3/releases");
}
private void showTooltipsToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.DisplayTooltips = showTooltipsToolStripMenuItem.Checked;
Settings.Default.Save();
}

private void showArgumentTooltipsToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
{
Expand All @@ -1186,14 +1203,58 @@ private void showArgumentsInPanelToolStripMenuItem_CheckedChanged(object sender,
Settings.Default.Save();
}

// DSMapStudio
private void connectToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
{
Settings.Default.UseSoapstone = connectToolStripMenuItem.Checked;
if(connectToolStripMenuItem.Checked)
{
useSmithboxForMetadataToolStripMenuItem.Checked = false;
Settings.Default.UseSoapstoneDSMS = true;
Settings.Default.UseSoapstoneSmithbox = false;
}
else
{
useSmithboxForMetadataToolStripMenuItem.Checked = true;
Settings.Default.UseSoapstoneDSMS = false;
Settings.Default.UseSoapstoneSmithbox = true;
}

Settings.Default.Save();
SoapstoneMetadata metadata = SharedControls?.Metadata;
if (metadata != null && metadata.IsOpenable())
{
if (Settings.Default.UseSoapstoneDSMS)
{
metadata.Open();
}
else
{
metadata.Close();
}
}
}

// Smithbox
private void useSmithboxForMetadataToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
{
if (useSmithboxForMetadataToolStripMenuItem.Checked)
{
connectToolStripMenuItem.Checked = false;
Settings.Default.UseSoapstoneDSMS = false;
Settings.Default.UseSoapstoneSmithbox = true;
}
else
{
connectToolStripMenuItem.Checked = true;
Settings.Default.UseSoapstoneDSMS = true;
Settings.Default.UseSoapstoneSmithbox = false;
}

Settings.Default.Save();
SoapstoneMetadata metadata = SharedControls?.Metadata;
if (metadata != null && metadata.IsOpenable())
{
if (Settings.Default.UseSoapstone)
if (Settings.Default.UseSoapstoneSmithbox)
{
metadata.Open();
}
Expand All @@ -1207,18 +1268,25 @@ private void connectToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
private void showConnectionInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
if (Settings.Default.UseSoapstone)

var name = "DSMapStudio";
if (Settings.Default.UseSoapstoneSmithbox)
{
name = "Smithbox";
}

if (Settings.Default.UseSoapstoneDSMS || Settings.Default.UseSoapstoneSmithbox)
{
sb.AppendLine("DSMapStudio connectivity is enabled.");
sb.AppendLine($"{name} connectivity is enabled.");
sb.AppendLine();
sb.AppendLine("When DSMapStudio is open and Settings > Soapstone Server is enabled, "
+ "data from DSMapStudio will be used to autocomplete values from params, FMGs, and loaded maps. "
sb.AppendLine($"When {name} is open and Settings > Soapstone Server is enabled, "
+ $"data from {name} will be used to autocomplete values from params, FMGs, and loaded maps. "
+ "You can also hover on numbers in DarkScript3 to get tooltip info, "
+ "and right-click on the tooltip to open it in DSMapStudio.");
+ $"and right-click on the tooltip to open it in {name}.");
}
else
{
sb.AppendLine("DSMapStudio connectivity is disabled.");
sb.AppendLine("Cross-reference connectivity is disabled.");
sb.AppendLine();
if (connectToolStripMenuItem.Enabled)
{
Expand All @@ -1229,6 +1297,7 @@ private void showConnectionInfoToolStripMenuItem_Click(object sender, EventArgs
sb.AppendLine($"Restart DarkScript3 and select \"{connectToolStripMenuItem.Text}\" to enable it.");
}
}

sb.AppendLine();
SoapstoneMetadata metadata = SharedControls.Metadata;
string portStr = metadata.LastPort is int port ? $"{port}" : "None";
Expand All @@ -1237,14 +1306,21 @@ private void showConnectionInfoToolStripMenuItem_Click(object sender, EventArgs
sb.AppendLine($"Client state: {metadata.State}");
sb.AppendLine();
sb.AppendLine(metadata.LastLoopResult ?? "No requests sent");
ScrollDialog.Show(this, sb.ToString(), "DSMapStudio Soapstone Server Info");
ScrollDialog.Show(this, sb.ToString(), "Soapstone Server Info");
}

private void clearMetadataCacheToolStripMenuItem_Click(object sender, EventArgs e)
{
SharedControls.Metadata.ResetData();

var name = "DSMapStudio";
if (Settings.Default.UseSoapstoneSmithbox)
{
name = "Smithbox";
}

ScrollDialog.Show(this,
"Metadata cache cleared. Names and autocomplete items will be refetched from DSMapStudio when connected."
$"Metadata cache cleared. Names and autocomplete items will be refetched from {name} when connected."
+ "\n\n(This may be supported automatically in the future, if that would be helpful.)",
"Cleared cached metadata");
}
Expand Down
63 changes: 63 additions & 0 deletions DarkScript3/GUI.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down Expand Up @@ -63,6 +123,9 @@
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>144, 17</value>
</metadata>
<data name="docBox.Hotkeys" xml:space="preserve">
<value>Tab=IndentIncrease, Escape=ClearHints, PgUp=GoPageUp, PgDn=GoPageDown, End=GoEnd, Home=GoHome, Left=GoLeft, Up=GoUp, Right=GoRight, Down=GoDown, Insert=ReplaceMode, Del=DeleteCharRight, F3=FindNext, Shift+Tab=IndentDecrease, Shift+PgUp=GoPageUpWithSelection, Shift+PgDn=GoPageDownWithSelection, Shift+End=GoEndWithSelection, Shift+Home=GoHomeWithSelection, Shift+Left=GoLeftWithSelection, Shift+Up=GoUpWithSelection, Shift+Right=GoRightWithSelection, Shift+Down=GoDownWithSelection, Shift+Insert=Paste, Shift+Del=Cut, Ctrl+Back=ClearWordLeft, Ctrl+Space=AutocompleteMenu, Ctrl+End=GoLastLine, Ctrl+Home=GoFirstLine, Ctrl+Left=GoWordLeft, Ctrl+Up=ScrollUp, Ctrl+Right=GoWordRight, Ctrl+Down=ScrollDown, Ctrl+Insert=Copy, Ctrl+Del=ClearWordRight, Ctrl+0=ZoomNormal, Ctrl+A=SelectAll, Ctrl+B=BookmarkLine, Ctrl+C=Copy, Ctrl+E=MacroExecute, Ctrl+F=FindDialog, Ctrl+G=GoToDialog, Ctrl+H=ReplaceDialog, Ctrl+I=AutoIndentChars, Ctrl+M=MacroRecord, Ctrl+N=GoNextBookmark, Ctrl+R=Redo, Ctrl+U=UpperCase, Ctrl+V=Paste, Ctrl+X=Cut, Ctrl+Z=Undo, Ctrl+Add=ZoomIn, Ctrl+Subtract=ZoomOut, Ctrl+OemMinus=NavigateBackward, Ctrl+Shift+End=GoLastLineWithSelection, Ctrl+Shift+Home=GoFirstLineWithSelection, Ctrl+Shift+Left=GoWordLeftWithSelection, Ctrl+Shift+Right=GoWordRightWithSelection, Ctrl+Shift+B=UnbookmarkLine, Ctrl+Shift+C=CommentSelected, Ctrl+Shift+N=GoPrevBookmark, Ctrl+Shift+U=LowerCase, Ctrl+Shift+OemMinus=NavigateForward, Alt+Back=Undo, Alt+Up=MoveSelectedLinesUp, Alt+Down=MoveSelectedLinesDown, Alt+F=FindChar, Alt+Shift+Left=GoLeft_ColumnSelectionMode, Alt+Shift+Up=GoUp_ColumnSelectionMode, Alt+Shift+Right=GoRight_ColumnSelectionMode, Alt+Shift+Down=GoDown_ColumnSelectionMode</value>
</data>
<data name="docBox.ServiceColors" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAERGYXN0Q29sb3JlZFRleHRCb3gsIEN1bHR1cmU9bmV1dHJhbCwg
Expand Down
Loading