Compare commits
10 Commits
42b0b0acf9
...
0.4.4
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bee591484 | |||
|
c3c14cec23
|
|||
| 4e885847a8 | |||
|
0ca6b27a11
|
|||
| 9b8900d7a7 | |||
|
792bba4875
|
|||
|
1c39e146fb
|
|||
|
47bcd0be34
|
|||
|
445f731170
|
|||
|
c7aa30581d
|
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
[0.4.4]
|
||||||
|
|
||||||
|
- Added Stationpedia docs back after removing all harmony patches from the mod
|
||||||
|
|
||||||
|
[0.4.3]
|
||||||
|
|
||||||
|
- Removed references to the `Mod` class from SLP. This was the root of the multiplayer
|
||||||
|
connectivity issues. Multiplayer should now work with Slang installed.
|
||||||
|
|
||||||
[0.4.2]
|
[0.4.2]
|
||||||
|
|
||||||
- Removed all harmony patches as most functionality as been added into the
|
- Removed all harmony patches as most functionality as been added into the
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<ModMetadata xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<ModMetadata xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<Name>Slang</Name>
|
<Name>Slang</Name>
|
||||||
<Author>JoeDiertay</Author>
|
<Author>JoeDiertay</Author>
|
||||||
<Version>0.4.2</Version>
|
<Version>0.4.4</Version>
|
||||||
<Description>
|
<Description>
|
||||||
[h1]Slang: High-Level Programming for Stationeers[/h1]
|
[h1]Slang: High-Level Programming for Stationeers[/h1]
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
private CancellationTokenSource? _lspCancellationToken;
|
private CancellationTokenSource? _lspCancellationToken;
|
||||||
private object _tokenLock = new();
|
private object _tokenLock = new();
|
||||||
|
|
||||||
protected static Editor? Ic10Editor = null;
|
protected Editor? Ic10Editor = null;
|
||||||
private IC10CodeFormatter iC10CodeFormatter = new IC10CodeFormatter();
|
private IC10CodeFormatter iC10CodeFormatter = new IC10CodeFormatter();
|
||||||
private string ic10CompilationResult = "";
|
private string ic10CompilationResult = "";
|
||||||
private List<SourceMapEntry> ic10SourceMap = new();
|
private List<SourceMapEntry> ic10SourceMap = new();
|
||||||
@@ -194,13 +194,17 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
|
|
||||||
private void UpdateIc10Formatter()
|
private void UpdateIc10Formatter()
|
||||||
{
|
{
|
||||||
if (Ic10Editor is null)
|
var tab = Editor.ParentTab;
|
||||||
|
if (Ic10Editor == null)
|
||||||
{
|
{
|
||||||
var tab = Editor.ParentTab;
|
|
||||||
iC10CodeFormatter = new IC10CodeFormatter();
|
iC10CodeFormatter = new IC10CodeFormatter();
|
||||||
Ic10Editor = new Editor(Editor.KeyHandler);
|
Ic10Editor = new Editor(Editor.KeyHandler);
|
||||||
Ic10Editor.IsReadOnly = true;
|
Ic10Editor.IsReadOnly = true;
|
||||||
iC10CodeFormatter.Editor = Ic10Editor;
|
iC10CodeFormatter.Editor = Ic10Editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tab.Editors.Count < 2)
|
||||||
|
{
|
||||||
tab.AddEditor(Ic10Editor);
|
tab.AddEditor(Ic10Editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,33 +223,26 @@ public class SlangFormatter : ICodeFormatter
|
|||||||
|
|
||||||
if (lines.Count() < 1)
|
if (lines.Count() < 1)
|
||||||
{
|
{
|
||||||
|
Ic10Editor.Selection = new TextRange
|
||||||
|
{
|
||||||
|
End = new TextPosition { Col = 0, Line = 0 },
|
||||||
|
Start = new TextPosition { Col = 0, Line = 0 },
|
||||||
|
};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// get the total range of the IC10 source for the selected Slang line
|
// get the total range of the IC10 source for the selected Slang line
|
||||||
var max = lines.Max(line => line.Ic10Line);
|
var max = lines.Max(line => line.Ic10Line);
|
||||||
var min = lines.Min(line => line.Ic10Line);
|
var min = lines.Min(line => line.Ic10Line);
|
||||||
|
|
||||||
|
Ic10Editor.CaretPos = new TextPosition { Col = 0, Line = (int)max };
|
||||||
|
|
||||||
// highlight all the IC10 lines that are within the specified range
|
// highlight all the IC10 lines that are within the specified range
|
||||||
foreach (var index in Enumerable.Range((int)min, (int)(max - min) + 1))
|
Ic10Editor.Selection.Start = new TextPosition { Col = 0, Line = (int)min };
|
||||||
|
Ic10Editor.Selection.End = new TextPosition
|
||||||
{
|
{
|
||||||
var lineText = Ic10Editor.Lines[index].Text;
|
Col = Ic10Editor.Lines[(int)max].Text.Length,
|
||||||
|
Line = (int)max,
|
||||||
var newLine = new StyledLine(
|
};
|
||||||
lineText,
|
|
||||||
[
|
|
||||||
new SemanticToken
|
|
||||||
{
|
|
||||||
Column = 0,
|
|
||||||
Length = lineText.Length,
|
|
||||||
Line = index,
|
|
||||||
Background = ColorIdentifier,
|
|
||||||
Color = ColorFromHTML("black"),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
Ic10Editor.Lines[index] = newLine;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This runs on the Main Thread
|
// This runs on the Main Thread
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.IO.Compression;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Slang;
|
namespace Slang;
|
||||||
|
|
||||||
|
|||||||
18
csharp_mod/Patches.cs
Normal file
18
csharp_mod/Patches.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
namespace Slang;
|
||||||
|
|
||||||
|
using Assets.Scripts.UI;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
|
public static class SlangPatches
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(Stationpedia), nameof(Stationpedia.Regenerate))]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
public static void Stationpedia_Regenerate()
|
||||||
|
{
|
||||||
|
foreach (var page in Marshal.GetSlangDocs())
|
||||||
|
{
|
||||||
|
Stationpedia.Register(page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using BepInEx;
|
using BepInEx;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using LaunchPadBooster;
|
|
||||||
|
|
||||||
namespace Slang
|
namespace Slang
|
||||||
{
|
{
|
||||||
@@ -41,9 +40,7 @@ namespace Slang
|
|||||||
{
|
{
|
||||||
public const string PluginGuid = "com.biddydev.slang";
|
public const string PluginGuid = "com.biddydev.slang";
|
||||||
public const string PluginName = "Slang";
|
public const string PluginName = "Slang";
|
||||||
public const string PluginVersion = "0.4.2";
|
public const string PluginVersion = "0.4.4";
|
||||||
|
|
||||||
public static Mod MOD = new Mod(PluginName, PluginVersion);
|
|
||||||
|
|
||||||
private Harmony? _harmony;
|
private Harmony? _harmony;
|
||||||
|
|
||||||
|
|||||||
2
rust_compiler/Cargo.lock
generated
2
rust_compiler/Cargo.lock
generated
@@ -930,7 +930,7 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slang"
|
name = "slang"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "slang"
|
name = "slang"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::compile;
|
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user