public void Execute() { var client = Logic.Logic.objClient; if (client.ReadyToUse != false) { var items = client.Inventory.GetItems(); ListViewItem listViewItem; ItemsListView.Items.Clear(); var sum = 0; foreach (var item in items) { if (item.Count < 1 || !canUseHere(item.ItemId)) { continue; // lest go to next item } listViewItem = new ListViewItem(); listViewItem.Tag = item; listViewItem.Text = ItemsPanel.getItemName(item.ItemId); listViewItem.ImageKey = item.ItemId.ToString().Replace("Item", ""); listViewItem.SubItems.Add("" + item.Count); sum += item.Count; listViewItem.SubItems.Add("" + item.Unseen); listViewItem.SubItems.Add("" + (int)item.ItemId); ItemsListView.Items.Add(listViewItem); } } }
public void Update() { if (ItemsPanel != null) { ItemsPanel.UpdateSize(PrintModel.GlyphSize); } }
public FFXEditor(bool fileMode = false) { InitializeComponent(); if (fileMode) { // Set up window for file mode } else { // Set up window for process mode GameMemory.ProcessExited += Close; _generalPanel = new GeneralPanel(); _partyPanel = new PartyPanel(); _aeonsPanel = new AeonsPanel(); _itemsPanel = new ItemsPanel(); _sphereGridPanel = new SphereGridPanel(); _equipmentPanel = new EquipmentPanel(); _blitzballPanel = new BlitzballPanel(); _monsterArenaPanel = new MonsterArenaPanel(); _debugPanel = new DebugPanel(); _battlePanel = new BattlePanel(); _boostersPanel = new BoostersPanel(); } // Set up general window parameters _skillEditorPanel = new SkillEditorPanel(); (EditorTree.Items[0] as TreeViewItem).IsSelected = true; }
void RenderPaneTemplate(RenderContext context) { if (ItemsPanel == null) { return; } if (!(ItemsPanel is DataGrid)) { throw new XamlException("Only DataGrid panel is supported"); } var dg = ItemsPanel as DataGrid; var tml = new TagBuilder("template"); tml.MergeAttribute("slot", "pane"); tml.MergeAttribute("slot-scope", "root"); tml.RenderStart(context); using (var ctx = new ScopeContext(context, "itm", null)) { ItemsPanel.RenderElement(context, (tag) => { tag.MergeAttribute(":is-item-active", "root.isItemActive"); tag.MergeAttribute(":hit-item", "root.hit"); tag.MergeAttribute(":items-source", "root.items"); if (ListSize != null && !ListSize.Height.IsEmpty && dg.FixedHeader) { // for fixed headers only tag.MergeStyle("height", ListSize.Height.ToString()); tag.MergeStyle("max-height", ListSize.Height.ToString()); } }); } tml.RenderEnd(context); }
private void ToggleAsDefault() { SingletonManager <StyleTemplateManager> .Instance.ToggleAsDefaultTemplate(EditObject); ItemsPanel.RefreshItems(); HeaderPanel.Refresh(); }
protected void AttachToItemsPanel() { currentItemsPanel = (Panel)ItemsPanel.LoadContent(); currentItemsPanel.IsItemsHost = false; if (currentItemsPanel is ViewportHostPanel) { var viewportItemsPanel = (ViewportHostPanel)currentItemsPanel; viewportItemsPanel.IsMarkersHost = true; viewportItemsPanel.ContentBoundsChanged += viewportItemsPanel_ContentBoundsChanged; if (currentItemsPanel == null) { throw new ArgumentNullException("ItemsPanel"); } Content = viewportItemsPanel.HostingCanvas; if (plotter != null) { viewportItemsPanel.OnPlotterAttached(plotter); } } else { Content = currentItemsPanel; } }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> private void CreatePanel() { ClearVisualChildren(); Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); if (!Panel.IsSet(KeyboardNavigation.DirectionalNavigationProperty)) { KeyboardNavigation.SetDirectionalNavigation( (InputElement)Panel, KeyboardNavigationMode.Contained); } AddVisualChild(Panel); var logicalHost = this.FindReparentingHost(); if (logicalHost != null) { ((IReparentingControl)Panel).ReparentLogicalChildren( logicalHost, logicalHost.LogicalChildren); } KeyboardNavigation.SetTabNavigation( (InputElement)Panel, KeyboardNavigation.GetTabNavigation(this)); _createdPanel = true; CreateItemsAndListenForChanges(Items); }
protected void AttachToItemsPanel() { currentItemsPanel = (Panel)ItemsPanel.LoadContent(); currentItemsPanel.IsItemsHost = false; var notifyingChildren = currentItemsPanel.Children as INotifyCollectionChanged; if (notifyingChildren != null) { notifyingChildren.CollectionChanged += OnItemsCollectionChanged; } if (currentItemsPanel is ViewportHostPanel) { var viewportItemsPanel = (ViewportHostPanel)currentItemsPanel; viewportItemsPanel.IsMarkersHost = true; viewportItemsPanel.ContentBoundsChanged += viewportItemsPanel_ContentBoundsChanged; this.Content = viewportItemsPanel.HostingCanvas; if (plotter != null) { viewportItemsPanel.OnPlotterAttached(plotter); } } else { this.Content = currentItemsPanel; } }
public void EnableMinionPanel() { MinionPanel.SetActive(true); PlayerPanel.SetActive(false); ItemsPanel.SetActive(false); QuestPanel.SetActive(false); }
private EditableGroupType AddGroup(GroupType groupType) { var group = ItemsPanel.AddUIComponent <EditableGroupType>(); group.Init(groupType, GroupName(groupType)); group.width = ItemsPanel.width; Groups[groupType] = group; return(group); }
protected override Vector2 ArrangeOverride(Vector2 finalSize) { if (ItemsPanel != null) { ItemsPanel.Arrange(new BoundingRectangle(finalSize.X, finalSize.Y)); } return(finalSize); }
protected override void OnEndInit() { base.OnEndInit(); if (Style == SelectorStyle.ComboBox && !ShowCaret.HasValue) { ShowCaret = true; } ItemsPanel?.SetParent(this); }
private void ArrangeControls() { BtnDelete.Location = new Point(3, (Height - BtnDelete.Height) / 2); BtnUp.Location = new Point(Width - BtnUp.Width - 3, Height / 2 - BtnUp.Height); BtnDown.Location = new Point(Width - BtnDown.Width - 3, Height / 2); var left = BtnDelete.Right + 3; ItemsPanel.SetBounds(left, 0, BtnUp.Left - left - 3, Height); }
protected override Vector2 MeasureOverride(Vector2 availableSize) { if (ItemsPanel == null) { return(Vector2.Zero); } ItemsPanel.Measure(availableSize); return(ItemsPanel.DesiredSize); }
/// <summary>Disables the custom citizen info panel, if it is enabled.</summary> protected sealed override void DisableCore() { if (scheduleLabel == null) { return; } ItemsPanel.RemoveUIComponent(scheduleLabel); UnityEngine.Object.Destroy(scheduleLabel.gameObject); scheduleLabel = null; }
protected override void OnObjectSelect(IntersectionTemplate editObject) { base.OnObjectSelect(editObject); ItemsPanel.RemovePreview(); Screenshot = ComponentPool.Get <PropertyGroupPanel>(ContentPanel.Content, nameof(Screenshot)); var info = ComponentPool.Get <IntersectionTemplateInfoProperty>(Screenshot, "Info"); info.Init(EditObject); }
protected override void DisableCore() { foreach (var button in createdButtons) { button.eventClick -= AdditionalButtonClick; ItemsPanel.RemoveUIComponent(button); UnityEngine.Object.Destroy(button); } createdButtons.Clear(); additionalButtons.Clear(); }
// The Panel is not ready during ApplyTemplate of the RibbonGallerryCategory, so it should be queried at later time. private void OnItemContainerGeneratorStatusChanged(object sender, EventArgs e) { if (ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated) { SynchronizeWithCurrentItem(); if (_itemsPresenter != null) { ItemsHostSite = (Panel)(ItemsPanel.FindName(RibbonGalleryCategory.ItemsHostPanelName, _itemsPresenter)); } } }
/// <summary> /// Creates the <see cref="Panel"/>. /// </summary> private void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); _createdPanel = true; var task = MoveToPage(-1, SelectedIndex); }
public MainDashboard(String userRole, String userName, int userID) { InitializeComponent(); if (userRole == "Cashier") { ItemsPanel.Hide(); CashierPanel.Hide(); BillsPanel.Hide(); CustomerPanel.Hide(); TransactionPanel.Hide(); } /*userNameLabel.Text = userName; * userIDLabel.Text = userID.ToString();*/ }
public void ShowItems() { currentPanel = Panels.Items; MenuPanel.SetActive(false); WeaponsPanel.SetActive(false); ItemsPanel.SetActive(true); AbilitiesPanel.SetActive(false); MenuButton.GetComponent <Image>().color = new Color(0.4117647f, 0.3882353f, 0.6196079f); WeaponsButton.GetComponent <Image>().color = new Color(0.4117647f, 0.3882353f, 0.6196079f); ItemsButton.GetComponent <Image>().color = new Color(0.2638712f, 0.2509804f, 0.3882353f); AbilitiesButton.GetComponent <Image>().color = new Color(0.4117647f, 0.3882353f, 0.6196079f); playerStats.SetupItemUIs(ItemsList); }
private void FindAssets(ContentFolder folder) { for (int i = 0; i < folder.Children.Count; i++) { if (folder.Children[i] is AssetItem asset && _isValid(asset)) { var item = new AssetItemView(asset); ItemsPanel.AddChild(item); } } for (int i = 0; i < folder.Children.Count; i++) { if (folder.Children[i] is ContentFolder child) { FindAssets(child); } } }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> private void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); _createdPanel = true; if (!IsHosted && _itemsSubscription == null && Items is INotifyCollectionChanged incc) { _itemsSubscription = incc.WeakSubscribe(ItemsCollectionChanged); } PanelCreated(Panel); }
/// <summary> /// Creates the <see cref="Panel"/>. /// </summary> private void CreatePanel() { var logicalHost = this.FindReparentingHost(); ClearVisualChildren(); Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); AddVisualChild(Panel); if (logicalHost != null) { ((IReparentingControl)Panel).ReparentLogicalChildren( logicalHost, logicalHost.LogicalChildren); } _createdPanel = true; var task = MoveToPage(-1, SelectedIndex); }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> protected virtual void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); _createdPanel = true; INotifyCollectionChanged incc = Items as INotifyCollectionChanged; if (incc != null) { incc.CollectionChanged += ItemsCollectionChanged; } ItemsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> private void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); if (!Panel.IsSet(KeyboardNavigation.DirectionalNavigationProperty)) { KeyboardNavigation.SetDirectionalNavigation( (InputElement)Panel, KeyboardNavigationMode.Contained); } LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); KeyboardNavigation.SetTabNavigation( (InputElement)Panel, KeyboardNavigation.GetTabNavigation(this)); _createdPanel = true; CreateItemsAndListenForChanges(Items); }
public override void ScrollTo(EditableItemType item) { ItemsPanel.ScrollToBottom(); ItemsPanel.ScrollIntoViewRecursive(item); }
private void ToggleAsDefault() { TemplateManager.StyleManager.ToggleAsDefaultTemplate(EditObject); ItemsPanel.RefreshItems(); HeaderPanel.Init(EditObject); }
public override void OnDispose() { base.OnDispose(); ItemsPanel?.OnDispose(); }
public override void OnSetStyles() { base.OnSetStyles(); ItemsPanel?.OnSetStyles(); }