private void RebuildProjectionSites() { //clear the transform foreach (Transform child in objProjectionSiteList.transform) { Destroy(child.gameObject); } //add new ones in foreach (var projectionSite in projectionSites.sites.OrderBy(o => o.name).ThenByDescending(o => o.majorVersion)) { if (latestProjectionSites != null && latestProjectionSites.sites != null && latestProjectionSites.sites.Count > 0) { //look for match in projectionSites on version ProjectionSite match = latestProjectionSites.sites.FirstOrDefault(c => c.versionId == projectionSite.versionId); if (match != null) { projectionSite.status = ProjectionSiteStatus.UpToDate; } else { match = latestProjectionSites.sites.OrderBy(o => o.minorVersion).FirstOrDefault(c => c.id == projectionSite.id); projectionSite.status = match == null ? ProjectionSiteStatus.NotOnServer : match.minorVersion > projectionSite.minorVersion ? ProjectionSiteStatus.OutOfDate : ProjectionSiteStatus.Unknown; } } var projectionSiteGameObject = Instantiate(prefabProjectListItem, objProjectionSiteList.transform); var btn = projectionSiteGameObject.GetComponent <ProjectButton>(); btn.applicationManager = this; btn.SetProjectionSite(projectionSite, true, false); } }
public void ShowProjectionSiteModal(ProjectionSite projectionSite, bool isLatestProjection) { holdingProjectionSiteMinor = projectionSite; ProjectionSiteDetailsManager man = objUpdateProjectionSiteMinorModal.GetComponent <ProjectionSiteDetailsManager>(); if (isLatestProjection) { man.ShowFooterUpdateLocal(projectionSite.status == ProjectionSiteStatus.NewOnServer ? "Would you like to install the new projection site?" : "Would you like to update your local version settings with the latest configuration?"); } else { man.ShowFooterInfoAndCreate(); } man.SetData(holdingProjectionSiteMinor, this); btnUpdateProjectionSiteMinor.onClick.Invoke(); }
public void SetProjectionSite(ProjectionSite projectionSite, bool showCheckBox = false, bool isLatestProjection = false) { this.isLatestProjection = isLatestProjection; isProject = false; this.projectionSite = projectionSite; this.showCheckBox = showCheckBox; this.isOn = projectionSite.status == ProjectionSiteStatus.UpToDate || projectionSite.status == ProjectionSiteStatus.OutOfDate; var imgIcon = objCheckBoxIcon.GetComponent <UnityEngine.UI.Image>(); var img = objCheckBox.GetComponent <UnityEngine.UI.Image>(); var imgFill = objCheckBoxFill.GetComponent <UnityEngine.UI.Image>(); switch (projectionSite.status) { case ProjectionSiteStatus.UpToDate: imgIcon.sprite = imgCheckBoxIconUpToDate; break; case ProjectionSiteStatus.OutOfDate: imgIcon.sprite = imgCheckBoxIconOutOfDate; break; case ProjectionSiteStatus.NotOnServer: imgIcon.sprite = imgCheckBoxIconNotOnServer; break; case ProjectionSiteStatus.Unknown: imgIcon.sprite = imgCheckBoxIconUnknown; break; case ProjectionSiteStatus.NewOnServer: imgIcon.sprite = imgCheckBoxIconNewOnServer; break; } //imgIcon.color = isOn ? colorBlack : colorWhite; //set colours img.color = projectionSite.status == ProjectionSiteStatus.OutOfDate || projectionSite.status == ProjectionSiteStatus.NotOnServer ? colorAlert : colorWhite; imgFill.color = new Color(img.color.r, img.color.g, img.color.b, 0.75f); title.text = this.projectionSite.name; date.text = this.projectionSite.version; CheckStart(); }
public void SetData(ProjectionSite projectionSite) { _projectionSite = projectionSite; Header header = objTitle.GetComponent <Header>(); header.SetData(_projectionSite.name); //clear the transform foreach (Transform child in objList.transform) { Destroy(child.gameObject); } //build listing AddHeader("OVERVIEW"); AddTextLine("NAME", _projectionSite.name); AddTextLine("VERSION", _projectionSite.version); AddTextLine("LOCATION", _projectionSite.location.name); AddTextLine("CITY/TOWN", _projectionSite.location.town); TextLineButton btnLoc = AddTextLineButton("GEO LOCATION", _projectionSite.location.geoLocation.latLng, imgLocationIcon); btnLoc.OnButtonClick += BtnLoc_OnButtonClick; AddHeader("PROJECTORS"); AddTextLine("COUNT", _projectionSite.projectors.Count.ToString()); AddHeader("CAMERAS"); AddTextLine("COUNT", _projectionSite.cameras.Count.ToString()); AddHeader("DETAILS"); AddTextLine("ID", _projectionSite.id); AddTextLine("VERSION ID", _projectionSite.versionId); AddTextLine("ASSET BUNDLE", _projectionSite.assetBundleName); AddHeader("AUDIT"); AddTextLine("LAST UPDATED", _projectionSite.updatedAsString); AddTextLine("UPDATED BY", _projectionSite.updatedBy); AddTextLine("CREATED", _projectionSite.createdAsString); AddTextLine("CREATED BY", _projectionSite.createdBy); }
private void RebuildLatestProjectionSites() { //clear the transform foreach (Transform child in objLatestProjectionSiteList.transform) { Destroy(child.gameObject); } //add new ones in foreach (var projectionSite in latestProjectionSites.sites) { //look for match in projectionSites on version ProjectionSite match = projectionSites.sites.FirstOrDefault(c => c.versionId == projectionSite.versionId); ProjectionSite siteMatch = projectionSites.sites.FirstOrDefault(c => c.id == projectionSite.id); projectionSite.status = match != null ? ProjectionSiteStatus.UpToDate : siteMatch != null ? ProjectionSiteStatus.OutOfDate : ProjectionSiteStatus.NewOnServer; //on id //if(match == null) match = projectionSites.sites.FirstOrDefault(c => c.id == projectionSite.id); var projectionSiteGameObject = Instantiate(prefabProjectListItem, objLatestProjectionSiteList.transform); var btn = projectionSiteGameObject.GetComponent <ProjectButton>(); btn.applicationManager = this; btn.SetProjectionSite(projectionSite, true, true); } }
public void CreateNewProjection(ProjectionSite projectionSite) { ShowErrorMessage("Create Project from Site: " + projectionSite.name); }
public void UpdateLocalProjectionSiteCancel() { holdingProjectionSiteMinor = null; }
public void SetData(ProjectionSite projectionSite, ApplicationManager applicationManager) { if (firstTime) { FileBrowser.AddQuickLink("Projects", applicationManager.rootPath + applicationManager.projectsFolder, null); FileBrowser.AddQuickLink("Users", "C:\\Users", null); firstTime = false; } _projectionSite = projectionSite; _applicationManager = applicationManager; this.colorAlert = applicationManager.colorAlert; _project = new Project() { createdBy = applicationManager.users.current.email, updatedBy = applicationManager.users.current.email, projectionSite = _projectionSite, path = applicationManager.rootPath + applicationManager.projectsFolder, siteId = _projectionSite.id, siteVersionId = _projectionSite.versionId }; scrollbar.value = 1; //set scrollbar to top //clear the transform foreach (Transform child in objList.transform) { Destroy(child.gameObject); } //build listing AddHeader("PROJECT SETTINGS"); _inputName = AddEditTextLine("NAME", _project.name); _inputName.colorAltert = this.colorAlert; _inputName.input.Select(); _folderLine = AddTextLineButton("FOLDER", _project.path, imgFolderIcon, false); _folderLine.OnButtonClick += _folderLine_OnButtonClick; _newFolderLine = AddSwitch("CREATE NEW FOLDER", true); //build listing AddHeader("PROJECTION SITE"); AddTextLine("NAME", _projectionSite.name); AddTextLine("VERSION", _projectionSite.version); switch (_projectionSite.status) { case ProjectionSiteStatus.Unknown: AddTextLine("VERSION STATUS", "UNKNOWN"); break; case ProjectionSiteStatus.OutOfDate: AddTextLine("VERSION STATUS", "OUT OF DATE", false, true); break; case ProjectionSiteStatus.NotOnServer: AddTextLine("VERSION STATUS", "NOT ON SERVER", false, true); break; case ProjectionSiteStatus.UpToDate: AddTextLine("VERSION STATUS", "UP TO DATE"); break; case ProjectionSiteStatus.NewOnServer: AddTextLine("VERSION STATUS", "NEW"); break; } }
public void SetData(ProjectionSite projectionSite, ApplicationManager applicationManager) { _projectionSite = projectionSite; _applicationManager = applicationManager; this.colorAlert = applicationManager.colorAlert; Header header = objTitle.GetComponent <Header>(); header.SetData(_projectionSite.name); scrollbar.value = 1; //set scrollbar to top //clear the transform foreach (Transform child in objList.transform) { Destroy(child.gameObject); } //build listing AddHeader("OVERVIEW"); AddTextLine("NAME", _projectionSite.name); AddTextLine("VERSION", _projectionSite.version); switch (_projectionSite.status) { case ProjectionSiteStatus.Unknown: TextLineButton btnUnknown = AddTextLineButton("VERSION STATUS", "UNKNOWN", imgRefreshIcon); btnUnknown.OnButtonClick += BtnUnknown_OnButtonClick; break; case ProjectionSiteStatus.OutOfDate: AddTextLine("VERSION STATUS", "OUT OF DATE", false, true); break; case ProjectionSiteStatus.NotOnServer: AddTextLine("VERSION STATUS", "NOT ON SERVER", false, true); break; case ProjectionSiteStatus.UpToDate: AddTextLine("VERSION STATUS", "UP TO DATE"); break; case ProjectionSiteStatus.NewOnServer: AddTextLine("VERSION STATUS", "NEW"); break; } AddTextLine("LOCATION", _projectionSite.location.name); AddTextLine("CITY/TOWN", _projectionSite.location.town); TextLineButton btnLoc = AddTextLineButton("GEO LOCATION", _projectionSite.location.geoLocation.latLng, imgLocationIcon); btnLoc.OnButtonClick += BtnLoc_OnButtonClick; AddTextLine("PROJECTOR STACKS", _projectionSite.projectors.Count.ToString()); AddTextLine("CAMERAS", _projectionSite.cameras.Count.ToString()); AddTextLine("NOTES", _projectionSite.notes, true); AddSeperator(); AddProjectorStack(_projectionSite.projectors); AddCamera(_projectionSite.cameras, true); AddHeader("DETAILS"); AddTextLine("ID", _projectionSite.id); AddTextLine("VERSION ID", _projectionSite.versionId); AddTextLine("ASSET BUNDLE", _projectionSite.assetBundleName); var textLineProjectResources = AddTextLine("PROJECT RECOURSES", string.Join("\n", _projectionSite.projectResources.ToArray()), true); textLineProjectResources.AlignValue(); var textLineSiteResources = AddTextLine("SITE RECOURSES", string.Join("\n", _projectionSite.siteResources.ToArray()), true); textLineSiteResources.AlignValue(); AddSeperator(); AddHeader("AUDIT"); AddTextLine("LAST UPDATED", _projectionSite.updatedAsString); AddTextLine("UPDATED BY", _projectionSite.updatedBy); AddTextLine("CREATED", _projectionSite.createdAsString); AddTextLine("CREATED BY", _projectionSite.createdBy); AddSeperator(); }