private void pasteScript(object sender, EventArgs e) { // import data as bytes try { string text = RTB_CompressedScript.Text.Replace(Environment.NewLine, "").Replace("\n", "").Replace(" ", ""); byte[] data = Util.StringToByteArray(text); byte[] dec = Scripts.decompressScript(data); RTB_DecompressedScript.Lines = Scripts.getHexLines(dec); } catch { RTB_DecompressedScript.Text = "DECMP ERROR"; } }
private void changeRAW_N(object sender, EventArgs e) { if (!(sender is RichTextBox) || !(sender as RichTextBox).Visible) { return; } try { byte[] data = Util.StringToByteArray((sender as RichTextBox).Text.Replace(Environment.NewLine, " ").Replace(" ", "")); if (data.Length != Zone.ZoneEntities.EntityNPC.Size) { return; } CurrentZone.Entities.NPCs[nEntry].Raw = data; getNPC(); } catch { (sender as RichTextBox).Text = Util.getHexString(CurrentZone.Entities.NPCs[nEntry].Raw); } }
private void ChangeRAW_F(object sender, EventArgs e) { if (!(sender is RichTextBox) || !((RichTextBox)sender).Visible) { return; } try { byte[] data = Util.StringToByteArray(((RichTextBox)sender).Text.Replace(Environment.NewLine, " ").Replace(" ", "")); if (data.Length != Zone.ZoneEntities.EntityFurniture.Size) { return; } CurrentZone.Entities.Furniture[fEntry].Raw = data; GetFurniture(); } catch { ((RichTextBox)sender).Text = Util.getHexString(CurrentZone.Entities.Furniture[fEntry].Raw); } }