Example #1
0
        public void OnMessageGenerated(MessageCat messageCat, NotifyItem item)
        {
            object obj;

            switch (messageCat)
            {
            case MessageCat.NewTaskNormal:
            case MessageCat.TimeoutNotify:
            case MessageCat.RecedeBack:
            case MessageCat.IndicateTask:
            case MessageCat.InformTask:
            case MessageCat.ManualRemind:
                obj = new
                {
                    Version    = 1.0,
                    MessageCat = messageCat,
                    Type       = "Task.Process",
                    StepID     = Context.Current.Step.StepID
                };
                break;

            case MessageCat.Approved:
            case MessageCat.Rejected:
            case MessageCat.Aborted:
            case MessageCat.Deleted:
            case MessageCat.StepStopHumanOpt:
            case MessageCat.StepStopVoteFinished:
            case MessageCat.NoParticipantException:
                obj = new
                {
                    Version    = 1.0,
                    MessageCat = messageCat,
                    Type       = "Task.Read",
                    TaskID     = Context.Current.Task.TaskID
                };
                break;

            default:
                obj = null;
                break;
            }
            if (obj == null)
            {
                item.Extra = null;
                return;
            }
            item.Extra = JObject.FromObject(obj).ToString(Newtonsoft.Json.Formatting.None, null);
        }
Example #2
0
File: Basic.cs Project: radtek/EMIP
        public virtual void SaveServerNotifyMessageCat(HttpContext context)
        {
            YZRequest  request    = new YZRequest(context);
            MessageCat messageCat = request.GetEnum <MessageCat>("messageCat");

            JArray post = request.GetPostData <JArray>();
            MessageItemCollection messageItems = post.ToObject <MessageItemCollection>();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                MessageGroupCollection messageGroups = NotifyManager.GetDefaultNotifyMessages(cn);
                messageGroups[messageCat.ToString()].MessageItems = messageItems;
                NotifyManager.SaveDefaultNotifyMessages(cn, messageGroups);
            }
        }
Example #3
0
        private void InitializeMessageCat()
        {
            var go = gameObject;

            go.AddComponent <ObservablePointerEnterTrigger>()
            .OnPointerEnterAsObservable()
            .Subscribe(x =>
            {
                if (!_isLock)
                {
                    return;
                }

                if (_cat)
                {
                    _cat.Hide();
                }

                _cat = Widget.Find <MessageCatManager>().Show(true, _messageForCat);
            })
            .AddTo(go);

            go.AddComponent <ObservablePointerExitTrigger>()
            .OnPointerExitAsObservable()
            .Subscribe(x =>
            {
                if (!_isLock || _cat is null)
                {
                    return;
                }

                _cat.Hide();
                _cat = null;
            })
            .AddTo(go);
        }
Example #4
0
        private void Awake()
        {
            _eventTrigger = GetComponent <EventTrigger>();
            if (!_eventTrigger)
            {
                throw new NotFoundComponentException <EventTrigger>();
            }

            EventTrigger.Entry entry = new EventTrigger.Entry();
            entry.eventID = EventTriggerType.PointerClick;
            entry.callback.AddListener(OnClick);
            _eventTrigger.triggers.Add(entry);

            RectTransform = GetComponent <RectTransform>();

            switch (ItemSubType)
            {
            case ItemSubType.FullCostume:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterFullCostumeSlot;
                break;

            case ItemSubType.HairCostume:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterHairCostumeSlot;
                break;

            case ItemSubType.EarCostume:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterEarCostumeSlot;
                break;

            case ItemSubType.EyeCostume:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterEyeCostumeSlot;
                break;

            case ItemSubType.TailCostume:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterTailCostumeSlot;
                break;

            case ItemSubType.Title:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterTitleSlot;
                break;

            case ItemSubType.Weapon:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterEquipmentSlotWeapon;
                break;

            case ItemSubType.Armor:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterEquipmentSlotArmor;
                break;

            case ItemSubType.Belt:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterEquipmentSlotBelt;
                break;

            case ItemSubType.Necklace:
                _requireLevel = GameConfig.RequireCharacterLevel.CharacterEquipmentSlotNecklace;
                break;

            case ItemSubType.Ring:
                _requireLevel = ItemSubTypeIndex == 1
                        ? GameConfig.RequireCharacterLevel.CharacterEquipmentSlotRing1
                        : GameConfig.RequireCharacterLevel.CharacterEquipmentSlotRing2;
                break;

            case ItemSubType.Food:
                switch (ItemSubTypeIndex)
                {
                case 1:
                    _requireLevel = GameConfig.RequireCharacterLevel
                                    .CharacterConsumableSlot1;
                    break;

                case 2:
                    _requireLevel = GameConfig.RequireCharacterLevel
                                    .CharacterConsumableSlot2;
                    break;

                case 3:
                    _requireLevel = GameConfig.RequireCharacterLevel
                                    .CharacterConsumableSlot3;
                    break;

                case 4:
                    _requireLevel = GameConfig.RequireCharacterLevel
                                    .CharacterConsumableSlot4;
                    break;

                case 5:
                    _requireLevel = GameConfig.RequireCharacterLevel
                                    .CharacterConsumableSlot5;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            _messageForCat =
                $"{L10nManager.Localize($"ITEM_SUB_TYPE_{ItemSubType.ToString()}")}\n<sprite name=\"UI_icon_lock_01\"> LV.{_requireLevel}";

            gameObject.AddComponent <ObservablePointerEnterTrigger>()
            .OnPointerEnterAsObservable()
            .Subscribe(x =>
            {
                if (!ShowUnlockTooltip || !IsLock)
                {
                    return;
                }

                if (_cat)
                {
                    _cat.Hide();
                }

                _cat = Widget.Find <MessageCatManager>().Show(true, _messageForCat);
            })
            .AddTo(gameObject);

            gameObject.AddComponent <ObservablePointerExitTrigger>()
            .OnPointerExitAsObservable()
            .Subscribe(x =>
            {
                if (!IsLock || !_cat)
                {
                    return;
                }

                _cat.Hide();
                _cat = null;
            })
            .AddTo(gameObject);
        }
Example #5
0
        private void Awake()
        {
            if (!GetComponentInParent <Menu>())
            {
                throw new NotFoundComponentException <Menu>();
            }

            _originLocalScale = bgTransform.localScale;

            switch (type)
            {
            case MenuType.Combination:
                _requireStage = GameConfig.RequireClearedStageLevel.UIMainMenuCombination;
                break;

            case MenuType.Ranking:
                _requireStage = GameConfig.RequireClearedStageLevel.UIMainMenuRankingBoard;
                break;

            case MenuType.Shop:
                _requireStage = GameConfig.RequireClearedStageLevel.UIMainMenuShop;
                break;

            case MenuType.Quest:
                _requireStage = GameConfig.RequireClearedStageLevel.UIMainMenuStage;
                break;

            case MenuType.Mimisbrunnr:
                _requireStage = GameConfig.RequireClearedStageLevel.UIBottomMenuMimisbrunnr;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            var unlockConditionString = string.Format(
                L10nManager.Localize("UI_STAGE_LOCK_FORMAT"),
                _requireStage);

            _messageForCat =
                $"{L10nManager.Localize(localizationKey)}\n<sprite name=\"UI_icon_lock_01\"> {unlockConditionString}";

            gameObject.AddComponent <ObservablePointerEnterTrigger>()
            .OnPointerEnterAsObservable()
            .Subscribe(x =>
            {
                if (!IsUnlocked)
                {
                    if (_cat)
                    {
                        _cat.Hide();
                    }

                    _cat = Widget.Find <MessageCatManager>().Show(true, _messageForCat);

                    return;
                }

                bgTransform.DOScale(_originLocalScale * BgScale, TweenDuration);
            })
            .AddTo(gameObject);

            gameObject.AddComponent <ObservablePointerExitTrigger>()
            .OnPointerExitAsObservable()
            .Subscribe(x =>
            {
                if (!IsUnlocked)
                {
                    if (!_cat)
                    {
                        return;
                    }

                    _cat.Hide();
                    _cat = null;

                    return;
                }

                bgTransform.DOScale(_originLocalScale, TweenDuration);
                ResetLocalizationKey();
            })
            .AddTo(gameObject);
        }