Ejemplo n.º 1
0
    void Awake()
    {
        optionListUI  = OptionListUI.GetInstance();
        rectTransform = GetComponent <RectTransform>();
        cardCubeList  = new List <GameObject>();
        if (!isCover)
        {
            cardCubeDic = new Dictionary <GameObject, string>();
        }

        deckNumText  = transform.FindChild("Text").GetComponent <Text>();
        rawImage     = GetComponent <RawImage>();
        coverTexture = Resources.Load("Prefebs/cover") as Texture;
        if (isMine)
        {
            cardCube = Resources.Load("Prefebs/cardCube") as GameObject;
        }
        else
        {
            cardCube = Resources.Load("Prefebs/cardCube_Small") as GameObject;
        }
        cardNum = 0;
        Transform theAct = transform.FindChild("ActImage");

        if (theAct != null)
        {
            actImage = theAct.GetComponent <ActImage>();
            actImage.gameObject.SetActive(false);
        }

        UpdateText();
    }
Ejemplo n.º 2
0
 /// <summary>Processes raw data to populate the resource</summary>
 /// <param name="raw">Raw byte data</param>
 /// <param name="containsHeader">Whether or not <i>raw</i> contains the resource Header information</param>
 /// <exception cref="ArgumentException">Header-defined <see cref="Type"/> is not <see cref="Resource.ResourceType.Xact"/></exception>
 public override void DecodeResource(byte[] raw, bool containsHeader)
 {
     _decodeResource(raw, containsHeader);
     if (_type != ResourceType.Xact)
     {
         throw new ArgumentException("Raw header is not for a Xact resource");
     }
     _act = new ActImage(_rawData);
 }
Ejemplo n.º 3
0
 private void cmdCopy_Click(object sender, EventArgs e)
 {
     if (_image == null)
     {
         try { _image = new ActImage((Bitmap)pctImport.BackgroundImage); }
         catch (Exception x)
         {
             _image = null;
             Text   = "X-wing series ACT Editor";
             pnlNavigation.Enabled  = false;
             pnlColors.Enabled      = false;
             lblFrame.Text          = "Frame 0 of 0";
             grpImage.Enabled       = false;
             grpFrame.Enabled       = false;
             pctAct.BackgroundImage = null;
             cmdExport.Enabled      = false;
             MessageBox.Show(x.Message);
             return;
         }
         LoadFile();
         txtFile.Text = _image.FilePath;
     }
     else
     {
         _image.Frames[_frame].Image = (Bitmap)pctImport.BackgroundImage;
         lblHeight.Text = _image.Height.ToString();
         lblWidth.Text  = _image.Width.ToString();
         if (chkAutoCenter.Checked)
         {
             if (_image.NumberOfFrames == 1)
             {
                 _loading           = true;
                 numCenterX.Maximum = _image.Width - 1;
                 numCenterY.Maximum = _image.Height - 1;
                 numCenterX.Value   = _image.Width / 2;
                 numCenterY.Value   = _image.Height / 2;
                 _loading           = false;
                 ChangeCenter();
             }
             _image.Frames[0].X = -_image.Frames[0].Width / 2;
             _image.Frames[0].Y = -_image.Frames[0].Height / 2;
         }
         UpdateView();
     }
     if (!Text.Contains("*"))
     {
         Text += "*";
     }
 }
Ejemplo n.º 4
0
        private void checkBoxBlue_CheckedChanged(object sender, EventArgs e)
        {
            if (!UsingColPenNow)
            {
                changeData();
            }

            BlueEditor.Enabled = checkBoxBlue.Checked;
            if (BlueEditor.Enabled)
            {
                curImage = ActImage.blue;
                changeImage();
            }
            ColorPic.Invalidate();
        }
Ejemplo n.º 5
0
        private void checkBoxGreen_CheckedChanged(object sender, EventArgs e)
        {
            if (!UsingColPenNow)
            {
                changeData();
            }

            GreenEditor.Enabled = checkBoxGreen.Checked;
            if (GreenEditor.Enabled)
            {
                curImage = ActImage.green;
                changeImage();
            }
            ColorPic.Invalidate();
        }
Ejemplo n.º 6
0
        private void checkBoxRed_CheckedChanged(object sender, EventArgs e)
        {
            if (!UsingColPenNow)
            {
                changeData();
            }

            RedEditor.Enabled = checkBoxRed.Checked;
            if (RedEditor.Enabled)
            {
                curImage = ActImage.red;
                changeImage();
            }
            ColorPic.Invalidate();
        }
Ejemplo n.º 7
0
 private void opnAct_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
 {
     txtFile.Text = opnAct.FileName;
     try { _image = new ActImage(txtFile.Text); }
     catch (Exception x)
     {
         _image = null;
         Text   = "X-wing series ACT Editor";
         pnlNavigation.Enabled  = false;
         pnlColors.Enabled      = false;
         lblFrame.Text          = "Frame 0 of 0";
         grpImage.Enabled       = false;
         grpFrame.Enabled       = false;
         pctAct.BackgroundImage = null;
         cmdExport.Enabled      = false;
         System.Diagnostics.Debug.WriteLine(x.StackTrace);
         MessageBox.Show(x.Message);
         return;
     }
     LoadFile();
 }