mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-08-03 10:09:35 -05:00
parent
46c38698c7
commit
c99cb4d202
|
|
@ -186,6 +186,9 @@ private void B_Randomize_Click(object sender, EventArgs e)
|
|||
CB_Location.SelectedIndex = i;
|
||||
for (int r = 0; r < dgv.Rows.Count; r++)
|
||||
{
|
||||
int currentItem = Array.IndexOf(itemlist, dgv.Rows[r].Cells[1].Value);
|
||||
if (MartEditor7.BannedItems.Contains(currentItem))
|
||||
continue;
|
||||
dgv.Rows[r].Cells[1].Value = itemlist[validItems[ctr++]];
|
||||
if (ctr <= validItems.Length) continue;
|
||||
Util.Shuffle(validItems); ctr = 0;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using pk3DS.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
|
@ -159,6 +160,19 @@ private void setList()
|
|||
for (int i = 0; i < count; i++)
|
||||
Array.Copy(BitConverter.GetBytes((ushort)Array.IndexOf(itemlist, dgv.Rows[i].Cells[1].Value)), 0, data, dataoffset + 2 * i, 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Just TMs & HMs; don't want these to be changed; if changed, they are not available elsewhere ingame.
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> BannedItems = new HashSet<int>
|
||||
{
|
||||
328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,
|
||||
349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369,
|
||||
370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390,
|
||||
391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411,
|
||||
412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 618, 619, 620, 690, 691,
|
||||
692, 693, 694, 701, 737
|
||||
};
|
||||
private void B_Randomize_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (DialogResult.Yes != WinFormsUtil.Prompt(MessageBoxButtons.YesNoCancel, "Randomize mart inventories?"))
|
||||
|
|
@ -176,6 +190,9 @@ private void B_Randomize_Click(object sender, EventArgs e)
|
|||
CB_Location.SelectedIndex = i;
|
||||
for (int r = 0; r < dgv.Rows.Count; r++)
|
||||
{
|
||||
int currentItem = Array.IndexOf(itemlist, dgv.Rows[r].Cells[1].Value);
|
||||
if (BannedItems.Contains(currentItem))
|
||||
continue;
|
||||
dgv.Rows[r].Cells[1].Value = itemlist[validItems[ctr++]];
|
||||
if (ctr <= validItems.Length) continue;
|
||||
Util.Shuffle(validItems); ctr = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user