Ejemplo n.º 1
0
 public void Clear()
 {
     CommandList.Items.Clear();
     FileName = "";
     CommandListBox.Items.Clear();
     ScreenObj.Clear();
 }
Ejemplo n.º 2
0
        private void BuildPixels()
        {
            mainQuest = new Pixel
            {
                Color = Color.FromArgb(255, 255, 255, 255),

                Point = new Point(125, 250)
            };

            //used in conjunctizon with timer to click main quest if no movement has been detected
            movePixel = new Pixel
            {
                Color = ScreenObj.GetColor(Screen, 230, 490),

                Point = new Point(230, 490)
            };

            //the blue arrow that is present during early game main quests, lots of bugs in early quests
            blueArrow[0] = new Pixel
            {           /*Condition*/                       /*MEmu Color*/                       /*Original Color*/
                Color = (ScreenObj.Emu == Emulator.MEmu) ? Color.FromArgb(255, 123, 123, 123) : Color.FromArgb(255, 54, 103, 123),

                Point = new Point(282, 243)
            };
            blueArrow[1] = new Pixel
            {           /*Condition*/                       /*MEmu Color*/                       /*Original Color*/
                Color = (ScreenObj.Emu == Emulator.MEmu) ? Color.FromArgb(255, 123, 123, 123) : Color.FromArgb(255, 46, 91, 108),

                Point = new Point(282, 249)
            };

            //Done graphic that is present upon main quest completion.
            questDone[0] = new Pixel
            {
                Color = Color.White,

                Point = new Point(218, 260)//White D in 'Done' graphic.
            };

            questDone[1] = new Pixel
            {
                Color = Color.White,

                Point = new Point(220, 260)//Center of white D in 'Done' graphic.
            };

            //Bubble that appears over an NPC when they need a talkin to.
            questBubble[0] = new Pixel
            {
                Color = Color.FromArgb(255, 226, 226, 226),

                Point = new Point(692, 249)
            };
            questBubble[1] = new Pixel
            {
                Color = Color.FromArgb(255, 63, 63, 63),

                Point = new Point(679, 262)
            };
        }
Ejemplo n.º 3
0
        private void CommandListBox_DoubleClick(object sender, EventArgs e)
        {
            int index = ((ListBox)sender).SelectedIndex;

            if (index < 0)
            {
                return;
            }

            CommandListBox.Items.RemoveAt(index);
            ScreenObj.Clear();
        }
Ejemplo n.º 4
0
        private void CommandListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            var target = ((ListBox)sender).SelectedItem;

            if (target == null)
            {
                return;
            }

            var items = ((CommandJsonStorage.Item)((CommandCsvStorage.Item)target).Tag).Controls;

            if (items == null)
            {
                return;
            }

            ScreenObj.Save(z1Items);
            ScreenObj.Update(items);

            z1Items = items;
        }
Ejemplo n.º 5
0
        public void Save()
        {
            #region 前処理
            try
            {
                ScreenObj.Save(((CommandJsonStorage.Item)((CommandCsvStorage.Item)CommandListBox.SelectedItem).Tag).Controls);

                foreach (var item in CommandListBox.Items)
                {
                    var jsonObj = (CommandJsonStorage.Item)((CommandCsvStorage.Item)item).Tag;
                    var csvObj  = ConvertJsonItemToCsvItem(jsonObj);
                    csvObj.Name = item.ToString();
                    CommandList.Items.Add(csvObj);
                }
            }
            catch
            {
                return;
            }
            #endregion

            #region 保存先ファイル選択
            try
            {
                if (FileName == "")
                {
                    string fileName = "";

                    //ダイアログを表示する
                    if (saveFileDialogCsv.ShowDialog() == DialogResult.OK)
                    {
                        //ファイル名取得(パス込み)
                        fileName = saveFileDialogCsv.FileName;
                    }
                    //Console.WriteLine(fileName);

                    FileName = fileName;
                }
            }
            catch
            {
                return;
            }
            #endregion

            #region CSVファイル書き込み
            try
            {
                // 出力用のファイルを開く
                using (var sw = new StreamWriter(FileName, false, Encoding.UTF8))
                {
                    sw.WriteLine(CommandList.Serialize());
                }
            }
            catch (Exception e)
            {
                // ファイルを開くのに失敗したときエラーメッセージを表示
                Console.WriteLine(e.Message);
                return;
            }
            #endregion

            #region 後処理
            {
                CommandList.Items.Clear();
            }
            #endregion
        }