Skip to content

Commit 5006e57

Browse files
committed
compatibility with lc2.0.0
1 parent 50ef135 commit 5006e57

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

external-scripts.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<ItemGroup>
1111
<Reference Include="ILeoConsole">
12-
<HintPath>/usr/include/LeoConsole/ILeoConsole.dll</HintPath>
12+
<HintPath>/usr/lib/ILeoConsole.dll</HintPath>
1313
</Reference>
1414
</ItemGroup>
1515

external-scripts.lcpkg

512 Bytes
Binary file not shown.

plugin.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class ConsoleData : IData {
1212
public string SavePath { get { return _SavePath; } set { _SavePath = value; } }
1313
public static string _DownloadPath;
1414
public string DownloadPath { get { return _DownloadPath; } set { _DownloadPath = value; } }
15+
public static string _Version;
16+
public string Version { get { return _Version; } set { _Version = value; } }
1517
}
1618

1719
public class ExternalScripts : IPlugin {
@@ -23,24 +25,23 @@ public class ExternalScripts : IPlugin {
2325

2426
private List<ICommand> _Commands;
2527
public List<ICommand> Commands { get { return _Commands; } set { _Commands = value; } }
26-
27-
public void PluginMain() {
28+
29+
public void PluginInit() {
2830
_data = new ConsoleData();
2931

3032
_Commands = new List<ICommand>();
3133
_Commands.Add(new Script());
3234
_Commands.Add(new ListScripts());
3335
_Commands.Add(new Exec());
36+
}
37+
38+
public void PluginMain() {
39+
if (!Directory.Exists(Path.Join(_data.SavePath, "share", "scripts"))) {
40+
Console.WriteLine("warning: scripts directory does not exist!");
41+
}
42+
}
3443

35-
// TODO SavePath is not set yet, see https://github.com/BoettcherDasOriginal/LeoConsole/issues/12
36-
//if (!Directory.Exists(Path.Join(_data.SavePath, "scripts"))) {
37-
// Console.WriteLine("creating scripts directory...");
38-
// try {
39-
// Directory.CreateDirectory(Path.Join(_data.SavePath, "scripts"));
40-
// } catch (Exception e) {
41-
// Console.WriteLine("WARNING: cannot create scripts dir: " + e.Message);
42-
// }
43-
//}
44+
public void PluginShutdown() {
4445
}
4546
}
4647
}

0 commit comments

Comments
 (0)