Ejemplo n.º 1
0
        private void treeView_ScanDir_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            //open node contents and display to main text box
            try
            {
                //call helper to set working file path
                var f = getFullPathFromTreeViewNode(e.Node.FullPath);
                if (f != null)
                {
                    UIVars.SetWorkingFilePath(f + e.Node.FullPath);

                    //set the text box contents
                    richTextBox_main.Text = File.ReadAllText(UIVars.GetWorkingFilePath());
                    richTextBox_output.AppendText("Displaying contents for: " + UIVars.WorkingFileName + "\n");
                }
                else
                {
                    //was null show message
                    richTextBox_output.AppendText(e.Node + ": is not a file.\n");
                }
            }
            catch (Exception ex)
            {
                //TODO: Add Logging
                richTextBox_error.Text = "Error opening: " + e.Node.FullPath + " " + ex.Message;
            }
        }
Ejemplo n.º 2
0
        public uint GetUIVar(UIVars uiVar)
        {
            if (uiVar >= UIVars.Max)
            {
                return(0);
            }

            return(pd.Read <uint>(D2Client.pUiVars + (uint)uiVar * 4));
        }
Ejemplo n.º 3
0
 void Awake()
 {
     fields = this.GetComponent <UIVars>();
     items  = this.GetComponent <UIShopItemField>();
     if (fields == null)
     {
         throw new System.Exception("ERROR: UIVars script not attached to " + this.name.ToString());
     }
     if (items == null)
     {
         throw new System.Exception("ERROR: UIShopItemField script not attached to " + this.name.ToString());
     }
 }
Ejemplo n.º 4
0
        public void SetUIVar(UIVars uiVar, uint value)
        {
            if (uiVar >= UIVars.Max)
            {
                return;
            }

            pd.Call(D2Client.SetUiVar,
                    MagicConvention.FastCall,
                    (uint)uiVar,
                    value,
                    0);
        }
Ejemplo n.º 5
0
        private void treeView_scan_results_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            try
            {
                if (e.Node.FullPath.Contains("ID: "))
                {
                    string[] sa = Regex.Split(e.Node.FullPath, "ID: ");
                    string   s  = sa[1];

                    string[] sa1 = s.Split('\\');
                    var      id  = sa1[0];
                    richTextBox_output.Text = "";

                    ScanResult    sr = GetScanResult(id);
                    StringBuilder sb = new StringBuilder();
                    sb.AppendFormat("Selected Details for:\nID: {0}\n", sr.ID);
                    sb.AppendFormat("Scanner: {0}\n", sr.ScannerName);
                    sb.AppendFormat("Found in: {0}\n", sr.FilePath);
                    sb.AppendFormat("Line: {0}\n", sr.LineNumber);
                    sb.AppendFormat("Pattern Used: {0}\n", sr.PatternUsed);
                    richTextBox_output.Text = sb.ToString();

                    //set main out
                    workingFilePath = sr.FilePath;
                    UIVars.SetWorkingFilePath(sr.FilePath);
                    richTextBox_main.Text = File.ReadAllText(sr.FilePath);
                    //highlight the text
                    getMatch(sr.PatternUsed);
                    textDetailUpdate();

                    tabControl_Panel_main_bottom.SelectedIndex = 2;
                }
            }
            catch (Exception ex)
            {
                richTextBox_error.Text = ex.Message;
            }
        }
Ejemplo n.º 6
0
    public void  CreateSlots()
    {
        UISlot = new UIVars[MaxItems];

        for (int i = 0; i < MaxItems; i++)
        {
            UISlot[i] = new UIVars();
        }

        float X = Slot.EmptySlot.GetComponent <RectTransform>().localPosition.x;
        float Y = Slot.EmptySlot.GetComponent <RectTransform>().localPosition.y;

        Slot.EmptySlot.name    = "EmptySlot";
        Slot.Icon.name         = "Icon";
        Slot.Textfield.name    = "Name";
        Slot.CurrencyIcon.name = "CurrencyIcon";
        Slot.PriceText.name    = "Price";

        int CurrentSlotsInRow = 0;
        int SlotsCount        = 0;

        for (int i = 0; i < MaxItems; i++)        //Starting a loop in the slots of the bag.
        {
            GameObject ItemSlot = Instantiate(Slot.EmptySlot.gameObject) as GameObject;

            UISlot[i].EmptySlot = ItemSlot.GetComponent <Image>();
            for (int j = 0; j < UISlot[i].EmptySlot.transform.childCount; j++)
            {
                switch (UISlot[i].EmptySlot.transform.GetChild(j).gameObject.name)
                {
                case "Icon":
                    UISlot[i].Icon = UISlot[i].EmptySlot.transform.GetChild(j).gameObject.GetComponent <Image>();
                    break;

                case "Name":
                    UISlot[i].Textfield = UISlot[i].EmptySlot.transform.GetChild(j).gameObject.GetComponent <Text>();
                    break;

                case "CurrencyIcon":
                    UISlot[i].CurrencyIcon = UISlot[i].EmptySlot.transform.GetChild(j).gameObject.GetComponent <Image>();
                    break;

                case "Price":
                    UISlot[i].PriceText = UISlot[i].EmptySlot.transform.GetChild(j).gameObject.GetComponent <Text>();
                    break;
                }
            }


            ItemSlot.transform.SetParent(Panel.transform, false);

            ItemSlot.GetComponent <RectTransform>().localPosition = new Vector3(X, Y, 0);

            X += ItemSlot.GetComponent <RectTransform>().rect.width + SlotsHorizontalSpacing;
            CurrentSlotsInRow++;

            if (CurrentSlotsInRow == SlotsPerRow)
            {
                X  = Slot.EmptySlot.GetComponent <RectTransform>().localPosition.x;
                Y -= ItemSlot.GetComponent <RectTransform>().rect.height + SlotsVerticalSpacing;

                CurrentSlotsInRow = 0;
            }

            ItemSlot.gameObject.SetActive(true);

            ItemSlot.transform.localScale = Slot.EmptySlot.transform.localScale;
        }

        Destroy(Slot.EmptySlot.gameObject);
    }
Ejemplo n.º 7
0
 //scan file
 private void textToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     scanFile(UIVars.GetWorkingFilePath());
 }