public void GenerateSpritesFromTSI(TSI tsi) { for (int i = 0; i < tsi.listDDS.Count; i++) { Sprite newDDSSprite = new Sprite(); newDDSSprite.LoadTextureFromFile(ContentManager.resFolderPartialPath + "\\" + tsi.listDDS[i].Path, new Vector2(0, 0)); if (!sprites.Contains(tsi.listDDS[i].Path.ToLower()))//check this later { sprites.Add(tsi.listDDS[i].Path.ToLower(), newDDSSprite); } for (int j = 0; j < tsi.listDDS[i].ListDDS_element.Count; j++) { Sprite newSprite = new Sprite(); newSprite.LoadTextureFromFile(ContentManager.resFolderPartialPath + "\\" + tsi.listDDS[i].Path, new Vector2(0, 0), new Rectangle( tsi.listDDS[i].ListDDS_element[j].X, tsi.listDDS[i].ListDDS_element[j].Y, tsi.listDDS[i].ListDDS_element[j].Width, tsi.listDDS[i].ListDDS_element[j].Height)); if (!sprites.Contains(tsi.listDDS[i].ListDDS_element[j].Name.ToLower()))//check this later { sprites.Add(tsi.listDDS[i].ListDDS_element[j].Name.ToLower(), newSprite); } } } }
private void ToLow() { foreach (ToolStripItem TSI in toolStrip1.Items) { ToolStripButton TSS = new ToolStripButton(); if (TSI.GetType() == TSS.GetType()) { ToolStripButton TB = (ToolStripButton)TSI; TB.Text = TB.Text.ToLower(); } } foreach (ToolStripItem TSI in toolStrip2.Items) { ToolStripButton TSS = new ToolStripButton(); if (TSI.GetType() == TSS.GetType()) { ToolStripButton TB = (ToolStripButton)TSI; TB.Text = TB.Text.ToLower(); } } foreach (ToolStripItem TSI in toolStrip3.Items) { ToolStripButton TSS = new ToolStripButton(); if (TSI.GetType() == TSS.GetType()) { ToolStripButton TB = (ToolStripButton)TSI; TB.Text = TB.Text.ToLower(); } } }
public UIDockContainer(string Name, string Text, string XMLFolder, string TSIFolder) { this.Name = Name; this.Text = Text; this.XMLFolder = XMLFolder; this.TSIFolder = TSIFolder; // // renderPanel // renderControl = new RenderControl(); renderControl.Location = new System.Drawing.Point(3, 3); renderControl.Dock = DockStyle.Fill; renderControl.Name = "renderControl"; renderControl.Size = new System.Drawing.Size(657, 423); renderControl.TabIndex = 0; renderControl.MouseMove += new MouseEventHandler(MouseMove); codePanelDockContainer = new DevComponents.DotNetBar.PanelDockContainer(); // // codePanelDockContainer // codePanelDockContainer.Controls.Add(renderControl); codePanelDockContainer.Location = new System.Drawing.Point(3, 28); codePanelDockContainer.Dock = DockStyle.Fill; codePanelDockContainer.Name = "codePanelDockContainer1"; codePanelDockContainer.Size = new System.Drawing.Size(663, 427); codePanelDockContainer.Style.Alignment = System.Drawing.StringAlignment.Center; codePanelDockContainer.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; codePanelDockContainer.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; codePanelDockContainer.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; codePanelDockContainer.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; codePanelDockContainer.Style.GradientAngle = 90; codePanelDockContainer.TabIndex = 0; this.Control = codePanelDockContainer; ui = new UI(); UI_tsi = new TSI(); EXUI_tsi = new TSI(); UI_tsi.Load(TSIFolder + "\\UI.TSI"); EXUI_tsi.Load(TSIFolder + "\\EXUI.TSI"); UI_DDSElement = new Dictionary <string, TSI.DDS.DDSElement>(); EXUI_DDSElement = new Dictionary <string, TSI.DDS.DDSElement>(); for (int i = 0; i < UI_tsi.listDDS.Count; i++) { for (int a = 0; a < UI_tsi.listDDS[i].ListDDS_element.Count; a++) { UI_DDSElement.Add(UI_tsi.listDDS[i].ListDDS_element[a].Name.Trim('\0'), UI_tsi.listDDS[i].ListDDS_element[a]); } } for (int i = 0; i < EXUI_tsi.listDDS.Count; i++) { for (int a = 0; a < EXUI_tsi.listDDS[i].ListDDS_element.Count; a++) { EXUI_DDSElement.Add(EXUI_tsi.listDDS[i].ListDDS_element[a].Name.Trim('\0'), EXUI_tsi.listDDS[i].ListDDS_element[a]); } } }
public TSI GetTSI(string name, string folderPath) { if (!TSIs.Contains(name)) { TSI tsi = new TSI(); tsi.Load(folderPath + name, ClientType.IROSE); TSIs.Add(name, tsi); return(tsi); } else { return((TSI)TSIs[name]); } }
/// <summary> /// Writes the statistics to the log. /// </summary> public void WriteStatisticsToLog() { Log.Write("Duration statistics:"); TimeSpanStatistics.Sort(); string LastGroupName = ""; foreach (TimeSpanStatisticsItem TSI in TimeSpanStatistics) { if (LastGroupName != TSI.GroupName) { Log.Write(" {0}".Build(TSI.GroupName)); LastGroupName = TSI.GroupName; } Log.Write(" - {0}".Build(TSI.ToString())); } }
public IconForm(string importpath, string exportpath) { this.InitializeComponent(); this.ImportedContentFolder = importpath; this.ExportedContentFolder = exportpath; this.ExportedTSI = new TSI(); this.ImportedTSI = new TSI(); this.LoadContent(); if (File.Exists("Imported Icon.bmp")) { File.Delete("Imported Icon.bmp"); } if (File.Exists("DDS imported.bmp")) { File.Delete("DDS imported.bmp"); } if (File.Exists("DDS Modified.png")) { File.Delete("DDS Modified.png"); } }
/// <summary> /// CALLED WHEN THE ROBOT FIRST STARTS, IT IS ONLY CALLED ONCE. /// </summary> protected override void OnStart() { // TRADE MANAGER DECLERATION //tm = new TradeManager(this); // INSTANTIATE THE INDICATORS //VindIchi = Indicators.IchimokuKinkoHyo(9, KijunSen, 52); // AVERAGE TRUE RANGE Vatr = Indicators.AverageTrueRange(ATRPeriod, MovingAverageType.Simple); // CUSTOM INDICATORS // AROON OSCILLATOR Vao = Indicators.GetIndicator <AroonOscilator>(ArroonPeriod); // HULL FORECAST Vhfc = Indicators.GetIndicator <HullForcast>(HFPeriod, HFCPeriod, MarketSeries.Close, false, ""); // INCORRECT NUMBER OF PARAMATERS // RATE OF CHANGE Vroc = Indicators.GetIndicator <RateOfChange>(MarketSeries.Close, ROCPeriod); // TREND MAGIC Vtm = Indicators.GetIndicator <TrendMagic>(TMCCI, TMATR); // TRUE STRENGTH INDEX Vtsi = Indicators.GetIndicator <TSI>(MarketSeries.Close, TSIShortPeriod, TSILongPeriod, TSISignalPeriod, MovingAverageType.Weighted); }
public TSIDockContainer(string Name, string Text, string TSIFolder) { this.Name = Name; this.Text = Text; this.TSIFolder = TSIFolder; // // renderPanel // renderControl = new RenderControl(); renderControl.Location = new System.Drawing.Point(3, 1); renderControl.Dock = DockStyle.Fill; renderControl.Name = "renderControl"; renderControl.Size = new System.Drawing.Size(657, 423); renderControl.TabIndex = 0; renderControl.MouseMove += new MouseEventHandler(MouseMove); codePanelDockContainer = new DevComponents.DotNetBar.PanelDockContainer(); // // codePanelDockContainer // codePanelDockContainer.Controls.Add(renderControl); codePanelDockContainer.Location = new System.Drawing.Point(3, 28); codePanelDockContainer.Dock = DockStyle.Fill; codePanelDockContainer.Name = "codePanelDockContainer1"; codePanelDockContainer.Size = new System.Drawing.Size(663, 427); codePanelDockContainer.Style.Alignment = System.Drawing.StringAlignment.Center; codePanelDockContainer.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; codePanelDockContainer.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; codePanelDockContainer.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; codePanelDockContainer.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; codePanelDockContainer.Style.GradientAngle = 90; codePanelDockContainer.TabIndex = 0; this.Control = codePanelDockContainer; tsi = new TSI(); }
public void Load(string path) { TSIPath = path; tsi = ContentManager.Instance().GetTSI(path); GenerateTree(); }
private void OpenButton_Click(object sender, EventArgs e) { folderBrowserDialog.Description = @"Select your client folder : for exemple C:\Game\Rose Online"; if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { controlNode.Nodes.Clear(); ContentManager.Instance().ClearAll(); //Clear spriteManager too clientFolder = new DirectoryInfo(folderBrowserDialog.SelectedPath); ContentManager.SetRootPath(folderBrowserDialog.SelectedPath); StatusManager.AddLog("Root Folder : " + folderBrowserDialog.SelectedPath); if (Directory.Exists(folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL")) { StatusManager.AddLog("Control Folder has been found at : " + folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL"); ContentManager.SetControlFolderPath(folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL"); } else { StatusManager.AddLog("Control Folder can't be found : it should be at " + folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL"); return; } if (Directory.Exists(folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\RES")) { StatusManager.AddLog("Res Folder has been found at : " + folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\RES"); ContentManager.SetResFolderPath(folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\RES"); } else { StatusManager.AddLog("Res Folder can't be found : it should be at " + folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\RES"); return; } if (Directory.Exists(folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\XML")) { StatusManager.AddLog("XML Folder has been found at : " + folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\XML"); ContentManager.SetXMLFolderPath(folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\XML"); } else { StatusManager.AddLog("XML Folder can't be found : it should be at " + folderBrowserDialog.SelectedPath + "\\3DDATA\\CONTROL\\XML"); return; } DirectoryInfo resFolder = new DirectoryInfo(ContentManager.GetResFolderPath()); DevComponents.AdvTree.Node resNode = new DevComponents.AdvTree.Node(); resNode.Image = global::Rose_online_UI_Editor.Properties.Resources.SmallOpenDocument; resNode.Text = resFolder.Name; StatusManager.AddLog("Creating file tree ..."); StatusManager.AddLog("Preloading TSI and Sprites"); foreach (FileInfo file in resFolder.GetFiles()) { if (file.Extension.ToLower() == ".dds" || file.Extension.ToLower() == ".tsi") { DevComponents.AdvTree.Node newFileNode = new DevComponents.AdvTree.Node(); newFileNode.Text = file.Name; newFileNode.Name = file.Extension.ToLower(); switch (file.Extension.ToLower()) { case ".dds": newFileNode.Image = global::Rose_online_UI_Editor.Properties.Resources.SmallPictureLogo; //ajouter un sprite dans le spritemanager pour chaque dds trouvé !!!! break; case ".tsi": newFileNode.Image = global::Rose_online_UI_Editor.Properties.Resources.SmallTSILogo; TSI newTSI = ContentManager.Instance().GetTSI(ContentManager.resFolderPartialPath + "\\" + file.Name); SpriteManager.Instance().GenerateSpritesFromTSI(newTSI); break; } resNode.Nodes.Add(newFileNode); } } DirectoryInfo xmlFolder = new DirectoryInfo(ContentManager.GetXMLFolderPath()); DevComponents.AdvTree.Node xmlNode = new DevComponents.AdvTree.Node(); xmlNode.Image = global::Rose_online_UI_Editor.Properties.Resources.SmallOpenDocument; xmlNode.Text = xmlFolder.Name; foreach (FileInfo file in xmlFolder.GetFiles()) { if (file.Extension.ToLower() == ".xml") { DevComponents.AdvTree.Node newFileNode = new DevComponents.AdvTree.Node(); newFileNode.Text = file.Name; newFileNode.Name = file.Extension.ToLower(); newFileNode.Image = global::Rose_online_UI_Editor.Properties.Resources.SmallxmlLogo; xmlNode.Nodes.Add(newFileNode); } } controlNode.Nodes.Add(resNode); controlNode.Nodes.Add(xmlNode); } }