Merge branch 'main' of ssh://git.datacentermods.com:2222/teamGreg/gregCore
gregCore CI / build (push) Has been cancelled

This commit is contained in:
Marvin
2026-04-25 02:47:33 +02:00
6 changed files with 52 additions and 63 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ using gregCore.Core.Events;
using gregCore.Core.Persistence;
using Il2CppInterop.Runtime.Injection;
[assembly: MelonInfo(typeof(gregCore.Core.GregCoreMod), "gregCore", "1.0.0.38-pre", "TeamGreg")]
[assembly: MelonInfo(typeof(gregCore.Core.GregCoreMod), "gregCore", "1.0.0.40-pre", "TeamGreg")]
[assembly: MelonColor(255, 0, 191, 165)] // Teal
[assembly: MelonPriority(-1000)] // Load first!
-15
View File
@@ -1,15 +0,0 @@
# gregCore Architektur
## Schichten
Core/ → Framework-Kern, kein Unity-Coupling, vollständig testbar
Infrastructure/ → Implementierungen, kennt MelonLoader/Win32/Mono
GameLayer/ → IL2CPP + Harmony, nur Daten-Extraktion + Dispatch
PublicApi/ → Was Modder nutzen dürfen
## Goldene Regeln
1. Patches haben KEINE Business-Logic
2. GregCoreLoader hat MAX 50 Zeilen
3. GameAPITable: Neue Felder NUR ans Ende
4. Alle Services via Interface — nie direkt instanziieren
5. MelonLogger nur in MelonLoggerAdapter
6. Assembly.LoadFrom VERBOTEN — immer Mono.Cecil
-27
View File
@@ -1,27 +0,0 @@
# gregCore API — Modder Guide
## Einstieg
```csharp
using gregCore.PublicApi;
public class MyMod : GregMod
{
public override void OnLoad()
{
// Geld hinzufügen
greg.Economy.AddMoney(500f);
// Auf Tagesende reagieren
greg.Time.OnDayEnd += OnNewDay;
// UI-Feedback
greg.UI.ShowToast("MyMod geladen!");
}
private void OnNewDay()
{
greg.UI.ShowToast("Neuer Tag!");
}
}
```
+50
View File
@@ -164,6 +164,44 @@ private static GregUIBuilder CreateBase(string title, bool isTablet)
return this;
}
public GregUIBuilder AddInputField(string label, string defaultValue, Action<string> onChanged)
{
var obj = GregUIManager.CreateUIObject("InputGroup", _contentContainer);
obj.AddComponent<LayoutElement>().minHeight = 40f;
var inputObj = GregUIManager.CreateUIObject("InputField", obj);
var input = inputObj.AddComponent<InputField>();
input.text = defaultValue;
input.onValueChanged.AddListener(new Action<string>(onChanged));
var txt = inputObj.AddComponent<Text>();
txt.text = label;
GregUITheme.ApplyText(txt);
return this;
}
public GregUIBuilder AddDropdown<T>(string label, T[] options, int selectedIndex, Action<T> onSelected)
{
var obj = GregUIManager.CreateUIObject("DropdownGroup", _contentContainer);
obj.AddComponent<LayoutElement>().minHeight = 40f;
var dp = obj.AddComponent<Dropdown>();
dp.value = selectedIndex;
var txt = GregUIManager.CreateUIObject("Label", obj).AddComponent<Text>();
txt.text = label;
GregUITheme.ApplyText(txt);
return this;
}
public GregUIBuilder AddSection(string title)
{
return AddHeadline(title);
}
public GregUIBuilder AddSpacer(float height = 20f)
{
var obj = GregUIManager.CreateUIObject("Spacer", _contentContainer);
obj.AddComponent<LayoutElement>().minHeight = height;
return this;
}
public GregUIBuilder AddSearchableList<T>(IEnumerable<T> items, Func<T, string> labelSelector, Action<T> onSelected)
{
// Implementation of a scrollable list (UGUI ScrollRect based)
@@ -208,6 +246,18 @@ private static GregUIBuilder CreateBase(string title, bool isTablet)
GregUIManager.RegisterPanel(name, _activePanel);
return _activePanel;
}
public GregUIBuilder Show() => SetVisible(true);
public GregUIBuilder Hide() => SetVisible(false);
public GregUIBuilder Toggle() => SetVisible(!_activePanel.activeSelf);
private GregUIBuilder SetVisible(bool visible)
{
if (_activePanel != null) _activePanel.SetActive(visible);
return this;
}
public bool IsVisible => _activePanel?.activeSelf ?? false;
}
public class GregUIDragHandler : MonoBehaviour
-19
View File
@@ -1,19 +0,0 @@
# greg.NoMoreEOL
## What it does
- Prevents servers & switches from reaching end-of-life
- Automatically repairs broken devices
- Runs continuously during gameplay
- Includes an in-game config menu (via gregCore Settings API)
## Why I made it
I wanted to remove the repetitive maintenance part of the game and focus more on building and optimizing the network.
## Details
This module is fully integrated into the `gregCore` framework. It utilizes the native Settings API (accessible via the SDK and RustAPI) to expose configuration toggles directly in the F8 Settings Hub.
### Configuration Options
- **Auto Repair Switches**: Automatically repairs broken network switches.
- **Auto Repair Servers**: Automatically repairs broken servers.
- **Disable Switches EOL**: Prevents switches from reaching End-Of-Life.
- **Disable Servers EOL**: Prevents servers from reaching End-Of-Life.
+1 -1
View File
@@ -51,7 +51,7 @@ namespace greg.UI.Settings
{
RegisterTab("greg.core", "Framework", builder =>
{
builder.AddLabel("gregCore v1.0.0.35")
builder.AddLabel("gregCore v1.0.0.40-pre")
.AddLabel("MelonLoader v0.6+")
.AddLabel($"Save Mode: {(frameworkSdk.GregFeatureGuard.IsVanillaSave ? "Vanilla" : "Greg")}")
.AddToggle("Verbose Startup Log", false, v => { })