コード例 #1
0
ファイル: Tour.cs プロジェクト: ryanmcgrail95/CRHC
    public override IMenu buildMenu()
    {
        sort();

        Menu menu = new Menu();

        SpaceItem padding = new SpaceItem();

        Row headerTitle = new Row();

        headerTitle.setPadding(true, true, false);
        headerTitle.setColor(CrhcConstants.COLOR_BLUE_LIGHT);

        TextItem titleText = new TextItem(getName().ToUpper());

        titleText.setColor(CrhcConstants.COLOR_RED);
        titleText.setFont(CrhcConstants.FONT_TITLE);
        headerTitle.addItem(titleText);

        menu.addRow(headerTitle);

        Row headerDesc = new Row();

        headerDesc.setPadding(true, false, true);
        headerDesc.setColor(CrhcConstants.COLOR_BLUE_LIGHT);

        TextItem descText = new TextItem(getDescription());

        headerDesc.addItem(descText);

        menu.addRow(headerDesc);

        Row paddingRow = new Row(5);

        foreach (Landmark child in this)
        {
            if (!child.isVisible())
            {
                continue;
            }

            menu.addRow(paddingRow);

            Row row = new Row();
            row.setPadding(true, true, true);

            if (CrhcConstants.LANDMARK_SORTORDER == SortOrder.NUMBER)
            {
                TextItem number = new TextItem(child.getNumber() + ". ");
                number.setFont(CrhcConstants.FONT_SUBTITLE);
                number.setColor(Color.white);
                row.addItem(number, .1f);

                TextItem text = new TextItem(child.getName());
                text.setFont(CrhcConstants.FONT_SUBTITLE);
                text.setColor(Color.white);
                row.addItem(text, .4f);
            }
            else
            {
                TextItem text = new TextItem(child.getName());
                text.setFont(CrhcConstants.FONT_SUBTITLE);
                text.setColor(Color.white);
                row.addItem(text, .55f);
            }

            Menu submenu = new Menu();
            submenu.setColor(CrhcConstants.COLOR_BLUE_LIGHT);

            Row subrow = new Row();
            subrow.setPadding(true, true, true);

            TextItem subtext = new TextItem(child.getDescription());

            subrow.addItem(subtext, 1);
            submenu.addRow(subrow);

            if (child.hasAudio())
            {
                JArray audioClips = child.getAudioClips();

                for (int i = 0; i < audioClips.Count; i++)
                {
                    JToken audioClip = audioClips.GetItem(i);

                    if (i == 0)
                    {
                        submenu.addRow(new AudioPlayerRow(child.getUrl() + "audio.mp3"));
                    }
                    else
                    {
                        submenu.addRow(new AudioPlayerRow(child.getUrl() + "audio" + i + ".mp3"));
                    }

                    Row audioSourceRow = new Row();
                    audioSourceRow.setPadding(true, false, false);

                    TextItem audioSourceItem = new TextItem(audioClip.Value <string>("audioSource"));
                    audioSourceItem.setTextAnchor(TextAnchor.UpperLeft);
                    audioSourceItem.setFont(CrhcConstants.FONT_SOURCE);
                    audioSourceRow.addItem(audioSourceItem, 1);
                    submenu.addRow(audioSourceRow);


                    Row      audioTranscriptionTitleRow = new Row();
                    TextItem audioTranscriptionTitle    = new TextItem("Audio Transcription");
                    audioTranscriptionTitle.setFont(CrhcConstants.FONT_SUBTITLE);
                    audioTranscriptionTitleRow.addItem(audioTranscriptionTitle, 1);
                    audioTranscriptionTitleRow.setPadding(true, true, false);
                    submenu.addRow(audioTranscriptionTitleRow);


                    Row audioTranscriptionRow = new Row();
                    audioTranscriptionRow.setPadding(true, false, true);

                    TextItem audioTranscriptionItem = new TextItem(audioClip.Value <string>("audioTranscription"));
                    audioTranscriptionItem.setTextAnchor(TextAnchor.UpperLeft);
                    audioTranscriptionRow.addItem(audioTranscriptionItem, 1);
                    submenu.addRow(audioTranscriptionRow);
                }
            }


            row.addItem(new SpaceItem(), .025f);
            if (child.hasAddress())
            {
                row.addItem(new DirectionButton(child), .1f);
            }
            else
            {
                row.addItem(new SpaceItem(), .1f);
            }

            row.addItem(new SpaceItem(), .025f);

            if (child.hasAR())
            {
                row.addItem(new ARButton(child), .1f);
            }
            else
            {
                row.addItem(new SpaceItem(), .1f);

                Row      subLongDescTitleRow = new Row();
                TextItem subLongDescTitle    = new TextItem("More Info");
                subLongDescTitle.setFont(CrhcConstants.FONT_SUBTITLE);
                subLongDescTitleRow.addItem(subLongDescTitle, 1);
                subLongDescTitleRow.setPadding(true, true, false);
                submenu.addRow(subLongDescTitleRow);

                Row      subLongDescRow = new Row();
                TextItem subLongDesc    = new TextItem(child.getLongDescription());
                subLongDescRow.addItem(subLongDesc, 1);
                subLongDescRow.setPadding(true, false, true);
                submenu.addRow(subLongDescRow);
            }


            PaneRow panerow = new PaneRow(row, submenu);
            panerow.setClosedColor(CrhcConstants.COLOR_BLUE_DARK);
            panerow.setOpenColor(CrhcConstants.COLOR_RED);

            menu.addRow(panerow);
        }

        menu.addRow(paddingRow);
        menu.addRow(new SurveyRow());
        menu.addRow(paddingRow);
        menu.addRow(new SettingsRow());

        IMenu scrollMenu = new ScrollMenu(menu);
        IMenu fadeInMenu = new FadeInMenu(scrollMenu);

        fadeInMenu.setColor(CrhcConstants.COLOR_GRAY_DARK);

        return(new BlackoutTransitionMenu(new TourMenu(fadeInMenu, getUrl() + "header.jpg")));
    }
コード例 #2
0
ファイル: Landmark.cs プロジェクト: ryanmcgrail95/CRHC
    public override IMenu buildMenu()
    {
        CoroutineManager.startCoroutine(loadCoroutine());

        Menu fullmenu = new Menu(), menu = new Menu();

        SpaceItem padding = new SpaceItem();

        Row backRow = new Row();

        backRow.addItem(new BackButton(this));
        fullmenu.addRow(backRow);

        Row titleRow = new Row();

        titleRow.setPadding(true, true, false);

        TextItem titleText = new TextItem(getName().ToUpper());

        titleText.setColor(CrhcConstants.COLOR_RED);
        titleText.setFont(CrhcConstants.FONT_SUBTITLE);
        titleRow.addItem(titleText, 1);

        menu.addRow(titleRow);

        Row descRow = new Row();

        descRow.setPadding(true, false, true);

        TextItem descText = new TextItem(getDescription());

        descRow.addItem(descText);

        menu.addRow(descRow);

        int inRow = 0, i = 0;
        Row curRow = null, sourceRow = null;

        Row paddingRow = new Row(30);

        foreach (Experience child in this)
        {
            child.onLandmarkLoad();

            // Add image.
            if (inRow == 0)
            {
                inRow++;

                if (i++ > 0)
                {
                    menu.addRow(paddingRow);
                }

                curRow = new Row();
                curRow.setPadding(true, false, false);
                sourceRow = new Row();
                sourceRow.setPadding(true, false, false);

                menu.addRow(curRow);
                menu.addRow(sourceRow);
            }
            else
            {
                curRow.addItem(new SpaceItem(), .2f);
                sourceRow.addItem(new SpaceItem(), .2f);
                inRow = 0;
            }

            ImageItem img = new ARButton(child);
            curRow.addItem(img);

            TextItem sourceText = new TextItem(child.getSource());
            sourceText.setFont(CrhcConstants.FONT_SOURCE);
            sourceText.setTextAnchor(TextAnchor.UpperLeft);
            sourceRow.addItem(sourceText);
        }

        if (inRow == 1)
        {
            curRow.addItem(new SpaceItem(), 1.2f);
            sourceRow.addItem(new SpaceItem(), 1.2f);
        }

        Row row = new Row();

        row.addItem(new TextItem(getLongDescription()));
        menu.addRow(row);
        row.setPadding(true, true, true);

        IRow submenuRow = new MenuRow(new FadeInMenu(new ScrollMenu(menu)));

        fullmenu.addRow(submenuRow);

        fullmenu.setColor(CrhcConstants.COLOR_BLUE_LIGHT);

        return(new BlackoutTransitionMenu(fullmenu));
    }