static void Scene_AfterDraw(object sender, EventArgs e) { if (ItemLabel != null && !ItemLabel.IsDisposed) { ItemLabel.Draw(); } if ((MirItemCell.PickedUpGold || MirItemCell.SelectedCell != null && MirItemCell.SelectedCell.Item != null) && MirGraphics.Libraries.Items != null) { int Image = MirItemCell.PickedUpGold ? 116 : MirItemCell.SelectedCell.Item.Info.Image; Point Location = Main.This.PointToClient(Cursor.Position); Size ImgSize = MirGraphics.Libraries.Items.GetSize(Image); Location.Offset(-ImgSize.Width / 2, -ImgSize.Height / 2); if (Location.X + ImgSize.Width >= Settings.ScreenSize.Width) { Location.X = Settings.ScreenSize.Width - ImgSize.Width; } if (Location.Y + ImgSize.Height >= Settings.ScreenSize.Height) { Location.Y = Settings.ScreenSize.Height - ImgSize.Height; } MirGraphics.Libraries.Items.Draw(Image, Location, Color.White); } for (int I = 0; I < OutputLines.Length; I++) { OutputLines[I].Draw(); } }
// --------------------------------- // Func // --------------------------------- void SetPopuplistItem() { UIPopupList popupList = FactoryReplicator.m_MenuContent.popList; popupList.items.Clear(); popupList.items.Add(this.m_AllStr); if (m_RootType == ItemLabel.Root.all) { } else { popupList.items.AddRange(ItemLabel.GetDirectChildrenName((int)m_RootType)); //foreach (KeyValuePair<int, int> kv in ItemType.s_tblItemFather) //{ // if (kv.Value != -1 && (int)m_RootType == kv.Value) // { // popupList.items.Add(ItemType.s_tblItemType[kv.Key]); // } //} } if (popupList.items.Count > 0) { popupList.selection = popupList.items[0]; } UpdateLeftList(true); }
public Ribbon(Rectangle position, string item, Texture2D texture, string mapName, Game1 game) { this.item = item; this.position = position; this.mapName = mapName; this.texture = texture; label = new ItemLabel(new Rectangle(position.X, position.Y - 25, 0, 25), this.item.Length, game); }
void OnTriggerExit(Collider collider) { ItemLabel itemLabel = collider.GetComponentInParent <ItemLabel>(); if (itemLabel != null && itemLabelsWithin.Contains(itemLabel.gameObject)) { itemLabelsWithin.Remove(itemLabel.gameObject); } }
void OnMenuSelectionChange(string selection) { if (selection == this.m_AllStr) { m_ItemType = 0; } else { m_ItemType = ItemLabel.GetItemTypeByName(selection); } this.UpdateLeftList(); }
private void SetSelected(bool value) { if (value) { ItemLabel.AddToClassList(ApplicationUtil.SelectedClassName); } else { ItemLabel.RemoveFromClassList(ApplicationUtil.SelectedClassName); } Spinner.InvertColor = value; }
void OnTriggerEnter(Collider collider) { ItemLabel itemLabel = collider.GetComponentInParent <ItemLabel>(); if (itemLabel != null && !itemLabelsWithin.Contains(itemLabel.gameObject)) { itemLabelsWithin.Add(itemLabel.gameObject); if (itemLabel.IsFalling()) { itemLabel.StickToBasket(); } } }
void OnTriggerStay(Collider collider) { ItemLabel itemLabel = collider.GetComponentInParent <ItemLabel>(); if (itemLabel != null) { Vector3 deltaV = velocity - collider.attachedRigidbody.velocity; Vector3 acceleration = deltaV / Time.fixedDeltaTime; if (acceleration.sqrMagnitude > maxAcceleration * maxAcceleration) { acceleration = acceleration.normalized * maxAcceleration; } collider.attachedRigidbody.AddForce(acceleration, ForceMode.Acceleration); } }
void OnTriggerEnter(Collider collider) { ItemLabel itemLabel = collider.GetComponentInParent <ItemLabel>(); if (itemLabel != null && clipboard.Contains(itemLabel.label) && GetAmount(itemLabel.label) < clipboard.GetAmount(itemLabel.label)) { Add(itemLabel.label); itemLabel.transform.position = transform.position + postScanPosition; collider.attachedRigidbody.velocity = Vector3.zero; GetComponentInChildren <AudioSource>().Play(); } Debug.Log("Debugging"); foreach (List <string> l in scannedItems) { Debug.Log(l[0]); } }
void OnSelectionChange1(string selectedItemName) { if (LockChange) { return; } if (selectedItemName == m_AllStr) { mItemType = 0; } else { mItemType = ItemLabel.GetItemTypeByName(selectedItemName); } UpdateLeftList(); }
private void CreateBindings() { // menu bar ItemLabel.SetBinding(ContentProperty, new Binding("Item") { Source = _model, Mode = BindingMode.OneWay }); FileLabel.SetBinding(ContentProperty, new Binding("File") { Source = _model, Mode = BindingMode.OneWay }); FileLabel.SetBinding(ForegroundProperty, new Binding("FileLabelForeground") { Source = _model, Mode = BindingMode.OneWay }); }
public PackageItem(Package package, Selection selection) { root = Resources.GetTemplate("PackageItem.uxml"); Add(root); Cache = new VisualElementCache(root); Selection = selection; SetItem(package); SelectionManager = new ElementSelection(this, Selection); ItemLabel.RegisterCallback <MouseDownEvent>(e => SelectMainItem()); SeeAllVersions.RegisterCallback <MouseDownEvent>(e => SeeAllVersionsClick()); VersionList.contentContainer.AddToClassList("fix-scroll-view"); Expander.RegisterCallback <MouseDownEvent>(e => ExpandToggle()); UIUtils.SetElementDisplay(ItemVersions, Expander.Expanded); StopSpinner(); }
private void SetPopuplistItem(bool useScerch) { LockChange = true; mPopuplist.items.Clear(); mPopuplist.items.Add(m_AllStr); if (mRootType == ItemLabel.Root.all) { } else { mPopuplist.items.AddRange(ItemLabel.GetDirectChildrenName((int)mRootType)); } if (mPopuplist.items.Count > 0) { mPopuplist.selection = mPopuplist.items[0]; } mItemType = 0; UpdateLeftList(useScerch); LockChange = false; }
/// <summary> /// Updates the selected equipment label with the given item info. /// </summary> /// <param name="label"></param> /// <param name="item"></param> private void UpdateEquipmentLabel(ItemLabel label, Item item) { label.Image = new Bitmap(string.Format("{0}\\Data\\Items\\item_{1}.png", Application.StartupPath, item.NetID)); this.m_Tooltip.SetToolTip(label, item.ToString()); }
//private Sprite GetSprite(YuLegoDropdownOptionMeta optionMeta) //{ // var spriteId = optionMeta.SpriteId; // if (spriteDict.ContainsKey(spriteId)) // { // return spriteDict[spriteId].GetAsset(); // } // var spRef = AssetModule.GetSprite(spriteId); // spriteDict.Add(spriteId, spRef); // return spRef.GetAsset(); //} #endregion public override void Metamorphose(LegoUIMeta uiMeta) { if (MetamorphoseStage == LegoMetamorphoseStage.Completed) { MetamorphoseStage = LegoMetamorphoseStage.Metamorphosing; } if (dropdownMeta == null) { dropdownMeta = uiMeta.NextDropdown; dropdownRectMeta = uiMeta.CurrentRect; } switch (metamorphoseStatus) { case MetamorphoseStatus.Dropdown: MetamorphoseRect(dropdownRectMeta); // 输入框自身附带Image控件变形 SelfImage.Metamorphose(dropdownMeta.DropdownImageMeta); if (dropdownMeta.Transition == LegoTransition.ColorTint) { var colorTintMeta = dropdownMeta.ColorTintMeta; colors = new ColorBlock { normalColor = colorTintMeta.NormalLegoColor.ToColor(), highlightedColor = colorTintMeta.HighlightedLegoColor.ToColor(), pressedColor = colorTintMeta.PressedLegoColor.ToColor(), disabledColor = colorTintMeta.DisabledLegoColor.ToColor(), colorMultiplier = colorTintMeta.ColorMultiplier, fadeDuration = colorTintMeta.FadeDuration }; } // 选项 if (dropdownMeta.OptionMetas != null && dropdownMeta.OptionMetas.Count > 0) { options.Clear(); foreach (var optionMeta in dropdownMeta.OptionMetas) { var optionData = new OptionData(); optionData.text = optionMeta.Text; // todo 下拉框菜单精灵 //optionData.image = SpriteRouter.GetSprite(optionMeta.SpriteId); options.Add(optionData); } } metamorphoseStatus = MetamorphoseStatus.Label; break; case MetamorphoseStatus.Label: Label.Metamorphose(dropdownMeta.LabelRectMeta, dropdownMeta.LabelTextMeta); metamorphoseStatus = MetamorphoseStatus.Arrow; break; case MetamorphoseStatus.Arrow: Arrow.Metamorphose(dropdownMeta.ArrowRectMeta, dropdownMeta.ArrowImageMeta); metamorphoseStatus = MetamorphoseStatus.Template; break; case MetamorphoseStatus.Template: TemplateImage.Metamorphose(dropdownMeta.TemplateRectMeta, dropdownMeta.TemplateImageMeta); metamorphoseStatus = MetamorphoseStatus.Viewport; break; case MetamorphoseStatus.Viewport: ViewportImage.Metamorphose(dropdownMeta.ViewPortRectMeta, dropdownMeta.ViewPortImageMeta); metamorphoseStatus = MetamorphoseStatus.Content; break; case MetamorphoseStatus.Content: YuLegoUtility.MetamorphoseRect(Content, dropdownMeta.ContentRectMeta); metamorphoseStatus = MetamorphoseStatus.Item; break; case MetamorphoseStatus.Item: if (dropdownMeta.ItemTransition == LegoTransition.ColorTint) { var colorTintMeta = dropdownMeta.ItemRootColorTintMeta; Item.colors = new ColorBlock { normalColor = colorTintMeta.NormalLegoColor.ToColor(), highlightedColor = colorTintMeta.HighlightedLegoColor.ToColor(), pressedColor = colorTintMeta.PressedLegoColor.ToColor(), disabledColor = colorTintMeta.DisabledLegoColor.ToColor(), colorMultiplier = colorTintMeta.ColorMultiplier, fadeDuration = colorTintMeta.FadeDuration }; } YuLegoUtility.MetamorphoseRect(Item.RectTransform, dropdownMeta.ItemRootRectMeta); metamorphoseStatus = MetamorphoseStatus.ItemBackground; break; case MetamorphoseStatus.ItemBackground: ItemBackground.Metamorphose(dropdownMeta.ItemBackgroundRectMeta, dropdownMeta.ItemBackgroundImageMeta); metamorphoseStatus = MetamorphoseStatus.ItemCheckmark; break; case MetamorphoseStatus.ItemCheckmark: ItemCheckmark.Metamorphose(dropdownMeta.ItemCheckmarkRectMeta, dropdownMeta.ItemCheckmarkImageMeta); metamorphoseStatus = MetamorphoseStatus.ItemLabel; break; case MetamorphoseStatus.ItemLabel: ItemLabel.Metamorphose(dropdownMeta.ItemLabelRectMeta, dropdownMeta.ItemLabelTextMeta); metamorphoseStatus = MetamorphoseStatus.Scrollbar; break; case MetamorphoseStatus.Scrollbar: ScrollbarImage.Metamorphose(dropdownMeta.ScrollbarRectMeta, dropdownMeta.ScrollbarImageMeta); metamorphoseStatus = MetamorphoseStatus.SlidingArea; break; case MetamorphoseStatus.SlidingArea: YuLegoUtility.MetamorphoseRect(SlidingArea, dropdownMeta.SlidingAreaRectMeta); metamorphoseStatus = MetamorphoseStatus.Handle; break; case MetamorphoseStatus.Handle: HandleImage.Metamorphose(dropdownMeta.ScrollbarHandleRectMeta, dropdownMeta.ScrollbarHandleImageMeta); dropdownMeta = null; dropdownRectMeta = null; metamorphoseStatus = MetamorphoseStatus.Dropdown; MetamorphoseStage = LegoMetamorphoseStage.Completed; break; default: throw new ArgumentOutOfRangeException(); } }
protected void btnGenerateLabels_Click(object sender, EventArgs e) { if (IsValid) { DateTime currentTime = DateTime.UtcNow.AddHours(10); // Australian time string relativePath = "~/files/temp/Labels-" + DateTime.Now.ToString("MMddyy") + ".pdf"; string path = Server.MapPath(relativePath); User user = new DataModelEntities().Users.First(u => u.User_Code == UserKey); string lastBuyerID = string.Empty; int count = 1; foreach (RepeaterItem item in rptParcelItems.Items) { if (((CheckBox)item.FindControl("chkSelect")).Checked == true) { string isIncomplete = ((HtmlInputHidden)item.FindControl("hfIsIncomplete")).Value; if (isIncomplete.ToLower() == "true") { continue; } string itemID = ((HiddenField)item.FindControl("hfItemID")).Value; string transactionId = ((HiddenField)item.FindControl("hfTransactionID")).Value; string customLabel = ((HiddenField)item.FindControl("hfCustomLabel")).Value; string customLabelText = ((Label)item.FindControl("lblCustomLabel")).Text; string itemName = ((Label)item.FindControl("lblItemName")).Text; string state = ((HiddenField)item.FindControl("hfState")).Value; string street = ((HtmlInputHidden)item.FindControl("hfStreet")).Value; string street2 = ((HtmlInputHidden)item.FindControl("hfStreet2")).Value; string street3 = ((HtmlInputHidden)item.FindControl("hfStreet3")).Value; string city = ((HtmlInputHidden)item.FindControl("hfCity")).Value; string postalCode = ((HtmlInputHidden)item.FindControl("hfPostalCode")).Value; string country = ((HiddenField)item.FindControl("hfCountry")).Value; string phone = ((HiddenField)item.FindControl("hfPhone")).Value; string shippingMethod = ((Label)item.FindControl("lblShippingMethod")).Text; string buyerName = ((Label)item.FindControl("lblBuyerName")).Text; string buyerId = ((Label)item.FindControl("lblBuyerID")).Text; string quantity = ((Label)item.FindControl("lblQuantity")).Text; string price = ((HiddenField)item.FindControl("hfPrice")).Value; string currency = ((HiddenField)item.FindControl("hfCurrency")).Value; string shippingCost = ((HiddenField)item.FindControl("hfShippingCost")).Value; string saleRecordId = ((HiddenField)item.FindControl("hfSaleRecordId")).Value; ItemLabel label = new ItemLabel(); ItemLabel sameLabel = labels.FirstOrDefault(i => i.BuyerId == buyerId); if (sameLabel == null) { label.Client_Name = buyerName; label.BuyerId = buyerId; label.City = city; label.State = state; label.Custom_Label = customLabel; label.PostalCode = postalCode; label.Record_Number = saleRecordId; label.Street = street2; label.Street2 = street3; labels.Add(label); } count++; } } GenerateLabel_Doc(path); pnlOutput.Visible = true; hplProcessedFile.Text = "Labels File Link"; hplProcessedFile.NavigateUrl = relativePath; } }