コード例 #1
0
        internal static void AI_GameSpecificSetup(Harmony harmony)
        {
            Assert.IsNotNull(harmony);
            TranslationHelper.AccelerationBehaviorChanged += AI_AccelerationBehaviorChanged;
            ResetCaches();

            StringMethodTranspilerHelper.PatchMethod(harmony, typeof(WildGround),
                                                     nameof(WildGround.InitializeCommandLabels));
            StringMethodTranspilerHelper.PatchMethod(harmony, typeof(AgentActor), nameof(AgentActor.InitCommands));
            StringMethodTranspilerHelper.PatchMethod(harmony, typeof(PetHomeUI), nameof(PetHomeUI.RemoveAnimal));
        }
コード例 #2
0
ファイル: Hooks.cs プロジェクト: GeBo1/GeBoPlugins
        private static void CommandLabelCommandInfoOnTextSetterPrefix(Func <string> value)
        {
            // necessary for things like "{0}にアクション" to translate without being mangled
            if (!Configuration.AccelerationEnabled)
            {
                return;
            }
            try
            {
                StringMethodTranspilerHelper.PatchMethod(
                    new Harmony($"{nameof(CommandLabelCommandInfoOnTextSetterPrefix)}_{value.Method.Name}_Patcher"),
                    value.Method);
            }

            catch (Exception err)
            {
                Logger.LogException(err, nameof(CommandLabelCommandInfoOnTextSetterPrefix));
            }
        }