コード例 #1
0
        private static bool Prefix(SettlementNameplateVM __instance, ref int ____bindRelation, IFaction ____currentFaction)
        {
            String faction = ____currentFaction.ToString().Replace(" ", "");

            switch (faction)
            {
            case "Aserai":
                ____bindRelation = 3;
                break;

            case "Battania":
                ____bindRelation = 4;
                break;

            case "Khuzait":
                ____bindRelation = 5;
                break;

            case "NorthernEmpire":
                ____bindRelation = 6;
                break;

            case "SouthernEmpire":
                ____bindRelation = 7;
                break;

            case "Sturgia":
                ____bindRelation = 8;
                break;

            case "Vlandia":
                ____bindRelation = 9;
                break;

            case "WesternEmpire":
                ____bindRelation = 10;
                break;

            default:
                return(true);

                break;
            }
            return(false);
        }
コード例 #2
0
            public static bool Prefix(SettlementNameplateVM __instance)
            {
                try
                {
                    if (Traverse.Create(MapScreen.Instance).Field("_mapState").GetValue <MapState>().AtMenu)
                    {
                        return(true);
                    }

                    var shift = Input.IsKeyDown(InputKey.LeftShift) || Input.IsKeyDown(InputKey.RightShift);
                    if (shift)
                    {
                        var ctrl = Input.IsKeyDown(InputKey.LeftControl) || Input.IsKeyDown(InputKey.RightControl);
                        MobileParty.MainParty.SetMoveGoToSettlement(__instance.Settlement);
                        Campaign.Current.TimeControlMode = CampaignTimeControlMode.StoppableFastForward;
#if !OneFourThree
                        if (ctrl)
                        {
                            MapScreen.Instance.CurrentCameraFollowMode = MapScreen.CameraFollowMode.Free;
                        }
                        else
                        {
                            MapScreen.Instance.CurrentCameraFollowMode = MapScreen.CameraFollowMode.FollowParty;
                        }
#else
                        MapScreen.Instance.CameraFollowMode = !ctrl;
#endif

                        return(false);
                    }
                }
                catch (Exception ex)
                {
                    Log(ex);
                }

                return(true);
            }