private void Start()
    {
        _animationRectTransform = _bigAniBar.GetComponent <RectTransform>();

        _thisAniBar = this.gameObject;
        //_thisAniBar.transform.localPosition = new Vector3(0, 0, 0); //부모를 지정해둔 뒤 위치를 새로 지정
        _timeScript = GameObject.Find("Controllers").transform.Find("SchedulerController").GetComponent <TimeController>();
        _time       = _timeScript._time;

        InfoUpdate();

        _toeTransform    = _item.item3d.GetComponent <Transform>().GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0); //발가락 오브젝트 담음
        _pelvisTransform = _item.item3d.GetComponent <Transform>().GetChild(0).GetChild(1);                                                             //골반 오브젝트 담음

        _itemListControl = GameObject.Find("Controllers").transform.Find("ItemController").GetComponent <ItemListControl>();
    }
Example #2
0
 public void AddLine()
 {
     ItemListControl.AddLine(new CustomScrollbarTableLayoutPanel.Item
     {
         Amount   = 100.45m,
         Name     = "Monster energy drink",
         Quantity = 2
     });
     ItemListControl.AddLine(new CustomScrollbarTableLayoutPanel.Item
     {
         Amount   = 4.5m,
         Name     = "Radenska kraljevi vrelec",
         Quantity = 5
     });
     ItemListControl.AddLine(new CustomScrollbarTableLayoutPanel.Item
     {
         Amount   = 10000.45m,
         Name     = "Radenska kraljevi vrelec Radenska kraljevi vrelec",
         Quantity = 10000
     });
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     HideSwitch       = true; //처음시작할땐 숨김기능이 On
     _itemListControl = GameObject.Find("ItemController").GetComponent <ItemListControl>();
 }
 public void SetupFixture()
 {
     _inbox = new ItemListControl();
     _window = new MainWindow(_inbox, new ItemListControl());
     _window.Show();
 }
 private void Start()
 {
     _itemListControl = GameObject.Find("ItemController").GetComponent <ItemListControl>();
 }
        private static FrameworkElement ExtractList(DisplayOption option)
        {
            var drop = new Expander {
                Margin = new Thickness(5), Header = option.ReadableName
            };

            var listType = option.PropertyType.GetGenericArguments()[0];

            FrameworkElement ctrl;

            if (listType == typeof(Item) ||
                listType == typeof(Attribute) ||
                listType == typeof(VillagerRecipe) ||
                listType == typeof(PotionEffect) ||
                listType == typeof(BookPage) ||
                listType == typeof(Enchantment) ||
                listType == typeof(MapDecoration) ||
                listType == typeof(BlockType) ||
                listType == typeof(BannerPattern) ||
                listType == typeof(JsonTextElement))
            {
                if (!option.FixedSize || (option.Minimum == null || option.Maximum == null))
                {
                    var sPanel = new ItemListControl
                    {
                        SlotDescription  = { Text = option.Description },
                        AddRemoveButtons = { Visibility = option.FixedSize ? Visibility.Collapsed : Visibility.Visible }
                    };
                    sPanel.SetBinding(FrameworkElement.DataContextProperty, new Binding(option.PropertyName));
                    ctrl = sPanel;
                }
                else
                {
                    var invGrid = new InventoryControl
                    {
                        InvWidth            = (int)option.Minimum,
                        InvHeight           = (int)option.Maximum,
                        HorizontalAlignment = HorizontalAlignment.Center
                    };
                    invGrid.SetBinding(FrameworkElement.DataContextProperty, new Binding(option.PropertyName));

                    ctrl = invGrid;
                }
            }
            else
            {
                // ReSharper disable once UseObjectOrCollectionInitializer
                var ctrl2 = new DataGrid
                {
                    Margin = new Thickness(3),
                    AutoGenerateColumns = true,
                    CanUserAddRows      = !option.FixedSize,
                    MinHeight           = 50
                };

                ctrl2.AutoGeneratingColumn += (sender1, e1) =>
                {
                    var displayName = PropertyHelpers.GetPropertyDisplayName(e1.PropertyDescriptor);
                    if (e1.PropertyType == typeof(string))
                    {
                        ((DataGridTextColumn)e1.Column).EditingElementStyle = (Style)Application.Current.Resources["DataGridTextColumnStyle"];
                    }

                    if (!string.IsNullOrEmpty(displayName))
                    {
                        e1.Column.Header = displayName;
                    }
                    else
                    {
                        e1.Cancel = true;
                    }
                };

                if (option.DataGridRowHeaderPath != null)
                {
                    var rowHeaderStyle = new Style(typeof(DataGridRowHeader));
                    rowHeaderStyle.Setters.Add(new Setter(ContentControl.ContentProperty, new Binding(option.DataGridRowHeaderPath)));
                    ctrl2.RowHeaderStyle = rowHeaderStyle;
                }
                ctrl2.Margin = new Thickness(15, 0, 0, 0);
                ctrl         = ctrl2;
                ctrl.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(option.PropertyName));
            }


            drop.Content = ctrl;
            drop.SetValue(Grid.ColumnSpanProperty, 2);
            return(drop);
        }