public void PresentAnimated(int workingFamilyId, bool browsingPeople, FamilyInfoViewController.OnBrowsePeopleCompleteDelegate onComplete) { KeyboardAdjustManager.Activate( ); WorkingFamilyId = workingFamilyId; OnCompleteDelegate = onComplete; // default to false RemoveFromOtherFamilies = false; // always begin at the SearchPanel SearchPanel.GetRootView( ).Layer.Position = CGPoint.Empty; PeoplePanel.GetRootView( ).Layer.Position = new CGPoint(MainPanel.Bounds.Width, 0); // use the provided bool to set the correct panel visible PeoplePanel.GetRootView( ).Hidden = !browsingPeople; ActivePanel = SearchPanel; View.Hidden = false; // animate the background to dark BackgroundPanel.Layer.Opacity = 0; SimpleAnimator_Float alphaAnim = new SimpleAnimator_Float(BackgroundPanel.Layer.Opacity, Settings.DarkenOpacity, .33f, delegate(float percent, object value) { BackgroundPanel.Layer.Opacity = (float)value; }, null); alphaAnim.Start(SimpleAnimator.Style.CurveEaseOut); // animate in the main panel MainPanel.Layer.Position = new CoreGraphics.CGPoint((View.Bounds.Width - MainPanel.Bounds.Width) / 2, View.Bounds.Height); // animate UP the main panel nfloat visibleHeight = Parent.GetVisibleHeight( ); PointF endPos = new PointF((float)(View.Bounds.Width - MainPanel.Bounds.Width) / 2, (float)(visibleHeight - MainPanel.Bounds.Height) / 2); SimpleAnimator_PointF posAnim = new SimpleAnimator_PointF(MainPanel.Layer.Position.ToPointF( ), endPos, .33f, delegate(float percent, object value) { MainPanel.Layer.Position = (PointF)value; }, delegate { SearchPanel.PerformSearch( ); }); posAnim.Start(SimpleAnimator.Style.CurveEaseOut); }
/// <summary> /// Called by the Search panel when a family is selected /// </summary> void FamilySelected(Family family) { if (PeoplePanel.GetRootView( ).Hidden == false) { PeoplePanel.SetFamily(family); PeoplePanel.ViewDidLayoutSubviews(MainPanel.Bounds); AnimateToPanel(SearchPanel, new CGPoint(-MainPanel.Bounds.Width, 0), PeoplePanel); } else { /*FamilyPanel.SetFamily( family ); * FamilyPanel.ViewDidLayoutSubviews( MainPanel.Bounds ); * * AnimateToPanel( SearchPanel, new CGPoint( -MainPanel.Bounds.Width, 0 ), FamilyPanel );*/ // build the confirmation string string familyName = family.Name; if (familyName.EndsWith(" Family") == false) { familyName += " Family"; } // add the up to the first 6 family members string members = null; for (int i = 0; i < Math.Min(6, family.FamilyMembers.Count); i++) { members += family.FamilyMembers[i].Person.NickName + ", "; } // truncate the trailing ", " members = members.Substring(0, members.Length - 2); string confirmString = string.Format(Strings.AddPerson_AddFamilyAsGuest_Message, familyName, members); // Confirm adding the family tapped. UIAlertController actionSheet = UIAlertController.Create(Strings.AddPerson_AddFamilyAsGuest_Header, confirmString, UIAlertControllerStyle.Alert); UIAlertAction yesAction = UIAlertAction.Create(Strings.General_Yes, UIAlertActionStyle.Default, delegate(UIAlertAction obj) { // display DismissAnimated(true, family); }); //setup cancel UIAlertAction cancelAction = UIAlertAction.Create(Strings.General_No, UIAlertActionStyle.Cancel, delegate { }); actionSheet.AddAction(yesAction); actionSheet.AddAction(cancelAction); Parent.PresentViewController(actionSheet, true, null); } }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews( ); BlockerView.SetBounds(MainPanel.Bounds.ToRectF( )); BackgroundPanel.Bounds = View.Bounds; BackgroundPanel.Layer.Position = View.Layer.Position; // setup the scroll view and contents ScrollView.Bounds = MainPanel.Bounds; // layout the active view SearchPanel.ViewDidLayoutSubviews(MainPanel.Bounds); PeoplePanel.ViewDidLayoutSubviews(MainPanel.Bounds); CloseButton.Layer.Position = new CGPoint(MainPanel.Bounds.Width - CloseButton.Bounds.Width - 10, 5); nfloat scrollSize = Math.Max((float)ActivePanel.GetRootView( ).Frame.Bottom, (float)MainPanel.Bounds.Height) * 1.05f; ScrollView.ContentSize = new CGSize(MainPanel.Bounds.Width, scrollSize); }
/// <summary> /// Initializes all the menu panels and links them togther. Call this in the Game's /// create cycle. Lots of hard coding here! - we'll have to adjust it if the game's /// viewport size changes. /// </summary> public static void init() { if (initialized) return; //initialize static variables components = new List<Sprite>(); panelStack = new Stack<Panel>(); activePanel = menuBody; menuOpen = false; initialized = true; // places list placesScreen = new PlacesPanel(200, 480, 440, 380); placesScreen.setPopLocations(200, 480, 200, 100); placesScreen.setScrolling(7, 1); placesScreen.loadEntriesFromFile(Directories.TEXTDATA + "PlacesJournalInfo.txt"); components.Add(placesScreen); // people list peopleScreen = new PeoplePanel(200, 480, 440, 380); peopleScreen.setPopLocations(200, 480, 200, 100); peopleScreen.setScrolling(7, 1); peopleScreen.loadEntriesFromFile(Directories.TEXTDATA + "PeopleJournalInfo.txt"); components.Add(peopleScreen); // quest list questScreen = new QuestPanel(200, 480, 440, 380); questScreen.setPopLocations(200, 480, 200, 100); questScreen.setScrolling(7, 1); questScreen.loadEntriesFromFile(Directories.TEXTDATA + "QuestJournalInfo.txt"); components.Add(questScreen); // journal prompt DialogPanel journalPrompt = new DialogPanel(200, -100, 440, 100); journalPrompt.setMessage("What type of info do you need?"); journalPrompt.setRefreshMessage(journalPrompt.getMessage()); ScreenSpecifierEntry questEntry = new ScreenSpecifierEntry("Quests", journalPrompt, questScreen); questEntry.setNewMessage("Looking up past and current quests..."); questEntry.setOtherPanels(peopleScreen, placesScreen); ScreenSpecifierEntry peopleEntry = new ScreenSpecifierEntry("People", journalPrompt, peopleScreen); peopleEntry.setNewMessage("Looking up intel on individuals..."); peopleEntry.setOtherPanels(questScreen, placesScreen); ScreenSpecifierEntry placesEntry = new ScreenSpecifierEntry("Places", journalPrompt, placesScreen); placesEntry.setNewMessage("Looking up intel on locations..."); placesEntry.setOtherPanels(questScreen, peopleScreen); journalPrompt.loadEntries(questEntry, peopleEntry, placesEntry); journalPrompt.setPopLocations(200, -100, 200, 0); journalPrompt.setYMargin(20); journalPrompt.setYDivider(journalPrompt.getHeight() - 30); components.Add(journalPrompt); // clues info screen TextPanel cluesInfoScreen = new TextPanel(400, -200, 240, 200); cluesInfoScreen.setMessage("Info about the clue here."); cluesInfoScreen.setPopLocations(400, -200, 400, 0); components.Add(cluesInfoScreen); // clues list ListPanel cluesScreen = new CluePanel(200, 480, 200, 480, cluesInfoScreen); cluesScreen.setPopLocations(200, 480, 200, 0); components.Add(cluesScreen); // inventory item info screen TextPanel inventoryInfoScreen = new TextPanel(200, 480, 440, 150); inventoryInfoScreen.setMessage("This is where information about the item will appear."); inventoryInfoScreen.setPopLocations(200, 480, 200, 330); components.Add(inventoryInfoScreen); // inventory screen inventoryScreen = new InventoryPanel(200, -330, 440, 330); inventoryScreen.setMessagePanel(inventoryInfoScreen); inventoryScreen.loadEntriesFromFile(Directories.TEXTDATA + "ItemInfo.txt"); inventoryScreen.setScrolling(5, 2); inventoryScreen.setPopLocations(200, -330, 200, 0); components.Add(inventoryScreen); // reputation screen ReputationPanel reputationScreen = new ReputationPanel(200, 480, 440, 480); reputationScreen.setPopLocations(200, 480, 200, 0); components.Add(reputationScreen); // sound config screen SoundConfigPanel soundConfigScreen = new SoundConfigPanel(200, 480, 440, 380); soundConfigScreen.setPopLocations(200, 480, 200, 100); components.Add(soundConfigScreen); // key config screen KeyConfigPanel keyConfigScreen = new KeyConfigPanel(200, 480, 440, 380); KeyModifierEntry keyAction = new KeyModifierEntry("Talk/Action/Confirm", keyConfigScreen, KeyInputType.Action); KeyModifierEntry keyCancel = new KeyModifierEntry("Go Back/Cancel", keyConfigScreen, KeyInputType.Cancel); KeyModifierEntry keyShoot = new KeyModifierEntry("Shoot", keyConfigScreen, KeyInputType.Shoot); KeyModifierEntry keyPickpocket = new KeyModifierEntry("Pickpocket", keyConfigScreen, KeyInputType.Pickpocket); KeyModifierEntry keyUp = new KeyModifierEntry("Move Up", keyConfigScreen, KeyInputType.MoveNorth); KeyModifierEntry keyDown = new KeyModifierEntry("Move Down", keyConfigScreen, KeyInputType.MoveSouth); KeyModifierEntry keyLeft = new KeyModifierEntry("Move Left", keyConfigScreen, KeyInputType.MoveWest); KeyModifierEntry keyRight = new KeyModifierEntry("Move Right", keyConfigScreen, KeyInputType.MoveEast); KeyModifierEntry keyToggleMenu = new KeyModifierEntry("Toggle Menu", keyConfigScreen, KeyInputType.MenuToggle); keyConfigScreen.loadEntries(keyAction, keyCancel, keyShoot, keyPickpocket, keyUp, keyDown, keyLeft, keyRight, keyToggleMenu); keyConfigScreen.alignEntriesVertical(); keyConfigScreen.setPopLocations(200, 480, 200, 100); components.Add(keyConfigScreen); // config prompt DialogPanel configPrompt = new DialogPanel(200, -100, 440, 100); keyConfigScreen.setPreviousPanel(configPrompt); configPrompt.setMessage("What would you like to configure?"); configPrompt.setRefreshMessage(configPrompt.getMessage()); ScreenSpecifierEntry keyEntry = new ScreenSpecifierEntry("Key Controls", configPrompt, keyConfigScreen); keyEntry.setNewMessage("Configuring key controls... Press [" + Enum.GetName(typeof(Keys), KeyboardManager.getKeyControl(KeyInputType.Action)) + "] to modify the key."); keyEntry.setOtherPanels(soundConfigScreen); ScreenSpecifierEntry soundEntry = new ScreenSpecifierEntry("Sound", configPrompt, soundConfigScreen); soundEntry.setNewMessage("Configuring sound settings..."); soundEntry.setOtherPanels(keyConfigScreen); configPrompt.loadEntries(keyEntry, soundEntry); configPrompt.setPopLocations(200, -100, 200, 0); configPrompt.setYMargin(20); configPrompt.setYDivider(configPrompt.getHeight() - 30); components.Add(configPrompt); // save file data screen SaveDataPanel saveScreen = new SaveDataPanel(200, 480, 440, 380); saveScreen.setScrolling(5, 1); saveScreen.loadSaveData(); saveScreen.setPopLocations(200, 480, 200, 100); components.Add(saveScreen); // save/load prompt DialogPanel savePrompt = new DialogPanel(200, -100, 440, 100); saveScreen.setPreviousPanel(savePrompt); savePrompt.setMessage("Would you like to save the current game or load an older game?"); savePrompt.setRefreshMessage(savePrompt.getMessage()); SaveTypeSpecifierEntry saveEntry = new SaveTypeSpecifierEntry("Save", savePrompt, saveScreen); saveEntry.setSaveType(true); saveEntry.setNewMessage("Saving current progress...select a file to overwrite."); SaveTypeSpecifierEntry loadEntry = new SaveTypeSpecifierEntry("Load", savePrompt, saveScreen); loadEntry.setSaveType(false); loadEntry.setNewMessage("Loading another save file...select a file to load."); savePrompt.loadEntries(saveEntry, loadEntry); //savePrompt.alignEntriesHorizontal(); savePrompt.setPopLocations(200, -100, 200, 0); savePrompt.setYMargin(20); savePrompt.setYDivider(savePrompt.getHeight() - 30); components.Add(savePrompt); // exit game prompt DialogPanel exitPrompt = new DialogPanel(200, 480, 350, 200); exitPrompt.setMessage("Are you sure you want to exit the game? All unsaved progress will be lost."); ExitEntry cancelEntry = new ExitEntry("Cancel", false); ExitEntry exitEntry = new ExitEntry("Quit Game", true); exitPrompt.loadEntries(cancelEntry, exitEntry); exitPrompt.setPopLocations(200, 480, 200, 280); components.Add(exitPrompt); // main menu menuBody = new ListPanel(-200, 0, 200, 480); SubMenuFocusEntry menuBodyJournal = new SubMenuFocusEntry("Journal", journalPrompt); SubMenuFocusEntry menuBodyClues = new SubMenuFocusEntry("Clues", cluesScreen); SubMenuFocusEntry menuBodyInventory = new SubMenuFocusEntry("Inventory", inventoryScreen); //SubMenuFocusEntry menuBodyEquip = new SubMenuFocusEntry("Equip", null); SubMenuFocusEntry menuBodyReputation = new SubMenuFocusEntry("Reputation", reputationScreen); SubMenuFocusEntry menuBodyConfig = new SubMenuFocusEntry("Config", configPrompt); SubMenuFocusEntry menuBodySave = new SubMenuFocusEntry("Save/Load", savePrompt); SubMenuFocusEntry menuBodyExit = new SubMenuFocusEntry("Exit Game", exitPrompt); menuBody.loadEntries(menuBodyJournal, menuBodyClues, menuBodyInventory, /*menuBodyEquip,*/ menuBodyReputation, menuBodyConfig, menuBodySave, menuBodyExit); menuBody.alignEntriesVertical(); menuBody.setPopLocations(-200, 0, 0, 0); components.Add(menuBody); // menu cursor menuArrow = new CursorArrow(-175, 67); menuArrow.setPopLocations(menuBody.getHideX() + 25, menuBody.getHideY() + 67, menuBody.getAppearX() + 25, menuBody.getAppearY() + 67); components.Add(menuArrow); // journal entry info screen // this panel "covers" the menu cursor, so it goes last components.Add(JournalInfoPanel.instance); //group panels that pop in and out together PanelGroup pg0 = new PanelGroup(menuBody); PanelGroup pg1 = new PanelGroup(journalPrompt, questScreen, peopleScreen, placesScreen); PanelGroup pg1a = new PanelGroup(JournalInfoPanel.instance); PanelGroup pg2 = new PanelGroup(cluesScreen, cluesInfoScreen); PanelGroup pg3 = new PanelGroup(inventoryScreen, inventoryInfoScreen); PanelGroup pg4 = new PanelGroup(reputationScreen); PanelGroup pg5 = new PanelGroup(configPrompt, keyConfigScreen, soundConfigScreen); PanelGroup pg6 = new PanelGroup(saveScreen, savePrompt); PanelGroup pg7 = new PanelGroup(exitPrompt); PanelGroupSorter.addPanelGroups(pg0, pg1, pg1a, pg2, pg3, pg4, pg5, pg6, pg7); }
public void Selected(int index, string title, List <BeatmapInfo>[] St5, List <BeatmapInfo>[] Th2, List <BeatmapInfo>[] Th4, List <BeatmapInfo>[] Th6, List <BeatmapInfo>[] Pt1, bool[] filled, int bgaFrame, string bgaPath, string backPath) { Starlight5 = St5; Theater2 = Th2; Theater4 = Th4; Theater6 = Th6; Platinum1 = Pt1; CurBGAVal = bgaFrame; BGAPath = bgaPath; BackPath = backPath; titleText.text = title; artistText.text = null; authorText.text = null; for (int i = 0; i < 5; i++) { ModeBtn[i].interactable = false; ModeBtn[i].gameObject.GetComponent <Image>().color = Color.white; ModeBtn[i].gameObject.GetComponentInChildren <Text>().color = Color.black; if (filled[i]) { ModeBtn[i].interactable = true; } } for (int i = 0; i < 4; i++) { LevelBtn[i].interactable = false; LevelBtn[i].gameObject.GetComponent <Image>().color = GlobalTheme.ThemeColor(); LevelBtn[i].gameObject.GetComponentInChildren <Text>().color = GlobalTheme.ThemeContrastColor(); } animationObj.Play("SelectSong_SongSelected", 0, 0); if (!TitlePanel.activeSelf) { TitlePanel.SetActive(true); } if (!PeoplePanel.activeSelf) { PeoplePanel.SetActive(true); } if (!ModePanel.activeSelf) { ModePanel.SetActive(true); } if (!SongSelectedPrevious) { OptionPanel.SetActive(true); SongSelectedPrevious = true; } LevelSelectedPrevious = false; if (BeatmapIndexPanel.activeSelf) { BeatmapIndexPanel.SetActive(false); } if (lastButtonIdx != -1) { buttons[lastButtonIdx].GetComponent <Graphic>().color = GlobalTheme.ThemeColor(); buttons[lastButtonIdx].GetComponent <SongButton>().buttonText.color = GlobalTheme.ThemeContrastColor(); } lastButtonIdx = index; }