예제 #1
0
        private void reset(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition pos)
        {
            if (Common.Instance.IsValidTarget(targetId))
            {
                SelectedItem = TargetList[targetId];
            }
            else
            {
                if (null == TargetList)
                {
                    SelectedItem = null;
                }
                else if (TargetList.Length > 0)
                {
                    SelectedItem = TargetList[0];
                }
                else
                {
                    SelectedItem = null;
                }
            }

            IsBlush  = isBlush;
            Face     = face;
            Costume  = costume;
            Position = pos;
        }
예제 #2
0
        private EditTargetAppear()
        {
            _faceList = new List <Sugarism.EFace>();
            Array arr = Enum.GetValues(typeof(Sugarism.EFace));

            foreach (var v in arr)
            {
                Sugarism.EFace item = (Sugarism.EFace)v;
                _faceList.Add(item);
            }

            _costumeList = new List <Sugarism.ECostume>();
            arr          = Enum.GetValues(typeof(Sugarism.ECostume));
            foreach (var v in arr)
            {
                Sugarism.ECostume item = (Sugarism.ECostume)v;
                _costumeList.Add(item);
            }

            _posList = new List <Sugarism.EPosition>();
            arr      = Enum.GetValues(typeof(Sugarism.EPosition));
            foreach (var v in arr)
            {
                Sugarism.EPosition item = (Sugarism.EPosition)v;
                _posList.Add(item);
            }
        }
예제 #3
0
    // callback handler
    private void onCmdAppear(int characterId, Sugarism.EPosition position)
    {
        //InputPanel.Hide();

        StoryCharacterPanel.Set(characterId, position);

        //Invoke(ON_TIMER_NAME, 0.1f);
    }
예제 #4
0
    private void onCmdTargetAppear(int targetId, bool isBlush, Sugarism.EFace face,
                                   Sugarism.ECostume costume, Sugarism.EPosition position)
    {
        //InputPanel.Hide();

        StoryCharacterPanel.Set(targetId, isBlush, face, costume, position);

        //Invoke(ON_TIMER_NAME, 0.1f);
    }
예제 #5
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if ((null == value) || (false == (value is Sugarism.EPosition)))
            {
                return(string.Empty);
            }

            Sugarism.EPosition pos = (Sugarism.EPosition)value;
            return(pos.ToString());
        }
예제 #6
0
        private EditAppear()
        {
            _posList = new List <Sugarism.EPosition>();
            Array arr = Enum.GetValues(typeof(Sugarism.EPosition));

            foreach (var v in arr)
            {
                Sugarism.EPosition item = (Sugarism.EPosition)v;
                _posList.Add(item);
            }
        }
예제 #7
0
        /// <summary>
        /// Show View.Popup.EditAppear.
        /// </summary>
        /// <param name="characterId">Character Id before editing.</param>
        /// <param name="pos">Position before editing.</param>
        /// <returns>Whether edit or not.</returns>
        public bool Show(int characterId, Sugarism.EPosition pos)
        {
            reset(characterId, pos);

            View.Popup.EditAppear view = new View.Popup.EditAppear(this);

            bool?result = view.ShowDialog();

            switch (result)
            {
            case true:
                return(true);

            default:
                return(false);
            }
        }
예제 #8
0
    public void Set(int characterId, Sugarism.EPosition pos)
    {
        Hide();

        if (false == ExtCharacter.IsValid(characterId))
        {
            Log.Error(string.Format("invalid character Id; {0}", characterId));
            return;
        }

        Character c = Manager.Instance.DT.Character[characterId];

        setBaseShape(c.image);
        setBlush(false);
        setFaceExpression(false);
        setCostume(false);

        set(pos);

        Show();
    }
예제 #9
0
    private void set(Sugarism.EPosition pos)
    {
        float posX  = 0.0f;
        float posY  = _rect.anchoredPosition.y;
        float scale = 1.0f;

        switch (pos)
        {
        case Sugarism.EPosition.Middle:
            posX  = 0.0f;
            scale = 1.0f;
            break;

        case Sugarism.EPosition.Left:
            posX -= DELTA_POS_X;
            scale = 1.0f;
            break;

        case Sugarism.EPosition.Right:
            posX += DELTA_POS_X;
            scale = 1.0f;
            break;

        case Sugarism.EPosition.Front:
            posX   = 0.0f;
            scale += DELTA_SCALE;
            break;

        case Sugarism.EPosition.Back:
            posX   = 0.0f;
            scale -= DELTA_SCALE;
            break;

        default:
            return;
        }

        _rect.anchoredPosition = new Vector2(posX, posY);
        _rect.localScale       = new Vector2(scale, scale);
    }
예제 #10
0
        private void reset(int characterId, Sugarism.EPosition pos)
        {
            if (Common.Instance.IsValidCharacter(characterId))
            {
                SelectedItem = CharacterList[characterId];
            }
            else
            {
                if (null == CharacterList)
                {
                    SelectedItem = null;
                }
                else if (CharacterList.Length > 0)
                {
                    SelectedItem = CharacterList[0];
                }
                else
                {
                    SelectedItem = null;
                }
            }

            Position = pos;
        }
예제 #11
0
    public void Set(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition pos)
    {
        Hide();

        if (false == ExtTarget.isValid(targetId))
        {
            Log.Error(string.Format("invalid target id; {0}", targetId));
            return;
        }

        Target target = Manager.Instance.DT.Target[targetId];

        setBaseShape(target.baseShape);

        if (isBlush)
        {
            setBlush(target.blush);
            setBlush(target.blushPosX, target.blushPosY);
        }
        setBlush(isBlush);

        base.setFaceExpression(get(ref target, face));
        setFaceExpression(target.faceExpPosX, target.faceExpPosY);
        setFaceExpression(true);

        base.setCostume(get(ref target, costume));
        setCostume(true);

        set(pos);

        Show();
    }
예제 #12
0
        /// <summary>
        /// Show View.Popup.EditTargetAppear.
        /// </summary>
        /// <param name="targetId">Target Id before editing.</param>
        /// <param name="isBlush">IsBlush before editing</param>
        /// <param name="face">Face before editing.</param>
        /// <param name="costume">Costume before editing.</param>
        /// <param name="pos">Position before editing.</param>
        /// <returns>Whether edit or not.</returns>
        public bool Show(int targetId, bool isBlush, Sugarism.EFace face, Sugarism.ECostume costume, Sugarism.EPosition pos)
        {
            reset(targetId, isBlush, face, costume, pos);

            View.Popup.EditTargetAppear view = new View.Popup.EditTargetAppear(this);

            bool?result = view.ShowDialog();

            switch (result)
            {
            case true:
                return(true);

            default:
                return(false);
            }
        }
예제 #13
0
 public void Invoke(int characterId, Sugarism.EPosition position)
 {
     _event.Invoke(characterId, position);
 }
예제 #14
0
 // default handler
 private void onCmdAppear(int characterId, Sugarism.EPosition position)
 {
     Log.Debug(string.Format("onCmdAppear; characterId({0}), pos({1})",
                 characterId, position));
 }
예제 #15
0
 public void Invoke(int targetId, bool isBlush, Sugarism.EFace face
                 , Sugarism.ECostume costume, Sugarism.EPosition position)
 {
     _event.Invoke(targetId, isBlush, face, costume, position);
 }
예제 #16
0
 // default handler
 private void onCmdTargetAppear(int targetId, bool isBlush, Sugarism.EFace face
                         , Sugarism.ECostume costume, Sugarism.EPosition position)
 {
     Log.Debug(string.Format("onCmdTargetAppear; targetId({0}, face({1}), blush({2}), costume({3}), pos({4})",
                 targetId, face, isBlush, costume, position));
 }