Esempio n. 1
0
        public override void OnFinishResize(RectTransform panel)
        {
            base.OnFinishResize(panel);

            InspectorManager.PanelWidth = this.Rect.rect.width;
            InspectorManager.OnPanelResized(panel.rect.width);
        }
        public override void CreateInspector(InspectorManager inspector)
        {
            //_inspectorViewModel = new InspectorViewModel();

            //_inspectorWindow = new InspectorWindow { DataContext = _inspectorViewModel, Padding = _windowPadding };

            //_inspectorUI = new InspectorUI(_inspectorWindow, _inspectorViewModel);

            //var inspectorTemplate = new DataTemplate(typeof(InspectorWindowViewModel), parent =>
            //{
            //    _inspectorWindow.Parent = parent;
            //    return _inspectorWindow;
            //});
            //_gearsetUI.Resources.Add(inspectorTemplate.DataTemplateKey, inspectorTemplate);

            //_inspectorViewModel.Top = 25;
            //_inspectorViewModel.Left = 0;
            //_inspectorViewModel.Opacity = 1f;
            //_inspectorViewModel.Width = 400;
            //_inspectorViewModel.Height = 200;

            //_ownedWindowContent.Add(_inspectorViewModel);

            //_widgetWindowViewModel.InspectorWindowVisible = inspector.Config.Visible;
            //SetWindowVisibility(_inspectorViewModel, inspector.Config.Visible);
        }
Esempio n. 3
0
        public void ChangeView(InspectorManager manager, IViewWrapper viewWrapper)
        {
            handleChange = true;

            bool showImage = false;
            bool showFont  = false;
            //NSPopUpButton
            var fontData = manager.Delegate.GetFont(viewWrapper);

            if (fontData?.Font != null)
            {
                var currentFontName = ((NSFont)fontData.Font.NativeObject).FontName;
                if (currentFontName == ".AppleSystemUIFont")
                {
                    currentFontName = "HelveticaNeue";
                }
                var name = fonts.FirstOrDefault(s => s.ToString() == currentFontName);
                fontsCombobox.Select(name);

                fontSizeTextView.IntValue = (int)fontData.Size;
                showFont = true;
            }

            if (viewWrapper.NativeObject is NSImageView || viewWrapper.NativeObject is NSButton)
            {
                showImage = true;
            }

            imageButtonVisible = showImage;
            fontButtonsVisible = showFont;

            handleChange = false;
        }
Esempio n. 4
0
    /// <summary>
    /// Initializiation
    /// </summary>
    private void Start()
    {
        if (Instance != null)
        {
            CustomLogger.Instance.Error(LogMessages.MULTIPLE_INSTANCES);
            return;
        }
        Instance = this;
        Active   = false;
        Cost_Row_Prototype.SetActive(false);
        Upkeep_Row_Prototype.SetActive(false);
        Delta_Row_Prototype.SetActive(false);
        Storage_Row_Prototype.SetActive(false);
        Services_Row_Prototype.SetActive(false);
        cost_rows         = new List <GameObject>();
        upkeep_rows       = new List <GameObject>();
        delta_rows        = new List <GameObject>();
        storage_rows      = new List <GameObject>();
        service_rows      = new List <GameObject>();
        highlighted_tiles = new List <Tile>();
        current_row_id    = 0;

        Button.ButtonClickedEvent click = new Button.ButtonClickedEvent();
        click.AddListener(new UnityAction(Pause));
        Pause_Button.onClick = click;

        Button.ButtonClickedEvent click2 = new Button.ButtonClickedEvent();
        click2.AddListener(new UnityAction(Delete));
        Delete_Button.onClick = click2;

        Button.ButtonClickedEvent click3 = new Button.ButtonClickedEvent();
        click3.AddListener(new UnityAction(Add_Peasant_Worker));
        Worker_Peasant_Plus_Button.onClick = click3;

        Button.ButtonClickedEvent click4 = new Button.ButtonClickedEvent();
        click4.AddListener(new UnityAction(Add_Citizen_Worker));
        Worker_Citizen_Plus_Button.onClick = click4;

        Button.ButtonClickedEvent click5 = new Button.ButtonClickedEvent();
        click5.AddListener(new UnityAction(Add_Noble_Worker));
        Worker_Noble_Plus_Button.onClick = click5;

        Button.ButtonClickedEvent click6 = new Button.ButtonClickedEvent();
        click6.AddListener(new UnityAction(Remove_Peasant_Worker));
        Worker_Peasant_Minus_Button.onClick = click6;

        Button.ButtonClickedEvent click7 = new Button.ButtonClickedEvent();
        click7.AddListener(new UnityAction(Remove_Citizen_Worker));
        Worker_Citizen_Minus_Button.onClick = click7;

        Button.ButtonClickedEvent click8 = new Button.ButtonClickedEvent();
        click8.AddListener(new UnityAction(Remove_Noble_Worker));
        Worker_Noble_Minus_Button.onClick = click8;

        Button.ButtonClickedEvent click9 = new Button.ButtonClickedEvent();
        click9.AddListener(new UnityAction(Show_Settings));
        Settings_Button.onClick = click9;
    }
Esempio n. 5
0
        private void OnCellClicked(int index)
        {
            if (index >= UiInspector.LastHitObjects.Count)
            {
                return;
            }

            InspectorManager.Inspect(UiInspector.LastHitObjects[index]);
        }
Esempio n. 6
0
        private void Awake()
        {
            inspectorManager = inspectorArea.GetComponent <InspectorManager>();
            previewCamera.GetComponent <FlyCameraController>().enabled   = true;
            inspectorCamera.GetComponent <FlyCameraController>().enabled = false;

            materialDatabase = GetComponent <MaterialDatabase>();
            plantDatabase    = GetComponent <PlantDatabase>();
        }
        // UI Listeners

        private void OnGameObjectButtonClicked()
        {
            if (!ComponentRef)
            {
                ExplorerCore.LogWarning("Component reference is null or destroyed!");
                return;
            }

            InspectorManager.Inspect(ComponentRef.gameObject);
        }
Esempio n. 8
0
        private static void InspectClipboard()
        {
            if (Current.IsNullOrDestroyed())
            {
                Notification.ShowMessage("Cannot inspect a null or destroyed object!");
                return;
            }

            InspectorManager.Inspect(Current);
        }
Esempio n. 9
0
        public override void CreateInspector(InspectorManager inspectorManager)
        {
            if (CreateUI == false)
            {
                return;
            }

            InspectorNode.ExtensionMethodTypes.Add(typeof(InspectorExtensionsMethods));

            _inspectorUI = new InspectorUI(inspectorManager.Config, _windows);
        }
Esempio n. 10
0
 private void OnCellClicked(int dataIndex)
 {
     if (m_context == SearchContext.StaticClass)
     {
         InspectorManager.Inspect(currentResults[dataIndex] as Type);
     }
     else
     {
         InspectorManager.Inspect(currentResults[dataIndex]);
     }
 }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Esempio n. 12
0
 /// <summary>
 /// Initializiation
 /// </summary>
 private void Start()
 {
     if (Instance != null)
     {
         CustomLogger.Instance.Error(LogMessages.MULTIPLE_INSTANCES);
         return;
     }
     Instance       = this;
     target         = null;
     default_action = null;
     Active         = false;
 }
Esempio n. 13
0
        private void Start()
        {
            ObjectNameUI.color = Color.clear;

            // toggles this script off
            this.gameObject.GetComponent <Inspector>().enabled = false;

            _manager = GameObject.FindObjectOfType <InspectorManager>();

            var objectTransform = transform;

            _initialPosition = objectTransform.localPosition;
            _initialRotation = objectTransform.localRotation;
        }
Esempio n. 14
0
    // Start is called before the first frame update
    void Awake()
    {
        Instance = this;
        UnityEngine.Events.UnityAction [] actions = new UnityEngine.Events.UnityAction[2];
        actions[0] = () => { SwitchStatsAndActions(true); };
        actions[1] = () => { SwitchStatsAndActions(false); };
        actionsStatsButton.InitActions(actions, 0);
        actions[0].Invoke();

        myPanel.AddActionToButton(new UnityAction(() =>
        {
            if (GameManager.Instance.representationManager.currentRepresentation == GameManager.Instance.representationManager.buildingsRepresentation)
            {
                (GameManager.Instance.representationManager.buildingsRepresentation as MapRepresentation).DeselectAll();
            }
        }));
    }
Esempio n. 15
0
        public void InitializeManager(InspectorContext context, ToolbarService service)
        {
            LoadModules(context);

            var over     = new MacBorderedWindow(CGRect.Empty, NSColor.Green);
            var next     = new MacBorderedWindow(CGRect.Empty, NSColor.Red);
            var previous = new MacBorderedWindow(CGRect.Empty, NSColor.Blue);
            var acc      = new MacAccessibilityWindow(new CGRect(10, 10, 600, 700));
            var ins      = new InspectorWindow(this, new CGRect(10, 10, 600, 700));;
            var tool     = new MacToolbarWindow(this, new CGRect(10, 10, 100, 700));

            tool.ShowToolkit(false);
            var manager = new InspectorManager(this, over, next, previous, acc, ins, tool);

            context.Initialize(manager, false);
            service.SetDelegate(this);
        }
Esempio n. 16
0
        private void DoBind()
        {
            //var predicate = PredicateBuilder.True<SubStatusMaster>();
            List <InspectorMaster> lst = InspectorManager.GetAll();

            if (lst.Count > 0)
            {
                lvData.DataSource = lst;
                lvData.DataBind();
                dvData.Visible   = true;
                PagerRow.Visible = true;
            }
            else
            {
                dvData.Visible   = false;
                PagerRow.Visible = false;
            }
        }
Esempio n. 17
0
 protected void lvData_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     lblError.Text      = string.Empty;
     lblSave.Text       = string.Empty;
     lblMessage.Text    = string.Empty;
     lblMessage.Visible = false;
     lblError.Visible   = false;
     lblSave.Visible    = false;
     if (e.CommandName.Equals("DoEdit"))
     {
         int id = Convert.ToInt32(e.CommandArgument);
         hdId.Value = id.ToString();
         Label lblName = (Label)e.Item.FindControl("lblName");
         txtName.Text = lblName.Text;
     }
     else if (e.CommandName.Equals("DoDelete"))
     {
         // In Case of delete
         try {
             var list = CheckPrimaryValue.CheckPrimaryValueExists(0, 0, 0, 0, 0, Convert.ToInt32(e.CommandArgument), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
             if (list.ToList().Count > 0)
             {
                 lblMessage.Text    = "Inspector is used so you can't delete !!!";
                 lblMessage.Visible = true;
                 return;
             }
             var inspector = InspectorManager.GetById(Convert.ToInt32(e.CommandArgument));
             inspector.Status = false;
             InspectorManager.Save(inspector);
             btnCancel_Click(null, null);
             lblSave.Text    = "Record Deleted Sucessfully.";
             lblSave.Visible = true;
         }
         catch (Exception ex) {
             lblError.Text    = "Record Not Deleted.";
             lblError.Visible = true;
         }
     }
 }
Esempio n. 18
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     lblError.Text      = string.Empty;
     lblError.Visible   = false;
     lblSave.Text       = string.Empty;
     lblSave.Visible    = false;
     lblMessage.Visible = false;
     lblMessage.Text    = string.Empty;
     try {
         using (TransactionScope scope = new TransactionScope()) {
             bool exists = InspectorManager.IsExist(txtName.Text.Trim(), Convert.ToInt32(hdId.Value));
             if (exists)
             {
                 lblMessage.Text    = "Inspector Name already exists.";
                 lblMessage.Visible = true;
                 txtName.Focus();
                 return;
             }
             InspectorMaster inspector = InspectorManager.GetById(Convert.ToInt32(hdId.Value));
             inspector.InspectorName = txtName.Text;
             inspector.Status        = true;
             InspectorManager.Save(inspector);
             saveMsg = hdId.Value == "0" ? "Record Saved Sucessfully." : "Record Updated Sucessfully.";
             btnCancel_Click(null, null);
             lblSave.Text    = saveMsg;
             lblSave.Visible = true;
             scope.Complete();
         }
         //btnCancel_Click(null, null);
         //lblSave.Visible = true;
         //lblSave.Text = "Record Saved Sucessfully.";
     }
     catch (Exception ex) {
         lblError.Visible = true;
         lblError.Text    = "Record Not Saved !!!";
     }
 }
Esempio n. 19
0
 public abstract void CreateInspector(InspectorManager inspectorManager);
Esempio n. 20
0
 public static void Inspect(Type type)
 => InspectorManager.Inspect(type);
Esempio n. 21
0
 public static void Inspect(object obj)
 => InspectorManager.Inspect(obj);
Esempio n. 22
0
 public override void OnSelectMouseInspect()
 {
     InspectorManager.Inspect(lastHitObject);
 }
Esempio n. 23
0
        void _OnRegisterAsset()
        {
            ImporterManager.AddImporter(new ImporterMaterial());

            InspectorManager.RegisterInspector(new InspectorComponent());
        }
Esempio n. 24
0
 public override void CreateInspector(InspectorManager inspectorManager)
 {
 }
Esempio n. 25
0
 protected virtual void InspectClicked()
 {
     InspectorManager.Inspect(Occupant.Value, this.Occupant);
 }
Esempio n. 26
0
 void Awake()
 {
     _main         = this;
     allInspectors = new List <BaseInspectorWindow>();
 }
        //public int HalfWidth => (int)(0.5f * Rect.rect.width) - 75;
        //public int AdjustedKeyWidth => HalfWidth - 50;
        //public int AdjustedRightWidth => HalfWidth;

        private void KeyInspectClicked()
        {
            InspectorManager.Inspect((Occupant as CacheKeyValuePair).DictKey, this.Occupant);
        }
Esempio n. 28
0
 public override void Update()
 {
     InspectorManager.Update();
 }
Esempio n. 29
0
 public void Show()
 {
     InspectorManager.Inspect(proto);
 }
Esempio n. 30
0
 void Awake()
 {
     _InspectorManager = this;
     StartCoroutine("StartAutoStm");
 }