Example #1
0
    public void Start()
    {
        StateControllerInit(false);

        playeractor = CreateActor(PD.GetPlayerSpritePath(PD.p1Char), new Vector3(-5.15f, 1.0f));
        PD.GetNextOpponent();
        opponentactor = CreateActor(PD.GetPlayerSpritePath(PD.p2Char), new Vector3(5.15f, 1.0f), true);
        skipMenuIsUp  = false;

        XmlNodeList dialogs = GetXMLHead("/" + playeractor.GetPath(PD.p1Char == PersistData.C.FuckingBalloon), "dialogs").SelectNodes("dialog");
        XmlNode     dialog  = dialogs[PD.GetPuzzleLevel()];

        dialogArr = dialog.SelectNodes("line");

        rawInput = GetInputHandler();

        dialogueBox = gameObject.AddComponent <DialogContainer>();
        dialogueBox.Setup(new Vector3(0.0f, -3.5f));

        bool isBossChar = PD.p1Char == PersistData.C.White || PD.p1Char == PersistData.C.September;

        curFrame = (!isBossChar && (PD.level == 6 || PD.level == 8))?0:2;
        StartFrame(curFrame);

        skipButtonSheet = Resources.LoadAll <Sprite>(SpritePaths.ShortButtons);
        skipButton      = GetGameObject(new Vector3(8.3f, -4.75f), "Skip", skipButtonSheet[0], true, "Pause HUD Buttons");
        FontData font = PD.mostCommonFont.Clone(); font.scale = 0.045f;
        XmlNode  top  = GetXMLHead();

        skipText = GetMeshText(new Vector3(8.3f, -4.61f), GetXmlValue(top, "skip"), font).gameObject;
        skipText.renderer.sortingLayerName = "Pause HUD Text";

        mouseObjects.Add(skipButton);
        mouseObjects.Add(skipText);

        skipMenu = GetGameObject(new Vector3(0.0f, 0.0f), "Skip Menu", Resources.Load <Sprite>(SpritePaths.CutsceneSkipBox), false, "HUDText");

        string f = string.Format(GetXmlValue(top, "skipmessage"), "\r\n", PD.controller.GetFriendlyActionName(InputMethod.Action.launch), PD.controller.GetFriendlyActionName(InputMethod.Action.pause));

        font.scale        = 0.08f; font.layerName = "Reference";
        skipMenuText      = GetMeshText(new Vector3(0.0f, 0.5f), f, font);
        skipMenuText.text = new WritingWriter().GetWrappedString(skipMenuText, f, skipMenu.renderer.bounds.size);
        skipMenuText.gameObject.SetActive(false);
        skipMenu.SetActive(false);

        PD.sounds.SetSoundVolume(PD.GetSaveData().savedOptions["vol_s"] / 350.0f);
    }
Example #2
0
    private void setText()
    {
        if (PD.p2Char == PersistData.C.FuckingBalloon)
        {
            SetPuhloon();
            return;
        }
        XmlDocument doc = new XmlDocument();
        TextAsset   ta  = Resources.Load <TextAsset>("XML/" + PD.culture + "/" + playeractor.GetPath(PD.p1Char == PersistData.C.FuckingBalloon));

        doc.LoadXml(ta.text);
        XmlNode     An        = doc.SelectSingleNode("dialogs");
        XmlNodeList nl        = An.SelectNodes("dialog");
        XmlNode     dialog    = nl[PD.GetPuzzleLevel()];
        XmlNodeList allLines  = dialog.SelectNodes("line");
        XmlNode     textNode  = allLines[didP1Win?1:0];
        string      textToSay = textNode.InnerText;

        if (textNode.Attributes["speaker"].Value == "1" && PD.p1Char == PersistData.C.FuckingBalloon)
        {
            textToSay = "p" + new string('f', Random.Range(4, 10)) + "th" + new string('e', Random.Range(4, 10)) + "nk";
        }
        tbox.StartTextFrame(textToSay);
        if (textNode.Attributes["speed"] == null)
        {
            tbox.UpdateFrameRate(1.0f);
        }
        else
        {
            tbox.UpdateFrameRate(float.Parse(textNode.Attributes["speed"].Value));
        }
        if (textNode.Attributes["speaker"].Value == "1")
        {
            setActor(playeractor, textNode.Attributes["pose"].Value);
            hideActor(opponentactor);
            isP1Speaker = true;
        }
        else
        {
            setActor(opponentactor, textNode.Attributes["pose"].Value);
            hideActor(playeractor);
            isP1Speaker = false;
        }
    }