mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
feat(LiveStreamAssist): add automatic statistics tab cycling
This commit is contained in:
1 parent
f91ccfcffb
commit
0604308d8a
8 files changed
+174
No files matched your search
@@ -51,6 +51,7 @@ DSP_Mods/
|
||||
|
||||
| Mod | GUID | Description |
|
||||
|-----|------|-------------|
|
||||
| **LiveStreamAssist** | `org.soardev.livestreamassist` | UXAssist-based live-stream statistics display. The rebindable Ctrl+F8 shortcut starts or stops the feature; starting opens Production Statistics, then alternates with Dyson Sphere at random 15-30-second unscaled-time intervals. Closing the statistics window or ending the game session stops the feature without reopening the window. |
|
||||
| **UXAssist** | `org.soardev.uxassist` | Core QoL mod and shared library. Window resize, profile-based saves, FPS control, factory/logistics/navigation/Dyson Sphere tweaks, UI improvements, config panel UI, and `Common/` + `UI/` widget library shared by other mods. The Factory tab's building-buffer controls include a comparison tip with the original game values. The Logistics tab can push auto-config values to all existing facilities of a type on the current planet (per-setting `Apply` and per-category `Apply All` buttons), and can set both product limits of every Orbital Collector across all loaded factories; logic is in `LogisticsPatch.Apply*`/`ForEach*` and wired in `UIConfigWindow`. Auto-construct uses forward sphere-cast probing, horizontal footprint-based detours, adaptive flight altitude, and stuck recovery while flying to construction ghosts. |
|
||||
| **CheatEnabler** | `org.soardev.cheatenabler` | Cheat pack (depends on UXAssist). Instant build, architect mode, infinite resources, power boosts, Dyson Sphere cheats with a bounded shell-count input (1–99,999), mecha invincibility, and more. |
|
||||
| **LogisticMiner** | — | Makes logistic stations automatically mine ores and water from the current planet. |
|
||||
|
||||
@@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LuaScriptEngine", "LuaScrip
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateGameDlls", "UpdateGameDlls\UpdateGameDlls.csproj", "{6E73B301-7C7A-4EF4-B0FA-4C6B40F96653}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveStreamAssist", "LiveStreamAssist\LiveStreamAssist.csproj", "{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -195,6 +197,18 @@ Global
|
||||
{6E73B301-7C7A-4EF4-B0FA-4C6B40F96653}.Release|x64.Build.0 = Release|Any CPU
|
||||
{6E73B301-7C7A-4EF4-B0FA-4C6B40F96653}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{6E73B301-7C7A-4EF4-B0FA-4C6B40F96653}.Release|x86.Build.0 = Release|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Release|x64.Build.0 = Release|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0E6D6C44-00CF-4FE9-A475-1D898B4D1DAC}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
using System.Reflection;
|
||||
using BepInEx;
|
||||
using CommonAPI.Systems;
|
||||
using UnityEngine;
|
||||
using UXAssist.Common;
|
||||
using UXAssist.Common.ModFeatures;
|
||||
using GameLogicProc = UXAssist.Common.GameLogic;
|
||||
|
||||
namespace LiveStreamAssist;
|
||||
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
[BepInDependency(UXAssist.PluginInfo.PLUGIN_GUID)]
|
||||
public class LiveStreamAssist : BaseUnityPlugin
|
||||
{
|
||||
public new static readonly BepInEx.Logging.ManualLogSource Logger =
|
||||
BepInEx.Logging.Logger.CreateLogSource(PluginInfo.PLUGIN_NAME);
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
I18N.Init();
|
||||
I18N.Add("KEYToggleLiveStreamAssist", "[LSA] Toggle live-stream statistics assist", "[LSA] \u5207\u6362\u76f4\u64ad\u7edf\u8ba1\u8f85\u52a9");
|
||||
ModFeatureRegistry.Discover(Assembly.GetExecutingAssembly());
|
||||
I18N.Apply();
|
||||
}
|
||||
}
|
||||
|
||||
[ModFeature("LiveStreamAssist", Order = 50)]
|
||||
internal static class LiveStreamAssistFeature
|
||||
{
|
||||
private const float MinIntervalSeconds = 15f;
|
||||
private const float MaxIntervalSeconds = 30f;
|
||||
private static PressKeyBind _toggleKey;
|
||||
private static bool _enabled;
|
||||
private static float _nextSwitchAt;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
_toggleKey = KeyBindings.RegisterKeyBinding(new BuiltinKey
|
||||
{
|
||||
key = new CombineKey((int)KeyCode.F8, CombineKey.CTRL_COMB, ECombineKeyAction.OnceClick, false),
|
||||
conflictGroup = KeyBindConflict.MOVEMENT | KeyBindConflict.FLYING | KeyBindConflict.SAILING |
|
||||
KeyBindConflict.BUILD_MODE_1 | KeyBindConflict.UI | KeyBindConflict.KEYBOARD_KEYBIND,
|
||||
name = "ToggleLiveStreamAssist",
|
||||
canOverride = true
|
||||
});
|
||||
}
|
||||
|
||||
public static void Start()
|
||||
{
|
||||
GameLogicProc.OnGameEnd += Stop;
|
||||
}
|
||||
|
||||
public static void Uninit()
|
||||
{
|
||||
GameLogicProc.OnGameEnd -= Stop;
|
||||
Stop();
|
||||
}
|
||||
|
||||
public static void OnInputUpdate()
|
||||
{
|
||||
if (!_toggleKey.keyValue) return;
|
||||
|
||||
if (_enabled)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
TryStart();
|
||||
}
|
||||
|
||||
public static void OnUpdate()
|
||||
{
|
||||
if (!_enabled) return;
|
||||
|
||||
var statWindow = GetStatWindow();
|
||||
if (statWindow == null || !statWindow.active)
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Time.unscaledTime < _nextSwitchAt) return;
|
||||
|
||||
var nextTab = statWindow.tabIndex == 1 ? 4 : 1;
|
||||
statWindow.OnTabButtonClick(nextTab);
|
||||
ScheduleNextSwitch();
|
||||
}
|
||||
|
||||
private static void TryStart()
|
||||
{
|
||||
var statWindow = GetStatWindow();
|
||||
if (statWindow == null || !GameMain.isRunning) return;
|
||||
|
||||
UIRoot.instance.uiGame.OpenProductionWindow();
|
||||
statWindow = GetStatWindow();
|
||||
if (statWindow == null || !statWindow.active) return;
|
||||
|
||||
statWindow.OnTabButtonClick(1);
|
||||
_enabled = true;
|
||||
ScheduleNextSwitch();
|
||||
}
|
||||
|
||||
private static UIStatisticsWindow GetStatWindow()
|
||||
{
|
||||
if (UIRoot.instance == null || UIRoot.instance.uiGame == null) return null;
|
||||
return UIRoot.instance.uiGame.statWindow;
|
||||
}
|
||||
|
||||
private static void ScheduleNextSwitch()
|
||||
{
|
||||
_nextSwitchAt = Time.unscaledTime + Random.Range(MinIntervalSeconds, MaxIntervalSeconds);
|
||||
}
|
||||
|
||||
private static void Stop()
|
||||
{
|
||||
_enabled = false;
|
||||
_nextSwitchAt = 0f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<BepInExPluginGuid>org.soardev.livestreamassist</BepInExPluginGuid>
|
||||
<Description>DSP MOD - LiveStreamAssist</Description>
|
||||
<Version>1.0.0</Version>
|
||||
<PackageId>LiveStreamAssist</PackageId>
|
||||
<RootNamespace>LiveStreamAssist</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UXAssist\UXAssist.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,12 @@
|
||||
# LiveStreamAssist
|
||||
|
||||
Keeps the Dyson Sphere Program statistics window active during a live stream by switching between the Production Statistics and Dyson Sphere tabs at a random interval.
|
||||
|
||||
## Usage
|
||||
|
||||
- Press Ctrl+F8 to start or stop the assist. The key can be changed in the game's keyboard settings.
|
||||
- Starting the assist opens the statistics window and selects Production Statistics.
|
||||
- The mod switches between Production Statistics and Dyson Sphere every 15 to 30 seconds.
|
||||
- Closing the statistics window stops the assist automatically.
|
||||
|
||||
The mod requires UXAssist.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "LiveStreamAssist",
|
||||
"version_number": "1.0.0",
|
||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/LiveStreamAssist",
|
||||
"description": "Keep the statistics window active for live streams",
|
||||
"dependencies": [
|
||||
"xiaoye97-BepInEx-5.4.17",
|
||||
"soarqin-UXAssist-1.5.9"
|
||||
]
|
||||
}
|
||||
@@ -64,3 +64,7 @@ Cloak(Fake) user account info
|
||||
|
||||
Some functions and patches for better user experience
|
||||
一些提升用户体验的功能和补丁
|
||||
|
||||
## [LiveStreamAssist](LiveStreamAssist)
|
||||
|
||||
Keeps the statistics window active for live streams by switching between the Production Statistics and Dyson Sphere tabs every 15 to 30 seconds.
|
||||
Reference in new issue
Block a user