This commit is contained in:
2025-05-14 10:52:53 +02:00
parent 1e190fe94b
commit f0536f4129
51 changed files with 934 additions and 381 deletions

View File

@@ -1,4 +1,7 @@
using RebootKit.Engine.UI;
using RebootKit.Engine.Main;
using RebootKit.Engine.Services.Console;
using RebootKit.Engine.UI;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
@@ -55,6 +58,67 @@ namespace RebootKitEditor.RebootWindow {
persistentPathContainer.Add(openPersistentPathButton);
rootContainer.Add(persistentPathContainer);
Label onGameRunScriptLabel = new("On Game Run Script (User):") {
style = {
fontSize = 12,
color = new Color(0.7f, 0.9f, 0.9f)
}
};
rootContainer.Add(onGameRunScriptLabel);
TextField onGameRunScriptTextField = new() {
style = {
fontSize = 12,
},
multiline = true,
value = EditorPrefs.GetString(REditorConsts.k_OnGameRunScriptContentKey, "")
};
onGameRunScriptTextField.RegisterValueChangedCallback(evt => {
EditorPrefs.SetString(REditorConsts.k_OnGameRunScriptContentKey, evt.newValue);
});
rootContainer.Add(onGameRunScriptTextField);
Label consoleCommandsLabel = new("Console Commands:") {
style = {
fontSize = 12,
color = new Color(0.7f, 0.9f, 0.9f)
}
};
rootContainer.Add(consoleCommandsLabel);
ConsoleService.ConsoleCommand[] consoleCommands = ConsoleService.GenerateCommandsToRegister();
foreach (ConsoleService.ConsoleCommand consoleCommand in consoleCommands) {
VisualElement commandContainer = new() {
style = {
flexDirection = FlexDirection.Row,
marginTop = 4,
marginBottom = 4,
paddingLeft = 4,
paddingRight = 4,
paddingTop = 4,
paddingBottom = 4,
}
};
Label commandLabel = new(consoleCommand.name) {
style = {
fontSize = 12,
color = new Color(0.7f, 0.9f, 0.9f)
}
};
commandContainer.Add(commandLabel);
Label descriptionLabel = new(consoleCommand.description) {
style = {
fontSize = 12,
color = new Color(0.5f, 0.7f, 0.7f)
}
};
commandContainer.Add(descriptionLabel);
rootContainer.Add(commandContainer);
}
return rootContainer;
}