Пример #1
0
        public static string GetPath()
        {
            if (s_path == null)
            {
                s_path = CheckForPath();

                if (s_path != PATH_NOT_FOUND)
                {
                    Debug.Log("REx: Mod path " + s_path);
                }
                else
                {
                    Debug.Log("REx: Path not found");
                }
            }

            return(s_path);
        }
Пример #2
0
        private void UpdateInternal()
        {
            if (!_doneWithInstall)
            {
                if (ValidatePrerequisites())
                {
                    Install();
                    Debug.Log(string.Format("NExt: {0} completed", GetType().Name));

                    _doneWithInstall = true;
                }
            }

            if (_doneWithInstall)
            {
                if (InstallationCompleted != null)
                {
                    InstallationCompleted();
                }
            }
        }
        public static void DisplayLaneProps(this NetInfo info)
        {
            foreach (var lane in info.m_lanes)
            {
                if (lane.m_laneProps != null)
                {
                    Debug.Log(string.Format("NExt: Lane name {0}", lane.m_laneProps.name));

                    if (lane.m_laneProps.m_props != null)
                    {
                        foreach (var prop in lane.m_laneProps.m_props)
                        {
                            if (prop.m_prop != null)
                            {
                                Debug.Log(string.Format("NExt:     Prop name {0}", prop.m_prop.name));
                            }
                        }
                    }
                }
            }
        }
Пример #4
0
        private static string CheckForPath()
        {
            // 1. Check Local path (CurrentUser\Appdata\Local\Colossal Order\Cities_Skylines\Addons\Mods)
            var localPath = Path.Combine(DataLocation.modsPath, "NetworkExtensions");

            Debug.Log(string.Format("REx: Exist={0} DataLocation.modsPath={1}", Directory.Exists(localPath), localPath));

            if (Directory.Exists(localPath))
            {
                return(localPath);
            }

            // 2. Check Steam
            foreach (var mod in Steam.workshop.GetSubscribedItems())
            {
                if (mod.AsUInt64 == WORKSHOP_ID)
                {
                    var workshopPath = Steam.workshop.GetSubscribedItemPath(mod);
                    Debug.Log(string.Format("REx: Exist={0} WorkshopPath={1}", Directory.Exists(workshopPath), workshopPath));
                    if (Directory.Exists(workshopPath))
                    {
                        return(workshopPath);
                    }
                }
            }

            // 3. Check Cities Skylines files folder
            var csFolderPath = Path.Combine(Path.Combine(DataLocation.gameContentPath, "Mods"), "NetworkExtensions");

            Debug.Log(string.Format("REx: Exist={0} DataLocation.gameContentPath={1}", Directory.Exists(csFolderPath), csFolderPath));
            if (Directory.Exists(csFolderPath))
            {
                return(csFolderPath);
            }

            return(PATH_NOT_FOUND);
        }