//object dictLockObj = new object(); // Use this for initialization void Start() { app = AppScript.getSharedInstance(); app.OnFloorSwitch += (floor) => { if (searchResults.Count > 0) { //Loom.QueueOnMainThread(() => { UpdateArrows(); if (_selectedFacility) { SelectFacilityArrow(_selectedFacility); } //}, 0.2f); } }; app.OnSearchResultSelect += (f) => { SelectFacilityArrow(f); }; app.bottomPanel.OnSnapToFacility += (f) => { SelectFacilityArrow(f); }; }
public void addPair() { var app = AppScript.getSharedInstance(); if (week == null) { Debug.LogError("WEEK IS NULL!!"); } app.timetablePanel.addPairClicked(week); }
public void Prepare() { app = AppScript.getSharedInstance(); Debug.LogWarning("Prepare timetable"); if (!firstLoadDone) { UpdateContents(); } else { updateCurrentPair(); } }
public TimetableManger() { app = AppScript.getSharedInstance(); db_path = Constants.getDBPath("timetable.db", false); history = new List <Dictionary <string, WeekTimetable> > (); /* DEBUG */ if (AppScript.CLEAN_EVERYTHING_ON_START) { clearDb(); } initTimetable(); }
public void Init() { loadingText.gameObject.SetActive(true); doneText.gameObject.SetActive(false); doneButton.interactable = false; if (AppScript.getSharedInstance().timetableManager.initTimetable(true)) { loadingText.gameObject.SetActive(false); doneText.gameObject.SetActive(true); doneButton.interactable = true; } else { var tour = FindObjectOfType <TTTourPanelScript> (); tour.nextPage(); tour.backButton.interactable = false; } }
// Use this for initialization void Start() { app = AppScript.getSharedInstance(); // hide tutorial if: // - searched something // - opened timetable // - tried everything // - already done tutorial /* if (app.timetableManager.hasTimetable ()) { * CompletedTutorial (); * }*/ if (ConfigStorage.getBool("completed_tutorial") /*|| app.timetableManager.hasTimetable ()*/) { HideTutorial(); } else { ShowTutorial(); } app.OnFacilityFocus += (f) => { HideTutorial(); CompletedTutorial(); }; app.OnShowSearchResults += (query) => { HideTutorial(); CompletedTutorial(); }; app.OnOpenTimetable += () => { HideTutorial(); CompletedTutorial(); }; }
public FacilitiesManager() { app = AppScript.getSharedInstance(); facilities_db = new FacilitiesDatabaseScript(); }
// Use this for initialization void Start() { app = AppScript.getSharedInstance(); }
void Start() { app = AppScript.getSharedInstance(); app.OnUpdateTimeBasedElements += UpdateTodayBadge; }
public void openTimetable() { close(); AppScript.getSharedInstance().openTimetable(); }
void Awake() { app = AppScript.getSharedInstance(); clear(); }
public void ExpandList() { expanded = true; originalPos = thisRect.anchoredPosition.y; if (gameObject.GetComponent <ShadowConfig>()) { hasShadows = true; if (!shadowConfig) { shadowConfig = gameObject.GetComponent <ShadowConfig>(); } } else { hasShadows = false; } if (shadowConfig != null) { contractedShadowLevel = shadowConfig.shadowNormalSize; } if (!rippleConfig) { rippleConfig = gameObject.GetComponent <RippleConfig> (); } if (!thisButton) { thisButton = gameObject.GetComponent <Button> (); } if (shadowConfig != null) { shadowConfig.shadowNormalSize = expandedListShadowLevel; shadowConfig.shadowActiveSize = expandedListShadowLevel; } if (rippleConfig) { rippleConfig.enabled = false; } thisButton.interactable = false; icon.enabled = false; selectedText.enabled = false; currentColor = thisImage.color; if (autoMaxItemHeight) { //var scale = Screen.dpi/82f; var canvasScale = AppScript.getSharedInstance().scaleFactorRefCanvas.scaleFactor; /*Debug.LogWarning ("Screen height: "+Screen.height); * Debug.LogWarning ("DPI: "+Screen.dpi); * Debug.LogWarning ("DPI scale: "+scale); * Debug.LogWarning ("Canvas scale: "+canvasScale); * Debug.LogWarning ("Item height: "+itemHeight);*/ float tempFloat = Screen.height / canvasScale / 100f * percentageOfScreenHeight / itemHeight; //Debug.LogWarning ("Temp float: "+tempFloat); if (tempFloat >= listItems.Length) { listheight = (listItems.Length * itemHeight) + 16f; } else { listheight = (tempFloat * itemHeight) - 8f; scrollbarEnabled = true; scrollbar.enabled = true; scrollbarCanvasGroup.interactable = true; scrollbarCanvasGroup.blocksRaycasts = true; } //Debug.LogWarning ("List height: "+listheight); } else if (manualMaxItemHeight > 0) { listheight = (manualMaxItemHeight * itemHeight) - 8f; scrollbarEnabled = true; scrollbar.enabled = true; scrollbarCanvasGroup.interactable = true; scrollbarCanvasGroup.blocksRaycasts = true; } else { listheight = (listItems.Length * itemHeight) + 16f; } listLayerHeight = (listItems.Length * itemHeight) + 16f; if (expandDirection == PopDirection.Popup) { expandedPos = originalPos + (listheight / 2f) - 24f; } else if (expandDirection == PopDirection.Popdown) { expandedPos = originalPos - (listheight / 2f) + 24f; } else { expandedPos = originalPos; } listLayer.SetActive(true); listCanvasGroup.interactable = true; listCanvasGroup.blocksRaycasts = true; cancelLayer.enabled = true; icon.enabled = false; selectedText.enabled = true; listCanvasAlpha = listCanvasGroup.alpha; animStartTime = Time.realtimeSinceStartup; state = 1; }
void Awake() { app = AppScript.getSharedInstance(); layoutElem = GetComponent <LayoutElement> (); }
protected virtual void Awake() { app = AppScript.getSharedInstance(); rect = GetComponent <RectTransform> (); scrollRect.onValueChanged.AddListener(OnScroll); }
public static void editPair(string title, Pair pair, Action <Pair, Pair> yesAction, string okButtonTitle = "СОХРАНИТЬ", string cancelButtonTitle = "ОТМЕНА") { hideAll(); current.overlay.gameObject.SetActive(true); current.editPairDialog.gameObject.SetActive(true); current.editPairDialog.wrongInput.text = "заполните все поля со *"; current.editPairDialog.selectedDayOfWeek = pair.day.DayOfWeek; //current.editPairDialog.selectionBox.Setup (); //current.editPairDialog.selectionBox.ContractList (); Loom.QueueOnMainThread(() => { current.editPairDialog.selectionBox.Select((int)pair.day.DayOfWeek - 1); }, 0.1f); Loom.QueueOnMainThread(() => { current.editPairDialog.title.text = title; current.editPairDialog.startTime.text = pair.startTime.ToString("HH:mm"); current.editPairDialog.startTime.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.endTime.text = pair.endTime.ToString("HH:mm"); current.editPairDialog.endTime.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.name.text = pair.name; current.editPairDialog.name.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.location.text = pair.location; current.editPairDialog.location.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.lecturer.text = pair.lecturer; current.editPairDialog.lecturer.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.okButtonTitle.text = okButtonTitle; current.editPairDialog.cancelButtonTitle.text = cancelButtonTitle; }); current.editPairDialog.okButton.onClick.RemoveAllListeners(); current.editPairDialog.cancelButton.onClick.RemoveAllListeners(); current.editPairDialog.cancelButton.onClick.AddListener(() => { hideAll(); }); current.editPairDialog.okButton.onClick.AddListener(() => { // first validate current.editPairDialog.wrongInput.text = ""; if (current.editPairDialog.name.text.Length < 3) { current.editPairDialog.wrongInput.text = "плохое нзвание пары"; return; } var provider = System.Globalization.CultureInfo.GetCultureInfo("ru-RU"); var dateTimeStyle = System.Globalization.DateTimeStyles.AssumeLocal; DateTime tryParseDateTimeResult; if (!DateTime.TryParseExact(current.editPairDialog.startTime.text, "HH:mm", provider, dateTimeStyle, out tryParseDateTimeResult)) { current.editPairDialog.wrongInput.text = "неверный формат начального времени, пример: 09:30"; return; } if (!DateTime.TryParseExact(current.editPairDialog.endTime.text, "HH:mm", provider, dateTimeStyle, out tryParseDateTimeResult)) { current.editPairDialog.wrongInput.text = "неверный формат конечного времени, пример: 09:30"; return; } if (current.editPairDialog.location.text.Length == 0) { current.editPairDialog.wrongInput.text = "введите место или кабинет"; return; } var weekStartDay = pair.day.AddDays(-(int)(pair.day.DayOfWeek - 1)).Date; var newPair = new Pair( weekStartDay.AddDays((int)current.editPairDialog.selectedDayOfWeek - 1).Date, current.editPairDialog.name.text, current.editPairDialog.startTime.text + "–" + current.editPairDialog.endTime.text, current.editPairDialog.location.text, current.editPairDialog.lecturer.text, _edited: true, _deleted: false, _hash: pair.hash ); // location var app = AppScript.getSharedInstance(); if (newPair.room == "" || newPair.room == null) { if (app.facilities.hasRoom(newPair.location.Trim())) { newPair.room = newPair.location.Trim(); //Debug.LogWarning("ROOM "+newPair.room+" EXISTS"); } } yesAction(pair, newPair); hideAll(); }); }
public static void addPair(string title, WeekTimetable week, Action <Pair> yesAction, string okButtonTitle = "ДОБАВИТЬ", string cancelButtonTitle = "ОТМЕНА") { hideAll(); current.overlay.gameObject.SetActive(true); current.editPairDialog.gameObject.SetActive(true); current.editPairDialog.wrongInput.text = "заполните все поля со *"; current.editPairDialog.selectedDayOfWeek = DayOfWeek.Sunday; current.editPairDialog.selectionBox.Setup(); Loom.QueueOnMainThread(() => { current.editPairDialog.title.text = title; current.editPairDialog.startTime.text = ""; current.editPairDialog.startTime.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.endTime.text = ""; current.editPairDialog.endTime.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.name.text = ""; current.editPairDialog.name.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.location.text = ""; current.editPairDialog.location.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.lecturer.text = ""; current.editPairDialog.lecturer.GetComponent <InputFieldConfig>().Refresh(); current.editPairDialog.okButtonTitle.text = okButtonTitle; current.editPairDialog.cancelButtonTitle.text = cancelButtonTitle; }); current.editPairDialog.okButton.onClick.RemoveAllListeners(); current.editPairDialog.cancelButton.onClick.RemoveAllListeners(); current.editPairDialog.cancelButton.onClick.AddListener(() => { hideAll(); }); current.editPairDialog.okButton.onClick.AddListener(() => { // first validate current.editPairDialog.wrongInput.text = ""; if (current.editPairDialog.selectedDayOfWeek == DayOfWeek.Sunday) { current.editPairDialog.wrongInput.text = "выберите день недели"; return; } var provider = System.Globalization.CultureInfo.GetCultureInfo("ru-RU"); var dateTimeStyle = System.Globalization.DateTimeStyles.AssumeLocal; DateTime tryParseDateTimeResult; if (!DateTime.TryParseExact(current.editPairDialog.startTime.text, "HH:mm", provider, dateTimeStyle, out tryParseDateTimeResult)) { current.editPairDialog.wrongInput.text = "неверный формат начального времени, пример: 09:30"; return; } if (!DateTime.TryParseExact(current.editPairDialog.endTime.text, "HH:mm", provider, dateTimeStyle, out tryParseDateTimeResult)) { current.editPairDialog.wrongInput.text = "неверный формат конечного времени, пример: 09:30"; return; } if (current.editPairDialog.name.text.Length < 3) { current.editPairDialog.wrongInput.text = "плохое нзвание пары"; return; } if (current.editPairDialog.location.text.Length == 0) { current.editPairDialog.wrongInput.text = "введите место или кабинет"; return; } Debug.LogWarning("week̉̉ " + week + " is nulL: " + (week == null?"YES":"NO")); Debug.LogWarning("weekStartDay " + week.weekStartDay + " is nulL: " + (week.weekStartDay == null?"YES":"NO")); Debug.LogWarning("selected day " + current.editPairDialog.selectedDayOfWeek + " is nulL: " + (current.editPairDialog.selectedDayOfWeek == null?"YES":"NO")); var day_t = week.weekStartDay.AddDays((int)current.editPairDialog.selectedDayOfWeek - 1).Date; var name_t = current.editPairDialog.name.text.Trim(); var time_t = current.editPairDialog.startTime.text + "–" + current.editPairDialog.endTime.text.Trim(); var location_t = current.editPairDialog.location.text.Trim(); var lecturer_t = current.editPairDialog.lecturer.text.Trim(); var newPair = new Pair( day_t, name_t, time_t, location_t, lecturer_t, true, false, TimetableParser.GetPairMD5(day_t.DayOfWeek, time_t, name_t, location_t, lecturer_t, week.weekType) ); // location var app = AppScript.getSharedInstance(); if (newPair.room == "" || newPair.room == null) { if (app.facilities.hasRoom(newPair.location.Trim())) { newPair.room = newPair.location.Trim(); } else { Debug.LogWarning("BBB"); } } else { Debug.LogWarning("AAA"); } yesAction(newPair); hideAll(); }); }
void Awake() { app = AppScript.getSharedInstance(); searchResults3d = gameObject.AddComponent <SearchResults3d> (); }