Ejemplo n.º 1
1
 public AutoCompleteTermResult(string info, int? icon)
 {
     _termMatch = info;
     if (icon != null)
         IconData.BeginGetIcon(
             icon.Value,
             (o, result) =>
             {
                 if (result.Error == null)
                     Icon = result.Object;
             });
     else
         Icon = null;
 }
Ejemplo n.º 2
0
    IconData GenerateIconData()
    {
        IconData.Shading shading = IconData.Shading.Open;

        switch (UnityEngine.Random.Range(0, 4))
        {
        case 0:
            shading = IconData.Shading.Open;
            break;

        case 1:
            shading = IconData.Shading.Striped;
            break;

        case 2:
            shading = IconData.Shading.Solid;
            break;
        }

        int spriteInt = UnityEngine.Random.Range(0, symbolSprites.Length);

        IconData iconData = new IconData(0, symbolSprites[spriteInt], symbolMaskSprites[spriteInt], shading, symbolColors[UnityEngine.Random.Range(0, symbolColors.Length)]);

        if (!IconExists(iconData))
        {
            iconObjects.Add(iconData);
            iconData.Index = iconObjects.Count - 1;
            return(iconData);
        }
        else
        {
            return(GenerateIconData());
        }
    }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes the static data of the program
        /// </summary>
        private static bool Initialize()
        {
            try {
                AssetInfo.GenerateAssetInfoList();
                IconData.itemIconDictionary = new Dictionary <string, byte[]>();
                IconData.uiIconDictionary   = new Dictionary <string, UIIconData>();
            }
            catch (Exception e) {
                ErrorHandler.HandleError("Error while processing icons. Failed to load asset files." + e.Message, e, true);
            }
            try {
                //This step normally fails. Lets suppressed the error message.
                //We get inventory icons
                IconData.PopulateIconDictionaries();
            }
            catch (Exception e) {
                ErrorHandler.HandleError("Error while processing icons. Failed to load asset files." + e.Message, e, false);
            }

            try {
                XmlData.GetBlocks();
                XmlData.GetItems();
                XmlData.ArrangeItemList();
                XmlData.GetSkills();
                AssetInfo.ClearAssetInfoList();
            }
            catch (Exception e) {
                ErrorHandler.HandleError(string.Format("Failed to load XML files!\n\n{0}\n\nProgram will now terminate!", e.Message), e, true);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
 /*! \brief Create IconAttributes where we wish to set the text and validation strings
  * of the icon and possibly change either one after the icon is created.  */
 public IconAttributes(string text, int textMaxLen,
                       string validation, int validationMaxLen)
 {
     Data = new IconData(new IconBuffer(text, textMaxLen),
                         new IconBuffer(validation, validationMaxLen));
     DefaultColours();
 }
Ejemplo n.º 5
0
        public void Notification(Pixbuf image, string stripUrl, string name, string author)
        {
            const int maxWidth = 387;
            Pixbuf    pixbuf   = image.ScaleSimple(maxWidth, image.Height * maxWidth / image.Width, InterpType.Hyper);

            image.Dispose();

            IDictionary <string, object> hints = new Dictionary <string, object> ();
            IconData icon_data = new IconData();

            icon_data.Width         = pixbuf.Width;
            icon_data.Height        = pixbuf.Height;
            icon_data.Rowstride     = pixbuf.Rowstride;
            icon_data.HasAlpha      = pixbuf.HasAlpha;
            icon_data.BitsPerSample = pixbuf.BitsPerSample;
            icon_data.NChannels     = pixbuf.NChannels;

            int len = (icon_data.Height - 1) * icon_data.Rowstride + icon_data.Width *
                      ((icon_data.NChannels * icon_data.BitsPerSample + 7) / 8);

            icon_data.Pixels = new byte[len];
            System.Runtime.InteropServices.Marshal.Copy(pixbuf.Pixels, icon_data.Pixels, 0, len);

            hints["icon_data"] = icon_data;

            int x = Gdk.Screen.Default.Width / 2;
            int y = 0;

            hints["x"] = x;
            hints["y"] = y;

            proxy.Notify("zencomic", 0, string.Empty, name + " of " + author,
                         string.Empty, new string[0], hints, popupDelay * 1000);
        }
Ejemplo n.º 6
0
    //穿上符文
    public void PutOnRuneResp(int idx, int posi)
    {
        Rune rune = bag[idx];

        bag.Remove(rune.index);
        BodyRune brune = body[posi];

        brune.rune = rune;
        rune.index = posi;
        rune.inBag = false;
        //todo更新UI
        string name = "no name";

        if (LanguageData.dataMap.ContainsKey(rune.ResData.name))
        {
            name = LanguageData.dataMap[rune.ResData.name].content;
            name = GetRuneNameString(rune.ResData.quality, name);
        }
        if (idx < 16)
        {
            DragonUIViewManager.Instance.RemoveDragonItem(idx);
        }
        else
        {
            RuneUIViewManager.Instance.RemoveRuneItem(idx % 16);
        }
        IconData _t = IconData.dataMap[rune.ResData.icon];

        RuneUIViewManager.Instance.AddInsetGridItem(rune.ResData.level, name, rune.index, _t.path, _t.color);
        CalcuScore();
    }
Ejemplo n.º 7
0
    //增加一个符文到身上
    public void AddRuneToBody(string uuid, int posi, int resID, int exp)
    {
        Debug.Log("add body idx: " + posi + " " + resID + " " + exp);
        Rune rune = new Rune(uuid, resID, exp);

        rune.index = posi;
        rune.inBag = false;
        BodyRune brune = body[posi];

        brune.rune = rune;
        //todo更新UI
        string name = "no name";

        if (LanguageData.dataMap.ContainsKey(rune.ResData.name))
        {
            name = LanguageData.dataMap[rune.ResData.name].content;
            name = GetRuneNameString(rune.ResData.quality, name);
        }
        IconData _t = IconData.dataMap[rune.ResData.icon];

        if (RuneUIViewManager.Instance != null)
        {
            RuneUIViewManager.Instance.AddInsetGridItem(rune.ResData.level, name, rune.index, _t.path, _t.color);
        }
        CalcuScore();
    }
Ejemplo n.º 8
0
    //卸下符文
    public void PutDownRuneResp(int posi, int idx)
    {
        BodyRune brune = body[posi];
        Rune     rune  = brune.rune;

        rune.index = idx;
        rune.inBag = true;
        brune.rune = null;
        bag.Add(rune.index, rune);
        //todo更新UI
        string   name = "no name";
        IconData _t   = IconData.dataMap[rune.ResData.icon];

        if (LanguageData.dataMap.ContainsKey(rune.ResData.name))
        {
            name = LanguageData.dataMap[rune.ResData.name].content;
            name = GetRuneNameString(rune.ResData.quality, name);
        }
        if (idx < 16)
        {
            DragonUIViewManager.Instance.AddDragonItem(rune.ResData.level, name, idx, _t.path, _t.color);
        }
        else
        {
            RuneUIViewManager.Instance.AddPackageGridItem(rune.ResData.level, name, idx % 16, _t.path, _t.color);
        }
        RuneUIViewManager.Instance.RemoveRuneInsetItem(posi);
        CalcuScore();
    }
Ejemplo n.º 9
0
 Widget buildButton(SwiperPluginConfig config, Color color, IconData iconDaga,
                    int quarterTurns, bool previous)
 {
     return(new GestureDetector(
                behavior: HitTestBehavior.opaque,
                onTap: () =>
     {
         if (previous)
         {
             config.controller.previous(animation: true);
         }
         else
         {
             config.controller.next(animation: true);
         }
     },
                child: new Padding(
                    padding: padding,
                    child: new RotatedBox(
                        quarterTurns: quarterTurns,
                        child: new Icon(
                            iconDaga,
                            //semanticLabel: previous? "Previous" : "Next",
                            size: size,
                            color: color
                            )))
                ));
 }
Ejemplo n.º 10
0
 public TapItemWidget(string title, IconData iconData, VoidCallback callback, bool isLast = false)
 {
     Title    = title;
     IconData = iconData;
     Callback = callback;
     IsLast   = isLast;
 }
Ejemplo n.º 11
0
 public GalleryDemoCategory(
     string name,
     IconData icon)
 {
     this.name = name;
     this.icon = icon;
 }
Ejemplo n.º 12
0
    /// <summary>
    /// 设置推荐装备信息
    /// </summary>
    /// <param name="iconName"></param>
    /// <param name="color"></param>
    /// <param name="quality"></param>
    public void SetRecommendEquip(string iconName, int color = 0, int quality = 1)
    {
        string qulityIcon = IconData.GetIconByQuality(quality);

        SetRecommendEquiptFG(iconName, color);
        SetRecommendEquipBG(qulityIcon);
    }
Ejemplo n.º 13
0
 public DialogDemoItem(Key key = null, IconData icon = null, Color color = null, string text = null, VoidCallback onPressed = null) : base(key: key)
 {
     this.icon      = icon;
     this.color     = color;
     this.text      = text;
     this.onPressed = onPressed;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes the static data of the program
        /// </summary>
        private static bool Initialize()
        {
            try {
                AssetInfo.GenerateAssetInfoList();
                IconData.itemIconDictionary = new Dictionary <string, byte[]>();
                IconData.uiIconDictionary   = new Dictionary <string, UIIconData>();
                IconData.PopulateIconDictionaries();
            }
            catch (Exception e) {
                ErrorHandler.HandleError("No icons will be loaded. Failed to load asset files." + e.Message, e, true);
            }

            try {
                XmlData.GetBlocks();
                XmlData.GetItems();
                XmlData.ArrangeItemList();
                XmlData.GetSkills();
                AssetInfo.ClearAssetInfoList();
            }
            catch (Exception e) {
                ErrorHandler.HandleError(string.Format("Failed to load XML files!\n\n{0}\n\nProgram will now terminate!", e.Message), e, true);
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// The user clicked okay; close the window and remember the selected icon.
 /// </summary>
 /// <param name="sender">The okay button.</param>
 /// <param name="eventArgs">The event arguments.</param>
 private void OnOkay(object sender, RoutedEventArgs eventArgs)
 {
     if (this.iconList.SelectedItem != null)
     {
         this.selected = iconList.SelectedItem as IconData;
     }
     this.Close();
 }
Ejemplo n.º 16
0
        public GalleryDemoCategory(string name = null, IconData icon = null)
        {
            D.assert(name != null);
            D.assert(icon != null);

            this.name = name;
            this.icon = icon;
        }
Ejemplo n.º 17
0
    // refresh the package item
    public void UpdatePackageItem(ItemSlotType _type)
    {
        mCurrPackageType = _type;

        // clear the former selected item
        if (mCurrSelectedIconData != null)
        {
            mCurrSelectedIconData.checkButton.isChecked = false;
        }
        mCurrSelectedIconData = null;

        ItemTipsName.transform.localScale  = Vector3.one;
        ItemTipsMoney.transform.localScale = Vector3.one;
        ItemTipsDesc.transform.localScale  = Vector3.one;

        // foreach(AttributeIcon icon in ItemAttributeIcon){
        //  icon.transform.localScale = Vector3.one;
        // }

        // hide the operation button
        ShowOpBtn(null);

        List <ItemSlotData> tDataList = ItemDataManager.Instance.GetItemDataList(_type);

        for (int i = 0; i < mCurrIconItemList.Count; i++)
        {
            IconData t_iconData = mCurrIconItemList[i];

            t_iconData.checkButton.isChecked = false;

            bool t_setIcon = false;

            // add Dictionary.Values to List for iterating
            foreach (ItemSlotData data in tDataList)
            {
                if (data.LocationID == i)
                {
                    t_setIcon           = true;
                    t_iconData.itemData = data;
                    HelpUtil.SetItemIcon(t_iconData.checkButton.transform, t_iconData.itemData, !ShopSellItemPackage);
                    break;
                }
            }

            if (!t_setIcon)
            {
                t_iconData.itemData            = new ItemSlotData();
                t_iconData.itemData.LocationID = i;
                t_iconData.itemData.SlotType   = _type;
                t_iconData.itemData.SlotState  = ItemSlotState.LOCK;
                HelpUtil.SetItemIcon(t_iconData.checkButton.transform, null, !ShopSellItemPackage);
            }
        }

        mCurrSelPageIndicatorIdx = 0;

        // SetPackageHighLight(HighLightRule.HIGHLIGHT_NONE);
    }
Ejemplo n.º 18
0
        public override Widget build(BuildContext context)
        {
            Widget image = new GestureDetector(
                onTap: () => { showPhoto(context); },
                child: new Hero(
                    key: Key.key(photo.assetName),
                    tag: photo.tag,
                    child: Image.file(
                        photo.assetPackage + photo.assetName,
                        fit: BoxFit.cover
                        )
                    )
                );

            IconData icon = photo.isFavorite ? Icons.star : Icons.star_border;

            switch (tileStyle)
            {
            case GridDemoTileStyle.imageOnly:
                return(image);

            case GridDemoTileStyle.oneLine:
                return(new GridTile(
                           header: new GestureDetector(
                               onTap: () => { onBannerTap(photo); },
                               child: new GridTileBar(
                                   title: new _GridTitleText(photo.title),
                                   backgroundColor: Colors.black45,
                                   leading: new Icon(
                                       icon,
                                       color: Colors.white
                                       )
                                   )
                               ),
                           child: image
                           ));

            case GridDemoTileStyle.twoLine:
                return(new GridTile(
                           footer: new GestureDetector(
                               onTap: () => { onBannerTap(photo); },
                               child: new GridTileBar(
                                   backgroundColor: Colors.black45,
                                   title: new _GridTitleText(photo.title),
                                   subtitle: new _GridTitleText(photo.caption),
                                   trailing: new Icon(
                                       icon,
                                       color: Colors.white
                                       )
                                   )
                               ),
                           child: image
                           ));
            }

            D.assert(tileStyle != null);
            return(null);
        }
Ejemplo n.º 19
0
 /*! \brief Create a menu item.
  * \param [in] text The text of the menu item.  */
 public MenuItem(String text)
 {
     Icon       = new IconData(new IconBuffer(text));
     SubMenu    = null;
     SubWindow  = null;
     Ticked     = false;
     DottedLine = false;
     Writable   = false;
 }
Ejemplo n.º 20
0
    private BottomNavigationBarItem BuildNavigationItem(string title, IconData icons)
    {
        float size = 25;

        return(new BottomNavigationBarItem(
                   title: new Text(title),
                   icon: new Icon(icon: icons, size: size)
                   ));
    }
Ejemplo n.º 21
0
        private async Task LoadItemThumbnail()
        {
            var(IconData, OverlayData, IsCustom) = await FileThumbnailHelper.LoadIconOverlayAsync(Item.ItemPath, 400);

            if (IconData != null)
            {
                Item.FileImage = await IconData.ToBitmapAsync();
            }
        }
Ejemplo n.º 22
0
        public async Task LoadLibraryIcon()
        {
            IconData = await FileThumbnailHelper.LoadIconWithoutOverlayAsync(Path, 24u);

            if (IconData != null)
            {
                Icon = await IconData.ToBitmapAsync();
            }
        }
Ejemplo n.º 23
0
 public SocialBrand(
     IconData data,
     Color hoverColor,
     Action <BuildContext> onTap)
 {
     _data       = data;
     _hoverColor = hoverColor;
     _onTap      = onTap;
 }
Ejemplo n.º 24
0
 public _ContactItem(Key key = null, IconData icon = null, List <string> lines = null, string tooltip = null,
                     VoidCallback onPressed = null) : base(key: key)
 {
     D.assert(lines.Count > 1);
     this.icon      = icon;
     this.lines     = lines;
     this.tooltip   = tooltip;
     this.onPressed = onPressed;
 }
Ejemplo n.º 25
0
 /*! \brief Create a menu item.
  * \param [in] text The text of the menu item.
  * \param [in] maxTextLen The size of the buffer that should be allocated
  * to the menu item's text. Used for writable entries where the text may
  * be shorter than what is allowed to be typed in.
  * \param [in] validation The validation string for the menu item. */
 public MenuItem(String text, int maxTextLen, String validation)
 {
     Icon = new IconData(new IconBuffer(text, maxTextLen),
                         new IconBuffer(validation));
     SubMenu    = null;
     SubWindow  = null;
     Ticked     = false;
     DottedLine = false;
     Writable   = false;
 }
Ejemplo n.º 26
0
 public PersonalCardItem(
     IconData icon,
     string title,
     GestureTapCallback onTap
     )
 {
     this.icon  = icon;
     this.title = title;
     this.onTap = onTap;
 }
Ejemplo n.º 27
0
 public _Page(
     string label,
     MaterialColor colors = null,
     IconData icon        = null
     )
 {
     this.label  = label;
     this.colors = colors;
     this.icon   = icon;
 }
Ejemplo n.º 28
0
    public void RefreshUI()
    {
        if (DecomposeUIViewManager.Instance == null)
        {
            return;
        }
        for (int i = 0; i < BodyName.names.Length; i++)
        {
            DecomposeUIViewManager.Instance.SetPackageGridImage(BodyName.names[i], i);
        }

        UpdateEquipmentList();


        for (int i = 0; i < 40; i++)
        {
            string icon        = IconData.none;
            bool   isLock      = false;
            bool   hasCheckBox = false;
            int    quality     = 0;
            if (m_equipmentList.Count > i)
            {
                icon = m_equipmentList[i].icon;

                hasCheckBox = true;
                quality     = m_equipmentList[i].quality;
                if (((ItemEquipment)m_equipmentList[i]).locked)
                {
                    isLock      = true;
                    hasCheckBox = false;
                }

                if (m_checkSet.Count < 10)
                {
                    if (!isLock)
                    {
                        OnCheckUp(i);
                    }
                }
            }

            DecomposeUIViewManager.Instance.ShowPackageGridCheck(hasCheckBox, i);
            DecomposeUIViewManager.Instance.ShowPacakgeGridCheckFG(m_checkSet.Contains(i), i);
            DecomposeUIViewManager.Instance.ShowPackageGridLock(isLock, i);
            DecomposeUIViewManager.Instance.SetPackageGridImage(icon, i);
            if (quality != 0)
            {
                DecomposeUIViewManager.Instance.SetPackageGridImageBG(IconData.GetIconByQuality(quality), i);
            }
            else
            {
                DecomposeUIViewManager.Instance.SetPackageGridImageBG(IconData.blankBox, i);
            }
        }
    }
Ejemplo n.º 29
0
        private Widget _buildIconButton(float iconSize, IconData icon, bool enabled)
        {
            var prefix = enabled ? "Enabled" : "Disabled";

            return(new IconButton(
                       icon: new Icon(icon),
                       iconSize: iconSize,
                       tooltip: $"{prefix} icon button",
                       onPressed: enabled ? handleIconButtonPress : null
                       ));
        }
Ejemplo n.º 30
0
    void Start()
    {
        IconData.setIconPlacer(this);

        iconContainer = new GameObject("Icon Container");
        iconContainer.transform.parent = gameObject.transform;

        IconData.generateNewIconLayout();

        updateIconPlaces();
    }
Ejemplo n.º 31
0
 public virtual void Setup(IconData objData)
 {
     if (iconImage != null)
     {
         iconImage.overrideSprite = resourceService.GetSprite(objData);
     }
     if (nameText != null)
     {
         nameText.text = resourceService.GetString(objData.nameId);
     }
 }
Ejemplo n.º 32
0
        private void SetPixbufHint(Pixbuf pixbuf)
        {
            IconData icon_data = new IconData ();
            icon_data.Width = pixbuf.Width;
            icon_data.Height = pixbuf.Height;
            icon_data.Rowstride = pixbuf.Rowstride;
            icon_data.HasAlpha = pixbuf.HasAlpha;
            icon_data.BitsPerSample = pixbuf.BitsPerSample;
            icon_data.NChannels = pixbuf.NChannels;

            int len = (icon_data.Height - 1) * icon_data.Rowstride + icon_data.Width *
                ((icon_data.NChannels * icon_data.BitsPerSample + 7) / 8);
            icon_data.Pixels = new byte[len];
            System.Runtime.InteropServices.Marshal.Copy (pixbuf.Pixels, icon_data.Pixels, 0, len);

            hints["icon_data"] = icon_data;
        }
Ejemplo n.º 33
0
        public void Notification(Pixbuf image, string stripUrl, string name, string author)
        {
            const int maxWidth = 387;
            Pixbuf pixbuf = image.ScaleSimple (maxWidth, image.Height * maxWidth / image.Width, InterpType.Hyper);
            image.Dispose ();

            IDictionary<string, object> hints = new Dictionary<string, object> ();
            IconData icon_data = new IconData ();
            icon_data.Width = pixbuf.Width;
            icon_data.Height = pixbuf.Height;
            icon_data.Rowstride = pixbuf.Rowstride;
            icon_data.HasAlpha = pixbuf.HasAlpha;
            icon_data.BitsPerSample = pixbuf.BitsPerSample;
            icon_data.NChannels = pixbuf.NChannels;

            int len = (icon_data.Height - 1) * icon_data.Rowstride + icon_data.Width *
                ((icon_data.NChannels * icon_data.BitsPerSample + 7) / 8);
            icon_data.Pixels = new byte[len];
            System.Runtime.InteropServices.Marshal.Copy (pixbuf.Pixels, icon_data.Pixels, 0, len);

            hints["icon_data"] = icon_data;

            int x = Gdk.Screen.Default.Width / 2;
            int y = 0;
            hints["x"] = x;
            hints["y"] = y;

            proxy.Notify ("zencomic", 0, string.Empty, name + " of " + author,
                          string.Empty, new string[0], hints, popupDelay * 1000);
        }
Ejemplo n.º 34
0
 public ProcessNavigationItem(string name, string systemName, IconData icon)
 {
     Name = name;
     SystemName = systemName;
     Icon = icon;
 }
Ejemplo n.º 35
0
 public DecoratorDrawerData(ShapeData shape, IconData icon)
 {
     Shape = shape;
     Icon = icon;
 }
 protected override void LoadIcon()
 {
     if (Model != null && Model.IconId.HasValue)
         Icon = new IconData();
 }
Ejemplo n.º 37
0
        //Method to fetch the Icon details
        public List<IconData> getWeatherIcons(DTOIcon objParam, string strControlName)
        {
            DataTable dtIconData = new DataTable();
            IconData icon;
            List<IconData> iconlist = new List<IconData>();
            try
            {
                ArrayList al = new ArrayList();
                dtIconData = objIconSvc.getIconData(objParam, strControlName);
                //al = objIconSvc.getWeatherIcons(objParam, strControlName);
                DataTable dtIconList = objIconSvc.getWeatherIconsWithTooltip(objParam, strControlName);
                DateTime startDate = DateTime.Parse(dtIconData.Rows[0][0].ToString()).Date;
                for (int j = 0; j < dtIconList.Rows.Count; j++)
                {
                    icon = new IconData();
                    string day = "";
                    string tooltip = System.Text.RegularExpressions.Regex.Replace(dtIconList.Rows[j][1].ToString(), "<.*?>", string.Empty);
                    if (objParam.iStep == 24)
                    {
                        day = startDate.AddHours(j * objParam.iStep).DayOfWeek.ToString();
                        icon.Date = day;
                        icon.IconToolTip = tooltip.Replace("{day}", day).Replace("{}", "");
                    }
                    else
                    {
                        day = startDate.AddHours(j * objParam.iStep).DayOfWeek.ToString();
                        icon.Date = startDate.AddHours(j * objParam.iStep).ToString();
                        icon.IconToolTip = tooltip.Replace("{day}", day).Replace("{}", "");

                    }
                    string IconURL = dtIconList.Rows[j]["ImageUrl"].ToString();
                    /********IM01144144 - New Agricast Webservices - icons URL - BEGIN ***************************/
                    IconURL=IconURL.Substring(IconURL.IndexOf("\\Images"));
                    //IconURL = System.Configuration.ConfigurationManager.AppSettings["WSHost"].ToString() + IconURL.Substring(IconURL.IndexOf("\\Images"));
                    IconURL = System.Configuration.ConfigurationManager.AppSettings["WSHost"].ToString() + IconURL.Substring(IconURL.IndexOf("\\") + 1);

                    //icon.IconPath = objCommonUtil.toBase64(IconURL);
                    icon.IconPath = IconURL;
                    /********IM01144144 - New Agricast Webservices - icons URL - END ***************************/
                    iconlist.Add(icon);
                }
            }
            catch (Exception ex)
            {
                AgriCastException currEx = new AgriCastException(GetServiceDetails(), ex);
                AgriCastLogger.Publish(currEx, AgriCastLogger.LogType.Error);
            }
            return iconlist;
        }