void Start()
        {
            Collider = GetComponent <Collider>();

            query        = FindObjectOfType <BoxQuery>();
            message      = FindObjectOfType <BoxMessage>();
            connectivity = FindObjectOfType <ConnectivityBox>();
        }
Example #2
0
        private void ShowBoxMessage(string xTitle, string xMsg)
        {
            BoxMessage b = new BoxMessage();

            b.SetTitle = xTitle;
            b.SetMsg   = xMsg;
            b.ShowDialog();
        }
Example #3
0
        public BoxServerForm(BoxMessage message)
        {
            InitializeComponent();

            Pandora.Localization.LocalizeControl(this);

            m_Message = message;
            m_Login   = false;
        }
Example #4
0
        private void bAreaRun_Click(object sender, EventArgs e)
        {
            if (!EnsureConditions())
            {
                return;
            }

            if (cmbMap.SelectedIndex == -1)
            {
                MessageBox.Show(Pandora.Localization.TextProvider["Random.NoMap"]);
                return;
            }

            var tileset = cmbTileSet.SelectedItem as RandomTilesList;

            var hues = cmbHues.SelectedItem as HuesCollection;

            var x1 = Math.Min((int)n1X.Value, (int)n2X.Value);
            var x2 = Math.Max((int)n1X.Value, (int)n2X.Value);
            var y1 = Math.Min((int)n1Y.Value, (int)n2Y.Value);
            var y2 = Math.Max((int)n1Y.Value, (int)n2Y.Value);

            var rect = new Rectangle(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
            var fill = slideFill.Value / 100d;

            var map = Pandora.Profile.Travel.GetRealMapIndex(cmbMap.SelectedIndex);

            var rnd = new RandomRectangle(tileset, rect, fill, map);

            if (rNoHue.Checked)
            {
                rnd.Hue = 0;
            }
            else if (rSelectedHue.Checked)
            {
                rnd.Hue = Pandora.Profile.Hues.SelectedIndex;
            }
            else
            {
                rnd.RandomHues = hues;
            }

            if (chkZ.Checked)
            {
                rnd.Z = (int)numZ.Value;
            }

            BoxMessage msg = rnd.CreateMessage();

            Pandora.BoxConnection.SendToServer(msg);
        }
Example #5
0
        /// <summary>
        /// Connects to the BoxServer and retrieves folder information
        /// </summary>
        /// <returns></returns>
        public bool GetFolderInfo()
        {
            TheBox.BoxServer.ExplorerRequest msg = new ExplorerRequest();

            BoxMessage result = Pandora.BoxConnection.SendToServer(msg);

            m_Info = result as FolderInfo;

            if (m_Info != null)
            {
                DoTree();
            }

            return(m_Info != null);
        }
Example #6
0
        /// <summary>
        /// Refresh the information on the server
        /// </summary>
        private void RefreshInfo()
        {
            TheBox.BoxServer.ExplorerRequest msg = new ExplorerRequest();

            BoxMessage result = Pandora.BoxConnection.SendToServer(msg);

            m_Info = result as FolderInfo;

            if (m_Info != null)
            {
                DoTree();
            }
            else
            {
                Close();
            }

//			Pandora.Profile.Server.FillBoxMessage( msg );
//
//			BoxServerForm form = new BoxServerForm( msg );
//
//			if ( form.ShowDialog() == DialogResult.OK )
//			{
//				m_Info = form.Response as FolderInfo;
//
//				if ( m_Info != null )
//				{
//					DoTree();
//				}
//				else
//				{
//					Close();
//				}
//			}
//			else
//			{
//				Close();
//			}
        }
Example #7
0
        private void SendMessage(object o)
        {
            BoxMessage result = Pandora.BoxConnection.ProcessMessage(m_Message);

            if (result != null)
            {
                if (Pandora.BoxConnection.CheckErrors(result))
                {
                    DialogResult = DialogResult.OK;
                    m_Response   = result;
                }
                else
                {
                    DialogResult = DialogResult.Cancel;
                }
            }

            if (!Pandora.BoxConnection.Connected)
            {
                DialogResult = DialogResult.Cancel;                 // Account for communication error
            }
            Close();
        }
Example #8
0
 /// <summary>
 ///     Sets the correct username and password for an outgoing BoxMessage
 /// </summary>
 /// <param name="msg">The BoxMessage that needs authentication values set</param>
 public void FillBoxMessage(BoxMessage msg)
 {
     msg.Username = m_Username;
     msg.Password = m_Password;
 }