public void BtnAddClass_Click(object sender, EventArgs e) { E_Globals.Max_Classes++; Array.Resize(ref Types.Classes, E_Globals.Max_Classes + 1); Types.Classes[E_Globals.Max_Classes].Name = "New Class"; Types.Classes[E_Globals.Max_Classes].Stat = new byte[(int)Enums.StatType.Count]; Types.Classes[E_Globals.Max_Classes].Vital = new int[(int)Enums.VitalType.Count]; Types.Classes[E_Globals.Max_Classes].MaleSprite = new int[2]; Types.Classes[E_Globals.Max_Classes].FemaleSprite = new int[2]; for (var i = 1; i <= (int)Enums.StatType.Count - 1; i++) { Types.Classes[E_Globals.Max_Classes].Stat[(int)i] = 1; } Types.Classes[E_Globals.Max_Classes].StartItem = new int[6]; Types.Classes[E_Globals.Max_Classes].StartValue = new int[6]; Types.Classes[E_Globals.Max_Classes].StartMap = 1; Types.Classes[E_Globals.Max_Classes].StartX = (byte)1; Types.Classes[E_Globals.Max_Classes].StartY = (byte)1; E_Editors.ClassEditorInit(); lstIndex.SelectedIndex = lstIndex.Items.Count - 1; }
public void OptNPCSpawn_CheckedChanged(object sender, EventArgs e) { int n = 0; lstNpc.Items.Clear(); for (n = 1; n <= Constants.MAX_MAP_NPCS; n++) { if (E_Types.Map.Npc[n] > 0) { if (Types.Npc[E_Types.Map.Npc[n]].Name != null) { lstNpc.Items.Add(n + ": " + Types.Npc[E_Types.Map.Npc[n]].Name); } else { lstNpc.Items.Add(n + ": " + "Null"); } } else { lstNpc.Items.Add(n + ": No Npc"); } } scrlNpcDir.Value = 0; lstNpc.SelectedIndex = 0; E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraNpcSpawn.Visible = true; }
public void BtnRemoveClass_Click(object sender, EventArgs e) { int i = 0; if (E_Globals.Max_Classes == 0) { return; } //If its The Last class, its simple, just remove and redim if (E_Globals.Editorindex == E_Globals.Max_Classes) { E_Globals.Max_Classes--; Array.Resize(ref Types.Classes, E_Globals.Max_Classes + 1); } else { //but if its somewhere in the middle, or beginning, it gets harder xD for (i = 1; i <= E_Globals.Max_Classes; i++) { //we shift everything thats beneath the selected class, up 1 slot Types.Classes[E_Globals.Editorindex] = Types.Classes[E_Globals.Editorindex + 1]; } //and then we remove it, and redim E_Globals.Max_Classes--; Array.Resize(ref Types.Classes, E_Globals.Max_Classes + 1); } E_Editors.ClassEditorInit(); }
public void OptHouse_CheckedChanged(object sender, EventArgs e) { E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraBuyHouse.Visible = true; scrlBuyHouse.Maximum = E_Housing.MAX_HOUSES; scrlBuyHouse.Value = 1; }
public void Picscreen_MouseDown(object sender, MouseEventArgs e) { if (e.X > pnlBack2.Width - 32 || e.Y > pnlBack2.Height - 32) { return; } E_Editors.MapEditorMouseDown((System.Int32)e.Button, e.X, e.Y, false); }
private void optLight_Click(object sender, EventArgs e) { E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraLight.Visible = true; lightRadiusInput.Value = 1; flickerCheckBox.Checked = true; }
public void OptWarp_CheckedChanged(object sender, EventArgs e) { if (optWarp.Checked == true) { E_Editors.ClearAttributeDialogue(); fraMapWarp.Visible = true; //FrmVisualWarp.Visible = True } }
public void BtnSave_Click(object sender, EventArgs e) { if (txtName.Text.Trim().Length == 0) { MessageBox.Show("Name required."); } else { E_Editors.ShopEditorOk(); } }
public void OptItem_CheckedChanged(object sender, EventArgs e) { E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraMapItem.Visible = true; scrlMapItem.Maximum = Constants.MAX_ITEMS; scrlMapItem.Value = 1; lblMapItem.Text = Types.Item[scrlMapItem.Value].Name.Trim() + " x" + System.Convert.ToString(scrlMapItemValue.Value); E_Graphics.EditorMap_DrawMapItem(); }
public void OptKeyOpen_CheckedChanged(object sender, EventArgs e) { E_Editors.ClearAttributeDialogue(); fraKeyOpen.Visible = true; pnlAttributes.Visible = true; scrlKeyX.Maximum = E_Types.Map.MaxX; scrlKeyY.Maximum = E_Types.Map.MaxY; scrlKeyX.Value = 0; scrlKeyY.Value = 0; }
public void OptKey_CheckedChanged(object sender, EventArgs e) { E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraMapKey.Visible = true; scrlMapKey.Maximum = Constants.MAX_ITEMS; scrlMapKey.Value = 1; chkMapKey.Checked = true; E_Graphics.EditorMap_DrawKey(); lblMapKey.Text = "Item: " + Types.Item[scrlMapKey.Value].Name.Trim(); }
public void BtnDelete_Click(object sender, EventArgs e) { int tmpindex = 0; ClientDataBase.ClearResource(E_Globals.Editorindex); tmpindex = lstIndex.SelectedIndex; lstIndex.Items.RemoveAt(E_Globals.Editorindex - 1); lstIndex.Items.Insert(E_Globals.Editorindex - 1, E_Globals.Editorindex + ": " + Types.Resource[E_Globals.Editorindex].Name); lstIndex.SelectedIndex = tmpindex; E_Editors.ResourceEditorInit(); }
public void FrmEditor_Classes_Load(object sender, EventArgs e) { nudMaleSprite.Maximum = E_Graphics.NumCharacters; nudFemaleSprite.Maximum = E_Graphics.NumCharacters; E_Editors.ClassEditorInit(); DrawPreview(); lstIndex.SelectedIndex = 0; E_Globals.LoadClassInfo = true; }
public void BtnDeleteTrade_Click(object sender, EventArgs e) { int index = 0; index = lstTradeItem.SelectedIndex + 1; if (index == 0) { return; } Types.Shop[E_Globals.Editorindex].TradeItem[index].Item = 0; Types.Shop[E_Globals.Editorindex].TradeItem[index].ItemValue = 0; Types.Shop[E_Globals.Editorindex].TradeItem[index].CostItem = 0; Types.Shop[E_Globals.Editorindex].TradeItem[index].CostValue = 0; E_Editors.UpdateShopTrade(); }
public void Picscreen_MouseMove(object sender, MouseEventArgs e) { E_Globals.CurX = E_Globals.TileView.Left + ((e.Location.X + E_Globals.Camera.Left) / E_Globals.PIC_X); E_Globals.CurY = E_Globals.TileView.Top + ((e.Location.Y + E_Globals.Camera.Top) / E_Globals.PIC_Y); E_Globals.CurMouseX = e.Location.X; E_Globals.CurMouseY = e.Location.Y; if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right) { E_Editors.MapEditorMouseDown((System.Int32)e.Button, e.X, e.Y); } tslCurXY.Text = "X: " + System.Convert.ToString(E_Globals.CurX) + " - " + " Y: " + System.Convert.ToString(E_Globals.CurY); }
public void OptDoor_CheckedChanged(object sender, EventArgs e) { if (optDoor.Checked == false) { return; } E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraMapWarp.Visible = true; scrlMapWarpMap.Maximum = Constants.MAX_MAPS; scrlMapWarpMap.Value = 1; scrlMapWarpX.Maximum = byte.MaxValue; scrlMapWarpY.Maximum = byte.MaxValue; scrlMapWarpX.Value = 0; scrlMapWarpY.Value = 0; }
public void BtnDelete_Click(object sender, EventArgs e) { int tmpindex = 0; if (E_Globals.Editorindex == 0 || E_Globals.Editorindex > Constants.MAX_ANIMATIONS) { return; } ClientDataBase.ClearAnimation(E_Globals.Editorindex); tmpindex = lstIndex.SelectedIndex; lstIndex.Items.RemoveAt(E_Globals.Editorindex - 1); lstIndex.Items.Insert(E_Globals.Editorindex - 1, E_Globals.Editorindex + ": " + Types.Animation[E_Globals.Editorindex].Name); lstIndex.SelectedIndex = tmpindex; E_Editors.AnimationEditorInit(); }
public void BtnDelete_Click(object sender, EventArgs e) { int tmpindex = 0; if (E_Globals.Editorindex <= 0) { return; } ClientDataBase.ClearNpc(E_Globals.Editorindex); tmpindex = lstIndex.SelectedIndex; lstIndex.Items.RemoveAt(E_Globals.Editorindex - 1); lstIndex.Items.Insert(E_Globals.Editorindex - 1, E_Globals.Editorindex + ": " + Types.Npc[E_Globals.Editorindex].Name); lstIndex.SelectedIndex = tmpindex; E_Editors.NpcEditorInit(); }
public void FrmEditor_NPC_Load(object sender, EventArgs e) { nudSprite.Maximum = E_Graphics.NumCharacters; cmbItem.Items.Clear(); cmbItem.Items.Add("None"); for (var i = 1; i <= Constants.MAX_ITEMS; i++) { if (Types.Item[(int)i].Name != null) { cmbItem.Items.Add(i + ": " + Types.Item[(int)i].Name); } else { cmbItem.Items.Add(i + ": " + "Null"); } } E_Editors.NpcEditorInit(); }
public void BtnSave_Click(object sender, EventArgs e) { E_Editors.ResourceEditorOk(); }
public void LstIndex_Click(object sender, EventArgs e) { E_Editors.ResourceEditorInit(); }
public void BtnClearAttribute_Click(object sender, EventArgs e) { E_Editors.MapEditorClearAttribs(); }
public void TsbFill_Click(object sender, EventArgs e) { E_Editors.MapEditorFillLayer((byte)cmbAutoTile.SelectedIndex); }
public static void GameLoop() { Point dest = new Point(frmMapEditor.Default.PointToScreen(frmMapEditor.Default.picScreen.Location).X, frmMapEditor.Default.PointToScreen(frmMapEditor.Default.picScreen.Location).Y); Graphics g = frmMapEditor.Default.picScreen.CreateGraphics(); int starttime = 0; int Tick = 0; int fogtmr = 0; int FrameTime; int tmr500 = 0; int tmpfps = 0; int rendercount = 0; starttime = ClientDataBase.GetTickCount(); do { if (E_Globals.GameDestroyed == true) { ProjectData.EndApp(); } UpdateUI(); if (E_Globals.GameStarted == true) { Tick = ClientDataBase.GetTickCount(); // update animation editor if (E_Globals.Editor == E_Globals.EDITOR_ANIMATION) { E_Graphics.EditorAnim_DrawAnim(); } if (E_Globals.Editor == E_Projectiles.EDITOR_PROJECTILE) { E_Graphics.Draw_ProjectilePreview(); } FrameTime = Tick; if (E_Globals.InMapEditor && !E_Globals.GettingMap) { //Calculate FPS if (starttime < Tick) { E_Globals.FPS = tmpfps; frmMapEditor.Default.tsCurFps.Text = "Current FPS: " + E_Globals.FPS; tmpfps = 0; starttime = (ClientDataBase.GetTickCount() + 1000); } tmpfps++; lock (E_Types.MapLock) { // fog scrolling if (fogtmr < Tick) { if (E_Globals.CurrentFogSpeed > 0) { //move E_Globals.fogOffsetX--; E_Globals.fogOffsetY--; FileSystem.Reset(); if (E_Globals.fogOffsetX < -256) { E_Globals.fogOffsetX = 0; } if (E_Globals.fogOffsetY < -256) { E_Globals.fogOffsetY = 0; } fogtmr = Tick + 255 - E_Globals.CurrentFogSpeed; } } if (tmr500 < Tick) { // animate waterfalls switch (E_AutoTiles.waterfallFrame) { case 0: E_AutoTiles.waterfallFrame = 1; break; case 1: E_AutoTiles.waterfallFrame = 2; break; case 2: E_AutoTiles.waterfallFrame = 0; break; } // animate autotiles switch (E_AutoTiles.autoTileFrame) { case 0: E_AutoTiles.autoTileFrame = 1; break; case 1: E_AutoTiles.autoTileFrame = 2; break; case 2: E_AutoTiles.autoTileFrame = 0; break; } tmr500 = Tick + 500; } E_Weather.ProcessWeather(); if (E_Sound.FadeInSwitch == true) { E_Sound.FadeIn(); } if (E_Sound.FadeOutSwitch == true) { E_Sound.FadeOut(); } if (rendercount < Tick) { //Auctual Game Loop Stuff :/ E_Graphics.Render_Graphics(); rendercount = Tick + 32; } //Do we need this? //Application.DoEvents(); E_Graphics.EditorMap_DrawTileset(); if (E_Globals.TakeScreenShot) { if (E_Globals.ScreenShotTimer < Tick) { SFML.Graphics.Image screenshot = E_Graphics.GameWindow.Capture(); if (!System.IO.Directory.Exists(Application.StartupPath + "\\Data\\Screenshots")) { System.IO.Directory.CreateDirectory(Application.StartupPath + "\\Data\\Screenshots"); } screenshot.SaveToFile(Application.StartupPath + "\\Data\\Screenshots\\Map" + System.Convert.ToString(E_Types.Map.mapNum) + ".png"); E_Globals.HideCursor = false; E_Globals.TakeScreenShot = false; } } if (E_Globals.MakeCache) { if (E_Globals.ScreenShotTimer < Tick) { SFML.Graphics.Image screenshot = E_Graphics.GameWindow.Capture(); if (!System.IO.Directory.Exists(Application.StartupPath + "\\Data\\Cache")) { System.IO.Directory.CreateDirectory(Application.StartupPath + "\\Data\\Cache"); } screenshot.SaveToFile(Application.StartupPath + "\\Data\\Cache\\Map" + System.Convert.ToString(E_Types.Map.mapNum) + ".png"); E_Globals.HideCursor = false; E_Globals.MakeCache = false; E_Editors.MapEditorSend(); } } } } } // This should be the only one we need? Application.DoEvents(); //Do we need to pause the thread? without it we gain like 200+ fps //Thread.Sleep(1); // Lets Yield Instead Thread.Yield(); } while (true); }
public void BtnCancel_Click(object sender, EventArgs e) { E_Editors.ResourceEditorCancel(); }
public void TsbClear_Click(object sender, EventArgs e) { E_Editors.MapEditorClearLayer(); }
public void FrmEditor_Resource_Load(object sender, EventArgs e) { E_Editors.ResourceEditorInit(); }
public void OptTrap_CheckedChanged(object sender, EventArgs e) { E_Editors.ClearAttributeDialogue(); pnlAttributes.Visible = true; fraTrap.Visible = true; }
public static void UpdateUI() { if (E_Globals.InitEditor == true) { FrmLogin.Default.pnlAdmin.Visible = true; E_Globals.InitEditor = false; } if (E_Pets.InitPetEditor == true) { E_Globals.Editor = E_Pets.EDITOR_PET; frmPet.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= Constants.MAX_PETS; i++) { if (E_Pets.Pet[(int)i].Name != null) { frmPet.Default.lstIndex.Items.Add(i + ": " + E_Pets.Pet[(int)i].Name.Trim()); } else { frmPet.Default.lstIndex.Items.Add(i + ": " + ""); } } frmPet.Default.cmbEvolve.Items.Clear(); frmPet.Default.cmbEvolve.Items.Add("None"); // Add the names for (var i = 1; i <= Constants.MAX_PETS; i++) { if (E_Pets.Pet[(int)i].Name != null) { frmPet.Default.cmbEvolve.Items.Add(i + ": " + E_Pets.Pet[(int)i].Name.Trim()); } else { frmPet.Default.cmbEvolve.Items.Add(i + ": " + "Null"); } } frmPet.Default.Show(); frmPet.Default.Visible = true; frmPet.Default.lstIndex.SelectedIndex = 0; frmPet.Default.cmbEvolve.SelectedIndex = 0; E_Pets.PetEditorInit(); E_Pets.InitPetEditor = false; } if (E_Quest.QuestEditorShow == true) { E_Globals.Editor = E_Quest.EDITOR_TASKS; FrmQuest.Default.lstIndex.Items.Clear(); FrmQuest.Default.cmbQuestReq.Items.Clear(); FrmQuest.Default.cmbQuestReq.Items.Add("None"); // Add the names for (var I = 1; I <= E_Quest.MAX_QUESTS; I++) { if (E_Quest.Quest[(int)I].Name != null) { FrmQuest.Default.lstIndex.Items.Add(I + ": " + E_Quest.Quest[(int)I].Name.Trim()); FrmQuest.Default.cmbQuestReq.Items.Add(I + ": " + E_Quest.Quest[(int)I].Name.Trim()); } else { FrmQuest.Default.lstIndex.Items.Add(I + ": " + ""); FrmQuest.Default.cmbQuestReq.Items.Add(I + ": " + ""); } } FrmQuest.Default.Show(); FrmQuest.Default.Visible = true; FrmQuest.Default.lstIndex.SelectedIndex = 0; E_Quest.QuestEditorInit(); E_Quest.QuestEditorShow = false; } if (E_Globals.InitAnimationEditor == true) { E_Globals.Editor = E_Globals.EDITOR_ANIMATION; FrmAnimation.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= Constants.MAX_ANIMATIONS; i++) { if (Types.Animation[(int)i].Name != null) { FrmAnimation.Default.lstIndex.Items.Add(i + ": " + Types.Animation[(int)i].Name.Trim()); } else { FrmAnimation.Default.lstIndex.Items.Add(i + ": " + ""); } } FrmAnimation.Default.Show(); FrmAnimation.Default.Visible = true; FrmAnimation.Default.lstIndex.SelectedIndex = 0; E_Editors.AnimationEditorInit(); E_Globals.InitAnimationEditor = false; } if (E_Globals.InitMapEditor == true) { E_Editors.MapEditorInit(); E_Globals.InitMapEditor = false; } if (E_Globals.InitMapProperties == true) { E_Editors.MapPropertiesInit(); E_Globals.InitMapProperties = false; } if (E_Globals.InitItemEditor == true) { E_Items.ItemEditorPreInit(); E_Globals.InitItemEditor = false; } if (E_Crafting.InitRecipeEditor == true) { E_Crafting.RecipeEditorPreInit(); E_Crafting.InitRecipeEditor = false; } if (E_Globals.InitClassEditor == true) { E_Editors.ClassEditorInit(); E_Globals.InitClassEditor = false; } if (E_Globals.LoadClassInfo == true) { E_Editors.LoadClass(); E_Globals.LoadClassInfo = false; } if (E_Globals.InitResourceEditor == true) { int i = 0; E_Globals.Editor = E_Globals.EDITOR_RESOURCE; FrmResource.Default.lstIndex.Items.Clear(); // Add the names for (i = 1; i <= Constants.MAX_RESOURCES; i++) { if (Types.Resource[i].Name == null) { Types.Resource[i].Name = ""; } if (Types.Resource[i].SuccessMessage == null) { Types.Resource[i].SuccessMessage = ""; } if (Types.Resource[i].EmptyMessage == null) { Types.Resource[i].EmptyMessage = ""; } FrmResource.Default.lstIndex.Items.Add(i + ": " + Types.Resource[i].Name.Trim()); } FrmResource.Default.Show(); FrmResource.Default.Visible = true; FrmResource.Default.lstIndex.SelectedIndex = 0; E_Editors.ResourceEditorInit(); E_Globals.InitResourceEditor = false; } if (E_Globals.InitNPCEditor == true) { E_Globals.Editor = E_Globals.EDITOR_NPC; frmNPC.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= Constants.MAX_NPCS; i++) { if (Types.Npc[(int)i].Name != null) { frmNPC.Default.lstIndex.Items.Add(i + ": " + Types.Npc[(int)i].Name.Trim()); } else { frmNPC.Default.lstIndex.Items.Add(i + ": " + ""); } } frmNPC.Default.Show(); frmNPC.Default.Visible = true; frmNPC.Default.lstIndex.SelectedIndex = 0; E_Editors.NpcEditorInit(); E_Globals.InitNPCEditor = false; } if (E_Globals.InitSkillEditor == true) { E_Globals.Editor = E_Globals.EDITOR_SKILL; frmSkill.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= Constants.MAX_SKILLS; i++) { if (Types.Skill[(int)i].Name != null) { frmSkill.Default.lstIndex.Items.Add(i + ": " + Types.Skill[(int)i].Name.Trim()); } else { frmSkill.Default.lstIndex.Items.Add(i + ": " + ""); } } frmSkill.Default.Show(); frmSkill.Default.Visible = true; frmSkill.Default.lstIndex.SelectedIndex = 0; E_Editors.SkillEditorInit(); E_Globals.InitSkillEditor = false; } if (E_Globals.InitShopEditor == true) { E_Globals.Editor = E_Globals.EDITOR_SHOP; frmShop.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= Constants.MAX_SHOPS; i++) { if (Types.Shop[(int)i].Name != null) { frmShop.Default.lstIndex.Items.Add(i + ": " + Types.Shop[(int)i].Name.Trim()); } else { frmShop.Default.lstIndex.Items.Add(i + ": " + ""); } } frmShop.Default.Show(); frmShop.Default.Visible = true; frmShop.Default.Visible = true; frmShop.Default.lstIndex.SelectedIndex = 0; E_Editors.ShopEditorInit(); E_Globals.InitShopEditor = false; } if (E_Globals.InitAnimationEditor == true) { E_Globals.Editor = E_Globals.EDITOR_ANIMATION; FrmAnimation.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= Constants.MAX_ANIMATIONS; i++) { if (Types.Animation[(int)i].Name != null) { FrmAnimation.Default.lstIndex.Items.Add(i + ": " + Types.Animation[(int)i].Name.Trim()); } else { FrmAnimation.Default.lstIndex.Items.Add(i + ": " + ""); } } FrmAnimation.Default.Show(); FrmAnimation.Default.Visible = true; FrmAnimation.Default.lstIndex.SelectedIndex = 0; E_Editors.AnimationEditorInit(); E_Globals.InitAnimationEditor = false; } if (E_Housing.HouseEdit == true) { E_Globals.Editor = E_Globals.EDITOR_HOUSE; FrmHouse.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= E_Housing.MAX_HOUSES; i++) { if (E_Housing.House[(int)i].ConfigName != null) { FrmHouse.Default.lstIndex.Items.Add(i + ": " + E_Housing.House[(int)i].ConfigName.Trim()); } else { FrmHouse.Default.lstIndex.Items.Add(i + ": " + ""); } } FrmHouse.Default.Show(); FrmHouse.Default.Visible = true; FrmHouse.Default.lstIndex.SelectedIndex = 0; E_Housing.HouseEditorInit(); E_Housing.HouseEdit = false; } if (E_EventSystem.InitEventEditorForm == true) { frmEvents.Default.InitEventEditorForm(); // populate form // set the tabs frmEvents.Default.tabPages.TabPages.Clear(); for (var i = 1; i <= E_EventSystem.TmpEvent.PageCount; i++) { frmEvents.Default.tabPages.TabPages.Add(Conversion.Str(i)); } // items frmEvents.Default.cmbHasItem.Items.Clear(); frmEvents.Default.cmbHasItem.Items.Add("None"); for (var i = 1; i <= Constants.MAX_ITEMS; i++) { if (Types.Item[(int)i].Name != null) { frmEvents.Default.cmbHasItem.Items.Add(i + ": " + Types.Item[(int)i].Name.Trim()); } else { frmEvents.Default.cmbHasItem.Items.Add(i + ": " + ""); } } // variables frmEvents.Default.cmbPlayerVar.Items.Clear(); frmEvents.Default.cmbPlayerVar.Items.Add("None"); for (var i = 1; i <= E_EventSystem.MaxVariables; i++) { if (E_EventSystem.Variables[(int)i] != null) { frmEvents.Default.cmbPlayerVar.Items.Add(i + ". " + E_EventSystem.Variables[(int)i]); } else { frmEvents.Default.cmbPlayerVar.Items.Add(i + ". " + ""); } } // variables frmEvents.Default.cmbPlayerSwitch.Items.Clear(); frmEvents.Default.cmbPlayerSwitch.Items.Add("None"); for (var i = 1; i <= E_EventSystem.MaxSwitches; i++) { if (E_EventSystem.Switches[(int)i] != null) { frmEvents.Default.cmbPlayerSwitch.Items.Add(i + ". " + E_EventSystem.Switches[(int)i]); } else { frmEvents.Default.cmbPlayerSwitch.Items.Add(i + ". " + ""); } } // name frmEvents.Default.txtName.Text = E_EventSystem.TmpEvent.Name; // enable delete button if (E_EventSystem.TmpEvent.PageCount > 1) { frmEvents.Default.btnDeletePage.Enabled = true; } else { frmEvents.Default.btnDeletePage.Enabled = false; } frmEvents.Default.btnPastePage.Enabled = false; // Load page 1 to start off with E_EventSystem.CurPageNum = 1; E_EventSystem.EventEditorLoadPage(E_EventSystem.CurPageNum); frmEvents.Default.nudShowTextFace.Maximum = E_Graphics.NumFaces; frmEvents.Default.nudShowChoicesFace.Maximum = E_Graphics.NumFaces; // show the editor frmEvents.Default.Show(); frmEvents.Default.Visible = true; E_EventSystem.InitEventEditorForm = false; } if (E_Projectiles.InitProjectileEditor == true) { E_Globals.Editor = E_Projectiles.EDITOR_PROJECTILE; frmProjectile.Default.lstIndex.Items.Clear(); // Add the names for (var i = 1; i <= E_Projectiles.MAX_PROJECTILES; i++) { if (E_Projectiles.Projectiles[(int)i].Name != null) { frmProjectile.Default.lstIndex.Items.Add(i + ": " + E_Projectiles.Projectiles[(int)i].Name.Trim()); } else { frmProjectile.Default.lstIndex.Items.Add(i + ": " + ""); } } frmProjectile.Default.Show(); frmProjectile.Default.Visible = true; frmProjectile.Default.lstIndex.SelectedIndex = 0; E_Projectiles.ProjectileEditorInit(); E_Projectiles.InitProjectileEditor = false; } if (frmProjectile.Default.Visible) { E_Projectiles.EditorProjectile_DrawProjectile(); } if (E_Globals.InitAutoMapper == true) { E_AutoMap.OpenAutomapper(); E_Globals.InitAutoMapper = false; } }
public void TsbDiscard_Click(object sender, EventArgs e) { E_Editors.MapEditorCancel(); }