Esempio n. 1
0
 private void SetSignalValueUI(Transform root, int signalValue)
 {
     if (root == null)
     {
         return;
     }
     for (int i = 0; i < 5; i++)
     {
         Transform transform = root.FindChild("signal" + i);
         if (i <= signalValue)
         {
             if (this.m_lastQuery.signal_status == 0)
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgGreen, null, true, false, false, false);
             }
             else if (this.m_lastQuery.signal_status == 1)
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgYellow, null, true, false, false, false);
             }
             else if (this.m_lastQuery.signal_status == 2)
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgRed, null, true, false, false, false);
             }
             else
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgBg, null, true, false, false, false);
             }
         }
         else
         {
             CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgBg, null, true, false, false, false);
         }
     }
 }
Esempio n. 2
0
 internal void EnsureTitleDOMElement()
 {
     if (CUIUtility.IsNullOrUndefined(_elmTitle))
     {
         _elmTitle = new ListItem();
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Tab constructor
        /// </summary>
        /// <param name="ribbon">the Ribbon that created this Tab and that it is a part of</param>
        /// <param name="id">Component id of the Tab</param>
        /// <param name="title">Title of the Tab</param>
        /// <param name="description">Description of the Tab</param>
        /// <param name="contextual">whether this Tab is a contextual Tab or not</param>
        /// <param name="command">the command for this Tab.  Used in enabling or disabling the tab.</param>
        /// <param name="contextualGroupId">the id of the ContextualGroup that this Tab is a part of.</param>
        internal Tab(SPRibbon ribbon,
                     string id,
                     string title,
                     string description,
                     string command,
                     bool contextual,
                     string contextualGroupId,
                     string cssClass)
            : base(ribbon, id, title, description)
        {
            _lastScalingIndex  = -1;
            _scalingInfo       = new Scaling();
            _contextual        = contextual;
            _contextualGroupId = CUIUtility.SafeString(contextualGroupId);
            _command           = CUIUtility.SafeString(command);
            _cssClass          = CUIUtility.SafeString(cssClass);

            // Contextual tabs are invisible by default
            if (contextual)
            {
                VisibleInternal = false;
            }
#if DEBUG
            if (command == "DEBUG_ALWAYS_ENABLED")
            {
                VisibleInternal = true;
            }
#endif
        }
Esempio n. 4
0
        public void Update(CUIFormScript formScript, float deltaTime)
        {
            if (this.m_duringTime < this.m_maxDuringTime)
            {
                this.m_duringTime += deltaTime;
                if (((this.m_signalInfo != null) && (this.m_signalInfo.bSignalType == 1)) && (this.m_signalRelatedActor != 0))
                {
                    Vector3 location = (Vector3)this.m_signalRelatedActor.handle.location;
                    if (this.m_signalInUISequence >= 0)
                    {
                        GameObject element = this.m_signalInUIContainer.GetElement(this.m_signalInUISequence);
                        if (element != null)
                        {
                            RectTransform transform = element.transform as RectTransform;
                            CBattleSystem instance  = Singleton <CBattleSystem> .GetInstance();

                            if (this.bSmall)
                            {
                                transform.anchoredPosition = new Vector2(location.x * instance.world_UI_Factor_Small.x, location.z * instance.world_UI_Factor_Small.y);
                            }
                            else
                            {
                                transform.anchoredPosition = new Vector2(location.x * instance.world_UI_Factor_Big.x, location.z * instance.world_UI_Factor_Big.y);
                            }
                            if ((this.m_signalInUIEffect != null) && (this.m_signalInUIEffect.parObj != null))
                            {
                                Vector2 screenPosition = CUIUtility.WorldToScreenPoint(formScript.GetCamera(), element.transform.position);
                                Singleton <CUIParticleSystem> .GetInstance().SetParticleScreenPosition(this.m_signalInUIEffect, ref screenPosition);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        internal override bool FocusPrevious(HtmlEvent evt)
        {
            int moveCount = 1;

            if (!CUIUtility.IsNullOrUndefined(evt) && evt.KeyCode == (int)Key.Up)
            {
                moveCount = ColumnSize;
            }


            if (_focusedIndex < 0)
            {
                _focusedIndex += _colorCells.Count + moveCount;
            }

            if (_focusedIndex >= moveCount)
            {
                SetFocusOnCell(_focusedIndex - moveCount);
                return(true);
            }

            RemoveHighlighting();
            _focusedIndex -= moveCount;
            return(false);
        }
Esempio n. 6
0
        private void HandleRow(Row row, JSObject data, DeclarativeTemplateBuildContext bc)
        {
            JSObject[] children = DataNodeWrapper.GetNodeChildren(data);
            for (int i = 0; i < children.Length; i++)
            {
                string    name = DataNodeWrapper.GetNodeName(children[i]);
                Component comp = null;

                if (name == DataNodeWrapper.CONTROL)
                {
                    comp = CreateControlComponentFromData(children[i], bc);
                }
                else if (name == DataNodeWrapper.OVERFLOWAREA)
                {
                    HandleOverflow(children[i], bc, row, i);
                }
                else
                {
                    comp = CreateStripFromData(children[i], bc, row, i);
                }

                if (!CUIUtility.IsNullOrUndefined(comp))
                {
                    row.AddChild(comp);
                }
            }
        }
Esempio n. 7
0
        public override Group CreateGroup(SPRibbon ribbon,
                                          string id,
                                          GroupProperties properties,
                                          string title,
                                          string description,
                                          string command,
                                          Dictionary <string, List <Control> > controls,
                                          Dictionary <string, string> pars)
        {
            DeclarativeTemplateBuildContext bc = new DeclarativeTemplateBuildContext();

            bc.Ribbon     = ribbon;
            bc.Controls   = controls;
            bc.Parameters = pars;

            Group group = ribbon.CreateGroup(id, properties, title, description, command);

            // Loop through the Layouts for this group and create them.
            JSObject[] children = DataNodeWrapper.GetNodeChildren(_data);
            for (int i = 0; i < children.Length; i++)
            {
                Layout layout = CreateLayoutFromData(children[i], group, bc);
                if (!CUIUtility.IsNullOrUndefined(layout))
                {
                    group.AddChild(layout);
                }
            }
            return(group);
        }
Esempio n. 8
0
        protected void OnBlur(HtmlEvent args)
        {
            OnEndFocus();
            if (!Enabled)
            {
                return;
            }

            if (string.IsNullOrEmpty(Properties.CommandRevert))
            {
                return;
            }

            CommandType ct     = CommandType.PreviewRevert;
            string      cmdtpe = Properties.CommandType;

            if (!CUIUtility.IsNullOrUndefined(cmdtpe) && cmdtpe == "OptionSelection")
            {
                ct = CommandType.OptionPreviewRevert;
                StateProperties[GalleryButtonCommandProperties.CommandValueId] = Properties.CommandValueId;
            }

            DisplayedComponent.RaiseCommandEvent(Properties.CommandRevert,
                                                 ct,
                                                 StateProperties);
        }
Esempio n. 9
0
            public void Show(BattleStatView.ChartView.ChartType chartType, SampleData data, CUIFormScript form)
            {
                this.root.CustomSetActive(true);
                string text = chartType.ToString();

                this.title.text = Singleton <CTextManager> .GetInstance().GetText(text + "_Title");

                this.bannerExp.CustomSetActive(chartType == BattleStatView.ChartView.ChartType.ExpTrend);
                this.bannerMoney.CustomSetActive(chartType == BattleStatView.ChartView.ChartType.MoneyTrend);
                this.camp1Data.text = data.curDataLeft.ToString();
                this.camp2Data.text = data.curDataRight.ToString();
                float num  = (data.count <= 1) ? 1f : (data.step * (float)(data.count - 1));
                int   num2 = Mathf.CeilToInt(num / 4f);

                for (int i = 0; i <= 4; i++)
                {
                    int num3 = i * num2;
                    this.xAxis[i].text = string.Format("{0:D2}:{1:D2}", num3 / 60, num3 % 60);
                }
                int  num4 = Math.Max(Math.Abs(data.min), Math.Abs(data.max));
                int  num5 = Mathf.CeilToInt((float)num4 / 5f);
                bool flag = num5 % 100 == 0;

                num5 /= 100;
                if (!flag)
                {
                    num5++;
                }
                if (num5 < 1)
                {
                    num5 = 1;
                }
                num5 *= 100;
                int num6 = 4;

                for (int j = 1; j <= num6; j++)
                {
                    string text2 = "+" + num5 * j;
                    this.yAxis[num6 + j].text = text2;
                    this.yAxis[num6 - j].text = text2;
                }
                RectTransform component = this.drawArea.GetComponent <RectTransform>();
                Vector3       vector    = CUIUtility.WorldToScreenPoint(form.GetCamera(), component.position);
                float         num7      = form.ChangeFormValueToScreen(component.rect.width);
                float         num8      = form.ChangeFormValueToScreen(component.rect.height);

                vector.x -= num7 * 0.5f;
                float num9  = num7 / (float)(num2 * 4);
                float num10 = num8 * 0.5f / (float)(num5 * 5);

                Vector3[] array = new Vector3[data.count];
                for (int k = 0; k < data.count; k++)
                {
                    array[k] = new Vector3(vector.x + data.step * (float)k * num9, vector.y + (float)data[k] * num10);
                }
                this.drawArea.color     = ((chartType != BattleStatView.ChartView.ChartType.ExpTrend) ? Color.yellow : Color.green);
                this.drawArea.thickness = 2f;
                this.drawArea.drawSpeed = 1000f;
                this.drawArea.SetVertexs(array);
            }
Esempio n. 10
0
        internal override bool SetFocusOnControl()
        {
            if (!Enabled)
            {
                return(false);
            }

            HtmlElement elm = DisplayedComponent.ElementInternal;

            if (!CUIUtility.IsNullOrUndefined(elm))
            {
                if (focusOnArrow || !_buttonEnabled)
                {
                    elm = (HtmlElement)elm.ChildNodes[1];
                }
                else
                {
                    elm = (HtmlElement)elm.ChildNodes[0];
                }

                elm.PerformFocus();
                return(true);
            }
            return(false);
        }
Esempio n. 11
0
        protected void OnFocus(HtmlEvent args)
        {
            OnBeginFocus();
            if (!Enabled)
            {
                return;
            }

            Root.LastFocusedControl = this;

            if (string.IsNullOrEmpty(Properties.CommandPreview))
            {
                return;
            }

            CommandType ct     = CommandType.Preview;
            string      cmdtpe = Properties.CommandType;

            StateProperties[GalleryButtonCommandProperties.CommandValueId] = Properties.CommandValueId;
            if (!CUIUtility.IsNullOrUndefined(cmdtpe) && cmdtpe == "OptionSelection")
            {
                ct = CommandType.OptionPreview;
            }

            DisplayedComponent.RaiseCommandEvent(Properties.CommandPreview,
                                                 ct,
                                                 StateProperties);
        }
Esempio n. 12
0
    public void InnerHandle_InBat_PreConfigMsg(COM_INBATTLE_CHAT_TYPE chatType, uint herocfgID, uint cfg_id, ulong ullUid)
    {
        ResInBatMsgHeroActCfg heroActCfg = Singleton <InBattleMsgMgr> .instance.GetHeroActCfg(herocfgID, cfg_id);

        ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .instance.GetCfgData(cfg_id);

        if (cfgData != null)
        {
            if (heroActCfg != null)
            {
                InBattleMsgUT.ShowInBattleMsg(chatType, ullUid, herocfgID, heroActCfg.szContent, heroActCfg.szSound, true);
            }
            else
            {
                InBattleMsgUT.ShowInBattleMsg(chatType, ullUid, herocfgID, cfgData.szContent, cfgData.szSound, false);
            }
            if ((chatType == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_SIGNAL) && (Singleton <CBattleSystem> .instance.TheMinimapSys.CurMapType() == MinimapSys.EMapType.Mini))
            {
                ReadonlyContext <PoolObjHandle <ActorRoot> > allHeroes = Singleton <GamePlayerCenter> .instance.GetPlayerByUid(ullUid).GetAllHeroes();

                for (int i = 0; i < allHeroes.Count; i++)
                {
                    PoolObjHandle <ActorRoot> handle = allHeroes[i];
                    ActorRoot root = handle.handle;
                    if ((root != null) && (root.TheActorMeta.ConfigId == herocfgID))
                    {
                        Vector2 sreenLoc = CUIUtility.WorldToScreenPoint(this.m_battleForm.GetCamera(), root.HudControl.GetSmallMapPointer_WorldPosition());
                        Singleton <CUIParticleSystem> .instance.AddParticle(cfgData.szMiniMapEffect, 2f, sreenLoc);

                        return;
                    }
                }
            }
        }
    }
Esempio n. 13
0
        private QAT BuildQATInternal(object data, QATBuildContext qbc)
        {
            if (CUIUtility.IsNullOrUndefined(data))
            {
                throw new ArgumentNullException("No QAT element was present in the data");
            }

            QAT = new QAT(DataNodeWrapper.GetAttribute(data, "Id"),
                          DataNodeWrapper.GetNodeAttributes(data).To <QATProperties>());

            // Handle the controls in the QAT
            // The XML structure looks like <QAT><Controls><Control></Control><Control></Control>...
            JSObject controlsParent = DataNodeWrapper.GetFirstChildNodeWithName(data, DataNodeWrapper.CONTROLS);

            JSObject[] controls = DataNodeWrapper.GetNodeChildren(controlsParent);
            for (int j = 0; j < controls.Length; j++)
            {
                if (!IsNodeTrimmed(controls[j]))
                {
                    Control control = BuildControl(controls[j], qbc);
                    QAT.AddChild(control.CreateComponentForDisplayMode("Small"));
                }
            }

            return(QAT);
        }
Esempio n. 14
0
        public void RefreshHeroInfo()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_qualifyingFormPath);

            if (form != null)
            {
                ListView <IHeroData> hostHeroList = CHeroDataFactory.GetHostHeroList(true);
                GameObject           gameObject   = form.gameObject.transform.Find("Panel/Panel_HeroInfo").gameObject;
                Text          component           = gameObject.transform.Find("lblProficiency").GetComponent <Text>();
                CUIListScript script2             = gameObject.transform.Find("ListHeroIno").GetComponent <CUIListScript>();
                script2.SetElementAmount(hostHeroList.Count);
                for (int i = 0; i < hostHeroList.Count; i++)
                {
                    GameObject obj3  = script2.GetElemenet(i).gameObject;
                    Image      image = obj3.transform.Find("heroInfo/imgRank").GetComponent <Image>();
                    Text       text2 = obj3.transform.Find("heroInfo/lblRank").GetComponent <Text>();
                    image.SetSprite(CUIUtility.s_Sprite_System_Qualifying_Dir + "ranking_icon" + hostHeroList[i].proficiencyLV, form, true, false, false);
                    text2.text = hostHeroList[i].proficiency.ToString();
                }
                uint num2 = 0;
                for (int j = 0; j < hostHeroList.Count; j++)
                {
                    num2 += hostHeroList[j].proficiency;
                }
                string[] values = new string[] { num2.ToString() };
                component.text = CUIUtility.StringReplace(Singleton <CTextManager> .GetInstance().GetText("Qualifying_Title0"), values);
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Add a page component to this PageManager.
        /// </summary>
        /// <param name="component">the component that is to be added</param>
        public void AddPageComponent(PageComponent component)
        {
            // If a component with this id has already been added, we throw
            string compId = component.GetId();

            if (_componentIds.ContainsKey(compId) && !CUIUtility.IsNullOrUndefined(_componentIds[compId]))
            {
                throw new ArgumentNullException("A PageComponent with id: " + component.GetId() + " has already been added to the PageManger.");
            }


            // REVIEW(josefl): for performance reasons, we may want to move this into an Init() method
            if (!CUIUtility.IsNullOrUndefined(_components) && !_components.Contains(component))
            {
                _componentIds[component.GetId()] = component;
                component.Init();
                _commandDispatcher.RegisterMultipleCommandHandler((ICommandHandler)component,
                                                                  component.GetGlobalCommands());
                _components.Add(component);
                if (component.IsFocusable())
                {
                    _focusManager.AddPageComponent(component);
                }
            }
        }
Esempio n. 16
0
 protected override void ReleaseEventHandlers()
 {
     if (!CUIUtility.IsNullOrUndefined(_elmMenu))
     {
         RemoveEvents(_elmMenu, true);
     }
     if (!CUIUtility.IsNullOrUndefined(_elmMenu16))
     {
         RemoveEvents(_elmMenu16, true);
     }
     if (!CUIUtility.IsNullOrUndefined(_elmMenu32))
     {
         RemoveEvents(_elmMenu32, true);
     }
     if (!CUIUtility.IsNullOrUndefined(_elmLarge))
     {
         RemoveEvents(_elmLarge, false);
     }
     if (!CUIUtility.IsNullOrUndefined(_elmMedium))
     {
         RemoveEvents(_elmMedium, false);
     }
     if (!CUIUtility.IsNullOrUndefined(_elmSmall))
     {
         RemoveEvents(_elmSmall, false);
     }
     if (!CUIUtility.IsNullOrUndefined(_elmThin))
     {
         RemoveEvents(_elmThin, false);
     }
 }
Esempio n. 17
0
 public override void OnRootRefreshed(Root root)
 {
     if (!CUIUtility.IsNullOrUndefined(root))
     {
         PollRootState(root);
     }
 }
Esempio n. 18
0
        public override void OnModalKeyPress(HtmlEvent args)
        {
            if (!CUIUtility.IsNullOrUndefined(args))
            {
                if ((((Root.TextDirection == Direction.LTR && args.KeyCode == (int)Key.Left) ||
                      (Root.TextDirection == Direction.RTL && args.KeyCode == (int)Key.Right)) &&
                     (DisplayedComponent.DisplayMode).StartsWith("Menu")) || args.KeyCode == (int)Key.Esc)
                {
                    Root.CloseMenuStack(this);
                    return;
                }
            }

            if (IsGroupPopup)
            {
                if (_focusSet)
                {
                    return;
                }
                if (Menu.SetFocusOnFirstControl())
                {
                    _focusSet = true;
                }

                Utility.CancelEventUtility(args, false, true);
            }
            else
            {
                base.OnModalKeyPress(args);
            }
        }
Esempio n. 19
0
        private Strip CreateStripFromData(object data,
                                          DeclarativeTemplateBuildContext bc,
                                          Component parent,
                                          int rowComponentNumber)
        {
            JSObject[] children = DataNodeWrapper.GetNodeChildren(data);
            Strip      strip    = bc.Ribbon.CreateStrip(parent.Id + "-" + rowComponentNumber);

            for (int i = 0; i < children.Length; i++)
            {
                string name = DataNodeWrapper.GetNodeName(children[i]);
                if (name == DataNodeWrapper.CONTROL)
                {
                    ControlComponent comp = CreateControlComponentFromData(children[i], bc);
                    if (!CUIUtility.IsNullOrUndefined(comp))
                    {
                        strip.AddChild(comp);
                    }
                }
                else
                {
                    HandleOverflow(children[i], bc, strip, i);
                }
            }

            // If there are no children in the strip then there is no reason to add it
            // If we ever support dynamically adding and removing components out of the ribbon
            // then this will need to be revisitited.
            if (strip.Children.Count == 0)
            {
                return(null);
            }

            return(strip);
        }
Esempio n. 20
0
 public void ValidateEquip()
 {
     stEquipInfo[] equips = this._heroInfo.actorHero.handle.EquipComponent.GetEquips();
     for (int i = 0; i < 6; i++)
     {
         Image  image   = this._equipIcons[i];
         ushort equipID = equips[i].m_equipID;
         bool   flag    = false;
         if (equipID > 0)
         {
             ResEquipInBattle dataByKey = GameDataMgr.m_equipInBattleDatabin.GetDataByKey((uint)equipID);
             if (dataByKey != null)
             {
                 image.gameObject.CustomSetActive(true);
                 string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_System_BattleEquip_Dir, dataByKey.szIcon);
                 CUIUtility.SetImageSprite(image, prefabPath, Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false);
                 flag = true;
             }
         }
         if (!flag)
         {
             image.SetSprite(string.Format((this.listCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? "{0}EquipmentSpace" : "{0}EquipmentSpaceRed", CUIUtility.s_Sprite_Dynamic_Talent_Dir), Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false);
         }
     }
 }
Esempio n. 21
0
        public void RefreshHeroInfo()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CQualifyingSystem.s_qualifyingFormPath);

            if (form == null)
            {
                return;
            }
            ListView <IHeroData> hostHeroList = CHeroDataFactory.GetHostHeroList(true, CMallSortHelper.HeroViewSortType.Name);
            GameObject           gameObject   = form.gameObject.transform.Find("Panel/Panel_HeroInfo").gameObject;
            Text          component           = gameObject.transform.Find("lblProficiency").GetComponent <Text>();
            CUIListScript component2          = gameObject.transform.Find("ListHeroIno").GetComponent <CUIListScript>();

            component2.SetElementAmount(hostHeroList.get_Count());
            for (int i = 0; i < hostHeroList.get_Count(); i++)
            {
                GameObject gameObject2 = component2.GetElemenet(i).gameObject;
                Image      component3  = gameObject2.transform.Find("heroInfo/imgRank").GetComponent <Image>();
                Text       component4  = gameObject2.transform.Find("heroInfo/lblRank").GetComponent <Text>();
                component3.SetSprite(CUIUtility.s_Sprite_System_Qualifying_Dir + "ranking_icon" + hostHeroList.get_Item(i).proficiencyLV, form, true, false, false, false);
                component4.text = hostHeroList.get_Item(i).proficiency.ToString();
            }
            uint num = 0u;

            for (int j = 0; j < hostHeroList.get_Count(); j++)
            {
                num += hostHeroList.get_Item(j).proficiency;
            }
            component.text = CUIUtility.StringReplace(Singleton <CTextManager> .GetInstance().GetText("Qualifying_Title0"), new string[]
            {
                num.ToString()
            });
        }
        public static void UpdateFriendListElementBase(GameObject element, ref COMDT_FRIEND_INFO friend)
        {
            GameObject gameObject = element.transform.FindChild("HeadBg").gameObject;
            Text       component  = element.transform.FindChild("PlayerName").GetComponent <Text>();
            Image      component2 = element.transform.FindChild("NobeIcon").GetComponent <Image>();
            Image      component3 = element.transform.FindChild("HeadBg/NobeImag").GetComponent <Image>();

            if (component2)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component2, (int)friend.stGameVip.dwCurLevel, false, false, friend.ullUserPrivacyBits);
            }
            if (component3)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component3, (int)friend.stGameVip.dwHeadIconId);
            }
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(friend.stUin.ullUid, friend.stUin.dwLogicWorldId);

            if (friendInGaming == null)
            {
                component.set_text(CInviteView.ConnectPlayerNameAndNickName(friend.szUserName, string.Empty));
            }
            else
            {
                component.set_text(CInviteView.ConnectPlayerNameAndNickName(friend.szUserName, friendInGaming.NickName));
            }
            string url = Utility.UTF8Convert(friend.szHeadUrl);

            if (!CSysDynamicBlock.bFriendBlocked)
            {
                CUIUtility.GetComponentInChildren <CUIHttpImageScript>(gameObject).SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            }
        }
Esempio n. 23
0
        public void ShowLoudSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            this.m_loudSpeakerCount = 0;
            this.m_timerLoudSpeaker = Singleton <CTimerManager> .instance.AddTimer(0x3e8, 0, new CTimer.OnTimeUpHandler(this.OnTimerLoudSpeaker));

            if (Singleton <BattleLogic> .instance.isRuning)
            {
                this.loudSpeakerList.Clear();
            }
            else
            {
                CUIFormScript form = Singleton <CUIManager> .instance.GetForm(LobbyForm.FORM_PATH);

                if (form != null)
                {
                    CUIAutoScroller component = form.GetWidget(5).GetComponent <CUIAutoScroller>();
                    if (component != null)
                    {
                        GameObject widget = form.GetWidget(6);
                        if (widget != null)
                        {
                            string rawText = UT.Bytes2String(data.szContent);
                            string str     = CChatUT.Build_4_LoudSpeaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, rawText);
                            component.SetText(CUIUtility.RemoveEmoji(str));
                            component.gameObject.CustomSetActive(true);
                            widget.CustomSetActive(true);
                            component.StopAutoScroll();
                            component.StartAutoScroll(true);
                        }
                    }
                }
            }
        }
Esempio n. 24
0
        internal override void AttachDOMElementsForDisplayMode(string displayMode)
        {
            EnsureValidDisplayMode(displayMode);

            _elmDefault = (Span)Browser.Document.GetById(Id + "-" + displayMode);
            StoreElementForDisplayMode(_elmDefault, displayMode);
            _elmDefaultA = (Anchor)_elmDefault.ChildNodes[0];

            _inLabelMode = !string.IsNullOrEmpty(Properties.LabelText);
            if (!_inLabelMode)
            {
                _elmDefaultImgCont = (Span)_elmDefaultA.ChildNodes[0];
                _elmDefaultImg     = (Image)_elmDefaultImgCont.ChildNodes[0];
            }
            else
            {
                _elmLeft   = (Span)Browser.Document.GetById(Id + "-" + displayMode + "-left");
                _elmRight  = (Span)Browser.Document.GetById(Id + "-" + displayMode + "-right");
                _elmMiddle = (Span)Browser.Document.GetById(Id + "-" + displayMode + "-middle");

                if (!CUIUtility.IsNullOrUndefined(_elmMiddle))
                {
                    _elmLabel = (Span)_elmMiddle.FirstChild;
                }
            }
        }
Esempio n. 25
0
        internal override bool FocusNext(HtmlEvent evt)
        {
            int moveCount = 1;

            if (!CUIUtility.IsNullOrUndefined(evt) && evt.KeyCode == (int)Key.Down)
            {
                moveCount = ColumnSize;
            }

            if (_focusedIndex + moveCount < 0)
            {
                _focusedIndex = -1;
                moveCount     = 1;
            }


            if (_focusedIndex + moveCount < _colorCells.Count)
            {
                SetFocusOnCell(_focusedIndex + moveCount);
                return(true);
            }
            RemoveHighlighting();
            _focusedIndex -= _colorCells.Count;
            return(false);
        }
Esempio n. 26
0
        protected void OnKeyPress(HtmlEvent args)
        {
            if (!Enabled)
            {
                return;
            }

            // Make OACR happy
            if (CUIUtility.IsNullOrUndefined(args))
            {
                return;
            }

            int key = args.KeyCode;

            if (key == (int)Key.Enter || key == (int)Key.Space || key == (int)Key.Down)
            {
                LaunchedByKeyboard = true;

                if (MenuLaunched)
                {
                    CloseMenu();
                }
                else
                {
                    LaunchJewelMenu();
                }

                Utility.CancelEventUtility(args, false, true);
            }
            // No need to check for escape to close here because the modal element will do that for us (O14:391733)
        }
Esempio n. 27
0
 internal void EnsureHiddenATDOMElement()
 {
     if (CUIUtility.IsNullOrUndefined(_elmATText))
     {
         _elmATText = new Span();
     }
 }
Esempio n. 28
0
    private void SetHonorImage(Transform imgTransform, COMDT_HONORINFO honorInfo)
    {
        string honorImagePath = this.GetHonorImagePath(honorInfo.iHonorID, honorInfo.iHonorLevel);
        Image  component      = imgTransform.GetComponent <Image>();

        component.SetSprite(CUIUtility.GetSpritePrefeb(honorImagePath, false, false), false);
    }
Esempio n. 29
0
 // Focus on the A tag in the tab title
 internal void SetFocusOnTitle()
 {
     if (!CUIUtility.IsNullOrUndefined(_elmTitleA))
     {
         _elmTitleA.PerformFocus();
     }
 }
        public void Show(CUIEvent uievent)
        {
            if (this.form == null)
            {
                return;
            }
            if (!this.bIsSPModel)
            {
                for (int i = 0; i < this.signalEntities.Count; i++)
                {
                    MiniMapSignalPanel.SignalEntity signalEntity = this.signalEntities[i];
                    if (signalEntity != null)
                    {
                        signalEntity.ShowSelected(false);
                    }
                }
            }
            Vector2 pressPosition = uievent.m_pointerEventData.get_pressPosition();

            this.cacheClickX = pressPosition.x;
            this.cacheClickY = pressPosition.y;
            Vector3 position = CUIUtility.ScreenToWorldPoint(this.form.GetCamera(), pressPosition, this.form.transform.position.z);

            this.node.transform.position = position;
            this.node.CustomSetActive(true);
            this.bIsSPModel = true;
        }