private void updateScriptDump(object sender, EventArgs e) { BeginUpdate(currentTextbox); Point scrollPos = GetScrollPos(currentTextbox); //Console.WriteLine(currentTextbox.Name); if (currentTextbox.Name.EndsWith("_ls_textbox")) { if (sd_tabs.SelectedIndex == 0) { organizeCurrentLevelScript(level.LevelScriptCommands_ForDump); } } else if (currentTextbox.Name.EndsWith("_gls_textbox")) { if (sd_tabs.SelectedIndex == 0) { organizeCurrentGeoLayoutScript(level.Areas[lt_gls_areaIndex].AreaModel.GeoLayoutCommands_ForDump); } else if (listBoxObjects.SelectedIndex > -1) { ushort key = objectCombos[listBoxObjects.SelectedIndex].ModelID;; if (level.ModelIDs.ContainsKey(key) && level.ModelIDs[key].GeoLayoutCommands_ForDump.Count > 0) { organizeCurrentGeoLayoutScript(level.ModelIDs[key].GeoLayoutCommands_ForDump); } else { currentTextbox.ResetText(); currentTextbox.ForeColor = Theme.SCRIPTDUMPS_GEOLAYOUT_TEXTBOX_TEXT; currentTextbox.Text = "<No script found>"; } } } else if (currentTextbox.Name.EndsWith("_f3d_textbox")) { if (sd_tabs.SelectedIndex == 0) { organizeCurrentFast3DScript(level.Areas[lt_f3d_areaIndex]. AreaModel.Fast3DCommands_ForDump[lt_f3d_listbox.SelectedIndex]); } else if (listBoxObjects.SelectedIndex > -1) { ushort key = objectCombos[listBoxObjects.SelectedIndex].ModelID; if (level.ModelIDs.ContainsKey(key) && ot_f3d_listbox.SelectedIndex > -1) { if (ot_f3d_listbox.SelectedItem.ToString().Equals("<Error 80>")) { currentTextbox.Text = "Error: Quad64 cannot read display lists from segment 0."; } else { organizeCurrentFast3DScript(level.ModelIDs[key].Fast3DCommands_ForDump[ot_f3d_listbox.SelectedIndex]); } } else { currentTextbox.ResetText(); currentTextbox.ForeColor = Theme.SCRIPTDUMPS_FAST3D_TEXTBOX_TEXT; currentTextbox.Text = "<No script found>"; } } } else if (currentTextbox.Name.EndsWith("_beh_textbox")) { if (sd_tabs.SelectedIndex == 1 && listBoxObjects.SelectedIndex > -1) { //ushort key = objectCombos[listBoxObjects.SelectedIndex].ModelID; // if (objectCombos.Count) // { List <ScriptDumpCommandInfo> behaviorDump = new List <ScriptDumpCommandInfo>(); BehaviorScripts.parse(ref behaviorDump, objectCombos[listBoxObjects.SelectedIndex].Behavior); organizeCurrentBehaviorScript(behaviorDump); // } //else //{ // currentTextbox.ResetText(); // currentTextbox.Text = "<No script found>"; //} } } SetScrollPos(scrollPos, currentTextbox); EndUpdate(currentTextbox); }
private void updateScriptDump(object sender, EventArgs e) { BeginUpdate(currentTextbox); Point scrollPos = GetScrollPos(currentTextbox); //Console.WriteLine(currentTextbox.Name); if (currentTextbox.Name.EndsWith("_ls_textbox")) { if (sd_tabs.SelectedIndex == 0) { organizeCurrentLevelScript(level.LevelScriptCommands_ForDump); } } else if (currentTextbox.Name.EndsWith("_gls_textbox")) { if (sd_tabs.SelectedIndex == 0) { organizeCurrentGeoLayoutScript(level.Areas[lt_gls_areaIndex].AreaModel.GeoLayoutCommands_ForDump); } else if (listBoxObjects.SelectedIndex > -1) { ushort key = objectCombos[listBoxObjects.SelectedIndex].ModelID;; if (level.ModelIDs.ContainsKey(key) && level.ModelIDs[key].GeoLayoutCommands_ForDump.Count > 0) { organizeCurrentGeoLayoutScript(level.ModelIDs[key].GeoLayoutCommands_ForDump); } else { currentTextbox.ResetText(); currentTextbox.Text = "<No script found>"; } } } else if (currentTextbox.Name.EndsWith("_f3d_textbox")) { if (sd_tabs.SelectedIndex == 0) { organizeCurrentFast3DScript(level.Areas[lt_f3d_areaIndex]. AreaModel.Fast3DCommands_ForDump[lt_f3d_listbox.SelectedIndex]); } else if (listBoxObjects.SelectedIndex > -1) { ushort key = objectCombos[listBoxObjects.SelectedIndex].ModelID; if (level.ModelIDs.ContainsKey(key) && ot_f3d_listbox.SelectedIndex > -1) { organizeCurrentFast3DScript(level.ModelIDs[key].Fast3DCommands_ForDump[ot_f3d_listbox.SelectedIndex]); } else { currentTextbox.ResetText(); currentTextbox.Text = "<No script found>"; } } } else if (currentTextbox.Name.EndsWith("_beh_textbox")) { if (sd_tabs.SelectedIndex == 1 && listBoxObjects.SelectedIndex > -1) { //ushort key = objectCombos[listBoxObjects.SelectedIndex].ModelID; // if (objectCombos.Count) // { List <ScriptDumpCommandInfo> behaviorDump = new List <ScriptDumpCommandInfo>(); BehaviorScripts.parse(ref behaviorDump, objectCombos[listBoxObjects.SelectedIndex].Behavior); organizeCurrentBehaviorScript(behaviorDump); // } //else //{ // currentTextbox.ResetText(); // currentTextbox.Text = "<No script found>"; //} } } SetScrollPos(scrollPos, currentTextbox); EndUpdate(currentTextbox); }