FillMyCart——v1.7.3 非官方更新版(测试版)
为较新版本的 Supermarket Simulator 更新 FillMyCart。为每种商品设置希望保留的最低数量,点击 Auto Fill 即可将库存和购物车中缺少的商品加入购物车;最低数量按单件计算,并会跨会话保存。本测试版针对 v1.7.3,仍需更多游戏内测试,不支持合作模式客户端。
供其他模组添加自定义提示的模组制作工具,也会修复玩家在不同可交互物体间移动视线时提示叠加的问题。安装需要 BepInEx;修改 PlayerInteraction.Raycast 可能与其他修改同一函数的模组冲突。
这是一个供其他模组添加自定义提示的工具。提示显示在屏幕左侧,包含按键输入和说明文字。工具还提供面向特定需求的功能,并修复一个游戏问题:玩家视线在不同可交互物体间移动、且没有移开视线时,提示可能会叠加显示。例如,从货架看向标签再看回货架时,标签提示仍会残留。
.dll 文件放入 Supermarket Simulator\BepInEx\plugin 文件夹。本模组会覆盖 PlayerInteraction.Raycast 函数,以便在玩家没有注视可交互物品时仍能显示提示。这可能与其他同样修改该函数的模组发生冲突。如果因此出现问题,可启用 DisablePermanentHints 设置来停用此覆盖。
文件中还提供了带 XML 文档的版本,位于 Files/Optional。实现说明见 README。
以下示例展示如何添加普通提示、多按键提示、使用 Unity KeyCode 的提示、加宽提示窗口、常驻提示,以及翻译提示:
using BepInEx;
using HarmonyLib;
using SirW_CustomHints;
namespace MyMod
{
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("SirW_CustomHints", BepInDependency.DependencyFlags.HardDependency)]
public class Plugin : BasePlugin
{
// 用于翻译提示;此项可选。
private static CustomTranslatedHints customTranslatedHints = new CustomTranslatedHints();
public override void Load()
{
// 将自定义函数附加到 SMS 代码。
Harmony.CreateAndPatchAll(typeof(Plugin));
}
// 与电脑交互时添加提示。
[HarmonyPatch(typeof(ComputerInteraction), nameof(ComputerInteraction.DefaultHint))]
[HarmonyPostfix]
static void ComputerExample(ComputerInteraction __instance, bool show)
{
// 仅在 ComputerInteraction.DefaultHint 设为显示时添加提示。
if (show)
{
// 基本提示。
CustomHints.AddHint(HintIcons.R, "Basic hint");
// 使用多个按键的提示。
CustomHints.AddHint([HintIcons.R, HintIcons.P], "Multi key");
// 使用 UnityEngine.KeyCode 的提示。
CustomHints.AddHint(HintIcons.GetKeyFromCode(KeyCode.R), "KeyCode hint");
// 增加提示窗口宽度。
CustomHints.AddHint(HintIcons.W, "Wider hint", 350f);
// 常驻提示。
CustomHints.AddHint(HintIcons.P, "Permanent hint", null, true);
// 显示翻译提示。
customTranslatedHints.AddHint(HintIcons.T, "translated_hint")
}
}
// 创建翻译。
private static void CreateTranslation()
{
string translationKey = "translated_hint";
LocalizedStrings localizedStrings = new LocalizedStrings();
localizedStrings["en"] = "Translated hint";
localizedStrings["de"] = "Übersetzter Hinweis";
localizedStrings["es-ES"] = "Pista traducida";
localizedStrings["da-DK"] = "Oversat tip";
// 如果列表中已有该条目,则更新它。
TranslationEntry existingKey = customTranslatedHints.Translations.FirstOrDefault(x => x.TranslationKey == translationKey);
if (existingKey != null)
{
existingKey.LocalizedStrings.Merge(localizedStrings);
}
else
{
TranslationEntry translationEntry = new TranslationEntry(translationKey, localizedStrings);
customTranslatedHints.Translations.Add(translationEntry);
}
}
}
}
示例中还使用了 HintIcons 类,其中包含所有可用图标。
作者:SirWintour
版本:2.3.0
DON'T UPDATE IF YOU USE GAMEPASS AND THE MOD WORKS! THIS WILL BREAK STUFF!
前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。
<!-- aoe-mods-source:nexusmods:supermarketsimulator:759 -->