예제 #1
0
        public static void Prefix(object __instance, ref bool __state)
        {
            if (IgnoreHelper.IsIgnored())
            {
                return;
            }

            TransportTool tool    = ReflectionHelper.GetAttr <TransportTool>(__instance, "$this");
            int           counter = ReflectionHelper.GetAttr <int>(__instance, "$PC");

            int mode         = ReflectionHelper.GetAttr <int>(tool, "m_mode");
            int expectedMode = ReflectionHelper.GetEnumValue(typeof(TransportTool).GetNestedType("Mode", ReflectionHelper.AllAccessFlags), "NewLine");

            ToolBase.ToolErrors m_errors = ReflectionHelper.GetAttr <ToolBase.ToolErrors>(tool, "m_errors");
            ushort m_lastEditLine        = ReflectionHelper.GetAttr <ushort>(tool, "m_lastEditLine");
            int    m_hoverStopIndex      = ReflectionHelper.GetAttr <int>(tool, "m_hoverStopIndex");
            int    m_building            = ReflectionHelper.GetAttr <int>(tool, "m_building");

            if (counter != 0 || m_errors != ToolBase.ToolErrors.None || mode != expectedMode || m_lastEditLine == 0 || m_hoverStopIndex == -1 || (m_building != 0 && m_hoverStopIndex == 0))
            {
                __state = false;
                return;
            }
            __state = true;

            ArrayHandler.StartCollecting();
            IgnoreHelper.StartIgnore("RemoveStop");
        }
예제 #2
0
        public static void Prefix(out CallState __state, object __instance)
        {
            __state = new CallState();

            if (IgnoreHelper.IsIgnored())
            {
                __state.run = false;
                return;
            }

            BuildingTool tool    = ReflectionHelper.GetAttr <BuildingTool>(__instance, "$this");
            int          counter = ReflectionHelper.GetAttr <int>(__instance, "$PC");

            ToolBase.ToolErrors ___m_placementErrors = ReflectionHelper.GetAttr <ToolBase.ToolErrors>(tool, "m_placementErrors");

            if (counter != 0 || ___m_placementErrors != ToolBase.ToolErrors.None)
            {
                __state.run = false;
                return;
            }

            __state.run      = true;
            __state.relocate = tool.m_relocate; // Save relocate state as it will be cleared at the end of the method

            IgnoreHelper.StartIgnore();
            ArrayHandler.StartCollecting();
        }
예제 #3
0
        public static void Prefix(object __instance, ref bool __state)
        {
            if (IgnoreHelper.IsIgnored())
            {
                return;
            }

            TransportTool tool    = ReflectionHelper.GetAttr <TransportTool>(__instance, "$this");
            int           counter = ReflectionHelper.GetAttr <int>(__instance, "$PC");

            int mode         = ReflectionHelper.GetAttr <int>(tool, "m_mode");
            int expectedMode = ReflectionHelper.GetEnumValue(
                typeof(TransportTool).GetNestedType("Mode", ReflectionHelper.AllAccessFlags), "MoveStops");

            if (counter != 0 || mode != expectedMode)
            {
                __state = false;
                return;
            }

            __state = true;

            ArrayHandler.StartCollecting();
            IgnoreHelper.StartIgnore("CancelMoveStop");
        }
예제 #4
0
        public static void Prefix()
        {
            if (IgnoreHelper.IsIgnored())
            {
                return;
            }

            ArrayHandler.StartCollecting();
        }
예제 #5
0
        public static void Prefix()
        {
            if (IgnoreHelper.IsIgnored())
            {
                return;
            }

            ArrayHandler.StartCollecting();
            IgnoreHelper.StartIgnore("StartEditingBuildingLine");
        }
예제 #6
0
        public static void Prefix(out bool __state)
        {
            if (IgnoreHelper.IsIgnored())
            {
                __state = false;
                return;
            }

            __state = true;
            ArrayHandler.StartCollecting();
            IgnoreHelper.StartIgnore();
        }
예제 #7
0
        public static void Prefix(ushort building, ref Building.Flags changeMask, out bool __state)
        {
            if (IgnoreHelper.IsIgnored())
            {
                __state = false;
                return;
            }

            __state = true;


            ArrayHandler.StartCollecting();
            IgnoreHelper.StartIgnore();
        }
예제 #8
0
        public static void Prefix(ushort ___m_tempLine, ushort ___m_lastEditLine, int ___m_lastMoveIndex, int ___m_lastAddIndex, Vector3 ___m_lastAddPos, out DataStore __state)
        {
            __state = new DataStore();

            if (IgnoreHelper.IsIgnored() || !TransportHandler.TrackSimulationStep)
            {
                return;
            }

            __state.tempLine = ___m_tempLine;
            __state.editLine = ___m_lastEditLine;
            __state.move     = ___m_lastMoveIndex;
            __state.add      = ___m_lastAddIndex;
            __state.addP     = ___m_lastAddPos;

            ArrayHandler.StartCollecting();
            IgnoreHelper.StartIgnore("EnsureTempLine");
        }
예제 #9
0
        public static void Prefix(out CallState __state, bool test, bool visualize,
                                  NetTool.ControlPoint startPoint, NetTool.ControlPoint middlePoint, NetTool.ControlPoint endPoint)
        {
            __state = new CallState();

            if (IgnoreHelper.IsIgnored())
            {
                __state.valid = false;
                return;
            }

            if (test || visualize)
            {
                __state.valid = false;
                return;
            }

            __state.valid = true;
            __state.SetControlPoints(startPoint, middlePoint, endPoint);

            IgnoreHelper.StartIgnore();
            ArrayHandler.StartCollecting();
        }