public void SetSelected(int index)
        {
            if (index < 0 || index >= GamesList.Count)
            {
                return;
            }


            SaveGameRowStruct currentStruct = GamesList[CurrentSelected];

            if (currentStruct != null)
            {
                // unset selected
                currentStruct.RowPanel.backgroundSprite = "";
            }

            currentStruct = GamesList[index];

            if (currentStruct != null)
            {
                CurrentSelected = index;

                // set selected
                currentStruct.RowPanel.backgroundSprite = "ListItemHighlight";

                // notify detail panel about new selected object
                ParentBetterLoadPanelWrapper.DetailsPanel.SetSelected(currentStruct);
            }
        }
        public void SetSelected(SaveGameRowStruct sgrs)
        {
            if (Snapshot.texture != null)
            {
                UnityEngine.Object.Destroy(Snapshot.texture);
            }

            if (sgrs.saveMeta.imageRef != null)
            {
                Texture newtex = sgrs.saveMeta.imageRef.Instantiate <Texture>();
                Snapshot.texture          = newtex;
                Snapshot.texture.wrapMode = TextureWrapMode.Clamp;
                RecalculateSnapshotSize();
            }
            else
            {
                Snapshot.texture = null;
            }

            AchSprite.isVisible = Singleton <PluginManager> .instance.enabledModCount > 0 || sgrs.saveMeta.achievementsDisabled || sgrs.saveMeta.assetRef.package.GetPublishedFileID() != PublishedFileId.invalid;
            AchSprite.Invalidate();

            //// use new modinfo to show mods active when save was made (?)
            //foreach (ModInfo mi in sgrs.saveMeta.mods)
            //{
            //   //mi.modName;
            //   //mi.modWorkshopID;
            //}
        }
        public void SelectRowObject(UIComponent component)
        {
            UIPanel panel = component as UIPanel;

            if (panel != null)
            {
                SaveGameRowStruct sgrs = panel.objectUserData as SaveGameRowStruct;

                if (sgrs != null)
                {
                    int idx = GamesList.IndexOf(sgrs);

                    if (idx >= 0 && idx < GamesList.Count)
                    {
                        SetSelected(idx);
                    }
                }
            }
        }
        public void LaunchRowObject(UIComponent component)
        {
            UIPanel panel = component as UIPanel;

            if (panel != null)
            {
                SaveGameRowStruct sgrs = panel.objectUserData as SaveGameRowStruct;

                if (sgrs != null)
                {
                    if (SavePanel.isSaving || !Singleton <LoadingManager> .exists || Singleton <LoadingManager> .instance.m_currentlyLoading)
                    {
                        return;
                    }

                    //this.CloseEverything();
                    WorldInfoPanel.HideAllWorldInfoPanels();

                    SaveGameMetaData listingMetaData = sgrs.saveMeta;          // this.GetListingMetaData(this.m_SaveList.selectedIndex);
                    Package.Asset    listingData     = sgrs.saveMeta.assetRef; // this.GetListingData(this.m_SaveList.selectedIndex);

                    SimulationMetaData ngs = new SimulationMetaData()
                    {
                        m_CityName   = listingMetaData.cityName,
                        m_updateMode = SimulationManager.UpdateMode.LoadGame //,
                                                                             //m_environment = this.m_forceEnvironment
                    };

                    if (Singleton <PluginManager> .instance.enabledModCount > 0 || listingData.package.GetPublishedFileID() != PublishedFileId.invalid)
                    {
                        ngs.m_disableAchievements = SimulationMetaData.MetaBool.True;
                    }

                    Singleton <LoadingManager> .instance.LoadLevel(listingData, "Game", "InGame", ngs);

                    //UIView.library.Hide(this.GetType().Name, 1);
                    ParentBetterLoadPanelWrapper.Hide();
                }
            }
        }