Example #1
0
        public void Draw()
        {
            GUILayout.BeginHorizontal();
            if (GUILayout.Button(_sellOrDiscard))
            {
                sellPart();
            }
            if (_moduleVM.GetModules().Count > 0 && GUILayout.Button("Modules"))
            {
                //show module window
                _moduleUI = ScrapYard.Instance.InstanceModulesUI;
                _moduleUI.SetUp(_moduleVM);
                _moduleUI.Show();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Select"))
            {
                selectPart(null);
            }
            if (_toApply != null && GUILayout.Button("Apply"))
            {
                selectPart(_toApply);
            }
            GUILayout.EndHorizontal();
        }
Example #2
0
        public override void Draw(int windowID)
        {
            if (!HighLogic.LoadedSceneIsEditor || _viewModel == null)
            {
                Close();
                return;
            }

            //show a list of all modules on the part on the left
            //click a module and see the confignode of it (or maybe just the differences from default?)

            //split into two parts, a smaller left and a larger right
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical(GUILayout.Width(200));
            if (GUILayout.Button("Close"))
            {
                Close();
            }
            moduleListScroll = GUILayout.BeginScrollView(moduleListScroll);

            _viewModel.SelectedGridItem = GUILayout.SelectionGrid(_viewModel.SelectedGridItem, _viewModel.GetModules().Select(m => m.Name).ToArray(), 1);

            GUILayout.EndScrollView();
            GUILayout.EndVertical();

            GUILayout.BeginVertical();
            moduleDisplayedScroll = GUILayout.BeginScrollView(moduleDisplayedScroll);
            if (_viewModel.DisplayedModule != null)
            {
                GUILayout.TextArea(_viewModel.DisplayedModule.ToString());
            }
            GUILayout.EndScrollView();
            GUILayout.EndVertical();

            GUILayout.EndHorizontal();

            base.Draw(windowID);
        }