示例#1
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         GManager.playerLocation.SendMessage("Sheath");
     }
 }
示例#2
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         GManager.self.UIOptions.SendMessage("Show", false);
     }
 }
示例#3
0
    void UIAction.doAction(MParams par)
    {
        RaycastHit hit        = par.hit;
        TouchPhase phase      = par.phase;
        Vector3    adjustVect = self.transform.InverseTransformPoint(hit.point);

        adjustVect.z = adjustVect.y;
        adjustVect.y = 0f;
        adjustVect  *= GManager.speed;

        GameObject toMove;

        if (GManager.GSState == GS.E)
        {
            toMove      = GManager.playerFollowL.gameObject;
            adjustVect *= 10f;
        }
        else
        {
            GManager.playerAnim.SetBool("walking", true);
            rotMove.eulerAngles = Vector3.up * CameraController.rotation;
            adjustVect          = rotMove * adjustVect;
            toMove = GManager.playerLocation.gameObject;
        }

        if (phase == TouchPhase.Ended)
        {
            toMove.SendMessage("endMove");
        }
        else
        {
            toMove.SendMessage("move", adjustVect);
        }
    }
示例#4
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Began && GManager.GSState == GS.E)
     {
         GManager.moveTo = transform.parent.position.y;
     }
 }
示例#5
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         ChatController.Next();
     }
 }
示例#6
0
        public void MakeScript()
        {
            if (TargetNode == null)
            {
                return;
            }

            string[] script = new string[TargetNode.Children.Count];
            int      tabs   = 0;

            for (int i = 0; i < TargetNode.Children.Count; i++)
            {
                MoveDefEventNode node = TargetNode.Children[i] as MoveDefEventNode;
                string           arg  = node._name;

                //Format the event and its parameters into a readable script.
                script[i] = ResolveEventSyntax(GetEventSyntax(node._event), node.EventData);
                if (script[i] == "")
                {
                    script[i] = GetDefaultSyntax(node.EventData);
                }

                //Add tabs to the script in correspondence to the code Params.
                tabs -= MParams.TabDownEvents(node._event);
                for (int i2 = 0; i2 < tabs; i2++)
                {
                    script[i] = "\t" + script[i];
                }
                tabs += MParams.TabUpEvents(node._event);
            }
            EventList.Items.Clear();
            EventList.Items.AddRange(script);
        }
示例#7
0
    void UIAction.doAction(MParams par)
    {
        Vector3 point  = transform.InverseTransformPoint(par.hit.point);
        float   getVal = (dir == DIR.Horizontal) ? point.x : point.y;

        getVal = GManager.clampF(getVal, minPos, maxPos);
        setVal(getVal);
    }
示例#8
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         YesNo.parent.SetActive(true);
         YesNo.self.gameObject.SetActive(false);
     }
 }
示例#9
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         GManager.sideView = doWhat;
         transform.parent.SendMessage("onToggleAction", base.selfGet());
     }
 }
示例#10
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         selfOn            = !selfOn;
         selfSprite.sprite = (selfOn) ? on : off;
     }
 }
示例#11
0
 private void lstEvents_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstEvents.SelectedIndex == -1)
     {
         return;
     }
     txtEventId.Text = MParams.Hex8((lstEvents.SelectedItem as ActionEventInfo).idNumber);
 }
示例#12
0
    void UIAction.doAction(MParams par)
    {
        Vector3 localPos = self.transform.InverseTransformPoint(par.hit.point);

        localPos.z        = 0f;
        rotTo.eulerAngles =
            Vector3.forward * (
                Vector3.SignedAngle(GManager.notZero, localPos, Vector3.forward) - 45f);
    }
示例#13
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Began)
     {
         GManager.GSState  = GS.I;
         ToggleStat.onStat = true;
         ToggleStat.flip();
     }
 }
示例#14
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         YesNo.self.gameObject.SetActive(true);
         YesNo.set(GManager.self.UIOptions, gameObject, "Quit?");
         GManager.self.UIOptions.SetActive(false);
     }
 }
示例#15
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended && GManager.GSState == GS.N)
     {
         GManager.GSState  = GS.I;
         ToggleStat.onStat = false;
         ToggleStat.flip();
     }
 }
示例#16
0
        //Display the selected parameter's value, type and description.
        private void DisplayParameter(int index)
        {
            param = eventData.Children[index] as MoveDefEventParameterNode;

            cboType.Enabled = true;
            try { cboType.SelectedIndex = (int)param._type; }
            catch { cboType.SelectedIndex = -1; cboType.Text = "(" + MParams.Hex((int)param._type) + ")"; }
            DisplayInType(param);

            lblParamDescription.Text = param.Description;
        }
示例#17
0
 void UIAction.doAction(MParams par)
 {
     if (GManager.GSState != GS.E)
     {
         if (par.phase == TouchPhase.Moved ||
             par.phase == TouchPhase.Began ||
             par.phase == TouchPhase.Stationary)
         {
             GManager.playerLocation.gameObject.SendMessage("contToMove", true);
         }
     }
 }
示例#18
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            try { eventEvent = MParams.UnHex(txtEventId.Text); }
            catch { eventEvent = 0; }
            if (eventEvent == 0)
            {
                MessageBox.Show("Invalid event Id.", "Invalid Id");
                return;
            }

            status = DialogResult.OK;
            this.Close();
        }
示例#19
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Began)
     {
         if (GManager.GSState == GS.N)
         {
             GManager.playerLocation.gameObject.SendMessage("endMove");
             GManager.playerLocation.gameObject.SendMessage("FaceTo", transform);
             gameObject.SendMessage("FaceTo", GManager.playerLocation);
             //ChatController.setSeq (transform.GetChild (0).gameObject, controller.type, controller.seqId);
             GManager.GSState = GS.C;
         }
     }
 }
示例#20
0
        //Return the requirement corresponding to the value passed.
        public string GetRequirement(long value)
        {
            bool not         = (value & 0x80000000) == 0x80000000;
            long requirement = value & 0xFF;

            if (requirement > iRequirements.Length)
            {
                return(MParams.Hex(requirement));
            }

            if (not == true)
            {
                return("Not " + iRequirements[requirement]);
            }

            return(iRequirements[requirement]);
        }
示例#21
0
        public void Setup()
        {
            //Add each event to the event list, but omit any events lacking a formal name.
            if (lstEvents.Items.Count <= 0)
            {
                foreach (ActionEventInfo e in p.EventDictionary.Values)
                {
                    if (!(e._name == null || e._name == ""))
                    {
                        lstEvents.Items.Add(e);
                    }
                }
            }

            txtEventId.Text = MParams.Hex8(eventEvent);
            status          = DialogResult.Cancel;
        }
示例#22
0
        public string GetValue(long eventId, int index, long value)
        {
            string s = null;

            switch (eventId)
            {
            case 0x04000100:
            case 0x04000200:
                if (index == 0)
                {
                    if (TargetNode.Parent != null && TargetNode.Parent.Parent != null && TargetNode.Parent.Parent.Name.StartsWith("Article"))
                    {
                        ResourceNode sa = TargetNode.Parent.Parent.FindChild("SubActions", false);
                        if (sa != null)
                        {
                            return(sa.Children[(int)value].Name);
                        }
                    }
                    else if (value < TargetNode.Root._subActions.Children.Count && value >= 0)
                    {
                        return(TargetNode.Root._subActions.Children[(int)value].Name);
                    }
                    else
                    {
                        return(((int)value).ToString());
                    }
                }
                break;
                //case 0x02010200:
                //case 0x02010300:
                //case 0x02010500:
                //    if (index == 0)
                //        if (TargetNode.Parent != null && TargetNode.Parent.Parent != null && TargetNode.Parent.Parent.Name.StartsWith("Article"))
                //        {
                //            ResourceNode sa = TargetNode.Parent.Parent.FindChild("Actions", false);
                //            if (sa != null)
                //                return sa.Children[(int)value].Name;
                //        }
                //        else if (value < TargetNode.Root._actions.Children.Count)
                //            return TargetNode.Root._actions.Children[(int)value].Name;
                //    break;
            }
            return(s == null?MParams.Hex((int)value) : s);
        }
示例#23
0
        private void txtEventId_TextChanged(object sender, EventArgs e)
        {
            if (txtEventId.Text.Length != 8)
            {
                return;
            }
            string eventId = txtEventId.Text;

            //Select the event corresponding to the id input.
            lstEvents.SelectedIndex = -1;
            for (int i = 0; i < lstEvents.Items.Count; i++)
            {
                if (eventId == MParams.Hex8((lstEvents.Items[i] as ActionEventInfo).idNumber))
                {
                    lstEvents.SelectedIndex = i;
                    break;
                }
            }
        }
示例#24
0
        //Return the passed syntax with all keywords replaced with their proper values.
        public string ResolveEventSyntax(string syntax, Event eventData)
        {
            while (true)
            {
                string   keyword   = "";
                string   keyResult = "";
                string   strParams = "";
                string[] kParams;

                int keyBegin = MParams.FindFirst(syntax, 0, '\\');
                if (keyBegin == -1)
                {
                    break;
                }

                int keyEnd = MParams.FindFirst(syntax, keyBegin, '(');
                if (keyEnd == -1)
                {
                    keyEnd = syntax.Length;
                }

                int paramsBegin = keyEnd + 1;

                int paramsEnd = MParams.FindFirstIgnoreNest(syntax, paramsBegin, ')');
                if (paramsEnd == -1)
                {
                    paramsEnd = syntax.Length;
                }

                keyword = syntax.Substring(keyBegin, keyEnd - keyBegin);

                strParams = syntax.Substring(paramsBegin, paramsEnd - paramsBegin);
                kParams   = GetParameters(strParams, eventData);

                keyResult = ResolveKeyword(keyword, kParams, eventData);

                syntax = MParams.DelSubstring(syntax, keyBegin, (paramsEnd + 1) - keyBegin);
                syntax = MParams.InsString(syntax, keyResult, keyBegin);
            }

            return(syntax);
        }
示例#25
0
    void UIAction.doAction(MParams par)
    {
        if (GManager.GSState != GS.E)
        {
            if (par.phase != TouchPhase.Ended)
            {
                GManager.playerAnim.SetBool("melee", true);
            }
            else
            {
                GManager.playerAnim.SetBool("melee", false);
            }
            Vector3 dist = self.transform.InverseTransformPoint(par.hit.point);

            if (dist.magnitude > 0.48f)
            {
                GManager.playerAnim.SetBool("melee", false);
            }
        }
    }
示例#26
0
 void UIAction.doAction(MParams par)
 {
     if (par.phase == TouchPhase.Ended)
     {
         Item      selfE   = iParams.invItem;
         Inventory selfinv = iParams.invObj;
         if (selfE is Modable)
         {
             if (!(selfE is IConsume))
             {
                 string name = string.Empty;
                 if (selfE is IWeapon)
                 {
                     IWeapon weap = selfE as IWeapon;
                     weap.setWepType(type);
                     name = type.ToString();
                     Debug.Log("Slot: " + name);
                 }
                 else
                 {
                     IArmor arm = selfE as IArmor;
                     name = arm.eType.ToString();
                 }
                 GameObject there = GManager.equipment.findByName(name);
                 Item       item  = GManager.equipment.getItem(there);
                 GManager.equipment.insertItem(there, selfE);
                 selfinv.removeItem(iParams.slot);
                 if (item != null)
                 {
                     selfinv.insertItem(selfinv.firstEmpty(), item);
                 }
                 GManager.playerLocation.gameObject.SendMessage("addEquip", selfE);
                 GManager.soundEquip.Play();
                 HAS.self.UpdateE();
             }
         }
         GManager.self.UIStats.SendMessage("Hide");
     }
 }
示例#27
0
        //Return the parameters contained in the keyword's parameter list.
        public string[] GetParameters(string strParams, Event eventData)
        {
            string[] parameters = new string[0];
            char     chrFound   = '\0';
            int      paramEnd   = -1;
            int      index      = 0;
            int      loc        = 0;

            //Search for a ',' or a ')' and return the preceeding string.
            do
            {
                paramEnd = MParams.FindFirstOfIgnoreNest(strParams, loc, new char[] { ',', ')' }, ref chrFound);
                if (paramEnd == -1)
                {
                    paramEnd = strParams.Length;
                }

                Array.Resize <string>(ref parameters, index + 1);
                parameters[index] = strParams.Substring(loc, paramEnd - loc);
                parameters[index] = MParams.ClearWhiteSpace(parameters[index]);

                loc = paramEnd + 1;
                index++;
            } while (chrFound != ')' && chrFound != '\0');

            //Check each parameter for keywords and resolve if they are present.
            for (int i = 0; i < parameters.Length; i++)
            {
                if (parameters[i] != "")
                {
                    parameters[i] = ResolveEventSyntax(parameters[i], eventData);
                }
            }

            return(parameters);
        }
示例#28
0
        //Return the name of the external pointer corresponding to the address if
        //one is available, otherwise return the string of the value passed.
        public string ResolvePointer(long pointer, Param parameter)
        {
            MoveDefExternalNode ext;

            if ((ext = _targetNode.Root.IsExternal((int)pointer)) != null || (ext = _targetNode.Root.IsExternal((int)parameter._data)) != null)
            {
                return("External: " + ext.Name);
            }

            int list, type, index;

            _targetNode.Root.GetLocation((int)parameter._data, out list, out type, out index);

            if (list == 4)
            {
                return("0x" + MParams.Hex(parameter._data));
            }
            else
            {
                string name = "", t = "", grp = "";
                switch (list)
                {
                case 0:
                    grp  = "Actions";
                    name = _targetNode.Root._actions.Children[index].Name;
                    switch (type)
                    {
                    case 0: t = "Entry"; break;

                    case 1: t = "Exit"; break;
                    }
                    break;

                case 1:
                    grp  = "SubActions";
                    name = _targetNode.Root._subActions.Children[index].Name;
                    switch (type)
                    {
                    case 0: t = "Main"; break;

                    case 1: t = "GFX"; break;

                    case 2: t = "SFX"; break;

                    case 3: t = "Other"; break;
                    }
                    break;

                case 2:
                    grp  = "SubRoutines";
                    name = _targetNode.Root._subRoutineList[index].Name;
                    break;

                case 3:
                    grp  = "References";
                    name = _targetNode.Root.references.Children[index].Name;
                    break;
                }

                return(name + (list >= 2 ? "" : " - " + t) + " in the " + grp + " list");
            }
        }
示例#29
0
 void UIAction.doAction(MParams par)
 {
     YesNo.parent.SetActive(true);
     YesNo.toSend.SendMessage("MyAction");
     YesNo.self.gameObject.SetActive(false);
 }
示例#30
0
	void UIAction.doAction(MParams par){
		if (par.phase == TouchPhase.Ended) {
			GManager.playerLocation.gameObject.SendMessage ("endMove");
			GManager.GSState = GS.E;
		}
	}