feat: add persistent storage
This commit is contained in:
parent
8b25c4fd9c
commit
19475c6573
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace DalamudPython {
|
namespace DalamudPython {
|
||||||
|
@ -17,6 +16,7 @@ namespace DalamudPython {
|
||||||
private Plugin Plugin { get; }
|
private Plugin Plugin { get; }
|
||||||
|
|
||||||
private string? Script { get; set; }
|
private string? Script { get; set; }
|
||||||
|
private Dictionary<object, object> Store { get; } = new();
|
||||||
|
|
||||||
public Commands(Plugin plugin) {
|
public Commands(Plugin plugin) {
|
||||||
this.Plugin = plugin;
|
this.Plugin = plugin;
|
||||||
|
@ -67,6 +67,7 @@ namespace DalamudPython {
|
||||||
private void Execute(string script, bool print) {
|
private void Execute(string script, bool print) {
|
||||||
var scope = this.Plugin.Engine.CreateScope();
|
var scope = this.Plugin.Engine.CreateScope();
|
||||||
scope.SetVariable("interface", this.Plugin.Interface);
|
scope.SetVariable("interface", this.Plugin.Interface);
|
||||||
|
scope.SetVariable("store", this.Store);
|
||||||
var fullScript = $@"import clr
|
var fullScript = $@"import clr
|
||||||
from Dalamud import *
|
from Dalamud import *
|
||||||
from Dalamud.Plugin import *
|
from Dalamud.Plugin import *
|
||||||
|
|
Loading…
Reference in New Issue