mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-15 08:19:49 -05:00
Merge branch 'pr/49'
This commit is contained in:
commit
a2c79d62c6
|
|
@ -49,11 +49,11 @@ namespace DSPRE {
|
|||
interiorCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
Helpers.DisableHandlers();
|
||||
FillListBox(false);
|
||||
FillTexturesBox();
|
||||
textureComboBox.SelectedIndex = 0;
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
buildingEditorBldListBox.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ namespace DSPRE {
|
|||
RenderModel();
|
||||
}
|
||||
private void buildingEditorListBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers || buildingEditorBldListBox.SelectedIndex < 0) {
|
||||
if (Helpers.HandlersDisabled || buildingEditorBldListBox.SelectedIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -213,17 +213,17 @@ namespace DSPRE {
|
|||
}
|
||||
}
|
||||
private void interiorCheckBox_CheckedChanged(object sender, EventArgs e) {
|
||||
disableHandlers = true;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
buildingEditorBldListBox.Items.Clear();
|
||||
FillListBox(interiorCheckBox.Checked);
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
buildingEditorBldListBox.SelectedIndex = 0;
|
||||
}
|
||||
private void textureComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
LoadModelTextures(textureComboBox.SelectedIndex - 1);
|
||||
|
|
|
|||
|
|
@ -64,30 +64,13 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\HelixToolkit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Desktop\sdsme\Map_Editor\OpenTK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="ScintillaNET, Version=3.6.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Collections.Specialized, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Xaml" />
|
||||
|
|
@ -113,7 +96,68 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DSUtils\ARM9.cs" />
|
||||
<Compile Include="DSUtils\DSUtils.cs" />
|
||||
<Compile Include="DSUtils\ModelUtils.cs" />
|
||||
<Compile Include="DSUtils\NSBUtils.cs" />
|
||||
<Compile Include="DSUtils\OverlayUtils.cs" />
|
||||
<Compile Include="DVCalculator\DVCalc.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DVCalculator\DVCalc.Designer.cs" />
|
||||
<Compile Include="DVCalculator\DVCalcNatureViewerForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DVCalculator\DVCalcNatureViewerForm.Designer.cs" />
|
||||
<Compile Include="DVCalculator\DVCalculator.cs" />
|
||||
<Compile Include="EditorPanels.cs" />
|
||||
<Compile Include="Editors\EncountersEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\EncountersEditor.Designer.cs">
|
||||
<DependentUpon>EncountersEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\HeadbuttEncounterEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\HeadbuttEncounterEditor.Designer.cs">
|
||||
<DependentUpon>HeadbuttEncounterEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\HeadbuttEncounterEditorTab.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\HeadbuttEncounterEditorTab.Designer.cs">
|
||||
<DependentUpon>HeadbuttEncounterEditorTab.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\LevelScriptEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\LevelScriptEditor.Designer.cs">
|
||||
<DependentUpon>LevelScriptEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\SafariZoneEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\SafariZoneEditor.Designer.cs">
|
||||
<DependentUpon>SafariZoneEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\SafariZoneEncounterEditorTab.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\SafariZoneEncounterEditorTab.Designer.cs">
|
||||
<DependentUpon>SafariZoneEncounterEditorTab.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\SafariZoneEncounterGroupEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\SafariZoneEncounterGroupEditor.Designer.cs">
|
||||
<DependentUpon>SafariZoneEncounterGroupEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Editors\ScriptEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Editors\ScriptEditor.Designer.cs">
|
||||
<DependentUpon>ScriptEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EventFileImport.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
@ -126,8 +170,11 @@
|
|||
<Compile Include="EvolutionsEditor.designer.cs">
|
||||
<DependentUpon>EvolutionsEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ExtensionMethods.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="Filesystem.cs" />
|
||||
<Compile Include="GameCamera.cs" />
|
||||
<Compile Include="Helpers.cs" />
|
||||
<Compile Include="InputComboBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
|
@ -137,14 +184,24 @@
|
|||
<Compile Include="LearnsetEditor.designer.cs">
|
||||
<DependentUpon>LearnsetEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DSUtils\NSBUtils.cs" />
|
||||
<Compile Include="DSUtils\OverlayUtils.cs" />
|
||||
<Compile Include="MoveEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MoveEditor.Designer.cs">
|
||||
<DependentUpon>MoveEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PersonalDataEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PersonalDataEditor.designer.cs">
|
||||
<DependentUpon>PersonalDataEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PokemonEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PokemonEditor.Designer.cs">
|
||||
<DependentUpon>PokemonEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
|
|
@ -153,7 +210,6 @@
|
|||
<Compile Include="Resources\ROMToolboxDB\ToolboxDB.cs" />
|
||||
<Compile Include="Resources\ScriptDatabase.cs" />
|
||||
<Compile Include="ROMFiles\AreaData.cs" />
|
||||
<Compile Include="DSUtils\DSUtils.cs" />
|
||||
<Compile Include="Resources\CommandsDatabase.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
@ -177,12 +233,29 @@
|
|||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ROMFiles\EvolutionFile.cs" />
|
||||
<Compile Include="ROMFiles\HeadbuttEncounter.cs" />
|
||||
<Compile Include="ROMFiles\HeadbuttEncounterFile.cs" />
|
||||
<Compile Include="ROMFiles\HeadbuttEncounterMap.cs" />
|
||||
<Compile Include="ROMFiles\HeadbuttTree.cs" />
|
||||
<Compile Include="ROMFiles\HeadbuttTreeGroup.cs" />
|
||||
<Compile Include="ROMFiles\LearnsetData.cs" />
|
||||
<Compile Include="ROMFiles\LevelScriptFile.cs" />
|
||||
<Compile Include="ROMFiles\LevelScriptTrigger.cs" />
|
||||
<Compile Include="ROMFiles\MapScreenLoadTrigger.cs" />
|
||||
<Compile Include="ROMFiles\MoveFile.cs" />
|
||||
<Compile Include="ROMFiles\PokemonPersonalData.cs" />
|
||||
<Compile Include="ROMFiles\RomFile.cs" />
|
||||
<Compile Include="ROMFiles\SafariZoneEncounter.cs" />
|
||||
<Compile Include="ROMFiles\SafariZoneEncounterFile.cs" />
|
||||
<Compile Include="ROMFiles\SafariZoneEncounterGroup.cs" />
|
||||
<Compile Include="ROMFiles\SafariZoneObjectRequirement.cs" />
|
||||
<Compile Include="ROMFiles\ScriptAction.cs" />
|
||||
<Compile Include="ROMFiles\ScriptActionContainer.cs" />
|
||||
<Compile Include="ROMFiles\ScriptCommandContainer.cs" />
|
||||
<Compile Include="ROMFiles\ScriptReference.cs" />
|
||||
<Compile Include="ROMFiles\SpeciesFile.cs" />
|
||||
<Compile Include="ROMFiles\TrainerFile.cs" />
|
||||
<Compile Include="ROMFiles\VariableValueTrigger.cs" />
|
||||
<Compile Include="PatchToolboxDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
@ -294,6 +367,32 @@
|
|||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Resources\writeText.Designer.cs" />
|
||||
<EmbeddedResource Include="DVCalculator\DVCalc.resx" />
|
||||
<EmbeddedResource Include="DVCalculator\DVCalcNatureViewerForm.resx" />
|
||||
<EmbeddedResource Include="Editors\EncountersEditor.resx">
|
||||
<DependentUpon>EncountersEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\HeadbuttEncounterEditor.resx">
|
||||
<DependentUpon>HeadbuttEncounterEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\HeadbuttEncounterEditorTab.resx">
|
||||
<DependentUpon>HeadbuttEncounterEditorTab.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\LevelScriptEditor.resx">
|
||||
<DependentUpon>LevelScriptEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\SafariZoneEditor.resx">
|
||||
<DependentUpon>SafariZoneEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\SafariZoneEncounterEditorTab.resx">
|
||||
<DependentUpon>SafariZoneEncounterEditorTab.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\SafariZoneEncounterGroupEditor.resx">
|
||||
<DependentUpon>SafariZoneEncounterGroupEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editors\ScriptEditor.resx">
|
||||
<DependentUpon>ScriptEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="EventFileImport.resx">
|
||||
<DependentUpon>EventFileImport.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
@ -309,6 +408,9 @@
|
|||
<EmbeddedResource Include="PersonalDataEditor.resx">
|
||||
<DependentUpon>PersonalDataEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PokemonEditor.resx">
|
||||
<DependentUpon>PokemonEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\ROMToolboxDB\BDHCAMPatchDB.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>BDHCAMPatchDB.Designer.cs</LastGenOutput>
|
||||
|
|
@ -347,7 +449,6 @@
|
|||
<EmbeddedResource Include="WildEditorDPPt.resx">
|
||||
<DependentUpon>WildEditorDPPt.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
|
@ -357,6 +458,7 @@
|
|||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="Resources\HGSSCommands.md" />
|
||||
<None Include="Resources\ROMToolboxDB\CPUE_cam.bin" />
|
||||
<None Include="Resources\ROMToolboxDB\CPUS_cam.bin" />
|
||||
<None Include="Resources\ROMToolboxDB\IPGE_cam.bin" />
|
||||
|
|
@ -604,5 +706,19 @@
|
|||
<Name>Images</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="jacobslusser.ScintillaNET">
|
||||
<Version>3.6.3</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.WindowsAPICodePack-Core">
|
||||
<Version>1.1.0.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.WindowsAPICodePack-Shell">
|
||||
<Version>1.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Collections.Specialized">
|
||||
<Version>4.3.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
|
@ -32,6 +32,17 @@ namespace DSPRE {
|
|||
return f.ReadUInt32();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets number of overlays
|
||||
**/
|
||||
public static long GetNumberOfOverlays() {
|
||||
using (FileStream fileStream = File.OpenRead(RomInfo.overlayTablePath))
|
||||
{
|
||||
// Get the length of the file in bytes
|
||||
return fileStream.Length / 32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -45,6 +56,7 @@ namespace DSPRE {
|
|||
public static bool IsCompressed(int ovNumber) {
|
||||
return (new FileInfo(GetPath(ovNumber)).Length < OverlayTable.GetUncompressedSize(ovNumber));
|
||||
}
|
||||
|
||||
public static void RestoreFromCompressedBackup(int overlayNumber, bool eventEditorIsReady) {
|
||||
String overlayFilePath = GetPath(overlayNumber);
|
||||
|
||||
|
|
|
|||
52
DS_Map/DVCalculator/DVCalc.Designer.cs
generated
Normal file
52
DS_Map/DVCalculator/DVCalc.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE
|
||||
{
|
||||
partial class DVCalc
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
|
||||
#endregion
|
||||
|
||||
private Label poke_label;
|
||||
private Label trainerClassIdx_label;
|
||||
private Label trainerIdx_label;
|
||||
private Label pokeLVL_label;
|
||||
private NumericUpDown pokeLevel;
|
||||
private NumericUpDown trainerClassIdx;
|
||||
private NumericUpDown trainerIdx;
|
||||
private ComboBox natureSelect;
|
||||
private Label nature_label;
|
||||
private Label DV_label;
|
||||
private Button calcButton;
|
||||
private CheckBox maleCheck;
|
||||
private Label maxDVNature_label;
|
||||
private Label IV_label;
|
||||
private ComboBox pokemonSelector;
|
||||
private Button showAllButton;
|
||||
private Button helpButton;
|
||||
}
|
||||
}
|
||||
372
DS_Map/DVCalculator/DVCalc.cs
Normal file
372
DS_Map/DVCalculator/DVCalc.cs
Normal file
|
|
@ -0,0 +1,372 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace DSPRE
|
||||
{
|
||||
public partial class DVCalc : Form
|
||||
{
|
||||
public DVCalc(int TrainerIndex, int TrainerClassIndex)
|
||||
{
|
||||
InitializeComponent();
|
||||
PopulateComboBox();
|
||||
SetTrainerData(TrainerIndex, TrainerClassIndex);
|
||||
|
||||
//make Pokemon searchable
|
||||
pokemonSelector.TextChanged += PokemonSelector_TextChanged;
|
||||
pokemonSelector.AutoCompleteMode = AutoCompleteMode.Suggest;
|
||||
pokemonSelector.AutoCompleteSource = AutoCompleteSource.CustomSource;
|
||||
|
||||
AutoCompleteStringCollection autoCompleteSource = new AutoCompleteStringCollection();
|
||||
foreach (KeyValuePair<int, string> item in pokemonSelector.Items)
|
||||
{
|
||||
autoCompleteSource.Add(item.Value);
|
||||
}
|
||||
|
||||
pokemonSelector.AutoCompleteCustomSource = autoCompleteSource;
|
||||
|
||||
}
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.poke_label = new System.Windows.Forms.Label();
|
||||
this.trainerClassIdx_label = new System.Windows.Forms.Label();
|
||||
this.trainerIdx_label = new System.Windows.Forms.Label();
|
||||
this.pokeLVL_label = new System.Windows.Forms.Label();
|
||||
this.pokeLevel = new System.Windows.Forms.NumericUpDown();
|
||||
this.trainerClassIdx = new System.Windows.Forms.NumericUpDown();
|
||||
this.trainerIdx = new System.Windows.Forms.NumericUpDown();
|
||||
this.natureSelect = new System.Windows.Forms.ComboBox();
|
||||
this.nature_label = new System.Windows.Forms.Label();
|
||||
this.DV_label = new System.Windows.Forms.Label();
|
||||
this.calcButton = new System.Windows.Forms.Button();
|
||||
this.maleCheck = new System.Windows.Forms.CheckBox();
|
||||
this.maxDVNature_label = new System.Windows.Forms.Label();
|
||||
this.IV_label = new System.Windows.Forms.Label();
|
||||
this.pokemonSelector = new System.Windows.Forms.ComboBox();
|
||||
this.showAllButton = new System.Windows.Forms.Button();
|
||||
this.helpButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pokeLevel)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trainerClassIdx)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trainerIdx)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// poke_label
|
||||
//
|
||||
this.poke_label.AutoSize = true;
|
||||
this.poke_label.Location = new System.Drawing.Point(28, 154);
|
||||
this.poke_label.Name = "poke_label";
|
||||
this.poke_label.Size = new System.Drawing.Size(65, 16);
|
||||
this.poke_label.TabIndex = 3;
|
||||
this.poke_label.Text = "Pokémon";
|
||||
//
|
||||
// trainerClassIdx_label
|
||||
//
|
||||
this.trainerClassIdx_label.AutoSize = true;
|
||||
this.trainerClassIdx_label.Location = new System.Drawing.Point(28, 87);
|
||||
this.trainerClassIdx_label.Name = "trainerClassIdx_label";
|
||||
this.trainerClassIdx_label.Size = new System.Drawing.Size(122, 16);
|
||||
this.trainerClassIdx_label.TabIndex = 4;
|
||||
this.trainerClassIdx_label.Text = "Trainer Class Index";
|
||||
//
|
||||
// trainerIdx_label
|
||||
//
|
||||
this.trainerIdx_label.AutoSize = true;
|
||||
this.trainerIdx_label.Location = new System.Drawing.Point(28, 21);
|
||||
this.trainerIdx_label.Name = "trainerIdx_label";
|
||||
this.trainerIdx_label.Size = new System.Drawing.Size(85, 16);
|
||||
this.trainerIdx_label.TabIndex = 5;
|
||||
this.trainerIdx_label.Text = "Trainer Index";
|
||||
//
|
||||
// pokeLVL_label
|
||||
//
|
||||
this.pokeLVL_label.AutoSize = true;
|
||||
this.pokeLVL_label.Location = new System.Drawing.Point(278, 179);
|
||||
this.pokeLVL_label.Name = "pokeLVL_label";
|
||||
this.pokeLVL_label.Size = new System.Drawing.Size(33, 16);
|
||||
this.pokeLVL_label.TabIndex = 6;
|
||||
this.pokeLVL_label.Text = "LVL.";
|
||||
//
|
||||
// pokeLevel
|
||||
//
|
||||
this.pokeLevel.Location = new System.Drawing.Point(318, 177);
|
||||
this.pokeLevel.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.pokeLevel.Name = "pokeLevel";
|
||||
this.pokeLevel.Size = new System.Drawing.Size(46, 22);
|
||||
this.pokeLevel.TabIndex = 7;
|
||||
this.pokeLevel.Value = new decimal(new int[] {
|
||||
50,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// trainerClassIdx
|
||||
//
|
||||
this.trainerClassIdx.Location = new System.Drawing.Point(28, 110);
|
||||
this.trainerClassIdx.Maximum = new decimal(new int[] {
|
||||
120,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.trainerClassIdx.Name = "trainerClassIdx";
|
||||
this.trainerClassIdx.Size = new System.Drawing.Size(125, 22);
|
||||
this.trainerClassIdx.TabIndex = 9;
|
||||
//
|
||||
// trainerIdx
|
||||
//
|
||||
this.trainerIdx.Location = new System.Drawing.Point(28, 44);
|
||||
this.trainerIdx.Maximum = new decimal(new int[] {
|
||||
1000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.trainerIdx.Name = "trainerIdx";
|
||||
this.trainerIdx.Size = new System.Drawing.Size(125, 22);
|
||||
this.trainerIdx.TabIndex = 10;
|
||||
//
|
||||
// natureSelect
|
||||
//
|
||||
this.natureSelect.FormattingEnabled = true;
|
||||
this.natureSelect.Location = new System.Drawing.Point(192, 44);
|
||||
this.natureSelect.Name = "natureSelect";
|
||||
this.natureSelect.Size = new System.Drawing.Size(207, 24);
|
||||
this.natureSelect.TabIndex = 11;
|
||||
//
|
||||
// nature_label
|
||||
//
|
||||
this.nature_label.AutoSize = true;
|
||||
this.nature_label.Location = new System.Drawing.Point(192, 21);
|
||||
this.nature_label.Name = "nature_label";
|
||||
this.nature_label.Size = new System.Drawing.Size(47, 16);
|
||||
this.nature_label.TabIndex = 12;
|
||||
this.nature_label.Text = "Nature";
|
||||
//
|
||||
// DV_label
|
||||
//
|
||||
this.DV_label.AutoSize = true;
|
||||
this.DV_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.DV_label.Location = new System.Drawing.Point(443, 44);
|
||||
this.DV_label.Name = "DV_label";
|
||||
this.DV_label.Size = new System.Drawing.Size(162, 25);
|
||||
this.DV_label.TabIndex = 13;
|
||||
this.DV_label.Text = "Difficulty Value: 0";
|
||||
//
|
||||
// calcButton
|
||||
//
|
||||
this.calcButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.calcButton.Location = new System.Drawing.Point(491, 179);
|
||||
this.calcButton.Name = "calcButton";
|
||||
this.calcButton.Size = new System.Drawing.Size(114, 51);
|
||||
this.calcButton.TabIndex = 14;
|
||||
this.calcButton.Text = "Calculate";
|
||||
this.calcButton.UseVisualStyleBackColor = true;
|
||||
this.calcButton.Click += new System.EventHandler(this.CalcButton_Click);
|
||||
//
|
||||
// maleCheck
|
||||
//
|
||||
this.maleCheck.AutoSize = true;
|
||||
this.maleCheck.Checked = true;
|
||||
this.maleCheck.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.maleCheck.Location = new System.Drawing.Point(192, 111);
|
||||
this.maleCheck.Name = "maleCheck";
|
||||
this.maleCheck.Size = new System.Drawing.Size(112, 20);
|
||||
this.maleCheck.TabIndex = 15;
|
||||
this.maleCheck.Text = "Trainer Male?";
|
||||
this.maleCheck.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// maxDVNature_label
|
||||
//
|
||||
this.maxDVNature_label.AutoSize = true;
|
||||
this.maxDVNature_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.maxDVNature_label.Location = new System.Drawing.Point(323, 127);
|
||||
this.maxDVNature_label.Name = "maxDVNature_label";
|
||||
this.maxDVNature_label.Size = new System.Drawing.Size(125, 20);
|
||||
this.maxDVNature_label.TabIndex = 16;
|
||||
this.maxDVNature_label.Text = "DV 255 Nature:";
|
||||
//
|
||||
// IV_label
|
||||
//
|
||||
this.IV_label.AutoSize = true;
|
||||
this.IV_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.IV_label.Location = new System.Drawing.Point(323, 87);
|
||||
this.IV_label.Name = "IV_label";
|
||||
this.IV_label.Size = new System.Drawing.Size(113, 20);
|
||||
this.IV_label.TabIndex = 17;
|
||||
this.IV_label.Text = "Resulting IVs:";
|
||||
//
|
||||
// pokemonSelector
|
||||
//
|
||||
this.pokemonSelector.FormattingEnabled = true;
|
||||
this.pokemonSelector.Location = new System.Drawing.Point(28, 176);
|
||||
this.pokemonSelector.Name = "pokemonSelector";
|
||||
this.pokemonSelector.Size = new System.Drawing.Size(244, 24);
|
||||
this.pokemonSelector.TabIndex = 18;
|
||||
//
|
||||
// showAllButton
|
||||
//
|
||||
this.showAllButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.showAllButton.Location = new System.Drawing.Point(391, 192);
|
||||
this.showAllButton.Name = "showAllButton";
|
||||
this.showAllButton.Size = new System.Drawing.Size(94, 29);
|
||||
this.showAllButton.TabIndex = 19;
|
||||
this.showAllButton.Text = "Show All";
|
||||
this.showAllButton.UseVisualStyleBackColor = true;
|
||||
this.showAllButton.Click += new System.EventHandler(this.ShowAllButton_Click);
|
||||
//
|
||||
// helpButton
|
||||
//
|
||||
this.helpButton.Location = new System.Drawing.Point(541, 2);
|
||||
this.helpButton.Name = "helpButton";
|
||||
this.helpButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.helpButton.TabIndex = 20;
|
||||
this.helpButton.Text = "Help";
|
||||
this.helpButton.UseVisualStyleBackColor = true;
|
||||
this.helpButton.Click += new System.EventHandler(this.buttonHelp_Click);
|
||||
//
|
||||
// DVCalc
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(628, 242);
|
||||
this.Controls.Add(this.helpButton);
|
||||
this.Controls.Add(this.showAllButton);
|
||||
this.Controls.Add(this.pokemonSelector);
|
||||
this.Controls.Add(this.IV_label);
|
||||
this.Controls.Add(this.maxDVNature_label);
|
||||
this.Controls.Add(this.maleCheck);
|
||||
this.Controls.Add(this.calcButton);
|
||||
this.Controls.Add(this.DV_label);
|
||||
this.Controls.Add(this.nature_label);
|
||||
this.Controls.Add(this.natureSelect);
|
||||
this.Controls.Add(this.trainerIdx);
|
||||
this.Controls.Add(this.trainerClassIdx);
|
||||
this.Controls.Add(this.pokeLevel);
|
||||
this.Controls.Add(this.pokeLVL_label);
|
||||
this.Controls.Add(this.trainerIdx_label);
|
||||
this.Controls.Add(this.trainerClassIdx_label);
|
||||
this.Controls.Add(this.poke_label);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "DVCalc";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "DVCalc";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pokeLevel)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trainerClassIdx)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trainerIdx)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void PopulateComboBox()
|
||||
{
|
||||
// Populate Nature ComboBox (static readonly List)
|
||||
natureSelect.DataSource = DVCalculator.Natures;
|
||||
|
||||
// Fill the pokemon selector combo box with pokemon names from the ROM
|
||||
string[] pokeNames = RomInfo.GetPokemonNames();
|
||||
|
||||
pokemonSelector.Items.Clear();
|
||||
|
||||
for (int id = 0; id < pokeNames.Length; id++)
|
||||
{
|
||||
pokemonSelector.Items.Add(new KeyValuePair<int, string>(id, pokeNames[id]));
|
||||
}
|
||||
|
||||
pokemonSelector.SelectedIndex = 0;
|
||||
|
||||
}
|
||||
|
||||
private void SetTrainerData(int TrainerIndex, int TrainerClassIndex)
|
||||
{
|
||||
trainerIdx.Value = TrainerIndex;
|
||||
trainerClassIdx.Value = TrainerClassIndex;
|
||||
}
|
||||
|
||||
private void CalcButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Natures are sorted by their index so this works
|
||||
uint nature = (uint)natureSelect.SelectedIndex;
|
||||
|
||||
int pokemonIndex = 1;
|
||||
|
||||
if (pokemonSelector.SelectedItem != null)
|
||||
{
|
||||
KeyValuePair<int, string> selectedPokemon = (KeyValuePair<int, string>)pokemonSelector.SelectedItem;
|
||||
|
||||
pokemonIndex = (int)selectedPokemon.Key;
|
||||
}
|
||||
|
||||
int DV = DVCalculator.findHighestDV((int)trainerIdx.Value, (int)trainerClassIdx.Value, maleCheck.Checked, pokemonIndex, (int)pokeLevel.Value, nature);
|
||||
|
||||
// Determine nature for max DV (max IV) for convenience
|
||||
uint maxDVNature = DVCalculator.getNatureFromPID(DVCalculator.generatePID((int)trainerIdx.Value, (int)trainerClassIdx.Value, maleCheck.Checked, pokemonIndex, (int)pokeLevel.Value, 255));
|
||||
|
||||
// Display results
|
||||
DV_label.Text = "Difficulty Value: " + DV;
|
||||
IV_label.Text = "Resulting IVs: " + (DV * 31 / 255);
|
||||
maxDVNature_label.Text = "DV 255 Nature: " + DVCalculator.Natures[(int)maxDVNature];
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void ShowAllButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
int pokemonIndex = 1;
|
||||
|
||||
if (pokemonSelector.SelectedItem != null)
|
||||
{
|
||||
KeyValuePair<int, string> selectedPokemon = (KeyValuePair<int, string>)pokemonSelector.SelectedItem;
|
||||
|
||||
pokemonIndex = (int)selectedPokemon.Key;
|
||||
|
||||
}
|
||||
|
||||
// Create a list of DV-IV-Nature Triplets
|
||||
List<DVIVNatureTriplet> natureDict = DVCalculator.getAllNatures((int)trainerIdx.Value, (int)trainerClassIdx.Value, maleCheck.Checked, pokemonIndex, (int)pokeLevel.Value);
|
||||
|
||||
// Create an instance of the view form and pass the data
|
||||
// There might be a better way to do this?
|
||||
DVCalcNatureViewerForm natureViewer = new DVCalcNatureViewerForm(natureDict);
|
||||
natureViewer.ShowDialog();
|
||||
}
|
||||
|
||||
private void PokemonSelector_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (sender == null || !(sender is ComboBox)) { return; }
|
||||
|
||||
ComboBox comboBox = (ComboBox)sender;
|
||||
string enteredText = comboBox.Text.ToLower();
|
||||
|
||||
// If name of pokemon is typed select that item
|
||||
foreach (KeyValuePair<int, string> item in comboBox.Items)
|
||||
{
|
||||
if (item.Value.ToLower().Equals(enteredText))
|
||||
{
|
||||
comboBox.SelectedItem = item;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonHelp_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show("DV, or \"Difficulty Value\", is used by the game engine to calculate how tough an opponent Pokemon should be.\n" +
|
||||
"The DV affects a Pokemon's Nature and IVs - the higher the value, the stronger the Pokemon.\n" +
|
||||
"DVs will go from 0 (0 IVs) to 255 (31 IVs). Natures are chosen semi-randomly." +
|
||||
"\nIVs will be the same value for all Stats at any DV, so Hidden Power will only be Fighting or Dark Type." +
|
||||
"\nThis calculator allows you to choose a desired Nature and then find the highest possible DV that will yield that Nature." +
|
||||
"\nIf you want a specific combination of IVs and Nature instead, please click the \"Show All\" button and find the one you want."
|
||||
, "Difficulty Value", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/DVCalculator/DVCalc.resx
Normal file
120
DS_Map/DVCalculator/DVCalc.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
78
DS_Map/DVCalculator/DVCalcNatureViewerForm.Designer.cs
generated
Normal file
78
DS_Map/DVCalculator/DVCalcNatureViewerForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE
|
||||
{
|
||||
partial class DVCalcNatureViewerForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.natureGridView = new System.Windows.Forms.DataGridView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.natureGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// natureGridView
|
||||
//
|
||||
this.natureGridView.AllowUserToAddRows = false;
|
||||
this.natureGridView.AllowUserToDeleteRows = false;
|
||||
this.natureGridView.AllowUserToOrderColumns = true;
|
||||
this.natureGridView.AllowUserToResizeRows = false;
|
||||
this.natureGridView.BackgroundColor = System.Drawing.SystemColors.Menu;
|
||||
this.natureGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.natureGridView.ColumnHeadersHeight = 29;
|
||||
this.natureGridView.Location = new System.Drawing.Point(16, 10);
|
||||
this.natureGridView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.natureGridView.Name = "natureGridView";
|
||||
this.natureGridView.ReadOnly = true;
|
||||
this.natureGridView.RowHeadersWidth = 51;
|
||||
this.natureGridView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.natureGridView.Size = new System.Drawing.Size(387, 333);
|
||||
this.natureGridView.TabIndex = 0;
|
||||
//
|
||||
// DVCalcNatureViewerForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 352);
|
||||
this.Controls.Add(this.natureGridView);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "DVCalcNatureViewerForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Full List";
|
||||
((System.ComponentModel.ISupportInitialize)(this.natureGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView natureGridView;
|
||||
}
|
||||
}
|
||||
40
DS_Map/DVCalculator/DVCalcNatureViewerForm.cs
Normal file
40
DS_Map/DVCalculator/DVCalcNatureViewerForm.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE
|
||||
{
|
||||
public partial class DVCalcNatureViewerForm : Form
|
||||
{
|
||||
|
||||
private List<DVIVNatureTriplet> data;
|
||||
|
||||
public DVCalcNatureViewerForm(List<DVIVNatureTriplet> data)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.data = data;
|
||||
PopulateDataGridView();
|
||||
}
|
||||
|
||||
private void PopulateDataGridView()
|
||||
{
|
||||
// Create a BindingList to bind to the DataGridView
|
||||
var bindingList = new BindingList<DVIVNatureTriplet>(data.ToList());
|
||||
|
||||
// Set the DataSource of the DataGridView
|
||||
natureGridView.DataSource = bindingList;
|
||||
|
||||
// Set the columns
|
||||
natureGridView.Columns[0].HeaderText = "IV";
|
||||
natureGridView.Columns[0].DataPropertyName = "IV";
|
||||
natureGridView.Columns[1].HeaderText = "Nature";
|
||||
natureGridView.Columns[1].DataPropertyName = "Nature";
|
||||
natureGridView.Columns[2].HeaderText = "DV";
|
||||
natureGridView.Columns[2].DataPropertyName = "DV";
|
||||
|
||||
// Adjust column widths
|
||||
natureGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/DVCalculator/DVCalcNatureViewerForm.resx
Normal file
120
DS_Map/DVCalculator/DVCalcNatureViewerForm.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
143
DS_Map/DVCalculator/DVCalculator.cs
Normal file
143
DS_Map/DVCalculator/DVCalculator.cs
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace DSPRE
|
||||
{
|
||||
// Putting this class here is bad practice, however it's just a really small utility class
|
||||
public class DVIVNatureTriplet
|
||||
{
|
||||
public int DV { get; set; }
|
||||
public int IV { get; set; }
|
||||
public string Nature { get; set; }
|
||||
|
||||
public DVIVNatureTriplet(int DV, int IV, string Nature)
|
||||
{
|
||||
this.DV = DV;
|
||||
this.IV = IV;
|
||||
this.Nature = Nature;
|
||||
}
|
||||
}
|
||||
|
||||
internal static class DVCalculator
|
||||
{
|
||||
private static long seed;
|
||||
|
||||
public static void setSeed(long seed)
|
||||
{
|
||||
DVCalculator.seed = seed;
|
||||
}
|
||||
|
||||
public static long getSeed()
|
||||
{
|
||||
return DVCalculator.seed;
|
||||
}
|
||||
|
||||
|
||||
// This function is lifted from turtleisaac's Pokeditor (with permission)
|
||||
// See https://github.com/turtleisaac/PokEditor-v2/blob/72ca6ab641f616b8be9a87624b81896baa45f947/src/com/turtleisaac/pokeditor/utilities/TrainerPersonalityCalculator.java
|
||||
public static long getNextRandom()
|
||||
{
|
||||
long random = 0x41c64e6d * seed + 0x6073;
|
||||
|
||||
//last 32 bits is new seed
|
||||
seed = random & 0xFFFFFFFFL;
|
||||
|
||||
return random;
|
||||
}
|
||||
|
||||
public static int findHighestDV(int trainerIdx, int trainerClassIdx, bool trainerClassMale, int pokeIdx, int pokeLevel, uint nature)
|
||||
{
|
||||
int DV;
|
||||
|
||||
// Iterate over all possible PIDs and return highest DV that yields the desired nature
|
||||
for (DV = 255; DV >= 0; DV--)
|
||||
{
|
||||
if (getNatureFromPID(generatePID(trainerIdx, trainerClassIdx, trainerClassMale, pokeIdx, pokeLevel, DV)) == nature)
|
||||
{ return DV; }
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
// this function is lifted from turtleisaac's Pokeditor (with permission)
|
||||
// See https://github.com/turtleisaac/PokEditor-v2/blob/72ca6ab641f616b8be9a87624b81896baa45f947/src/com/turtleisaac/pokeditor/utilities/TrainerPersonalityCalculator.java
|
||||
public static uint generatePID(int trainerIdx, int trainerClassIdx, bool trainerClassMale, int pokeIdx, int pokeLevel, int difficultyValue)
|
||||
{
|
||||
long newSeed = trainerIdx + pokeIdx + pokeLevel + difficultyValue;
|
||||
|
||||
long random = 0;
|
||||
|
||||
setSeed(newSeed);
|
||||
|
||||
while (trainerClassIdx > 0)
|
||||
{
|
||||
trainerClassIdx--;
|
||||
random = getNextRandom();
|
||||
}
|
||||
|
||||
// Don't really get this part? Why are we shifting to the right then left again?
|
||||
long PID = (random >> 16) & 0xffff;
|
||||
PID = PID * 256;
|
||||
|
||||
// This seems super arbitrary (wtf GameFreak?)
|
||||
PID += trainerClassMale ? 136 : 120;
|
||||
|
||||
return (uint)PID;
|
||||
}
|
||||
|
||||
public static uint getNatureFromPID(uint PID)
|
||||
{
|
||||
return (PID % 100) % 25;
|
||||
}
|
||||
|
||||
public static List<DVIVNatureTriplet> getAllNatures(int trainerIdx, int trainerClassIdx, bool trainerClassMale, int pokeIdx, int pokeLevel)
|
||||
{
|
||||
List<DVIVNatureTriplet> natureList = new List<DVIVNatureTriplet>();
|
||||
|
||||
int DV;
|
||||
uint natureIdx;
|
||||
|
||||
// Iterate over all possible PIDs and store the DV IV and Nature String in the custom data type
|
||||
for (DV = 255; DV >= 0; DV--)
|
||||
{
|
||||
natureIdx = getNatureFromPID(generatePID(trainerIdx, trainerClassIdx, trainerClassMale, pokeIdx, pokeLevel, DV));
|
||||
|
||||
natureList.Add(new DVIVNatureTriplet(DV, DV*31/255 , Natures[(int)natureIdx]));
|
||||
|
||||
}
|
||||
|
||||
return natureList;
|
||||
}
|
||||
|
||||
public static readonly List<string> Natures = new List<string>
|
||||
{
|
||||
"Hardy: Neutral",
|
||||
"Lonely: +Atk, -Def",
|
||||
"Brave: +Atk, -Spe",
|
||||
"Adamant: +Atk, -SpA",
|
||||
"Naughty: +Atk, -SpD",
|
||||
"Bold: +Def, -Atk",
|
||||
"Docile: Neutral",
|
||||
"Relaxed: +Def, -Spe",
|
||||
"Impish: +Def, -SpA",
|
||||
"Lax: +Def, -SpD",
|
||||
"Timid: +Spe, -Atk",
|
||||
"Hasty: +Spe, -Def",
|
||||
"Serious: Neutral",
|
||||
"Jolly: +Spe, -SpA",
|
||||
"Naive: +Spe, -SpD",
|
||||
"Modest: +SpA, -Atk",
|
||||
"Mild: +SpA, -Def",
|
||||
"Quiet: +SpA, -Spe",
|
||||
"Bashful: Neutral",
|
||||
"Rash: +SpA, -SpD",
|
||||
"Calm: +SpD, -Atk",
|
||||
"Gentle: +SpD, -Def",
|
||||
"Sassy: +SpD, -Spe",
|
||||
"Careful: +SpD, -SpA",
|
||||
"Quirky: Neutral"
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
24
DS_Map/EditorPanels.cs
Normal file
24
DS_Map/EditorPanels.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System.Windows.Forms;
|
||||
using DSPRE.Editors;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class EditorPanels {
|
||||
public static MainProgram MainProgram;
|
||||
|
||||
public static void Initialize(MainProgram mainProgram) {
|
||||
MainProgram = mainProgram;
|
||||
}
|
||||
public static TabControl mainTabControl { get { return MainProgram.mainTabControl; } }
|
||||
|
||||
public static ScriptEditor scriptEditor { get { return MainProgram.scriptEditor; } }
|
||||
public static LevelScriptEditor levelScriptEditor { get { return MainProgram.levelScriptEditor; } }
|
||||
|
||||
public static EncountersEditor encountersEditor { get { return MainProgram.encountersEditor; } }
|
||||
|
||||
public static TabPage scriptEditorTabPage { get { return MainProgram.tabPageScriptEditor; } }
|
||||
public static TabPage levelScriptEditorTabPage { get { return MainProgram.tabPageLevelScriptEditor; } }
|
||||
public static TabPage tabPageEncountersEditor { get { return MainProgram.tabPageEncountersEditor; } }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
115
DS_Map/Editors/EncountersEditor.Designer.cs
generated
Normal file
115
DS_Map/Editors/EncountersEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
partial class EncountersEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tabControl = new System.Windows.Forms.TabControl();
|
||||
this.tabPageHeadbuttEditor = new System.Windows.Forms.TabPage();
|
||||
this.headbuttEncounterEditor = new DSPRE.Editors.HeadbuttEncounterEditor();
|
||||
this.tabPageSafariZoneEditor = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEditor = new DSPRE.Editors.SafariZoneEditor();
|
||||
this.tabControl.SuspendLayout();
|
||||
this.tabPageHeadbuttEditor.SuspendLayout();
|
||||
this.tabPageSafariZoneEditor.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl
|
||||
//
|
||||
this.tabControl.Controls.Add(this.tabPageHeadbuttEditor);
|
||||
this.tabControl.Controls.Add(this.tabPageSafariZoneEditor);
|
||||
this.tabControl.Location = new System.Drawing.Point(4, 4);
|
||||
this.tabControl.Name = "tabControl";
|
||||
this.tabControl.SelectedIndex = 0;
|
||||
this.tabControl.Size = new System.Drawing.Size(1103, 654);
|
||||
this.tabControl.TabIndex = 2;
|
||||
//
|
||||
// tabPageHeadbuttEditor
|
||||
//
|
||||
this.tabPageHeadbuttEditor.Controls.Add(this.headbuttEncounterEditor);
|
||||
this.tabPageHeadbuttEditor.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageHeadbuttEditor.Name = "tabPageHeadbuttEditor";
|
||||
this.tabPageHeadbuttEditor.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageHeadbuttEditor.Size = new System.Drawing.Size(1095, 628);
|
||||
this.tabPageHeadbuttEditor.TabIndex = 0;
|
||||
this.tabPageHeadbuttEditor.Text = "Headbutt";
|
||||
this.tabPageHeadbuttEditor.UseVisualStyleBackColor = true;
|
||||
this.tabPageHeadbuttEditor.Enter += new System.EventHandler(this.tabPageHeadbuttEditor_Enter);
|
||||
//
|
||||
// headbuttEncounterEditor
|
||||
//
|
||||
this.headbuttEncounterEditor.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.headbuttEncounterEditor.headbuttEncounterEditorIsReady = false;
|
||||
this.headbuttEncounterEditor.Location = new System.Drawing.Point(6, 6);
|
||||
this.headbuttEncounterEditor.Name = "headbuttEncounterEditor";
|
||||
this.headbuttEncounterEditor.Size = new System.Drawing.Size(1081, 621);
|
||||
this.headbuttEncounterEditor.TabIndex = 1;
|
||||
//
|
||||
// tabPageSafariZoneEditor
|
||||
//
|
||||
this.tabPageSafariZoneEditor.Controls.Add(this.safariZoneEditor);
|
||||
this.tabPageSafariZoneEditor.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageSafariZoneEditor.Name = "tabPageSafariZoneEditor";
|
||||
this.tabPageSafariZoneEditor.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageSafariZoneEditor.Size = new System.Drawing.Size(1095, 628);
|
||||
this.tabPageSafariZoneEditor.TabIndex = 1;
|
||||
this.tabPageSafariZoneEditor.Text = "Safari Zone";
|
||||
this.tabPageSafariZoneEditor.UseVisualStyleBackColor = true;
|
||||
this.tabPageSafariZoneEditor.Enter += new System.EventHandler(this.tabPageSafariZoneEditor_Enter);
|
||||
//
|
||||
// safariZoneEditor
|
||||
//
|
||||
this.safariZoneEditor.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEditor.Name = "safariZoneEditor";
|
||||
this.safariZoneEditor.safariZoneEditorIsReady = false;
|
||||
this.safariZoneEditor.Size = new System.Drawing.Size(996, 341);
|
||||
this.safariZoneEditor.TabIndex = 1;
|
||||
//
|
||||
// EncountersEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.tabControl);
|
||||
this.Name = "EncountersEditor";
|
||||
this.Size = new System.Drawing.Size(1111, 664);
|
||||
this.tabControl.ResumeLayout(false);
|
||||
this.tabPageHeadbuttEditor.ResumeLayout(false);
|
||||
this.tabPageSafariZoneEditor.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public HeadbuttEncounterEditor headbuttEncounterEditor;
|
||||
private System.Windows.Forms.TabControl tabControl;
|
||||
private System.Windows.Forms.TabPage tabPageHeadbuttEditor;
|
||||
private System.Windows.Forms.TabPage tabPageSafariZoneEditor;
|
||||
public SafariZoneEditor safariZoneEditor;
|
||||
}
|
||||
}
|
||||
27
DS_Map/Editors/EncountersEditor.cs
Normal file
27
DS_Map/Editors/EncountersEditor.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
public partial class EncountersEditor : UserControl
|
||||
{
|
||||
public EncountersEditor()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetupEncountersEditor() {
|
||||
tabPageHeadbuttEditor_Enter(null, null);
|
||||
}
|
||||
|
||||
private void tabPageHeadbuttEditor_Enter(object sender, System.EventArgs e)
|
||||
{
|
||||
headbuttEncounterEditor.SetupHeadbuttEncounterEditor();
|
||||
headbuttEncounterEditor.makeCurrent();
|
||||
}
|
||||
|
||||
private void tabPageSafariZoneEditor_Enter(object sender, System.EventArgs e)
|
||||
{
|
||||
safariZoneEditor.SetupSafariZoneEditor();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/EncountersEditor.resx
Normal file
120
DS_Map/Editors/EncountersEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
459
DS_Map/Editors/HeadbuttEncounterEditor.Designer.cs
generated
Normal file
459
DS_Map/Editors/HeadbuttEncounterEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,459 @@
|
|||
using System.ComponentModel;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
partial class HeadbuttEncounterEditor {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.buttonSaveAs = new System.Windows.Forms.Button();
|
||||
this.buttonSave = new System.Windows.Forms.Button();
|
||||
this.tabControl = new System.Windows.Forms.TabControl();
|
||||
this.tabPageNormal = new System.Windows.Forms.TabPage();
|
||||
this.headbuttEncounterEditorTabNormal = new DSPRE.Editors.HeadbuttEncounterEditorTab();
|
||||
this.tabPageSpecial = new System.Windows.Forms.TabPage();
|
||||
this.headbuttEncounterEditorTabSpecial = new DSPRE.Editors.HeadbuttEncounterEditorTab();
|
||||
this.mapRenderPanel = new System.Windows.Forms.Panel();
|
||||
this.openGlPictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.mapScreenshotButton = new System.Windows.Forms.Button();
|
||||
this.comboBoxMapHeader = new System.Windows.Forms.ComboBox();
|
||||
this.comboBoxMapFile = new System.Windows.Forms.ComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.labelLocationName = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.numericUpDownTreeGlobalX = new System.Windows.Forms.NumericUpDown();
|
||||
this.numericUpDownTreeGlobalY = new System.Windows.Forms.NumericUpDown();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.numericUpDownTreeMatrixX = new System.Windows.Forms.NumericUpDown();
|
||||
this.numericUpDownTreeMatrixY = new System.Windows.Forms.NumericUpDown();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.numericUpDownTreeMapX = new System.Windows.Forms.NumericUpDown();
|
||||
this.numericUpDownTreeMapY = new System.Windows.Forms.NumericUpDown();
|
||||
this.RightClickLabel = new System.Windows.Forms.Label();
|
||||
this.LeftClickLabel = new System.Windows.Forms.Label();
|
||||
this.LeftClickPicture = new System.Windows.Forms.PictureBox();
|
||||
this.rightClickPicture = new System.Windows.Forms.PictureBox();
|
||||
this.buttonImport = new System.Windows.Forms.Button();
|
||||
this.tabControl.SuspendLayout();
|
||||
this.tabPageNormal.SuspendLayout();
|
||||
this.tabPageSpecial.SuspendLayout();
|
||||
this.mapRenderPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.openGlPictureBox)).BeginInit();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeGlobalX)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeGlobalY)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMatrixX)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMatrixY)).BeginInit();
|
||||
this.groupBox3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMapX)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMapY)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.LeftClickPicture)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rightClickPicture)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonSaveAs
|
||||
//
|
||||
this.buttonSaveAs.Location = new System.Drawing.Point(338, 29);
|
||||
this.buttonSaveAs.Name = "buttonSaveAs";
|
||||
this.buttonSaveAs.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonSaveAs.TabIndex = 9;
|
||||
this.buttonSaveAs.Text = "Save As";
|
||||
this.buttonSaveAs.UseVisualStyleBackColor = true;
|
||||
this.buttonSaveAs.Click += new System.EventHandler(this.buttonSaveAs_Click);
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
this.buttonSave.Location = new System.Drawing.Point(338, 3);
|
||||
this.buttonSave.Name = "buttonSave";
|
||||
this.buttonSave.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonSave.TabIndex = 10;
|
||||
this.buttonSave.Text = "Save";
|
||||
this.buttonSave.UseVisualStyleBackColor = true;
|
||||
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
|
||||
//
|
||||
// tabControl
|
||||
//
|
||||
this.tabControl.Controls.Add(this.tabPageNormal);
|
||||
this.tabControl.Controls.Add(this.tabPageSpecial);
|
||||
this.tabControl.Location = new System.Drawing.Point(3, 71);
|
||||
this.tabControl.Name = "tabControl";
|
||||
this.tabControl.SelectedIndex = 0;
|
||||
this.tabControl.Size = new System.Drawing.Size(274, 544);
|
||||
this.tabControl.TabIndex = 21;
|
||||
//
|
||||
// tabPageNormal
|
||||
//
|
||||
this.tabPageNormal.Controls.Add(this.headbuttEncounterEditorTabNormal);
|
||||
this.tabPageNormal.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageNormal.Name = "tabPageNormal";
|
||||
this.tabPageNormal.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageNormal.Size = new System.Drawing.Size(266, 518);
|
||||
this.tabPageNormal.TabIndex = 0;
|
||||
this.tabPageNormal.Text = "Normal";
|
||||
this.tabPageNormal.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// headbuttEncounterEditorTabNormal
|
||||
//
|
||||
this.headbuttEncounterEditorTabNormal.Location = new System.Drawing.Point(2, 2);
|
||||
this.headbuttEncounterEditorTabNormal.Name = "headbuttEncounterEditorTabNormal";
|
||||
this.headbuttEncounterEditorTabNormal.Size = new System.Drawing.Size(264, 519);
|
||||
this.headbuttEncounterEditorTabNormal.TabIndex = 0;
|
||||
//
|
||||
// tabPageSpecial
|
||||
//
|
||||
this.tabPageSpecial.Controls.Add(this.headbuttEncounterEditorTabSpecial);
|
||||
this.tabPageSpecial.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageSpecial.Name = "tabPageSpecial";
|
||||
this.tabPageSpecial.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageSpecial.Size = new System.Drawing.Size(266, 518);
|
||||
this.tabPageSpecial.TabIndex = 1;
|
||||
this.tabPageSpecial.Text = "Special";
|
||||
this.tabPageSpecial.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// headbuttEncounterEditorTabSpecial
|
||||
//
|
||||
this.headbuttEncounterEditorTabSpecial.Location = new System.Drawing.Point(2, 2);
|
||||
this.headbuttEncounterEditorTabSpecial.Name = "headbuttEncounterEditorTabSpecial";
|
||||
this.headbuttEncounterEditorTabSpecial.Size = new System.Drawing.Size(402, 518);
|
||||
this.headbuttEncounterEditorTabSpecial.TabIndex = 0;
|
||||
//
|
||||
// mapRenderPanel
|
||||
//
|
||||
this.mapRenderPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.mapRenderPanel.Controls.Add(this.openGlPictureBox);
|
||||
this.mapRenderPanel.Location = new System.Drawing.Point(419, 4);
|
||||
this.mapRenderPanel.Name = "mapRenderPanel";
|
||||
this.mapRenderPanel.Size = new System.Drawing.Size(610, 610);
|
||||
this.mapRenderPanel.TabIndex = 24;
|
||||
//
|
||||
// openGlPictureBox
|
||||
//
|
||||
this.openGlPictureBox.BackColor = System.Drawing.Color.White;
|
||||
this.openGlPictureBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.openGlPictureBox.Name = "openGlPictureBox";
|
||||
this.openGlPictureBox.Size = new System.Drawing.Size(608, 608);
|
||||
this.openGlPictureBox.TabIndex = 3;
|
||||
this.openGlPictureBox.TabStop = false;
|
||||
this.openGlPictureBox.Click += new System.EventHandler(this.openGlPictureBox_Click);
|
||||
//
|
||||
// mapScreenshotButton
|
||||
//
|
||||
this.mapScreenshotButton.Image = global::DSPRE.Properties.Resources.cameraIcon;
|
||||
this.mapScreenshotButton.Location = new System.Drawing.Point(1034, 574);
|
||||
this.mapScreenshotButton.Name = "mapScreenshotButton";
|
||||
this.mapScreenshotButton.Size = new System.Drawing.Size(41, 40);
|
||||
this.mapScreenshotButton.TabIndex = 39;
|
||||
this.mapScreenshotButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.mapScreenshotButton.UseVisualStyleBackColor = true;
|
||||
this.mapScreenshotButton.Click += new System.EventHandler(this.mapScreenshotButton_Click);
|
||||
//
|
||||
// comboBoxMapHeader
|
||||
//
|
||||
this.comboBoxMapHeader.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxMapHeader.FormattingEnabled = true;
|
||||
this.comboBoxMapHeader.Location = new System.Drawing.Point(54, 4);
|
||||
this.comboBoxMapHeader.Name = "comboBoxMapHeader";
|
||||
this.comboBoxMapHeader.Size = new System.Drawing.Size(278, 21);
|
||||
this.comboBoxMapHeader.TabIndex = 40;
|
||||
this.comboBoxMapHeader.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapHeader_SelectedIndexChanged);
|
||||
//
|
||||
// comboBoxMapFile
|
||||
//
|
||||
this.comboBoxMapFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxMapFile.FormattingEnabled = true;
|
||||
this.comboBoxMapFile.Location = new System.Drawing.Point(54, 31);
|
||||
this.comboBoxMapFile.Name = "comboBoxMapFile";
|
||||
this.comboBoxMapFile.Size = new System.Drawing.Size(278, 21);
|
||||
this.comboBoxMapFile.TabIndex = 40;
|
||||
this.comboBoxMapFile.SelectedIndexChanged += new System.EventHandler(this.comboBoxMapFile_SelectedIndexChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(6, 7);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(42, 13);
|
||||
this.label1.TabIndex = 41;
|
||||
this.label1.Text = "Header";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(20, 36);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(28, 13);
|
||||
this.label2.TabIndex = 41;
|
||||
this.label2.Text = "Map";
|
||||
//
|
||||
// labelLocationName
|
||||
//
|
||||
this.labelLocationName.AutoSize = true;
|
||||
this.labelLocationName.Location = new System.Drawing.Point(51, 55);
|
||||
this.labelLocationName.Name = "labelLocationName";
|
||||
this.labelLocationName.Size = new System.Drawing.Size(35, 13);
|
||||
this.labelLocationName.TabIndex = 42;
|
||||
this.labelLocationName.Text = "label3";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.numericUpDownTreeGlobalX);
|
||||
this.groupBox1.Controls.Add(this.numericUpDownTreeGlobalY);
|
||||
this.groupBox1.Location = new System.Drawing.Point(279, 452);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(134, 49);
|
||||
this.groupBox1.TabIndex = 16;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Global";
|
||||
//
|
||||
// numericUpDownTreeGlobalX
|
||||
//
|
||||
this.numericUpDownTreeGlobalX.Location = new System.Drawing.Point(6, 19);
|
||||
this.numericUpDownTreeGlobalX.Maximum = new decimal(new int[] {
|
||||
65535,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownTreeGlobalX.Name = "numericUpDownTreeGlobalX";
|
||||
this.numericUpDownTreeGlobalX.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownTreeGlobalX.TabIndex = 15;
|
||||
this.numericUpDownTreeGlobalX.ValueChanged += new System.EventHandler(this.numericUpDownTreeGlobalX_ValueChanged);
|
||||
//
|
||||
// numericUpDownTreeGlobalY
|
||||
//
|
||||
this.numericUpDownTreeGlobalY.Location = new System.Drawing.Point(70, 19);
|
||||
this.numericUpDownTreeGlobalY.Maximum = new decimal(new int[] {
|
||||
65535,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownTreeGlobalY.Name = "numericUpDownTreeGlobalY";
|
||||
this.numericUpDownTreeGlobalY.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownTreeGlobalY.TabIndex = 15;
|
||||
this.numericUpDownTreeGlobalY.ValueChanged += new System.EventHandler(this.numericUpDownTreeGlobalY_ValueChanged);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.numericUpDownTreeMatrixX);
|
||||
this.groupBox2.Controls.Add(this.numericUpDownTreeMatrixY);
|
||||
this.groupBox2.Location = new System.Drawing.Point(279, 507);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(134, 49);
|
||||
this.groupBox2.TabIndex = 16;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Matrix";
|
||||
//
|
||||
// numericUpDownTreeMatrixX
|
||||
//
|
||||
this.numericUpDownTreeMatrixX.Location = new System.Drawing.Point(6, 19);
|
||||
this.numericUpDownTreeMatrixX.Maximum = new decimal(new int[] {
|
||||
65535,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownTreeMatrixX.Name = "numericUpDownTreeMatrixX";
|
||||
this.numericUpDownTreeMatrixX.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownTreeMatrixX.TabIndex = 15;
|
||||
this.numericUpDownTreeMatrixX.ValueChanged += new System.EventHandler(this.numericUpDownTreeMatrixX_ValueChanged);
|
||||
//
|
||||
// numericUpDownTreeMatrixY
|
||||
//
|
||||
this.numericUpDownTreeMatrixY.Location = new System.Drawing.Point(70, 19);
|
||||
this.numericUpDownTreeMatrixY.Maximum = new decimal(new int[] {
|
||||
65535,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownTreeMatrixY.Name = "numericUpDownTreeMatrixY";
|
||||
this.numericUpDownTreeMatrixY.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownTreeMatrixY.TabIndex = 15;
|
||||
this.numericUpDownTreeMatrixY.ValueChanged += new System.EventHandler(this.numericUpDownTreeMatrixY_ValueChanged);
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.numericUpDownTreeMapX);
|
||||
this.groupBox3.Controls.Add(this.numericUpDownTreeMapY);
|
||||
this.groupBox3.Location = new System.Drawing.Point(279, 562);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(134, 49);
|
||||
this.groupBox3.TabIndex = 16;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Local";
|
||||
//
|
||||
// numericUpDownTreeMapX
|
||||
//
|
||||
this.numericUpDownTreeMapX.Location = new System.Drawing.Point(6, 19);
|
||||
this.numericUpDownTreeMapX.Maximum = new decimal(new int[] {
|
||||
31,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownTreeMapX.Name = "numericUpDownTreeMapX";
|
||||
this.numericUpDownTreeMapX.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownTreeMapX.TabIndex = 15;
|
||||
this.numericUpDownTreeMapX.ValueChanged += new System.EventHandler(this.numericUpDownTreeMapX_ValueChanged);
|
||||
//
|
||||
// numericUpDownTreeMapY
|
||||
//
|
||||
this.numericUpDownTreeMapY.Location = new System.Drawing.Point(70, 19);
|
||||
this.numericUpDownTreeMapY.Maximum = new decimal(new int[] {
|
||||
31,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownTreeMapY.Name = "numericUpDownTreeMapY";
|
||||
this.numericUpDownTreeMapY.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownTreeMapY.TabIndex = 15;
|
||||
this.numericUpDownTreeMapY.ValueChanged += new System.EventHandler(this.numericUpDownTreeMapY_ValueChanged);
|
||||
//
|
||||
// RightClickLabel
|
||||
//
|
||||
this.RightClickLabel.AutoSize = true;
|
||||
this.RightClickLabel.Location = new System.Drawing.Point(308, 425);
|
||||
this.RightClickLabel.Name = "RightClickLabel";
|
||||
this.RightClickLabel.Size = new System.Drawing.Size(37, 13);
|
||||
this.RightClickLabel.TabIndex = 66;
|
||||
this.RightClickLabel.Text = "Select";
|
||||
//
|
||||
// LeftClickLabel
|
||||
//
|
||||
this.LeftClickLabel.AutoSize = true;
|
||||
this.LeftClickLabel.Location = new System.Drawing.Point(352, 425);
|
||||
this.LeftClickLabel.Name = "LeftClickLabel";
|
||||
this.LeftClickLabel.Size = new System.Drawing.Size(34, 13);
|
||||
this.LeftClickLabel.TabIndex = 63;
|
||||
this.LeftClickLabel.Text = "Move";
|
||||
//
|
||||
// LeftClickPicture
|
||||
//
|
||||
this.LeftClickPicture.Image = global::DSPRE.Properties.Resources.LeftClick;
|
||||
this.LeftClickPicture.ImageLocation = "";
|
||||
this.LeftClickPicture.Location = new System.Drawing.Point(349, 387);
|
||||
this.LeftClickPicture.Name = "LeftClickPicture";
|
||||
this.LeftClickPicture.Size = new System.Drawing.Size(38, 38);
|
||||
this.LeftClickPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||
this.LeftClickPicture.TabIndex = 61;
|
||||
this.LeftClickPicture.TabStop = false;
|
||||
//
|
||||
// rightClickPicture
|
||||
//
|
||||
this.rightClickPicture.Image = global::DSPRE.Properties.Resources.RightClick;
|
||||
this.rightClickPicture.ImageLocation = "";
|
||||
this.rightClickPicture.Location = new System.Drawing.Point(307, 387);
|
||||
this.rightClickPicture.Name = "rightClickPicture";
|
||||
this.rightClickPicture.Size = new System.Drawing.Size(38, 38);
|
||||
this.rightClickPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||
this.rightClickPicture.TabIndex = 65;
|
||||
this.rightClickPicture.TabStop = false;
|
||||
//
|
||||
// buttonImport
|
||||
//
|
||||
this.buttonImport.Location = new System.Drawing.Point(338, 55);
|
||||
this.buttonImport.Name = "buttonImport";
|
||||
this.buttonImport.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonImport.TabIndex = 9;
|
||||
this.buttonImport.Text = "Import";
|
||||
this.buttonImport.UseVisualStyleBackColor = true;
|
||||
this.buttonImport.Click += new System.EventHandler(this.buttonImport_Click);
|
||||
//
|
||||
// HeadbuttEncounterEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Controls.Add(this.RightClickLabel);
|
||||
this.Controls.Add(this.LeftClickLabel);
|
||||
this.Controls.Add(this.LeftClickPicture);
|
||||
this.Controls.Add(this.rightClickPicture);
|
||||
this.Controls.Add(this.labelLocationName);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.comboBoxMapFile);
|
||||
this.Controls.Add(this.comboBoxMapHeader);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.mapRenderPanel);
|
||||
this.Controls.Add(this.tabControl);
|
||||
this.Controls.Add(this.mapScreenshotButton);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.buttonImport);
|
||||
this.Controls.Add(this.buttonSaveAs);
|
||||
this.Controls.Add(this.buttonSave);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Location = new System.Drawing.Point(15, 15);
|
||||
this.Name = "HeadbuttEncounterEditor";
|
||||
this.Size = new System.Drawing.Size(1080, 620);
|
||||
this.tabControl.ResumeLayout(false);
|
||||
this.tabPageNormal.ResumeLayout(false);
|
||||
this.tabPageSpecial.ResumeLayout(false);
|
||||
this.mapRenderPanel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.openGlPictureBox)).EndInit();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeGlobalX)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeGlobalY)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMatrixX)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMatrixY)).EndInit();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMapX)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTreeMapY)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.LeftClickPicture)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.rightClickPicture)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
private System.Windows.Forms.Button buttonSaveAs;
|
||||
private System.Windows.Forms.Button buttonSave;
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.TabControl tabControl;
|
||||
private System.Windows.Forms.TabPage tabPageNormal;
|
||||
private System.Windows.Forms.TabPage tabPageSpecial;
|
||||
private HeadbuttEncounterEditorTab headbuttEncounterEditorTabNormal;
|
||||
private HeadbuttEncounterEditorTab headbuttEncounterEditorTabSpecial;
|
||||
private System.Windows.Forms.Panel mapRenderPanel;
|
||||
private System.Windows.Forms.PictureBox openGlPictureBox;
|
||||
private System.Windows.Forms.Button mapScreenshotButton;
|
||||
private System.Windows.Forms.ComboBox comboBoxMapHeader;
|
||||
private System.Windows.Forms.ComboBox comboBoxMapFile;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label labelLocationName;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownTreeGlobalX;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownTreeGlobalY;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownTreeMatrixX;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownTreeMatrixY;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownTreeMapX;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownTreeMapY;
|
||||
private System.Windows.Forms.Label RightClickLabel;
|
||||
private System.Windows.Forms.Label LeftClickLabel;
|
||||
private System.Windows.Forms.PictureBox LeftClickPicture;
|
||||
private System.Windows.Forms.PictureBox rightClickPicture;
|
||||
private System.Windows.Forms.Button buttonImport;
|
||||
}
|
||||
}
|
||||
|
||||
491
DS_Map/Editors/HeadbuttEncounterEditor.cs
Normal file
491
DS_Map/Editors/HeadbuttEncounterEditor.cs
Normal file
|
|
@ -0,0 +1,491 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using DSPRE.ROMFiles;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
public partial class HeadbuttEncounterEditor : UserControl {
|
||||
public bool headbuttEncounterEditorIsReady { get; set; } = false;
|
||||
|
||||
private ListBox2 listBoxTrees;
|
||||
private HeadbuttTree headbuttTree;
|
||||
|
||||
private HeaderHGSS mapHeader;
|
||||
private HeadbuttEncounterFile headbuttEncounterFile;
|
||||
private HeadbuttEncounterMap headbuttEncounterMap;
|
||||
private GameMatrix gameMatrix;
|
||||
private AreaData areaData;
|
||||
private MapFile mapFile;
|
||||
private string locationName;
|
||||
|
||||
private int width;
|
||||
private int height;
|
||||
static SimpleOpenGlControl2 openGlControl;
|
||||
|
||||
private Pen selectedPen;
|
||||
private Pen normalPen;
|
||||
private SolidBrush normalBrush;
|
||||
private Pen specialPen;
|
||||
private SolidBrush specialBrush;
|
||||
|
||||
private static float perspective;
|
||||
private static float ang;
|
||||
private static float dist;
|
||||
private static float elev;
|
||||
|
||||
public HeadbuttEncounterEditor() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
//TODO: refresh headers list if a header is added
|
||||
public void SetupHeadbuttEncounterEditor(bool force = false) {
|
||||
if (headbuttEncounterEditorIsReady && !force) return;
|
||||
headbuttEncounterEditorIsReady = true;
|
||||
|
||||
DSUtils.TryUnpackNarcs(new List<RomInfo.DirNames>() {
|
||||
RomInfo.DirNames.dynamicHeaders,
|
||||
RomInfo.DirNames.matrices,
|
||||
RomInfo.DirNames.textArchives,
|
||||
RomInfo.DirNames.areaData,
|
||||
RomInfo.DirNames.headbutt,
|
||||
RomInfo.DirNames.maps,
|
||||
RomInfo.DirNames.mapTextures,
|
||||
RomInfo.DirNames.exteriorBuildingModels,
|
||||
RomInfo.DirNames.buildingTextures,
|
||||
});
|
||||
|
||||
width = openGlPictureBox.Width;
|
||||
height = openGlPictureBox.Height;
|
||||
|
||||
openGlControl = new SimpleOpenGlControl2();
|
||||
openGlControl.InitializeContexts();
|
||||
openGlControl.Width = width;
|
||||
openGlControl.Height = height;
|
||||
openGlControl.Invalidate();
|
||||
openGlControl.MakeCurrent();
|
||||
|
||||
List<string> headerListBoxNames = Helpers.getHeaderListBoxNames();
|
||||
|
||||
Color selectedColor = Color.FromArgb(255, Color.White);
|
||||
selectedPen = new Pen(selectedColor);
|
||||
|
||||
Color normalColor = Color.FromArgb(128, Color.DarkBlue);
|
||||
normalPen = new Pen(normalColor);
|
||||
normalBrush = new SolidBrush(normalColor);
|
||||
|
||||
Color specialColor = Color.FromArgb(128, Color.DarkRed);
|
||||
specialPen = new Pen(specialColor);
|
||||
specialBrush = new SolidBrush(specialColor);
|
||||
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
for (int i = 0; i < Filesystem.GetHeadbuttCount(); i++) {
|
||||
if (i < headerListBoxNames.Count) {
|
||||
comboBoxMapHeader.Items.Add(headerListBoxNames[i]);
|
||||
}
|
||||
else {
|
||||
i.ToString("D4");
|
||||
}
|
||||
}
|
||||
|
||||
string[] pokemonNames = RomInfo.GetPokemonNames();
|
||||
headbuttEncounterEditorTabNormal.comboBoxPokemon.Items.AddRange(pokemonNames);
|
||||
headbuttEncounterEditorTabNormal.comboBoxPokemon.SelectedIndex = 0;
|
||||
headbuttEncounterEditorTabNormal.listBoxTrees.SelectedIndexChanged += ListBoxTrees_SelectedIndexChanged;
|
||||
|
||||
headbuttEncounterEditorTabSpecial.comboBoxPokemon.Items.AddRange(pokemonNames);
|
||||
headbuttEncounterEditorTabSpecial.comboBoxPokemon.SelectedIndex = 0;
|
||||
headbuttEncounterEditorTabSpecial.listBoxTrees.SelectedIndexChanged += ListBoxTrees_SelectedIndexChanged;
|
||||
|
||||
openGlPictureBox.BringToFront();
|
||||
SetCam2DValues();
|
||||
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
if (comboBoxMapHeader.Items.Count > 0) {
|
||||
comboBoxMapHeader.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void makeCurrent() {
|
||||
openGlControl.MakeCurrent();
|
||||
}
|
||||
|
||||
private void comboBoxMapHeader_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
ushort headbuttID = (ushort)comboBoxMapHeader.SelectedIndex;
|
||||
this.headbuttEncounterFile = new HeadbuttEncounterFile(headbuttID);
|
||||
setCurrentMap(headbuttEncounterFile);
|
||||
}
|
||||
|
||||
public void setCurrentMap(HeadbuttEncounterFile headbuttEncounterFile) {
|
||||
this.mapFile = null;
|
||||
this.headbuttEncounterMap = null;
|
||||
|
||||
comboBoxMapFile.Items.Clear();
|
||||
labelLocationName.Text = "";
|
||||
|
||||
listBoxTrees = null;
|
||||
if (headbuttTree != null) headbuttTree.picked = false;
|
||||
headbuttTree = null;
|
||||
|
||||
headbuttEncounterEditorTabNormal.Reset();
|
||||
headbuttEncounterEditorTabSpecial.Reset();
|
||||
|
||||
numericUpDownTreeGlobalX.Value = 0;
|
||||
numericUpDownTreeGlobalY.Value = 0;
|
||||
numericUpDownTreeMatrixX.Value = 0;
|
||||
numericUpDownTreeMatrixY.Value = 0;
|
||||
numericUpDownTreeMapX.Value = 0;
|
||||
numericUpDownTreeMapY.Value = 0;
|
||||
|
||||
RenderBackground();
|
||||
|
||||
try {
|
||||
if (headbuttEncounterFile.ID == GameMatrix.EMPTY) return;
|
||||
this.mapHeader = (HeaderHGSS)MapHeader.GetMapHeader(headbuttEncounterFile.ID);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
//most likely more headbutt files than map headers
|
||||
//there should be the same amount
|
||||
Console.WriteLine(ex);
|
||||
return;
|
||||
}
|
||||
|
||||
this.gameMatrix = new GameMatrix(mapHeader.matrixID);
|
||||
this.areaData = new AreaData(mapHeader.areaDataID);
|
||||
|
||||
TextArchive currentTextArchive = new TextArchive(RomInfo.locationNamesTextNumber);
|
||||
this.locationName = currentTextArchive.messages[mapHeader.locationName];
|
||||
labelLocationName.Text = locationName;
|
||||
|
||||
headbuttEncounterEditorTabNormal.SetHeadbuttEncounter(headbuttEncounterFile.normalEncounters, headbuttEncounterFile.normalTreeGroups);
|
||||
headbuttEncounterEditorTabSpecial.SetHeadbuttEncounter(headbuttEncounterFile.specialEncounters, headbuttEncounterFile.specialTreeGroups);
|
||||
|
||||
List<HeadbuttEncounterMap> mapHeaderMapsIDsList = new List<HeadbuttEncounterMap>();
|
||||
|
||||
if (gameMatrix.hasHeadersSection) {
|
||||
for (int y = 0; y < gameMatrix.height; y++) {
|
||||
for (int x = 0; x < gameMatrix.width; x++) {
|
||||
if (gameMatrix.headers[y, x] == mapHeader.ID) {
|
||||
int mapID = gameMatrix.maps[y, x];
|
||||
if (mapID == GameMatrix.EMPTY) continue;
|
||||
HeadbuttEncounterMap map = new HeadbuttEncounterMap(mapID, x, y);
|
||||
if (mapHeaderMapsIDsList.Contains(map)) continue;
|
||||
mapHeaderMapsIDsList.Add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int y = 0; y < gameMatrix.height; y++) {
|
||||
for (int x = 0; x < gameMatrix.width; x++) {
|
||||
int mapID = gameMatrix.maps[y, x];
|
||||
if (mapID == GameMatrix.EMPTY) continue;
|
||||
HeadbuttEncounterMap map = new HeadbuttEncounterMap(mapID, x, y);
|
||||
if (mapHeaderMapsIDsList.Contains(map)) continue;
|
||||
mapHeaderMapsIDsList.Add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (HeadbuttTreeGroup treeGroup in headbuttEncounterFile.normalTreeGroups) {
|
||||
foreach (HeadbuttTree tree in treeGroup.trees) {
|
||||
if (tree.unused) continue;
|
||||
if (tree.matrixX >= gameMatrix.width || tree.matrixY >= gameMatrix.height) continue;
|
||||
int x = tree.matrixX;
|
||||
int y = tree.matrixY;
|
||||
int mapID = gameMatrix.maps[y, x];
|
||||
if (mapID == GameMatrix.EMPTY) continue;
|
||||
HeadbuttEncounterMap map = new HeadbuttEncounterMap(mapID, x, y);
|
||||
if (mapHeaderMapsIDsList.Contains(map)) continue;
|
||||
mapHeaderMapsIDsList.Add(map);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (HeadbuttTreeGroup treeGroup in headbuttEncounterFile.specialTreeGroups) {
|
||||
foreach (HeadbuttTree tree in treeGroup.trees) {
|
||||
if (tree.unused) continue;
|
||||
if (tree.matrixX >= gameMatrix.width || tree.matrixY >= gameMatrix.height) continue;
|
||||
int x = tree.matrixX;
|
||||
int y = tree.matrixY;
|
||||
int mapID = gameMatrix.maps[y, x];
|
||||
if (mapID == GameMatrix.EMPTY) continue;
|
||||
HeadbuttEncounterMap map = new HeadbuttEncounterMap(mapID, x, y);
|
||||
if (mapHeaderMapsIDsList.Contains(map)) continue;
|
||||
mapHeaderMapsIDsList.Add(map);
|
||||
}
|
||||
}
|
||||
|
||||
mapHeaderMapsIDsList.Sort((first, second) => {
|
||||
int ret = first.mapID.CompareTo(second.mapID);
|
||||
return ret != 0 ? ret : first.x.CompareTo(second.x);
|
||||
});
|
||||
foreach (HeadbuttEncounterMap map in mapHeaderMapsIDsList) {
|
||||
comboBoxMapFile.Items.Add(map);
|
||||
}
|
||||
|
||||
if (comboBoxMapFile.Items.Count > 0) {
|
||||
comboBoxMapFile.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e) {
|
||||
if (headbuttEncounterFile == null) return;
|
||||
headbuttEncounterFile.SaveToFile();
|
||||
}
|
||||
|
||||
private void buttonSaveAs_Click(object sender, EventArgs e) {
|
||||
if (headbuttEncounterFile == null) return;
|
||||
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
try {
|
||||
sfd.InitialDirectory = Path.GetDirectoryName(sfd.FileName);
|
||||
sfd.FileName = Path.GetFileName(sfd.FileName);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
sfd.InitialDirectory = Path.GetDirectoryName(Environment.SpecialFolder.UserProfile.ToString());
|
||||
sfd.FileName = Path.GetFileName(sfd.FileName);
|
||||
}
|
||||
|
||||
if (sfd.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
headbuttEncounterFile.SaveToFile(sfd.FileName);
|
||||
}
|
||||
|
||||
private void buttonImport_Click(object sender, EventArgs e) {
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
try {
|
||||
ofd.InitialDirectory = Path.GetDirectoryName(ofd.FileName);
|
||||
ofd.FileName = Path.GetFileName(ofd.FileName);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ofd.InitialDirectory = Path.GetDirectoryName(Environment.SpecialFolder.UserProfile.ToString());
|
||||
ofd.FileName = Path.GetFileName(ofd.FileName);
|
||||
}
|
||||
|
||||
if (ofd.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
this.headbuttEncounterFile = new HeadbuttEncounterFile(ofd.FileName);
|
||||
headbuttEncounterFile.ID = (ushort)comboBoxMapHeader.SelectedIndex;
|
||||
setCurrentMap(headbuttEncounterFile);
|
||||
}
|
||||
|
||||
private void comboBoxMapFile_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
HeadbuttEncounterMap map = comboBoxMapFile.SelectedItem as HeadbuttEncounterMap;
|
||||
int mapID = gameMatrix.maps[map.y, map.x];
|
||||
this.mapFile = new MapFile(mapID, RomInfo.gameFamily, discardMoveperms: true);
|
||||
this.headbuttEncounterMap = map;
|
||||
RenderBackground();
|
||||
}
|
||||
|
||||
private Bitmap GetMapBitmap() {
|
||||
Bitmap bm = RenderMap();
|
||||
openGlControl.Invalidate();
|
||||
return bm;
|
||||
}
|
||||
|
||||
private void RenderBackground() {
|
||||
Bitmap bm = GetMapBitmap();
|
||||
|
||||
if (headbuttEncounterFile != null) {
|
||||
using (Graphics g = Graphics.FromImage(bm)) {
|
||||
g.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
MarkTrees(g, headbuttEncounterFile.normalTreeGroups, HeadbuttTree.Types.Normal);
|
||||
MarkTrees(g, headbuttEncounterFile.specialTreeGroups, HeadbuttTree.Types.Special);
|
||||
}
|
||||
}
|
||||
|
||||
openGlPictureBox.BackgroundImage = bm;
|
||||
}
|
||||
|
||||
private Bitmap RenderMap() {
|
||||
MapFile currentMapFile = this.mapFile;
|
||||
|
||||
if (currentMapFile == null) {
|
||||
Bitmap blank = new Bitmap(openGlPictureBox.Width, openGlPictureBox.Height);
|
||||
using (Graphics g = Graphics.FromImage(blank)) {
|
||||
g.Clear(Color.Black);
|
||||
}
|
||||
|
||||
return blank;
|
||||
}
|
||||
|
||||
Helpers.MW_LoadModelTextures(currentMapFile, areaData.mapTileset);
|
||||
|
||||
bool isInteriorMap = false;
|
||||
if (RomInfo.gameFamily == RomInfo.GameFamilies.HGSS && areaData.areaType == AreaData.TYPE_INDOOR) {
|
||||
isInteriorMap = true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < currentMapFile.buildings.Count; i++) {
|
||||
Building building = currentMapFile.buildings[i];
|
||||
building.LoadModelData(isInteriorMap); // Load building nsbmd
|
||||
Helpers.MW_LoadModelTextures(building, areaData.buildingsTileset); // Load building textures
|
||||
}
|
||||
|
||||
Helpers.RenderMap(ref currentMapFile, openGlControl.Width, openGlControl.Height, ang, dist, elev, perspective);
|
||||
return Helpers.GrabMapScreenshot(width, height);
|
||||
}
|
||||
|
||||
private void MarkTrees(Graphics g, BindingList<HeadbuttTreeGroup> treeGroups, HeadbuttTree.Types treeType) {
|
||||
HeadbuttEncounterMap map = comboBoxMapFile.SelectedItem as HeadbuttEncounterMap;
|
||||
if (map == null) return;
|
||||
|
||||
foreach (HeadbuttTreeGroup treeGroup in treeGroups) {
|
||||
foreach (HeadbuttTree tree in treeGroup.trees) {
|
||||
if (tree.unused) continue;
|
||||
if (tree.matrixX != map.x || tree.matrixY != map.y) continue;
|
||||
MarkTree(g, tree, treeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MarkTree(Graphics g, HeadbuttTree tree, HeadbuttTree.Types treeType) {
|
||||
Pen paintPen;
|
||||
SolidBrush paintBrush;
|
||||
if (treeType == HeadbuttTree.Types.Normal) {
|
||||
paintPen = normalPen;
|
||||
paintBrush = normalBrush;
|
||||
}
|
||||
else {
|
||||
paintPen = specialPen;
|
||||
paintBrush = specialBrush;
|
||||
}
|
||||
|
||||
if (tree.picked) {
|
||||
paintPen = selectedPen;
|
||||
}
|
||||
|
||||
int tileWidth = openGlControl.Width / MapFile.mapSize;
|
||||
int tileHeight = openGlControl.Height / MapFile.mapSize;
|
||||
int tileX = tree.mapX * tileWidth;
|
||||
int tileY = tree.mapY * tileHeight;
|
||||
|
||||
int padding = 1;
|
||||
Rectangle rectangle = new Rectangle(tileX + padding, tileY + padding, tileWidth - padding, tileHeight - padding);
|
||||
g.FillRectangle(paintBrush, rectangle);
|
||||
g.DrawRectangle(paintPen, rectangle);
|
||||
}
|
||||
|
||||
private void ListBoxTrees_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
listBoxTrees = sender as ListBox2;
|
||||
headbuttTree = listBoxTrees.SelectedItem as HeadbuttTree;
|
||||
if (headbuttTree == null) return;
|
||||
numericUpDownTreeGlobalX.Value = headbuttTree.globalX;
|
||||
numericUpDownTreeGlobalY.Value = headbuttTree.globalY;
|
||||
numericUpDownTreeMatrixX.Value = headbuttTree.matrixX;
|
||||
numericUpDownTreeMatrixY.Value = headbuttTree.matrixY;
|
||||
numericUpDownTreeMapX.Value = headbuttTree.mapX;
|
||||
numericUpDownTreeMapY.Value = headbuttTree.mapY;
|
||||
}
|
||||
|
||||
private void openGlPictureBox_Click(object sender, EventArgs e) {
|
||||
MouseEventArgs mea = (MouseEventArgs)e;
|
||||
|
||||
int tileWidth = openGlControl.Width / MapFile.mapSize;
|
||||
int tileHeight = openGlControl.Height / MapFile.mapSize;
|
||||
int mouseX = openGlPictureBox.PointToClient(MousePosition).X / tileWidth;
|
||||
int mouseY = openGlPictureBox.PointToClient(MousePosition).Y / tileHeight;
|
||||
|
||||
|
||||
if (mea.Button == MouseButtons.Left) {
|
||||
if (this.headbuttEncounterMap != null) {
|
||||
numericUpDownTreeMatrixX.Value = headbuttEncounterMap.x;
|
||||
numericUpDownTreeMatrixY.Value = headbuttEncounterMap.y;
|
||||
numericUpDownTreeMapX.Value = mouseX;
|
||||
numericUpDownTreeMapY.Value = mouseY;
|
||||
}
|
||||
}
|
||||
else if (mea.Button == MouseButtons.Middle) {
|
||||
//warp
|
||||
}
|
||||
else if (mea.Button == MouseButtons.Right) {
|
||||
if (headbuttTree != null) headbuttTree.picked = false;
|
||||
|
||||
if (FindTreeFromMap(headbuttEncounterEditorTabNormal.listBoxTreeGroups, headbuttEncounterEditorTabNormal.listBoxTrees, mouseX, mouseY)) {
|
||||
tabControl.SelectedTab = tabPageNormal;
|
||||
}
|
||||
else if (FindTreeFromMap(headbuttEncounterEditorTabSpecial.listBoxTreeGroups, headbuttEncounterEditorTabSpecial.listBoxTrees, mouseX, mouseY)) {
|
||||
tabControl.SelectedTab = tabPageSpecial;
|
||||
}
|
||||
else {
|
||||
headbuttEncounterEditorTabNormal.listBoxTreeGroups.SelectedItem = null;
|
||||
headbuttEncounterEditorTabNormal.listBoxTrees.SelectedItem = null;
|
||||
headbuttEncounterEditorTabSpecial.listBoxTreeGroups.SelectedItem = null;
|
||||
headbuttEncounterEditorTabSpecial.listBoxTrees.SelectedItem = null;
|
||||
}
|
||||
}
|
||||
|
||||
RenderBackground();
|
||||
}
|
||||
|
||||
private bool FindTreeFromMap(ListBox2 listBoxTreeGroups, ListBox2 listBoxTrees, int x, int y) {
|
||||
foreach (HeadbuttTreeGroup headbuttTreeGroup in listBoxTreeGroups.Items) {
|
||||
foreach (HeadbuttTree tree in headbuttTreeGroup.trees) {
|
||||
if (tree.mapX != x || tree.mapY != y) continue;
|
||||
listBoxTreeGroups.SelectedItem = headbuttTreeGroup;
|
||||
listBoxTrees.SelectedItem = tree;
|
||||
tree.picked = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void numericUpDownTreeGlobalX_ValueChanged(object sender, EventArgs e) {
|
||||
if (headbuttTree == null) return;
|
||||
headbuttTree.globalX = (ushort)((NumericUpDown)sender).Value;
|
||||
listBoxTrees.RefreshItem(listBoxTrees.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownTreeGlobalY_ValueChanged(object sender, EventArgs e) {
|
||||
if (headbuttTree == null) return;
|
||||
headbuttTree.globalY = (ushort)((NumericUpDown)sender).Value;
|
||||
listBoxTrees.RefreshItem(listBoxTrees.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownTreeMatrixX_ValueChanged(object sender, EventArgs e) {
|
||||
if (headbuttTree == null) return;
|
||||
headbuttTree.matrixX = (ushort)((NumericUpDown)sender).Value;
|
||||
listBoxTrees.RefreshItem(listBoxTrees.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownTreeMatrixY_ValueChanged(object sender, EventArgs e) {
|
||||
if (headbuttTree == null) return;
|
||||
headbuttTree.matrixY = (ushort)((NumericUpDown)sender).Value;
|
||||
listBoxTrees.RefreshItem(listBoxTrees.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownTreeMapX_ValueChanged(object sender, EventArgs e) {
|
||||
if (headbuttTree == null) return;
|
||||
headbuttTree.mapX = (ushort)((NumericUpDown)sender).Value;
|
||||
listBoxTrees.RefreshItem(listBoxTrees.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownTreeMapY_ValueChanged(object sender, EventArgs e) {
|
||||
if (headbuttTree == null) return;
|
||||
headbuttTree.mapY = (ushort)((NumericUpDown)sender).Value;
|
||||
listBoxTrees.RefreshItem(listBoxTrees.SelectedIndex);
|
||||
}
|
||||
|
||||
private void mapScreenshotButton_Click(object sender, EventArgs e) {
|
||||
SaveFileDialog imageSFD = new SaveFileDialog { Filter = "PNG File(*.png)|*.png", };
|
||||
if (imageSFD.ShowDialog() != DialogResult.OK) return;
|
||||
openGlPictureBox.BackgroundImage.Save(imageSFD.FileName);
|
||||
MessageBox.Show("Screenshot saved.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void SetCam2DValues() {
|
||||
perspective = 4f;
|
||||
ang = 0f;
|
||||
dist = 115.2f;
|
||||
elev = 90f;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/HeadbuttEncounterEditor.resx
Normal file
120
DS_Map/Editors/HeadbuttEncounterEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
235
DS_Map/Editors/HeadbuttEncounterEditorTab.Designer.cs
generated
Normal file
235
DS_Map/Editors/HeadbuttEncounterEditorTab.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
partial class HeadbuttEncounterEditorTab
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.buttonDuplicateTreeGroup = new System.Windows.Forms.Button();
|
||||
this.buttonRemoveTreeGroup = new System.Windows.Forms.Button();
|
||||
this.numericUpDownMaxLevel = new System.Windows.Forms.NumericUpDown();
|
||||
this.numericUpDownMinLevel = new System.Windows.Forms.NumericUpDown();
|
||||
this.buttonAddTreeGroup = new System.Windows.Forms.Button();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.comboBoxPokemon = new System.Windows.Forms.ComboBox();
|
||||
this.listBoxTreeGroups = new DSPRE.ListBox2();
|
||||
this.listBoxTrees = new DSPRE.ListBox2();
|
||||
this.listBoxEncounters = new DSPRE.ListBox2();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxLevel)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMinLevel)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonDuplicateTreeGroup
|
||||
//
|
||||
this.buttonDuplicateTreeGroup.Location = new System.Drawing.Point(177, 389);
|
||||
this.buttonDuplicateTreeGroup.Name = "buttonDuplicateTreeGroup";
|
||||
this.buttonDuplicateTreeGroup.Size = new System.Drawing.Size(81, 23);
|
||||
this.buttonDuplicateTreeGroup.TabIndex = 17;
|
||||
this.buttonDuplicateTreeGroup.Text = "Duplicate";
|
||||
this.buttonDuplicateTreeGroup.UseVisualStyleBackColor = true;
|
||||
this.buttonDuplicateTreeGroup.Click += new System.EventHandler(this.buttonDuplicateTreeGroup_Click);
|
||||
//
|
||||
// buttonRemoveTreeGroup
|
||||
//
|
||||
this.buttonRemoveTreeGroup.Location = new System.Drawing.Point(90, 389);
|
||||
this.buttonRemoveTreeGroup.Name = "buttonRemoveTreeGroup";
|
||||
this.buttonRemoveTreeGroup.Size = new System.Drawing.Size(81, 23);
|
||||
this.buttonRemoveTreeGroup.TabIndex = 17;
|
||||
this.buttonRemoveTreeGroup.Text = "Remove";
|
||||
this.buttonRemoveTreeGroup.UseVisualStyleBackColor = true;
|
||||
this.buttonRemoveTreeGroup.Click += new System.EventHandler(this.buttonRemoveTreeGroup_Click);
|
||||
//
|
||||
// numericUpDownMaxLevel
|
||||
//
|
||||
this.numericUpDownMaxLevel.Location = new System.Drawing.Point(200, 210);
|
||||
this.numericUpDownMaxLevel.Name = "numericUpDownMaxLevel";
|
||||
this.numericUpDownMaxLevel.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownMaxLevel.TabIndex = 15;
|
||||
this.numericUpDownMaxLevel.ValueChanged += new System.EventHandler(this.numericUpDownMaxLevel_ValueChanged);
|
||||
//
|
||||
// numericUpDownMinLevel
|
||||
//
|
||||
this.numericUpDownMinLevel.Location = new System.Drawing.Point(136, 210);
|
||||
this.numericUpDownMinLevel.Name = "numericUpDownMinLevel";
|
||||
this.numericUpDownMinLevel.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownMinLevel.TabIndex = 15;
|
||||
this.numericUpDownMinLevel.ValueChanged += new System.EventHandler(this.numericUpDownMinLevel_ValueChanged);
|
||||
//
|
||||
// buttonAddTreeGroup
|
||||
//
|
||||
this.buttonAddTreeGroup.Location = new System.Drawing.Point(3, 389);
|
||||
this.buttonAddTreeGroup.Name = "buttonAddTreeGroup";
|
||||
this.buttonAddTreeGroup.Size = new System.Drawing.Size(81, 23);
|
||||
this.buttonAddTreeGroup.TabIndex = 17;
|
||||
this.buttonAddTreeGroup.Text = "Add";
|
||||
this.buttonAddTreeGroup.UseVisualStyleBackColor = true;
|
||||
this.buttonAddTreeGroup.Click += new System.EventHandler(this.buttonAddTreeGroup_Click);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(0, 233);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(66, 13);
|
||||
this.label5.TabIndex = 18;
|
||||
this.label5.Text = "Tree Groups";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(0, 415);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(34, 13);
|
||||
this.label6.TabIndex = 18;
|
||||
this.label6.Text = "Trees";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(0, 193);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(52, 13);
|
||||
this.label2.TabIndex = 18;
|
||||
this.label2.Text = "Pokemon";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(133, 193);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 13);
|
||||
this.label3.TabIndex = 18;
|
||||
this.label3.Text = "Min Level";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(86, 13);
|
||||
this.label1.TabIndex = 18;
|
||||
this.label1.Text = "Encounter Table";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(197, 193);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(56, 13);
|
||||
this.label4.TabIndex = 18;
|
||||
this.label4.Text = "Max Level";
|
||||
//
|
||||
// comboBoxPokemon
|
||||
//
|
||||
this.comboBoxPokemon.FormattingEnabled = true;
|
||||
this.comboBoxPokemon.Location = new System.Drawing.Point(3, 209);
|
||||
this.comboBoxPokemon.Name = "comboBoxPokemon";
|
||||
this.comboBoxPokemon.Size = new System.Drawing.Size(127, 21);
|
||||
this.comboBoxPokemon.TabIndex = 19;
|
||||
this.comboBoxPokemon.SelectedIndexChanged += new System.EventHandler(this.comboBoxPokemon_SelectedIndexChanged);
|
||||
//
|
||||
// listBoxTreeGroups
|
||||
//
|
||||
this.listBoxTreeGroups.DisplayMember = "DisplayName";
|
||||
this.listBoxTreeGroups.FormattingEnabled = true;
|
||||
this.listBoxTreeGroups.Location = new System.Drawing.Point(3, 249);
|
||||
this.listBoxTreeGroups.Name = "listBoxTreeGroups";
|
||||
this.listBoxTreeGroups.Size = new System.Drawing.Size(255, 134);
|
||||
this.listBoxTreeGroups.TabIndex = 11;
|
||||
this.listBoxTreeGroups.SelectedIndexChanged += new System.EventHandler(this.listBoxTreeGroups_SelectedIndexChanged);
|
||||
//
|
||||
// listBoxTrees
|
||||
//
|
||||
this.listBoxTrees.DisplayMember = "DisplayName";
|
||||
this.listBoxTrees.FormattingEnabled = true;
|
||||
this.listBoxTrees.Location = new System.Drawing.Point(3, 431);
|
||||
this.listBoxTrees.Name = "listBoxTrees";
|
||||
this.listBoxTrees.Size = new System.Drawing.Size(255, 82);
|
||||
this.listBoxTrees.TabIndex = 11;
|
||||
//
|
||||
// listBoxEncounters
|
||||
//
|
||||
this.listBoxEncounters.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listBoxEncounters.FormattingEnabled = true;
|
||||
this.listBoxEncounters.ItemHeight = 14;
|
||||
this.listBoxEncounters.Location = new System.Drawing.Point(3, 15);
|
||||
this.listBoxEncounters.Name = "listBoxEncounters";
|
||||
this.listBoxEncounters.Size = new System.Drawing.Size(255, 172);
|
||||
this.listBoxEncounters.TabIndex = 13;
|
||||
this.listBoxEncounters.SelectedIndexChanged += new System.EventHandler(this.listBoxEncounters_SelectedIndexChanged);
|
||||
//
|
||||
// HeadbuttEncounterEditorTab
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.comboBoxPokemon);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.listBoxTreeGroups);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.buttonDuplicateTreeGroup);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.buttonRemoveTreeGroup);
|
||||
this.Controls.Add(this.listBoxTrees);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.numericUpDownMaxLevel);
|
||||
this.Controls.Add(this.listBoxEncounters);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.numericUpDownMinLevel);
|
||||
this.Controls.Add(this.buttonAddTreeGroup);
|
||||
this.Name = "HeadbuttEncounterEditorTab";
|
||||
this.Size = new System.Drawing.Size(262, 517);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxLevel)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMinLevel)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public DSPRE.ListBox2 listBoxTreeGroups;
|
||||
private System.Windows.Forms.Button buttonDuplicateTreeGroup;
|
||||
private System.Windows.Forms.Button buttonRemoveTreeGroup;
|
||||
public ListBox2 listBoxTrees;
|
||||
public System.Windows.Forms.NumericUpDown numericUpDownMaxLevel;
|
||||
public DSPRE.ListBox2 listBoxEncounters;
|
||||
public System.Windows.Forms.NumericUpDown numericUpDownMinLevel;
|
||||
private System.Windows.Forms.Button buttonAddTreeGroup;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
public System.Windows.Forms.ComboBox comboBoxPokemon;
|
||||
}
|
||||
}
|
||||
95
DS_Map/Editors/HeadbuttEncounterEditorTab.cs
Normal file
95
DS_Map/Editors/HeadbuttEncounterEditorTab.cs
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using DSPRE.ROMFiles;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
public partial class HeadbuttEncounterEditorTab : UserControl {
|
||||
private List<HeadbuttEncounter> encounters;
|
||||
private BindingList<HeadbuttTreeGroup> treeGroups;
|
||||
|
||||
public HeadbuttEncounterEditorTab() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
Helpers.DisableHandlers();
|
||||
listBoxEncounters.DataSource = null;
|
||||
listBoxTreeGroups.DataSource = null;
|
||||
listBoxTrees.DataSource = null;
|
||||
comboBoxPokemon.SelectedIndex = 0;
|
||||
numericUpDownMinLevel.Value = 0;
|
||||
numericUpDownMaxLevel.Value = 0;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
public void SetHeadbuttEncounter(List<HeadbuttEncounter> encounters, BindingList<HeadbuttTreeGroup> treeGroups) {
|
||||
Helpers.DisableHandlers();
|
||||
this.encounters = encounters;
|
||||
this.treeGroups = treeGroups;
|
||||
listBoxEncounters.DataSource = this.encounters;
|
||||
listBoxTreeGroups.DataSource = this.treeGroups;
|
||||
listBoxEncounters.SelectedIndex = -1;
|
||||
listBoxTreeGroups.SelectedIndex = -1;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
private void listBoxEncounters_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
HeadbuttEncounter headbuttEncounter = (HeadbuttEncounter)listBoxEncounters.SelectedItem;
|
||||
if (headbuttEncounter == null) return;
|
||||
comboBoxPokemon.SelectedIndex = headbuttEncounter.pokemonID;
|
||||
numericUpDownMinLevel.Value = headbuttEncounter.minLevel;
|
||||
numericUpDownMaxLevel.Value = headbuttEncounter.maxLevel;
|
||||
}
|
||||
|
||||
private void comboBoxPokemon_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
HeadbuttEncounter headbuttEncounter = (HeadbuttEncounter)listBoxEncounters.SelectedItem;
|
||||
if (headbuttEncounter == null) return;
|
||||
headbuttEncounter.pokemonID = (ushort)comboBoxPokemon.SelectedIndex;
|
||||
listBoxEncounters.RefreshItem(listBoxEncounters.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownMinLevel_ValueChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
HeadbuttEncounter headbuttEncounter = (HeadbuttEncounter)listBoxEncounters.SelectedItem;
|
||||
if (headbuttEncounter == null) return;
|
||||
headbuttEncounter.minLevel = (byte)numericUpDownMinLevel.Value;
|
||||
listBoxEncounters.RefreshItem(listBoxEncounters.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownMaxLevel_ValueChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
HeadbuttEncounter headbuttEncounter = (HeadbuttEncounter)listBoxEncounters.SelectedItem;
|
||||
if (headbuttEncounter == null) return;
|
||||
headbuttEncounter.maxLevel = (byte)numericUpDownMaxLevel.Value;
|
||||
listBoxEncounters.RefreshItem(listBoxEncounters.SelectedIndex);
|
||||
}
|
||||
|
||||
private void listBoxTreeGroups_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
HeadbuttTreeGroup headbuttTreeGroup = (HeadbuttTreeGroup)listBoxTreeGroups.SelectedItem;
|
||||
if (headbuttTreeGroup == null) return;
|
||||
listBoxTrees.DataSource = headbuttTreeGroup.trees;
|
||||
}
|
||||
|
||||
private void buttonAddTreeGroup_Click(object sender, EventArgs e) {
|
||||
treeGroups.Add(new HeadbuttTreeGroup());
|
||||
}
|
||||
|
||||
private void buttonRemoveTreeGroup_Click(object sender, EventArgs e) {
|
||||
int selectedIndex = listBoxTreeGroups.SelectedIndex;
|
||||
if (selectedIndex == -1) return;
|
||||
treeGroups.RemoveAt(selectedIndex);
|
||||
}
|
||||
|
||||
private void buttonDuplicateTreeGroup_Click(object sender, EventArgs e) {
|
||||
HeadbuttTreeGroup headbuttTreeGroup = (HeadbuttTreeGroup)listBoxTreeGroups.SelectedItem;
|
||||
if (headbuttTreeGroup == null) return;
|
||||
treeGroups.Add(new HeadbuttTreeGroup(headbuttTreeGroup));
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/HeadbuttEncounterEditorTab.resx
Normal file
120
DS_Map/Editors/HeadbuttEncounterEditorTab.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
458
DS_Map/Editors/LevelScriptEditor.Designer.cs
generated
Normal file
458
DS_Map/Editors/LevelScriptEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,458 @@
|
|||
using System.ComponentModel;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
partial class LevelScriptEditor {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.buttonSave = new System.Windows.Forms.Button();
|
||||
this.buttonExport = new System.Windows.Forms.Button();
|
||||
this.radioButtonVariableValue = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonMapChange = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonScreenReset = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonLoadGame = new System.Windows.Forms.RadioButton();
|
||||
this.textBoxScriptID = new System.Windows.Forms.TextBox();
|
||||
this.textBoxVariableName = new System.Windows.Forms.TextBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBoxVariable = new System.Windows.Forms.GroupBox();
|
||||
this.groupBoxValue = new System.Windows.Forms.GroupBox();
|
||||
this.textBoxVariableValue = new System.Windows.Forms.TextBox();
|
||||
this.checkBoxPadding = new System.Windows.Forms.CheckBox();
|
||||
this.buttonAdd = new System.Windows.Forms.Button();
|
||||
this.buttonRemove = new System.Windows.Forms.Button();
|
||||
this.radioButtonDecimal = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonHex = new System.Windows.Forms.RadioButton();
|
||||
this.radioButtonAuto = new System.Windows.Forms.RadioButton();
|
||||
this.selectScriptFileComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.listBoxTriggers = new DSPRE.ListBox2();
|
||||
this.buttonOpenHeaderScript = new System.Windows.Forms.Button();
|
||||
this.buttonOpenSelectedScript = new System.Windows.Forms.Button();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.buttonLocate = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.buttonImport = new System.Windows.Forms.Button();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox7 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBoxVariable.SuspendLayout();
|
||||
this.groupBoxValue.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.groupBox6.SuspendLayout();
|
||||
this.groupBox7.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
this.buttonSave.Location = new System.Drawing.Point(70, 19);
|
||||
this.buttonSave.Name = "buttonSave";
|
||||
this.buttonSave.Size = new System.Drawing.Size(53, 23);
|
||||
this.buttonSave.TabIndex = 5;
|
||||
this.buttonSave.Text = "Save";
|
||||
this.buttonSave.UseVisualStyleBackColor = true;
|
||||
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
|
||||
//
|
||||
// buttonExport
|
||||
//
|
||||
this.buttonExport.Location = new System.Drawing.Point(129, 19);
|
||||
this.buttonExport.Name = "buttonExport";
|
||||
this.buttonExport.Size = new System.Drawing.Size(51, 23);
|
||||
this.buttonExport.TabIndex = 6;
|
||||
this.buttonExport.Text = "Export";
|
||||
this.buttonExport.UseVisualStyleBackColor = true;
|
||||
this.buttonExport.Click += new System.EventHandler(this.buttonExport_Click);
|
||||
//
|
||||
// radioButtonVariableValue
|
||||
//
|
||||
this.radioButtonVariableValue.AutoSize = true;
|
||||
this.radioButtonVariableValue.Checked = true;
|
||||
this.radioButtonVariableValue.Location = new System.Drawing.Point(6, 19);
|
||||
this.radioButtonVariableValue.Name = "radioButtonVariableValue";
|
||||
this.radioButtonVariableValue.Size = new System.Drawing.Size(107, 17);
|
||||
this.radioButtonVariableValue.TabIndex = 12;
|
||||
this.radioButtonVariableValue.TabStop = true;
|
||||
this.radioButtonVariableValue.Text = "Variable == value";
|
||||
this.radioButtonVariableValue.UseVisualStyleBackColor = true;
|
||||
this.radioButtonVariableValue.CheckedChanged += new System.EventHandler(this.radioButtonVariableValue_CheckedChanged);
|
||||
//
|
||||
// radioButtonMapChange
|
||||
//
|
||||
this.radioButtonMapChange.AutoSize = true;
|
||||
this.radioButtonMapChange.Location = new System.Drawing.Point(119, 19);
|
||||
this.radioButtonMapChange.Name = "radioButtonMapChange";
|
||||
this.radioButtonMapChange.Size = new System.Drawing.Size(86, 17);
|
||||
this.radioButtonMapChange.TabIndex = 13;
|
||||
this.radioButtonMapChange.Text = "Player enters";
|
||||
this.radioButtonMapChange.UseVisualStyleBackColor = true;
|
||||
this.radioButtonMapChange.CheckedChanged += new System.EventHandler(this.radioButtonMapChange_CheckedChanged);
|
||||
//
|
||||
// radioButtonScreenReset
|
||||
//
|
||||
this.radioButtonScreenReset.AutoSize = true;
|
||||
this.radioButtonScreenReset.Location = new System.Drawing.Point(211, 19);
|
||||
this.radioButtonScreenReset.Name = "radioButtonScreenReset";
|
||||
this.radioButtonScreenReset.Size = new System.Drawing.Size(88, 17);
|
||||
this.radioButtonScreenReset.TabIndex = 14;
|
||||
this.radioButtonScreenReset.Text = "Screen fades";
|
||||
this.radioButtonScreenReset.UseVisualStyleBackColor = true;
|
||||
this.radioButtonScreenReset.CheckedChanged += new System.EventHandler(this.radioButtonScreenReset_CheckedChanged);
|
||||
//
|
||||
// radioButtonLoadGame
|
||||
//
|
||||
this.radioButtonLoadGame.AutoSize = true;
|
||||
this.radioButtonLoadGame.Location = new System.Drawing.Point(305, 19);
|
||||
this.radioButtonLoadGame.Name = "radioButtonLoadGame";
|
||||
this.radioButtonLoadGame.Size = new System.Drawing.Size(81, 17);
|
||||
this.radioButtonLoadGame.TabIndex = 15;
|
||||
this.radioButtonLoadGame.Text = "Game loads";
|
||||
this.radioButtonLoadGame.UseVisualStyleBackColor = true;
|
||||
this.radioButtonLoadGame.CheckedChanged += new System.EventHandler(this.radioButtonLoadGame_CheckedChanged);
|
||||
//
|
||||
// textBoxScriptID
|
||||
//
|
||||
this.textBoxScriptID.Location = new System.Drawing.Point(6, 19);
|
||||
this.textBoxScriptID.Name = "textBoxScriptID";
|
||||
this.textBoxScriptID.Size = new System.Drawing.Size(116, 20);
|
||||
this.textBoxScriptID.TabIndex = 16;
|
||||
this.textBoxScriptID.TextChanged += new System.EventHandler(this.textBoxScriptID_TextChanged);
|
||||
//
|
||||
// textBoxVariableName
|
||||
//
|
||||
this.textBoxVariableName.Location = new System.Drawing.Point(6, 19);
|
||||
this.textBoxVariableName.Name = "textBoxVariableName";
|
||||
this.textBoxVariableName.Size = new System.Drawing.Size(116, 20);
|
||||
this.textBoxVariableName.TabIndex = 17;
|
||||
this.textBoxVariableName.TextChanged += new System.EventHandler(this.textBoxVariableName_TextChanged);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.radioButtonVariableValue);
|
||||
this.groupBox1.Controls.Add(this.radioButtonMapChange);
|
||||
this.groupBox1.Controls.Add(this.radioButtonScreenReset);
|
||||
this.groupBox1.Controls.Add(this.radioButtonLoadGame);
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 366);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(397, 48);
|
||||
this.groupBox1.TabIndex = 11;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "When this happens in the map:";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.textBoxScriptID);
|
||||
this.groupBox2.Location = new System.Drawing.Point(3, 420);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(128, 48);
|
||||
this.groupBox2.TabIndex = 12;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Run this script ID";
|
||||
//
|
||||
// groupBoxVariable
|
||||
//
|
||||
this.groupBoxVariable.Controls.Add(this.textBoxVariableName);
|
||||
this.groupBoxVariable.Location = new System.Drawing.Point(137, 420);
|
||||
this.groupBoxVariable.Name = "groupBoxVariable";
|
||||
this.groupBoxVariable.Size = new System.Drawing.Size(128, 48);
|
||||
this.groupBoxVariable.TabIndex = 13;
|
||||
this.groupBoxVariable.TabStop = false;
|
||||
this.groupBoxVariable.Text = "when this variable ==";
|
||||
//
|
||||
// groupBoxValue
|
||||
//
|
||||
this.groupBoxValue.Controls.Add(this.textBoxVariableValue);
|
||||
this.groupBoxValue.Location = new System.Drawing.Point(271, 420);
|
||||
this.groupBoxValue.Name = "groupBoxValue";
|
||||
this.groupBoxValue.Size = new System.Drawing.Size(129, 48);
|
||||
this.groupBoxValue.TabIndex = 13;
|
||||
this.groupBoxValue.TabStop = false;
|
||||
this.groupBoxValue.Text = "this value";
|
||||
//
|
||||
// textBoxVariableValue
|
||||
//
|
||||
this.textBoxVariableValue.Location = new System.Drawing.Point(6, 19);
|
||||
this.textBoxVariableValue.Name = "textBoxVariableValue";
|
||||
this.textBoxVariableValue.Size = new System.Drawing.Size(117, 20);
|
||||
this.textBoxVariableValue.TabIndex = 18;
|
||||
this.textBoxVariableValue.TextChanged += new System.EventHandler(this.textBoxVariableValue_TextChanged);
|
||||
//
|
||||
// checkBoxPadding
|
||||
//
|
||||
this.checkBoxPadding.AutoSize = true;
|
||||
this.checkBoxPadding.Location = new System.Drawing.Point(186, 23);
|
||||
this.checkBoxPadding.Name = "checkBoxPadding";
|
||||
this.checkBoxPadding.Size = new System.Drawing.Size(141, 17);
|
||||
this.checkBoxPadding.TabIndex = 7;
|
||||
this.checkBoxPadding.Text = "Word-alignment padding";
|
||||
this.checkBoxPadding.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
this.buttonAdd.Location = new System.Drawing.Point(6, 19);
|
||||
this.buttonAdd.Name = "buttonAdd";
|
||||
this.buttonAdd.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonAdd.TabIndex = 19;
|
||||
this.buttonAdd.Text = "Add";
|
||||
this.buttonAdd.UseVisualStyleBackColor = true;
|
||||
this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
|
||||
//
|
||||
// buttonRemove
|
||||
//
|
||||
this.buttonRemove.Location = new System.Drawing.Point(87, 19);
|
||||
this.buttonRemove.Name = "buttonRemove";
|
||||
this.buttonRemove.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonRemove.TabIndex = 20;
|
||||
this.buttonRemove.Text = "Remove";
|
||||
this.buttonRemove.UseVisualStyleBackColor = true;
|
||||
this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click);
|
||||
//
|
||||
// radioButtonDecimal
|
||||
//
|
||||
this.radioButtonDecimal.AutoSize = true;
|
||||
this.radioButtonDecimal.Location = new System.Drawing.Point(109, 19);
|
||||
this.radioButtonDecimal.Name = "radioButtonDecimal";
|
||||
this.radioButtonDecimal.Size = new System.Drawing.Size(63, 17);
|
||||
this.radioButtonDecimal.TabIndex = 10;
|
||||
this.radioButtonDecimal.Text = "Decimal";
|
||||
this.radioButtonDecimal.UseVisualStyleBackColor = true;
|
||||
this.radioButtonDecimal.CheckedChanged += new System.EventHandler(this.radioButtonDecimal_CheckedChanged);
|
||||
//
|
||||
// radioButtonHex
|
||||
//
|
||||
this.radioButtonHex.AutoSize = true;
|
||||
this.radioButtonHex.Location = new System.Drawing.Point(59, 19);
|
||||
this.radioButtonHex.Name = "radioButtonHex";
|
||||
this.radioButtonHex.Size = new System.Drawing.Size(44, 17);
|
||||
this.radioButtonHex.TabIndex = 9;
|
||||
this.radioButtonHex.Text = "Hex";
|
||||
this.radioButtonHex.UseVisualStyleBackColor = true;
|
||||
this.radioButtonHex.CheckedChanged += new System.EventHandler(this.radioButtonHex_CheckedChanged);
|
||||
//
|
||||
// radioButtonAuto
|
||||
//
|
||||
this.radioButtonAuto.AutoSize = true;
|
||||
this.radioButtonAuto.Checked = true;
|
||||
this.radioButtonAuto.Location = new System.Drawing.Point(6, 19);
|
||||
this.radioButtonAuto.Name = "radioButtonAuto";
|
||||
this.radioButtonAuto.Size = new System.Drawing.Size(47, 17);
|
||||
this.radioButtonAuto.TabIndex = 8;
|
||||
this.radioButtonAuto.TabStop = true;
|
||||
this.radioButtonAuto.Text = "Auto";
|
||||
this.radioButtonAuto.UseVisualStyleBackColor = true;
|
||||
this.radioButtonAuto.CheckedChanged += new System.EventHandler(this.radioButtonAuto_CheckedChanged);
|
||||
//
|
||||
// selectScriptFileComboBox
|
||||
//
|
||||
this.selectScriptFileComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.selectScriptFileComboBox.FormattingEnabled = true;
|
||||
this.selectScriptFileComboBox.Location = new System.Drawing.Point(6, 19);
|
||||
this.selectScriptFileComboBox.Name = "selectScriptFileComboBox";
|
||||
this.selectScriptFileComboBox.Size = new System.Drawing.Size(152, 21);
|
||||
this.selectScriptFileComboBox.TabIndex = 1;
|
||||
this.selectScriptFileComboBox.SelectedIndexChanged += new System.EventHandler(this.selectScriptFileComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// listBoxTriggers
|
||||
//
|
||||
this.listBoxTriggers.FormattingEnabled = true;
|
||||
this.listBoxTriggers.Location = new System.Drawing.Point(3, 226);
|
||||
this.listBoxTriggers.Name = "listBoxTriggers";
|
||||
this.listBoxTriggers.Size = new System.Drawing.Size(397, 134);
|
||||
this.listBoxTriggers.TabIndex = 11;
|
||||
this.listBoxTriggers.SelectedValueChanged += new System.EventHandler(this.listBoxTriggers_SelectedValueChanged);
|
||||
//
|
||||
// buttonOpenHeaderScript
|
||||
//
|
||||
this.buttonOpenHeaderScript.Location = new System.Drawing.Point(6, 19);
|
||||
this.buttonOpenHeaderScript.Name = "buttonOpenHeaderScript";
|
||||
this.buttonOpenHeaderScript.Size = new System.Drawing.Size(88, 23);
|
||||
this.buttonOpenHeaderScript.TabIndex = 2;
|
||||
this.buttonOpenHeaderScript.Text = "Header Script";
|
||||
this.buttonOpenHeaderScript.UseVisualStyleBackColor = true;
|
||||
this.buttonOpenHeaderScript.Click += new System.EventHandler(this.buttonOpenHeaderScript_Click);
|
||||
//
|
||||
// buttonOpenSelectedScript
|
||||
//
|
||||
this.buttonOpenSelectedScript.Location = new System.Drawing.Point(100, 19);
|
||||
this.buttonOpenSelectedScript.Name = "buttonOpenSelectedScript";
|
||||
this.buttonOpenSelectedScript.Size = new System.Drawing.Size(94, 23);
|
||||
this.buttonOpenSelectedScript.TabIndex = 3;
|
||||
this.buttonOpenSelectedScript.Text = "Selected Script";
|
||||
this.buttonOpenSelectedScript.UseVisualStyleBackColor = true;
|
||||
this.buttonOpenSelectedScript.Click += new System.EventHandler(this.buttonOpenSelectedScript_Click);
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.buttonLocate);
|
||||
this.groupBox3.Controls.Add(this.buttonOpenSelectedScript);
|
||||
this.groupBox3.Controls.Add(this.buttonOpenHeaderScript);
|
||||
this.groupBox3.Location = new System.Drawing.Point(3, 61);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(263, 52);
|
||||
this.groupBox3.TabIndex = 18;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Open";
|
||||
//
|
||||
// buttonLocate
|
||||
//
|
||||
this.buttonLocate.Location = new System.Drawing.Point(200, 19);
|
||||
this.buttonLocate.Name = "buttonLocate";
|
||||
this.buttonLocate.Size = new System.Drawing.Size(56, 23);
|
||||
this.buttonLocate.TabIndex = 3;
|
||||
this.buttonLocate.Text = "Locate";
|
||||
this.buttonLocate.UseVisualStyleBackColor = true;
|
||||
this.buttonLocate.Click += new System.EventHandler(this.buttonLocate_Click);
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.buttonImport);
|
||||
this.groupBox4.Controls.Add(this.buttonSave);
|
||||
this.groupBox4.Controls.Add(this.buttonExport);
|
||||
this.groupBox4.Controls.Add(this.checkBoxPadding);
|
||||
this.groupBox4.Location = new System.Drawing.Point(3, 119);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(329, 53);
|
||||
this.groupBox4.TabIndex = 20;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "File";
|
||||
//
|
||||
// buttonImport
|
||||
//
|
||||
this.buttonImport.Location = new System.Drawing.Point(6, 19);
|
||||
this.buttonImport.Name = "buttonImport";
|
||||
this.buttonImport.Size = new System.Drawing.Size(58, 23);
|
||||
this.buttonImport.TabIndex = 4;
|
||||
this.buttonImport.Text = "Import";
|
||||
this.buttonImport.UseVisualStyleBackColor = true;
|
||||
this.buttonImport.Click += new System.EventHandler(this.buttonImport_Click);
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Controls.Add(this.buttonRemove);
|
||||
this.groupBox5.Controls.Add(this.buttonAdd);
|
||||
this.groupBox5.Location = new System.Drawing.Point(231, 474);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(169, 52);
|
||||
this.groupBox5.TabIndex = 21;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Trigger";
|
||||
//
|
||||
// groupBox6
|
||||
//
|
||||
this.groupBox6.Controls.Add(this.radioButtonAuto);
|
||||
this.groupBox6.Controls.Add(this.radioButtonDecimal);
|
||||
this.groupBox6.Controls.Add(this.radioButtonHex);
|
||||
this.groupBox6.Location = new System.Drawing.Point(3, 178);
|
||||
this.groupBox6.Name = "groupBox6";
|
||||
this.groupBox6.Size = new System.Drawing.Size(178, 42);
|
||||
this.groupBox6.TabIndex = 22;
|
||||
this.groupBox6.TabStop = false;
|
||||
this.groupBox6.Text = "Number Format";
|
||||
//
|
||||
// groupBox7
|
||||
//
|
||||
this.groupBox7.Controls.Add(this.selectScriptFileComboBox);
|
||||
this.groupBox7.Location = new System.Drawing.Point(3, 3);
|
||||
this.groupBox7.Name = "groupBox7";
|
||||
this.groupBox7.Size = new System.Drawing.Size(164, 52);
|
||||
this.groupBox7.TabIndex = 23;
|
||||
this.groupBox7.TabStop = false;
|
||||
this.groupBox7.Text = "Script File";
|
||||
//
|
||||
// LevelScriptEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Controls.Add(this.groupBox7);
|
||||
this.Controls.Add(this.groupBox6);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBoxValue);
|
||||
this.Controls.Add(this.groupBoxVariable);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.listBoxTriggers);
|
||||
this.Location = new System.Drawing.Point(15, 15);
|
||||
this.Name = "LevelScriptEditor";
|
||||
this.Size = new System.Drawing.Size(408, 622);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBoxVariable.ResumeLayout(false);
|
||||
this.groupBoxVariable.PerformLayout();
|
||||
this.groupBoxValue.ResumeLayout(false);
|
||||
this.groupBoxValue.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox6.ResumeLayout(false);
|
||||
this.groupBox6.PerformLayout();
|
||||
this.groupBox7.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
private System.Windows.Forms.Button buttonImport;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
|
||||
private System.Windows.Forms.Button buttonOpenSelectedScript;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
|
||||
public System.Windows.Forms.ComboBox selectScriptFileComboBox;
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button buttonSave;
|
||||
private DSPRE.ListBox2 listBoxTriggers;
|
||||
private System.Windows.Forms.Button buttonExport;
|
||||
private System.Windows.Forms.RadioButton radioButtonVariableValue;
|
||||
private System.Windows.Forms.RadioButton radioButtonMapChange;
|
||||
private System.Windows.Forms.RadioButton radioButtonScreenReset;
|
||||
private System.Windows.Forms.RadioButton radioButtonLoadGame;
|
||||
private System.Windows.Forms.TextBox textBoxScriptID;
|
||||
private System.Windows.Forms.TextBox textBoxVariableName;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.GroupBox groupBoxVariable;
|
||||
private System.Windows.Forms.GroupBox groupBoxValue;
|
||||
private System.Windows.Forms.TextBox textBoxVariableValue;
|
||||
private System.Windows.Forms.CheckBox checkBoxPadding;
|
||||
private System.Windows.Forms.Button buttonAdd;
|
||||
private System.Windows.Forms.Button buttonRemove;
|
||||
private System.Windows.Forms.RadioButton radioButtonDecimal;
|
||||
private System.Windows.Forms.RadioButton radioButtonHex;
|
||||
private System.Windows.Forms.RadioButton radioButtonAuto;
|
||||
private System.Windows.Forms.Button buttonOpenHeaderScript;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.GroupBox groupBox7;
|
||||
private System.Windows.Forms.Button buttonLocate;
|
||||
}
|
||||
}
|
||||
|
||||
371
DS_Map/Editors/LevelScriptEditor.cs
Normal file
371
DS_Map/Editors/LevelScriptEditor.cs
Normal file
|
|
@ -0,0 +1,371 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using DSPRE.ROMFiles;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
public partial class LevelScriptEditor : UserControl {
|
||||
public bool levelScriptEditorIsReady { get; set; } = false;
|
||||
LevelScriptFile _levelScriptFile;
|
||||
MainProgram _parent;
|
||||
|
||||
public LevelScriptEditor() {
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
public void SetUpLevelScriptEditor(MainProgram parent, bool force = false) {
|
||||
if (levelScriptEditorIsReady && !force) return;
|
||||
levelScriptEditorIsReady = true;
|
||||
this._parent = parent;
|
||||
DSUtils.TryUnpackNarcs(new List<RomInfo.DirNames> { RomInfo.DirNames.scripts }); //12 = scripts Narc Dir
|
||||
populate_selectScriptFileComboBox();
|
||||
}
|
||||
|
||||
public void OpenLevelScriptEditor(MainProgram parent, int levelScriptID) {
|
||||
|
||||
SetUpLevelScriptEditor(parent);
|
||||
|
||||
selectScriptFileComboBox.SelectedIndex = levelScriptID;
|
||||
EditorPanels.mainTabControl.SelectedTab = EditorPanels.levelScriptEditorTabPage;
|
||||
}
|
||||
|
||||
private void populate_selectScriptFileComboBox(int selectedIndex = 0) {
|
||||
selectScriptFileComboBox.Items.Clear();
|
||||
int scriptCount = Filesystem.GetScriptCount();
|
||||
for (int i = 0; i < scriptCount; i++) {
|
||||
// ScriptFile currentScriptFile = new ScriptFile(i, true, true);
|
||||
// selectScriptFileComboBox.Items.Add(currentScriptFile);
|
||||
selectScriptFileComboBox.Items.Add($"Script File {i}");
|
||||
}
|
||||
|
||||
selectScriptFileComboBox.SelectedIndex = selectedIndex;
|
||||
}
|
||||
|
||||
void disableButtons() {
|
||||
listBoxTriggers.DataSource = null;
|
||||
|
||||
textBoxScriptID.Clear();
|
||||
textBoxVariableName.Clear();
|
||||
textBoxVariableValue.Clear();
|
||||
|
||||
radioButtonVariableValue.Checked = false;
|
||||
radioButtonMapChange.Checked = false;
|
||||
radioButtonScreenReset.Checked = false;
|
||||
radioButtonLoadGame.Checked = false;
|
||||
|
||||
textBoxScriptID.Enabled = false;
|
||||
textBoxVariableName.Enabled = false;
|
||||
textBoxVariableValue.Enabled = false;
|
||||
|
||||
radioButtonVariableValue.Enabled = false;
|
||||
radioButtonMapChange.Enabled = false;
|
||||
radioButtonScreenReset.Enabled = false;
|
||||
radioButtonLoadGame.Enabled = false;
|
||||
|
||||
radioButtonAuto.Enabled = false;
|
||||
radioButtonHex.Enabled = false;
|
||||
radioButtonDecimal.Enabled = false;
|
||||
|
||||
buttonImport.Enabled = false;
|
||||
buttonSave.Enabled = false;
|
||||
buttonExport.Enabled = false;
|
||||
checkBoxPadding.Enabled = false;
|
||||
|
||||
buttonAdd.Enabled = false;
|
||||
buttonRemove.Enabled = false;
|
||||
}
|
||||
|
||||
void enableButtons() {
|
||||
// textBoxScriptID.Enabled = true;
|
||||
// textBoxVariableName.Enabled = true;
|
||||
// textBoxVariableValue.Enabled = true;
|
||||
|
||||
radioButtonVariableValue.Enabled = true;
|
||||
radioButtonMapChange.Enabled = true;
|
||||
radioButtonScreenReset.Enabled = true;
|
||||
radioButtonLoadGame.Enabled = true;
|
||||
|
||||
radioButtonAuto.Enabled = true;
|
||||
radioButtonHex.Enabled = true;
|
||||
radioButtonDecimal.Enabled = true;
|
||||
|
||||
buttonImport.Enabled = true;
|
||||
buttonSave.Enabled = true;
|
||||
buttonExport.Enabled = true;
|
||||
checkBoxPadding.Enabled = true;
|
||||
}
|
||||
|
||||
void buttonAdd_logic() {
|
||||
buttonAdd.Enabled = false;
|
||||
|
||||
if (radioButtonVariableValue.Checked) {
|
||||
if (!string.IsNullOrEmpty(textBoxScriptID.Text) && !string.IsNullOrEmpty(textBoxVariableName.Text) && !string.IsNullOrEmpty(textBoxVariableValue.Text)) {
|
||||
buttonAdd.Enabled = true;
|
||||
}
|
||||
} else if (radioButtonMapChange.Checked || radioButtonScreenReset.Checked || radioButtonLoadGame.Checked) {
|
||||
if (!string.IsNullOrEmpty(textBoxScriptID.Text)) {
|
||||
buttonAdd.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void selectScriptFileComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (selectScriptFileComboBox.SelectedIndex == -1) {
|
||||
buttonOpenSelectedScript.Enabled = false;
|
||||
buttonOpenHeaderScript.Enabled = false;
|
||||
buttonLocate.Enabled = false;
|
||||
} else {
|
||||
buttonOpenSelectedScript.Enabled = true;
|
||||
buttonOpenHeaderScript.Enabled = true;
|
||||
buttonLocate.Enabled = true;
|
||||
}
|
||||
|
||||
disableButtons();
|
||||
|
||||
try {
|
||||
_levelScriptFile = new LevelScriptFile(selectScriptFileComboBox.SelectedIndex);
|
||||
|
||||
listBoxTriggers.DataSource = _levelScriptFile.bufferSet;
|
||||
if (listBoxTriggers.Items.Count > 0) listBoxTriggers.SelectedIndex = 0;
|
||||
|
||||
enableButtons();
|
||||
} catch (InvalidDataException ex) { //not a level script
|
||||
disableButtons();
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
void listBoxTriggers_SelectedValueChanged(object sender, EventArgs e) {
|
||||
if (listBoxTriggers.SelectedItem == null) {
|
||||
buttonRemove.Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (listBoxTriggers.SelectedItem is MapScreenLoadTrigger mapScreenLoadTrigger) {
|
||||
if (mapScreenLoadTrigger.triggerType == LevelScriptTrigger.LOADGAME) {
|
||||
radioButtonLoadGame.Checked = true;
|
||||
} else if (mapScreenLoadTrigger.triggerType == LevelScriptTrigger.MAPCHANGE) {
|
||||
radioButtonMapChange.Checked = true;
|
||||
} else if (mapScreenLoadTrigger.triggerType == LevelScriptTrigger.SCREENRESET) {
|
||||
radioButtonScreenReset.Checked = true;
|
||||
}
|
||||
} else if (listBoxTriggers.SelectedItem is VariableValueTrigger variableValueTrigger) {
|
||||
if (variableValueTrigger.triggerType == LevelScriptTrigger.VARIABLEVALUE) {
|
||||
radioButtonVariableValue.Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
handleAutoFormat();
|
||||
handleHexFormat();
|
||||
handleDecimalFormat();
|
||||
|
||||
textBoxScriptID.Enabled = true;
|
||||
buttonRemove.Enabled = true;
|
||||
}
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e) {
|
||||
// try {
|
||||
if (_levelScriptFile == null) {
|
||||
_levelScriptFile = new LevelScriptFile();
|
||||
}
|
||||
|
||||
int convertBase = 10; //decimal
|
||||
if (radioButtonHex.Checked) {
|
||||
convertBase = 16; //hex
|
||||
}
|
||||
|
||||
if (radioButtonVariableValue.Checked) {
|
||||
int scriptID = Convert.ToInt16(textBoxScriptID.Text, convertBase);
|
||||
int variableName = Convert.ToInt16(textBoxVariableName.Text, convertBase);
|
||||
int variableValue = Convert.ToInt16(textBoxVariableValue.Text, convertBase);
|
||||
VariableValueTrigger variableValueTrigger = new VariableValueTrigger(scriptID, variableName, variableValue);
|
||||
_levelScriptFile.bufferSet.Add(variableValueTrigger);
|
||||
} else {
|
||||
int scriptID = Convert.ToInt16(textBoxScriptID.Text, convertBase);
|
||||
if (radioButtonMapChange.Checked) {
|
||||
MapScreenLoadTrigger mapScreenLoadTrigger = new MapScreenLoadTrigger(LevelScriptTrigger.MAPCHANGE, scriptID);
|
||||
_levelScriptFile.bufferSet.Add(mapScreenLoadTrigger);
|
||||
} else if (radioButtonScreenReset.Checked) {
|
||||
MapScreenLoadTrigger mapScreenLoadTrigger = new MapScreenLoadTrigger(LevelScriptTrigger.SCREENRESET, scriptID);
|
||||
_levelScriptFile.bufferSet.Add(mapScreenLoadTrigger);
|
||||
} else if (radioButtonLoadGame.Checked) {
|
||||
MapScreenLoadTrigger mapScreenLoadTrigger = new MapScreenLoadTrigger(LevelScriptTrigger.LOADGAME, scriptID);
|
||||
_levelScriptFile.bufferSet.Add(mapScreenLoadTrigger);
|
||||
}
|
||||
}
|
||||
|
||||
textBoxScriptID.Clear();
|
||||
textBoxVariableName.Clear();
|
||||
textBoxVariableValue.Clear();
|
||||
// }
|
||||
// catch (Exception exception) {
|
||||
// MessageBox.Show(exception.Message);
|
||||
// }
|
||||
}
|
||||
|
||||
private void buttonRemove_Click(object sender, EventArgs e) {
|
||||
_levelScriptFile.bufferSet.RemoveAt(listBoxTriggers.SelectedIndex);
|
||||
}
|
||||
|
||||
private void buttonOpenHeaderScript_Click(object sender, EventArgs e) {
|
||||
EditorPanels.scriptEditor.OpenScriptEditor(this._parent, (int)EditorPanels.MainProgram.scriptFileUpDown.Value);
|
||||
}
|
||||
|
||||
private void buttonOpenSelectedScript_Click(object sender, EventArgs e) {
|
||||
EditorPanels.scriptEditor.OpenScriptEditor(this._parent, (int)EditorPanels.levelScriptEditor.selectScriptFileComboBox.SelectedIndex);
|
||||
}
|
||||
|
||||
void buttonLocate_Click(object sender, EventArgs e) {
|
||||
if (_levelScriptFile == null) return;
|
||||
string path = Filesystem.GetScriptPath(_levelScriptFile.ID);
|
||||
Helpers.ExplorerSelect(path);
|
||||
}
|
||||
|
||||
void buttonImport_Click(object sender, EventArgs e) {
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
if (ofd.ShowDialog() == DialogResult.OK) {
|
||||
try {
|
||||
LevelScriptFile importedFile = new LevelScriptFile();
|
||||
importedFile.parse_file(ofd.FileName);
|
||||
_levelScriptFile.bufferSet.Clear();
|
||||
foreach (LevelScriptTrigger trigger in importedFile.bufferSet) {
|
||||
_levelScriptFile.bufferSet.Add(trigger);
|
||||
}
|
||||
} catch (InvalidDataException ex) {
|
||||
MessageBox.Show(ex.Message, ex.GetType().ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e) {
|
||||
string path = Filesystem.GetScriptPath(_levelScriptFile.ID);
|
||||
saveFile(path);
|
||||
}
|
||||
|
||||
private void buttonExport_Click(object sender, EventArgs e) {
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
try {
|
||||
sfd.InitialDirectory = Path.GetDirectoryName(sfd.FileName);
|
||||
sfd.FileName = Path.GetFileName(sfd.FileName);
|
||||
} catch (Exception ex) {
|
||||
sfd.InitialDirectory = Path.GetDirectoryName(Environment.SpecialFolder.UserProfile.ToString());
|
||||
sfd.FileName = Path.GetFileName(sfd.FileName);
|
||||
}
|
||||
|
||||
if (sfd.ShowDialog() == DialogResult.OK) {
|
||||
saveFile(sfd.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
void saveFile(string path) {
|
||||
try {
|
||||
long bytes_written = _levelScriptFile.write_file(path);
|
||||
if (bytes_written <= 4) {
|
||||
MessageBox.Show("Empty level script file was correctly saved.", "Success!");
|
||||
} else {
|
||||
MessageBox.Show("File was correctly saved.", "Success!");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
MessageBox.Show(ex.Message, ex.GetType().ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void handleAutoFormat() {
|
||||
if (!radioButtonAuto.Checked) return;
|
||||
|
||||
textBoxScriptID.Clear();
|
||||
textBoxVariableName.Clear();
|
||||
textBoxVariableValue.Clear();
|
||||
|
||||
if (listBoxTriggers.SelectedItem is MapScreenLoadTrigger mapScreenLoadTrigger) {
|
||||
textBoxScriptID.Text = mapScreenLoadTrigger.scriptTriggered.ToString();
|
||||
} else if (listBoxTriggers.SelectedItem is VariableValueTrigger variableValueTrigger) {
|
||||
textBoxScriptID.Text = variableValueTrigger.scriptTriggered.ToString();
|
||||
textBoxVariableName.Text = "" + variableValueTrigger.variableToWatch.ToString("D");
|
||||
textBoxVariableValue.Text = "" + variableValueTrigger.expectedValue.ToString("D");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleHexFormat() {
|
||||
if (!radioButtonHex.Checked) return;
|
||||
|
||||
textBoxScriptID.Clear();
|
||||
textBoxVariableName.Clear();
|
||||
textBoxVariableValue.Clear();
|
||||
|
||||
if (listBoxTriggers.SelectedItem is MapScreenLoadTrigger mapScreenLoadTrigger) {
|
||||
textBoxScriptID.Text = mapScreenLoadTrigger.scriptTriggered.ToString();
|
||||
} else if (listBoxTriggers.SelectedItem is VariableValueTrigger variableValueTrigger) {
|
||||
textBoxScriptID.Text = variableValueTrigger.scriptTriggered.ToString();
|
||||
textBoxVariableName.Text = "0x" + variableValueTrigger.variableToWatch.ToString("X");
|
||||
textBoxVariableValue.Text = "0x" + variableValueTrigger.expectedValue.ToString("X");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleDecimalFormat() {
|
||||
if (!radioButtonDecimal.Checked) return;
|
||||
|
||||
textBoxScriptID.Clear();
|
||||
textBoxVariableName.Clear();
|
||||
textBoxVariableValue.Clear();
|
||||
|
||||
if (listBoxTriggers.SelectedItem is MapScreenLoadTrigger mapScreenLoadTrigger) {
|
||||
textBoxScriptID.Text = mapScreenLoadTrigger.scriptTriggered.ToString();
|
||||
} else if (listBoxTriggers.SelectedItem is VariableValueTrigger variableValueTrigger) {
|
||||
textBoxScriptID.Text = variableValueTrigger.scriptTriggered.ToString();
|
||||
textBoxVariableName.Text = "" + variableValueTrigger.variableToWatch.ToString("D");
|
||||
textBoxVariableValue.Text = "" + variableValueTrigger.expectedValue.ToString("D");
|
||||
}
|
||||
}
|
||||
|
||||
private void radioButtonAuto_CheckedChanged(object sender, EventArgs e) {
|
||||
handleAutoFormat();
|
||||
}
|
||||
|
||||
private void radioButtonHex_CheckedChanged(object sender, EventArgs e) {
|
||||
handleHexFormat();
|
||||
}
|
||||
|
||||
private void radioButtonDecimal_CheckedChanged(object sender, EventArgs e) {
|
||||
handleDecimalFormat();
|
||||
}
|
||||
|
||||
private void radioButtonVariableValue_CheckedChanged(object sender, EventArgs e) {
|
||||
textBoxVariableName.Enabled = true;
|
||||
textBoxVariableValue.Enabled = true;
|
||||
buttonAdd_logic();
|
||||
}
|
||||
|
||||
private void radioButtonMapChange_CheckedChanged(object sender, EventArgs e) {
|
||||
textBoxVariableName.Enabled = false;
|
||||
textBoxVariableValue.Enabled = false;
|
||||
buttonAdd_logic();
|
||||
}
|
||||
|
||||
private void radioButtonScreenReset_CheckedChanged(object sender, EventArgs e) {
|
||||
textBoxVariableName.Enabled = false;
|
||||
textBoxVariableValue.Enabled = false;
|
||||
buttonAdd_logic();
|
||||
}
|
||||
|
||||
private void radioButtonLoadGame_CheckedChanged(object sender, EventArgs e) {
|
||||
textBoxVariableName.Enabled = false;
|
||||
textBoxVariableValue.Enabled = false;
|
||||
buttonAdd_logic();
|
||||
}
|
||||
|
||||
void textBoxScriptID_TextChanged(object sender, EventArgs e) {
|
||||
buttonAdd_logic();
|
||||
}
|
||||
|
||||
void textBoxVariableName_TextChanged(object sender, EventArgs e) {
|
||||
buttonAdd_logic();
|
||||
}
|
||||
|
||||
void textBoxVariableValue_TextChanged(object sender, EventArgs e) {
|
||||
buttonAdd_logic();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/LevelScriptEditor.resx
Normal file
120
DS_Map/Editors/LevelScriptEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
250
DS_Map/Editors/SafariZoneEditor.Designer.cs
generated
Normal file
250
DS_Map/Editors/SafariZoneEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
partial class SafariZoneEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.buttonSaveAs = new System.Windows.Forms.Button();
|
||||
this.buttonSave = new System.Windows.Forms.Button();
|
||||
this.tabPageSuperRod = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterGroupEditorSuperRod = new DSPRE.Editors.SafariZoneEncounterGroupEditor();
|
||||
this.tabPageGoodRod = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterGroupEditorGoodRod = new DSPRE.Editors.SafariZoneEncounterGroupEditor();
|
||||
this.tabPageOldRod = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterGroupEditorOldRod = new DSPRE.Editors.SafariZoneEncounterGroupEditor();
|
||||
this.tabPageSurf = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterGroupEditorSurf = new DSPRE.Editors.SafariZoneEncounterGroupEditor();
|
||||
this.tabPageGrass = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterGroupEditorGrass = new DSPRE.Editors.SafariZoneEncounterGroupEditor();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBoxFileID = new System.Windows.Forms.ComboBox();
|
||||
this.buttonImport = new System.Windows.Forms.Button();
|
||||
this.tabPageSuperRod.SuspendLayout();
|
||||
this.tabPageGoodRod.SuspendLayout();
|
||||
this.tabPageOldRod.SuspendLayout();
|
||||
this.tabPageSurf.SuspendLayout();
|
||||
this.tabPageGrass.SuspendLayout();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonSaveAs
|
||||
//
|
||||
this.buttonSaveAs.Location = new System.Drawing.Point(236, 14);
|
||||
this.buttonSaveAs.Name = "buttonSaveAs";
|
||||
this.buttonSaveAs.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonSaveAs.TabIndex = 28;
|
||||
this.buttonSaveAs.Text = "Save As";
|
||||
this.buttonSaveAs.UseVisualStyleBackColor = true;
|
||||
this.buttonSaveAs.Click += new System.EventHandler(this.buttonSaveAs_Click);
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
this.buttonSave.Location = new System.Drawing.Point(155, 14);
|
||||
this.buttonSave.Name = "buttonSave";
|
||||
this.buttonSave.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonSave.TabIndex = 28;
|
||||
this.buttonSave.Text = "Save";
|
||||
this.buttonSave.UseVisualStyleBackColor = true;
|
||||
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
|
||||
//
|
||||
// tabPageSuperRod
|
||||
//
|
||||
this.tabPageSuperRod.Controls.Add(this.safariZoneEncounterGroupEditorSuperRod);
|
||||
this.tabPageSuperRod.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageSuperRod.Name = "tabPageSuperRod";
|
||||
this.tabPageSuperRod.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageSuperRod.Size = new System.Drawing.Size(935, 264);
|
||||
this.tabPageSuperRod.TabIndex = 4;
|
||||
this.tabPageSuperRod.Text = "Super Rod";
|
||||
this.tabPageSuperRod.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterGroupEditorSuperRod
|
||||
//
|
||||
this.safariZoneEncounterGroupEditorSuperRod.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterGroupEditorSuperRod.Name = "safariZoneEncounterGroupEditorSuperRod";
|
||||
this.safariZoneEncounterGroupEditorSuperRod.Size = new System.Drawing.Size(969, 255);
|
||||
this.safariZoneEncounterGroupEditorSuperRod.TabIndex = 25;
|
||||
//
|
||||
// tabPageGoodRod
|
||||
//
|
||||
this.tabPageGoodRod.Controls.Add(this.safariZoneEncounterGroupEditorGoodRod);
|
||||
this.tabPageGoodRod.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageGoodRod.Name = "tabPageGoodRod";
|
||||
this.tabPageGoodRod.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageGoodRod.Size = new System.Drawing.Size(935, 264);
|
||||
this.tabPageGoodRod.TabIndex = 3;
|
||||
this.tabPageGoodRod.Text = "Good Rod";
|
||||
this.tabPageGoodRod.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterGroupEditorGoodRod
|
||||
//
|
||||
this.safariZoneEncounterGroupEditorGoodRod.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterGroupEditorGoodRod.Name = "safariZoneEncounterGroupEditorGoodRod";
|
||||
this.safariZoneEncounterGroupEditorGoodRod.Size = new System.Drawing.Size(969, 255);
|
||||
this.safariZoneEncounterGroupEditorGoodRod.TabIndex = 25;
|
||||
//
|
||||
// tabPageOldRod
|
||||
//
|
||||
this.tabPageOldRod.Controls.Add(this.safariZoneEncounterGroupEditorOldRod);
|
||||
this.tabPageOldRod.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageOldRod.Name = "tabPageOldRod";
|
||||
this.tabPageOldRod.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageOldRod.Size = new System.Drawing.Size(935, 264);
|
||||
this.tabPageOldRod.TabIndex = 2;
|
||||
this.tabPageOldRod.Text = "Old Rod";
|
||||
this.tabPageOldRod.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterGroupEditorOldRod
|
||||
//
|
||||
this.safariZoneEncounterGroupEditorOldRod.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterGroupEditorOldRod.Name = "safariZoneEncounterGroupEditorOldRod";
|
||||
this.safariZoneEncounterGroupEditorOldRod.Size = new System.Drawing.Size(969, 255);
|
||||
this.safariZoneEncounterGroupEditorOldRod.TabIndex = 25;
|
||||
//
|
||||
// tabPageSurf
|
||||
//
|
||||
this.tabPageSurf.Controls.Add(this.safariZoneEncounterGroupEditorSurf);
|
||||
this.tabPageSurf.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageSurf.Name = "tabPageSurf";
|
||||
this.tabPageSurf.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageSurf.Size = new System.Drawing.Size(935, 264);
|
||||
this.tabPageSurf.TabIndex = 1;
|
||||
this.tabPageSurf.Text = "Surf";
|
||||
this.tabPageSurf.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterGroupEditorSurf
|
||||
//
|
||||
this.safariZoneEncounterGroupEditorSurf.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterGroupEditorSurf.Name = "safariZoneEncounterGroupEditorSurf";
|
||||
this.safariZoneEncounterGroupEditorSurf.Size = new System.Drawing.Size(969, 255);
|
||||
this.safariZoneEncounterGroupEditorSurf.TabIndex = 25;
|
||||
//
|
||||
// tabPageGrass
|
||||
//
|
||||
this.tabPageGrass.Controls.Add(this.safariZoneEncounterGroupEditorGrass);
|
||||
this.tabPageGrass.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageGrass.Name = "tabPageGrass";
|
||||
this.tabPageGrass.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageGrass.Size = new System.Drawing.Size(935, 264);
|
||||
this.tabPageGrass.TabIndex = 0;
|
||||
this.tabPageGrass.Text = "Grass";
|
||||
this.tabPageGrass.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterGroupEditorGrass
|
||||
//
|
||||
this.safariZoneEncounterGroupEditorGrass.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterGroupEditorGrass.Name = "safariZoneEncounterGroupEditorGrass";
|
||||
this.safariZoneEncounterGroupEditorGrass.Size = new System.Drawing.Size(969, 255);
|
||||
this.safariZoneEncounterGroupEditorGrass.TabIndex = 25;
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.tabPageGrass);
|
||||
this.tabControl1.Controls.Add(this.tabPageSurf);
|
||||
this.tabControl1.Controls.Add(this.tabPageOldRod);
|
||||
this.tabControl1.Controls.Add(this.tabPageGoodRod);
|
||||
this.tabControl1.Controls.Add(this.tabPageSuperRod);
|
||||
this.tabControl1.Location = new System.Drawing.Point(4, 44);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(943, 290);
|
||||
this.tabControl1.TabIndex = 27;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(3, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(59, 13);
|
||||
this.label1.TabIndex = 26;
|
||||
this.label1.Text = "Map Name";
|
||||
//
|
||||
// comboBoxFileID
|
||||
//
|
||||
this.comboBoxFileID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxFileID.FormattingEnabled = true;
|
||||
this.comboBoxFileID.Location = new System.Drawing.Point(3, 16);
|
||||
this.comboBoxFileID.Name = "comboBoxFileID";
|
||||
this.comboBoxFileID.Size = new System.Drawing.Size(146, 21);
|
||||
this.comboBoxFileID.TabIndex = 0;
|
||||
this.comboBoxFileID.SelectedIndexChanged += new System.EventHandler(this.comboBoxFileID_SelectedIndexChanged);
|
||||
//
|
||||
// buttonImport
|
||||
//
|
||||
this.buttonImport.Location = new System.Drawing.Point(317, 14);
|
||||
this.buttonImport.Name = "buttonImport";
|
||||
this.buttonImport.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonImport.TabIndex = 28;
|
||||
this.buttonImport.Text = "Import";
|
||||
this.buttonImport.UseVisualStyleBackColor = true;
|
||||
this.buttonImport.Click += new System.EventHandler(this.buttonImport_Click);
|
||||
//
|
||||
// SafariZoneEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.buttonImport);
|
||||
this.Controls.Add(this.buttonSaveAs);
|
||||
this.Controls.Add(this.buttonSave);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.comboBoxFileID);
|
||||
this.Name = "SafariZoneEditor";
|
||||
this.Size = new System.Drawing.Size(953, 340);
|
||||
this.tabPageSuperRod.ResumeLayout(false);
|
||||
this.tabPageGoodRod.ResumeLayout(false);
|
||||
this.tabPageOldRod.ResumeLayout(false);
|
||||
this.tabPageSurf.ResumeLayout(false);
|
||||
this.tabPageGrass.ResumeLayout(false);
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button buttonSaveAs;
|
||||
private System.Windows.Forms.Button buttonSave;
|
||||
private System.Windows.Forms.TabPage tabPageSuperRod;
|
||||
private SafariZoneEncounterGroupEditor safariZoneEncounterGroupEditorSuperRod;
|
||||
private System.Windows.Forms.TabPage tabPageGoodRod;
|
||||
private SafariZoneEncounterGroupEditor safariZoneEncounterGroupEditorGoodRod;
|
||||
private System.Windows.Forms.TabPage tabPageOldRod;
|
||||
private SafariZoneEncounterGroupEditor safariZoneEncounterGroupEditorOldRod;
|
||||
private System.Windows.Forms.TabPage tabPageSurf;
|
||||
private SafariZoneEncounterGroupEditor safariZoneEncounterGroupEditorSurf;
|
||||
private System.Windows.Forms.TabPage tabPageGrass;
|
||||
private SafariZoneEncounterGroupEditor safariZoneEncounterGroupEditorGrass;
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ComboBox comboBoxFileID;
|
||||
private System.Windows.Forms.Button buttonImport;
|
||||
}
|
||||
}
|
||||
105
DS_Map/Editors/SafariZoneEditor.cs
Normal file
105
DS_Map/Editors/SafariZoneEditor.cs
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using DSPRE.ROMFiles;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
public partial class SafariZoneEditor : UserControl {
|
||||
public bool safariZoneEditorIsReady { get; set; } = false;
|
||||
private SafariZoneEncounterFile safariZoneEncounterFile;
|
||||
|
||||
public SafariZoneEditor() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetupSafariZoneEditor(bool force = false) {
|
||||
if (safariZoneEditorIsReady && !force) return;
|
||||
safariZoneEditorIsReady = true;
|
||||
|
||||
DSUtils.TryUnpackNarcs(new List<RomInfo.DirNames>() {
|
||||
RomInfo.DirNames.safariZone,
|
||||
RomInfo.DirNames.textArchives,
|
||||
});
|
||||
|
||||
safariZoneEncounterGroupEditorGrass.SetPokemonNames();
|
||||
safariZoneEncounterGroupEditorSurf.SetPokemonNames();
|
||||
safariZoneEncounterGroupEditorOldRod.SetPokemonNames();
|
||||
safariZoneEncounterGroupEditorGoodRod.SetPokemonNames();
|
||||
safariZoneEncounterGroupEditorSuperRod.SetPokemonNames();
|
||||
|
||||
int safariZoneCount = Filesystem.GetSafariZoneCount();
|
||||
comboBoxFileID.Items.Clear();
|
||||
for (int i = 0; i < safariZoneCount; i++) {
|
||||
comboBoxFileID.Items.Add(SafariZoneEncounterFile.Names[i]);
|
||||
}
|
||||
|
||||
if (comboBoxFileID.Items.Count > 0) {
|
||||
comboBoxFileID.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBoxFileID_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (comboBoxFileID.SelectedIndex == -1) {
|
||||
safariZoneEncounterFile = null;
|
||||
safariZoneEncounterGroupEditorGrass.Reset();
|
||||
safariZoneEncounterGroupEditorSurf.Reset();
|
||||
safariZoneEncounterGroupEditorOldRod.Reset();
|
||||
safariZoneEncounterGroupEditorGoodRod.Reset();
|
||||
safariZoneEncounterGroupEditorSuperRod.Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
safariZoneEncounterFile = new SafariZoneEncounterFile(comboBoxFileID.SelectedIndex);
|
||||
safariZoneEncounterGroupEditorGrass.SetData(safariZoneEncounterFile.grassEncounterGroup);
|
||||
safariZoneEncounterGroupEditorSurf.SetData(safariZoneEncounterFile.surfEncounterGroup);
|
||||
safariZoneEncounterGroupEditorOldRod.SetData(safariZoneEncounterFile.oldRodEncounterGroup);
|
||||
safariZoneEncounterGroupEditorGoodRod.SetData(safariZoneEncounterFile.goodRodEncounterGroup);
|
||||
safariZoneEncounterGroupEditorSuperRod.SetData(safariZoneEncounterFile.superRodEncounterGroup);
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e) {
|
||||
if (safariZoneEncounterFile == null) return;
|
||||
safariZoneEncounterFile.SaveToFile();
|
||||
}
|
||||
|
||||
private void buttonSaveAs_Click(object sender, EventArgs e) {
|
||||
if (safariZoneEncounterFile == null) return;
|
||||
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
try {
|
||||
sfd.InitialDirectory = Path.GetDirectoryName(sfd.FileName);
|
||||
sfd.FileName = Path.GetFileName(sfd.FileName);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
sfd.InitialDirectory = Path.GetDirectoryName(Environment.SpecialFolder.UserProfile.ToString());
|
||||
sfd.FileName = Path.GetFileName(sfd.FileName);
|
||||
}
|
||||
if (sfd.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
safariZoneEncounterFile.SaveToFile(sfd.FileName);
|
||||
}
|
||||
|
||||
private void buttonImport_Click(object sender, EventArgs e) {
|
||||
if (safariZoneEncounterFile == null) return;
|
||||
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
try {
|
||||
ofd.InitialDirectory = Path.GetDirectoryName(ofd.FileName);
|
||||
ofd.FileName = Path.GetFileName(ofd.FileName);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ofd.InitialDirectory = Path.GetDirectoryName(Environment.SpecialFolder.UserProfile.ToString());
|
||||
ofd.FileName = Path.GetFileName(ofd.FileName);
|
||||
}
|
||||
if (ofd.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
safariZoneEncounterFile = new SafariZoneEncounterFile(ofd.FileName);
|
||||
safariZoneEncounterGroupEditorGrass.SetData(safariZoneEncounterFile.grassEncounterGroup);
|
||||
safariZoneEncounterGroupEditorSurf.SetData(safariZoneEncounterFile.surfEncounterGroup);
|
||||
safariZoneEncounterGroupEditorOldRod.SetData(safariZoneEncounterFile.oldRodEncounterGroup);
|
||||
safariZoneEncounterGroupEditorGoodRod.SetData(safariZoneEncounterFile.goodRodEncounterGroup);
|
||||
safariZoneEncounterGroupEditorSuperRod.SetData(safariZoneEncounterFile.superRodEncounterGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/SafariZoneEditor.resx
Normal file
120
DS_Map/Editors/SafariZoneEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
218
DS_Map/Editors/SafariZoneEncounterEditorTab.Designer.cs
generated
Normal file
218
DS_Map/Editors/SafariZoneEncounterEditorTab.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
partial class SafariZoneEncounterEditorTab
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.numericUpDownLevel = new System.Windows.Forms.NumericUpDown();
|
||||
this.comboBoxPokemon = new System.Windows.Forms.ComboBox();
|
||||
this.numericUpDownLevelObject = new System.Windows.Forms.NumericUpDown();
|
||||
this.comboBoxPokemonObject = new System.Windows.Forms.ComboBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.listBoxEncountersObject = new DSPRE.ListBox2();
|
||||
this.listBoxEncounters = new DSPRE.ListBox2();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownLevel)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownLevelObject)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// numericUpDownLevel
|
||||
//
|
||||
this.numericUpDownLevel.Location = new System.Drawing.Point(139, 180);
|
||||
this.numericUpDownLevel.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownLevel.Name = "numericUpDownLevel";
|
||||
this.numericUpDownLevel.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownLevel.TabIndex = 20;
|
||||
this.numericUpDownLevel.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownLevel.ValueChanged += new System.EventHandler(this.numericUpDownLevel_ValueChanged);
|
||||
//
|
||||
// comboBoxPokemon
|
||||
//
|
||||
this.comboBoxPokemon.FormattingEnabled = true;
|
||||
this.comboBoxPokemon.Location = new System.Drawing.Point(6, 179);
|
||||
this.comboBoxPokemon.Name = "comboBoxPokemon";
|
||||
this.comboBoxPokemon.Size = new System.Drawing.Size(127, 21);
|
||||
this.comboBoxPokemon.TabIndex = 21;
|
||||
this.comboBoxPokemon.SelectedIndexChanged += new System.EventHandler(this.comboBoxPokemon_SelectedIndexChanged);
|
||||
//
|
||||
// numericUpDownLevelObject
|
||||
//
|
||||
this.numericUpDownLevelObject.Location = new System.Drawing.Point(339, 180);
|
||||
this.numericUpDownLevelObject.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownLevelObject.Name = "numericUpDownLevelObject";
|
||||
this.numericUpDownLevelObject.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownLevelObject.TabIndex = 20;
|
||||
this.numericUpDownLevelObject.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownLevelObject.ValueChanged += new System.EventHandler(this.numericUpDownLevelObject_ValueChanged);
|
||||
//
|
||||
// comboBoxPokemonObject
|
||||
//
|
||||
this.comboBoxPokemonObject.FormattingEnabled = true;
|
||||
this.comboBoxPokemonObject.Location = new System.Drawing.Point(206, 179);
|
||||
this.comboBoxPokemonObject.Name = "comboBoxPokemonObject";
|
||||
this.comboBoxPokemonObject.Size = new System.Drawing.Size(127, 21);
|
||||
this.comboBoxPokemonObject.TabIndex = 21;
|
||||
this.comboBoxPokemonObject.SelectedIndexChanged += new System.EventHandler(this.comboBoxPokemonObject_SelectedIndexChanged);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(86, 13);
|
||||
this.label2.TabIndex = 22;
|
||||
this.label2.Text = "Encounter Table";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(203, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(120, 13);
|
||||
this.label1.TabIndex = 22;
|
||||
this.label1.Text = "Object Encounter Table";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(136, 163);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(33, 13);
|
||||
this.label3.TabIndex = 23;
|
||||
this.label3.Text = "Level";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(3, 163);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(52, 13);
|
||||
this.label4.TabIndex = 24;
|
||||
this.label4.Text = "Pokemon";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(203, 163);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(52, 13);
|
||||
this.label5.TabIndex = 24;
|
||||
this.label5.Text = "Pokemon";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(336, 163);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(33, 13);
|
||||
this.label6.TabIndex = 23;
|
||||
this.label6.Text = "Level";
|
||||
//
|
||||
// listBoxEncountersObject
|
||||
//
|
||||
this.listBoxEncountersObject.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listBoxEncountersObject.FormattingEnabled = true;
|
||||
this.listBoxEncountersObject.ItemHeight = 14;
|
||||
this.listBoxEncountersObject.Location = new System.Drawing.Point(206, 16);
|
||||
this.listBoxEncountersObject.Name = "listBoxEncountersObject";
|
||||
this.listBoxEncountersObject.Size = new System.Drawing.Size(191, 144);
|
||||
this.listBoxEncountersObject.TabIndex = 1;
|
||||
this.listBoxEncountersObject.SelectedIndexChanged += new System.EventHandler(this.listBoxEncountersObject_SelectedIndexChanged);
|
||||
//
|
||||
// listBoxEncounters
|
||||
//
|
||||
this.listBoxEncounters.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listBoxEncounters.FormattingEnabled = true;
|
||||
this.listBoxEncounters.ItemHeight = 14;
|
||||
this.listBoxEncounters.Location = new System.Drawing.Point(6, 16);
|
||||
this.listBoxEncounters.Name = "listBoxEncounters";
|
||||
this.listBoxEncounters.Size = new System.Drawing.Size(191, 144);
|
||||
this.listBoxEncounters.TabIndex = 1;
|
||||
this.listBoxEncounters.SelectedIndexChanged += new System.EventHandler(this.listBoxEncounters_SelectedIndexChanged);
|
||||
//
|
||||
// SafariZoneEncounterEditorTab
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.comboBoxPokemonObject);
|
||||
this.Controls.Add(this.comboBoxPokemon);
|
||||
this.Controls.Add(this.numericUpDownLevelObject);
|
||||
this.Controls.Add(this.numericUpDownLevel);
|
||||
this.Controls.Add(this.listBoxEncountersObject);
|
||||
this.Controls.Add(this.listBoxEncounters);
|
||||
this.Name = "SafariZoneEncounterEditorTab";
|
||||
this.Size = new System.Drawing.Size(404, 208);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownLevel)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownLevelObject)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public ListBox2 listBoxEncounters;
|
||||
public System.Windows.Forms.NumericUpDown numericUpDownLevel;
|
||||
public System.Windows.Forms.ComboBox comboBoxPokemon;
|
||||
public ListBox2 listBoxEncountersObject;
|
||||
public System.Windows.Forms.NumericUpDown numericUpDownLevelObject;
|
||||
public System.Windows.Forms.ComboBox comboBoxPokemonObject;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
}
|
||||
}
|
||||
63
DS_Map/Editors/SafariZoneEncounterEditorTab.cs
Normal file
63
DS_Map/Editors/SafariZoneEncounterEditorTab.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using DSPRE.ROMFiles;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
public partial class SafariZoneEncounterEditorTab : UserControl {
|
||||
public SafariZoneEncounterEditorTab() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void listBoxEncounters_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneEncounter safariZoneEncounter = (SafariZoneEncounter)listBoxEncounters.SelectedItem;
|
||||
if (safariZoneEncounter == null) return;
|
||||
comboBoxPokemon.SelectedIndex = safariZoneEncounter.pokemonID;
|
||||
numericUpDownLevel.Value = safariZoneEncounter.level;
|
||||
}
|
||||
|
||||
private void comboBoxPokemon_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneEncounter safariZoneEncounter = (SafariZoneEncounter)listBoxEncounters.SelectedItem;
|
||||
if (safariZoneEncounter == null) return;
|
||||
safariZoneEncounter.pokemonID = (ushort)comboBoxPokemon.SelectedIndex;
|
||||
listBoxEncounters.RefreshItem(listBoxEncounters.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownLevel_ValueChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneEncounter safariZoneEncounter = (SafariZoneEncounter)listBoxEncounters.SelectedItem;
|
||||
if (safariZoneEncounter == null) return;
|
||||
safariZoneEncounter.level = (byte)numericUpDownLevel.Value;
|
||||
listBoxEncounters.RefreshItem(listBoxEncounters.SelectedIndex);
|
||||
}
|
||||
|
||||
private void listBoxEncountersObject_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneEncounter safariZoneEncounter = (SafariZoneEncounter)listBoxEncountersObject.SelectedItem;
|
||||
if (safariZoneEncounter == null) return;
|
||||
|
||||
comboBoxPokemonObject.SelectedIndex = safariZoneEncounter.pokemonID;
|
||||
numericUpDownLevelObject.Value = safariZoneEncounter.level;
|
||||
}
|
||||
|
||||
private void comboBoxPokemonObject_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneEncounter safariZoneEncounter = (SafariZoneEncounter)listBoxEncountersObject.SelectedItem;
|
||||
if (safariZoneEncounter == null) return;
|
||||
safariZoneEncounter.pokemonID = (ushort)comboBoxPokemonObject.SelectedIndex;
|
||||
listBoxEncountersObject.RefreshItem(listBoxEncountersObject.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownLevelObject_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneEncounter safariZoneEncounter = (SafariZoneEncounter)listBoxEncountersObject.SelectedItem;
|
||||
if (safariZoneEncounter == null) return;
|
||||
safariZoneEncounter.level = (byte)numericUpDownLevelObject.Value;
|
||||
listBoxEncountersObject.RefreshItem(listBoxEncountersObject.SelectedIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/SafariZoneEncounterEditorTab.resx
Normal file
120
DS_Map/Editors/SafariZoneEncounterEditorTab.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
323
DS_Map/Editors/SafariZoneEncounterGroupEditor.Designer.cs
generated
Normal file
323
DS_Map/Editors/SafariZoneEncounterGroupEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,323 @@
|
|||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
partial class SafariZoneEncounterGroupEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tabControlEncounters = new System.Windows.Forms.TabControl();
|
||||
this.tabPageMorning = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterEditorMorningTab = new DSPRE.Editors.SafariZoneEncounterEditorTab();
|
||||
this.tabPageDay = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterEditorDayTab = new DSPRE.Editors.SafariZoneEncounterEditorTab();
|
||||
this.tabPageNight = new System.Windows.Forms.TabPage();
|
||||
this.safariZoneEncounterEditorNightTab = new DSPRE.Editors.SafariZoneEncounterEditorTab();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.comboBoxObjectRequirementType = new System.Windows.Forms.ComboBox();
|
||||
this.numericUpDownObjectRequirementQty = new System.Windows.Forms.NumericUpDown();
|
||||
this.listBoxObjectRequirements = new DSPRE.ListBox2();
|
||||
this.listBoxObjectOptionalRequirements = new DSPRE.ListBox2();
|
||||
this.numericUpDownObjectOptionalRequirementQty = new System.Windows.Forms.NumericUpDown();
|
||||
this.comboBoxOptionalObjectRequirementType = new System.Windows.Forms.ComboBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.buttonRemoveObjectEncounter = new System.Windows.Forms.Button();
|
||||
this.buttonAddObjectEncounter = new System.Windows.Forms.Button();
|
||||
this.tabControlEncounters.SuspendLayout();
|
||||
this.tabPageMorning.SuspendLayout();
|
||||
this.tabPageDay.SuspendLayout();
|
||||
this.tabPageNight.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownObjectRequirementQty)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownObjectOptionalRequirementQty)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControlEncounters
|
||||
//
|
||||
this.tabControlEncounters.Controls.Add(this.tabPageMorning);
|
||||
this.tabControlEncounters.Controls.Add(this.tabPageDay);
|
||||
this.tabControlEncounters.Controls.Add(this.tabPageNight);
|
||||
this.tabControlEncounters.Location = new System.Drawing.Point(4, 7);
|
||||
this.tabControlEncounters.Name = "tabControlEncounters";
|
||||
this.tabControlEncounters.SelectedIndex = 0;
|
||||
this.tabControlEncounters.Size = new System.Drawing.Size(418, 244);
|
||||
this.tabControlEncounters.TabIndex = 2;
|
||||
//
|
||||
// tabPageMorning
|
||||
//
|
||||
this.tabPageMorning.Controls.Add(this.safariZoneEncounterEditorMorningTab);
|
||||
this.tabPageMorning.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageMorning.Name = "tabPageMorning";
|
||||
this.tabPageMorning.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageMorning.Size = new System.Drawing.Size(410, 218);
|
||||
this.tabPageMorning.TabIndex = 0;
|
||||
this.tabPageMorning.Text = "Morning";
|
||||
this.tabPageMorning.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterEditorMorningTab
|
||||
//
|
||||
this.safariZoneEncounterEditorMorningTab.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterEditorMorningTab.Name = "safariZoneEncounterEditorMorningTab";
|
||||
this.safariZoneEncounterEditorMorningTab.Size = new System.Drawing.Size(405, 209);
|
||||
this.safariZoneEncounterEditorMorningTab.TabIndex = 1;
|
||||
//
|
||||
// tabPageDay
|
||||
//
|
||||
this.tabPageDay.Controls.Add(this.safariZoneEncounterEditorDayTab);
|
||||
this.tabPageDay.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageDay.Name = "tabPageDay";
|
||||
this.tabPageDay.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageDay.Size = new System.Drawing.Size(410, 218);
|
||||
this.tabPageDay.TabIndex = 1;
|
||||
this.tabPageDay.Text = "Day";
|
||||
this.tabPageDay.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterEditorDayTab
|
||||
//
|
||||
this.safariZoneEncounterEditorDayTab.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterEditorDayTab.Name = "safariZoneEncounterEditorDayTab";
|
||||
this.safariZoneEncounterEditorDayTab.Size = new System.Drawing.Size(401, 206);
|
||||
this.safariZoneEncounterEditorDayTab.TabIndex = 1;
|
||||
//
|
||||
// tabPageNight
|
||||
//
|
||||
this.tabPageNight.Controls.Add(this.safariZoneEncounterEditorNightTab);
|
||||
this.tabPageNight.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPageNight.Name = "tabPageNight";
|
||||
this.tabPageNight.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPageNight.Size = new System.Drawing.Size(410, 218);
|
||||
this.tabPageNight.TabIndex = 2;
|
||||
this.tabPageNight.Text = "Night";
|
||||
this.tabPageNight.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// safariZoneEncounterEditorNightTab
|
||||
//
|
||||
this.safariZoneEncounterEditorNightTab.Location = new System.Drawing.Point(6, 6);
|
||||
this.safariZoneEncounterEditorNightTab.Name = "safariZoneEncounterEditorNightTab";
|
||||
this.safariZoneEncounterEditorNightTab.Size = new System.Drawing.Size(401, 206);
|
||||
this.safariZoneEncounterEditorNightTab.TabIndex = 1;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(657, 198);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(23, 13);
|
||||
this.label3.TabIndex = 29;
|
||||
this.label3.Text = "Qty";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(524, 198);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(31, 13);
|
||||
this.label4.TabIndex = 30;
|
||||
this.label4.Text = "Type";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(524, 35);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(133, 13);
|
||||
this.label2.TabIndex = 28;
|
||||
this.label2.Text = "Object Type Requirements";
|
||||
//
|
||||
// comboBoxObjectRequirementType
|
||||
//
|
||||
this.comboBoxObjectRequirementType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxObjectRequirementType.FormattingEnabled = true;
|
||||
this.comboBoxObjectRequirementType.Location = new System.Drawing.Point(527, 214);
|
||||
this.comboBoxObjectRequirementType.Name = "comboBoxObjectRequirementType";
|
||||
this.comboBoxObjectRequirementType.Size = new System.Drawing.Size(127, 21);
|
||||
this.comboBoxObjectRequirementType.TabIndex = 27;
|
||||
this.comboBoxObjectRequirementType.SelectedIndexChanged += new System.EventHandler(this.comboBoxObjectRequirementType_SelectedIndexChanged);
|
||||
//
|
||||
// numericUpDownObjectRequirementQty
|
||||
//
|
||||
this.numericUpDownObjectRequirementQty.Location = new System.Drawing.Point(660, 215);
|
||||
this.numericUpDownObjectRequirementQty.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownObjectRequirementQty.Name = "numericUpDownObjectRequirementQty";
|
||||
this.numericUpDownObjectRequirementQty.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownObjectRequirementQty.TabIndex = 26;
|
||||
this.numericUpDownObjectRequirementQty.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDownObjectRequirementQty.ValueChanged += new System.EventHandler(this.numericUpDownObjectRequirementQty_ValueChanged);
|
||||
//
|
||||
// listBoxObjectRequirements
|
||||
//
|
||||
this.listBoxObjectRequirements.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listBoxObjectRequirements.FormattingEnabled = true;
|
||||
this.listBoxObjectRequirements.ItemHeight = 14;
|
||||
this.listBoxObjectRequirements.Location = new System.Drawing.Point(527, 51);
|
||||
this.listBoxObjectRequirements.Name = "listBoxObjectRequirements";
|
||||
this.listBoxObjectRequirements.Size = new System.Drawing.Size(191, 144);
|
||||
this.listBoxObjectRequirements.TabIndex = 25;
|
||||
this.listBoxObjectRequirements.SelectedIndexChanged += new System.EventHandler(this.listBoxObjectRequirements_SelectedIndexChanged);
|
||||
//
|
||||
// listBoxObjectOptionalRequirements
|
||||
//
|
||||
this.listBoxObjectOptionalRequirements.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listBoxObjectOptionalRequirements.FormattingEnabled = true;
|
||||
this.listBoxObjectOptionalRequirements.ItemHeight = 14;
|
||||
this.listBoxObjectOptionalRequirements.Location = new System.Drawing.Point(724, 51);
|
||||
this.listBoxObjectOptionalRequirements.Name = "listBoxObjectOptionalRequirements";
|
||||
this.listBoxObjectOptionalRequirements.Size = new System.Drawing.Size(191, 144);
|
||||
this.listBoxObjectOptionalRequirements.TabIndex = 25;
|
||||
this.listBoxObjectOptionalRequirements.SelectedIndexChanged += new System.EventHandler(this.listBoxObjectOptionalRequirements_SelectedIndexChanged);
|
||||
//
|
||||
// numericUpDownObjectOptionalRequirementQty
|
||||
//
|
||||
this.numericUpDownObjectOptionalRequirementQty.Location = new System.Drawing.Point(857, 215);
|
||||
this.numericUpDownObjectOptionalRequirementQty.Name = "numericUpDownObjectOptionalRequirementQty";
|
||||
this.numericUpDownObjectOptionalRequirementQty.Size = new System.Drawing.Size(58, 20);
|
||||
this.numericUpDownObjectOptionalRequirementQty.TabIndex = 26;
|
||||
this.numericUpDownObjectOptionalRequirementQty.ValueChanged += new System.EventHandler(this.numericUpDownObjectOptionalRequirementQty_ValueChanged);
|
||||
//
|
||||
// comboBoxOptionalObjectRequirementType
|
||||
//
|
||||
this.comboBoxOptionalObjectRequirementType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxOptionalObjectRequirementType.FormattingEnabled = true;
|
||||
this.comboBoxOptionalObjectRequirementType.Location = new System.Drawing.Point(724, 214);
|
||||
this.comboBoxOptionalObjectRequirementType.Name = "comboBoxOptionalObjectRequirementType";
|
||||
this.comboBoxOptionalObjectRequirementType.Size = new System.Drawing.Size(127, 21);
|
||||
this.comboBoxOptionalObjectRequirementType.TabIndex = 27;
|
||||
this.comboBoxOptionalObjectRequirementType.SelectedIndexChanged += new System.EventHandler(this.comboBoxOptionalObjectRequirementType_SelectedIndexChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(721, 35);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(175, 13);
|
||||
this.label5.TabIndex = 28;
|
||||
this.label5.Text = "Optional Object Type Requirements";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(721, 198);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(31, 13);
|
||||
this.label6.TabIndex = 30;
|
||||
this.label6.Text = "Type";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(854, 198);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(23, 13);
|
||||
this.label7.TabIndex = 29;
|
||||
this.label7.Text = "Qty";
|
||||
//
|
||||
// buttonRemoveObjectEncounter
|
||||
//
|
||||
this.buttonRemoveObjectEncounter.Location = new System.Drawing.Point(424, 77);
|
||||
this.buttonRemoveObjectEncounter.Name = "buttonRemoveObjectEncounter";
|
||||
this.buttonRemoveObjectEncounter.Size = new System.Drawing.Size(97, 55);
|
||||
this.buttonRemoveObjectEncounter.TabIndex = 31;
|
||||
this.buttonRemoveObjectEncounter.Text = "Remove Last Object Encounter";
|
||||
this.buttonRemoveObjectEncounter.UseVisualStyleBackColor = true;
|
||||
this.buttonRemoveObjectEncounter.Click += new System.EventHandler(this.buttonRemoveObjectEncounter_Click);
|
||||
//
|
||||
// buttonAddObjectEncounter
|
||||
//
|
||||
this.buttonAddObjectEncounter.Location = new System.Drawing.Point(424, 32);
|
||||
this.buttonAddObjectEncounter.Name = "buttonAddObjectEncounter";
|
||||
this.buttonAddObjectEncounter.Size = new System.Drawing.Size(97, 39);
|
||||
this.buttonAddObjectEncounter.TabIndex = 31;
|
||||
this.buttonAddObjectEncounter.Text = "Add Object Encounter";
|
||||
this.buttonAddObjectEncounter.UseVisualStyleBackColor = true;
|
||||
this.buttonAddObjectEncounter.Click += new System.EventHandler(this.buttonAddObjectEncounter_Click);
|
||||
//
|
||||
// SafariZoneEncounterGroupEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.buttonAddObjectEncounter);
|
||||
this.Controls.Add(this.buttonRemoveObjectEncounter);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.tabControlEncounters);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.comboBoxOptionalObjectRequirementType);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.comboBoxObjectRequirementType);
|
||||
this.Controls.Add(this.numericUpDownObjectOptionalRequirementQty);
|
||||
this.Controls.Add(this.listBoxObjectOptionalRequirements);
|
||||
this.Controls.Add(this.numericUpDownObjectRequirementQty);
|
||||
this.Controls.Add(this.listBoxObjectRequirements);
|
||||
this.Name = "SafariZoneEncounterGroupEditor";
|
||||
this.Size = new System.Drawing.Size(927, 257);
|
||||
this.tabControlEncounters.ResumeLayout(false);
|
||||
this.tabPageMorning.ResumeLayout(false);
|
||||
this.tabPageDay.ResumeLayout(false);
|
||||
this.tabPageNight.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownObjectRequirementQty)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownObjectOptionalRequirementQty)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.TabControl tabControlEncounters;
|
||||
private System.Windows.Forms.TabPage tabPageMorning;
|
||||
private System.Windows.Forms.TabPage tabPageDay;
|
||||
private System.Windows.Forms.TabPage tabPageNight;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label2;
|
||||
public System.Windows.Forms.ComboBox comboBoxObjectRequirementType;
|
||||
public System.Windows.Forms.NumericUpDown numericUpDownObjectRequirementQty;
|
||||
public ListBox2 listBoxObjectRequirements;
|
||||
public ListBox2 listBoxObjectOptionalRequirements;
|
||||
public System.Windows.Forms.NumericUpDown numericUpDownObjectOptionalRequirementQty;
|
||||
public System.Windows.Forms.ComboBox comboBoxOptionalObjectRequirementType;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label7;
|
||||
public SafariZoneEncounterEditorTab safariZoneEncounterEditorMorningTab;
|
||||
public SafariZoneEncounterEditorTab safariZoneEncounterEditorDayTab;
|
||||
public SafariZoneEncounterEditorTab safariZoneEncounterEditorNightTab;
|
||||
private System.Windows.Forms.Button buttonRemoveObjectEncounter;
|
||||
private System.Windows.Forms.Button buttonAddObjectEncounter;
|
||||
}
|
||||
}
|
||||
143
DS_Map/Editors/SafariZoneEncounterGroupEditor.cs
Normal file
143
DS_Map/Editors/SafariZoneEncounterGroupEditor.cs
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using DSPRE.ROMFiles;
|
||||
|
||||
namespace DSPRE.Editors {
|
||||
public partial class SafariZoneEncounterGroupEditor : UserControl {
|
||||
private SafariZoneEncounterGroup safariZoneEncounterGroup;
|
||||
|
||||
public SafariZoneEncounterGroupEditor() {
|
||||
InitializeComponent();
|
||||
safariZoneEncounterEditorMorningTab.listBoxEncountersObject.SelectedIndexChanged += ListBoxEncountersObject_SelectedIndexChanged;
|
||||
safariZoneEncounterEditorDayTab.listBoxEncountersObject.SelectedIndexChanged += ListBoxEncountersObject_SelectedIndexChanged;
|
||||
safariZoneEncounterEditorNightTab.listBoxEncountersObject.SelectedIndexChanged += ListBoxEncountersObject_SelectedIndexChanged;
|
||||
listBoxObjectRequirements.SelectedIndexChanged += ListBoxEncountersObject_SelectedIndexChanged;
|
||||
listBoxObjectOptionalRequirements.SelectedIndexChanged += ListBoxEncountersObject_SelectedIndexChanged;
|
||||
}
|
||||
|
||||
private void ListBoxEncountersObject_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
try {
|
||||
ListBox2 s = sender as ListBox2;
|
||||
safariZoneEncounterEditorMorningTab.listBoxEncountersObject.SelectedIndex = s.SelectedIndex;
|
||||
safariZoneEncounterEditorDayTab.listBoxEncountersObject.SelectedIndex = s.SelectedIndex;
|
||||
safariZoneEncounterEditorNightTab.listBoxEncountersObject.SelectedIndex = s.SelectedIndex;
|
||||
listBoxObjectRequirements.SelectedIndex = s.SelectedIndex;
|
||||
listBoxObjectOptionalRequirements.SelectedIndex = s.SelectedIndex;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPokemonNames() {
|
||||
string[] pokemonNames = RomInfo.GetPokemonNames();
|
||||
safariZoneEncounterEditorMorningTab.comboBoxPokemon.Items.AddRange(pokemonNames);
|
||||
safariZoneEncounterEditorMorningTab.comboBoxPokemonObject.Items.AddRange(pokemonNames);
|
||||
safariZoneEncounterEditorDayTab.comboBoxPokemon.Items.AddRange(pokemonNames);
|
||||
safariZoneEncounterEditorDayTab.comboBoxPokemonObject.Items.AddRange(pokemonNames);
|
||||
safariZoneEncounterEditorNightTab.comboBoxPokemon.Items.AddRange(pokemonNames);
|
||||
safariZoneEncounterEditorNightTab.comboBoxPokemonObject.Items.AddRange(pokemonNames);
|
||||
|
||||
foreach (string type in SafariZoneObjectRequirement.ObjectTypes.Values) {
|
||||
comboBoxObjectRequirementType.Items.Add(type);
|
||||
comboBoxOptionalObjectRequirementType.Items.Add(type);
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
this.safariZoneEncounterGroup = null;
|
||||
safariZoneEncounterEditorMorningTab.listBoxEncounters.DataSource = null;
|
||||
safariZoneEncounterEditorDayTab.listBoxEncounters.DataSource = null;
|
||||
safariZoneEncounterEditorNightTab.listBoxEncounters.DataSource = null;
|
||||
|
||||
safariZoneEncounterEditorMorningTab.listBoxEncountersObject.DataSource = null;
|
||||
safariZoneEncounterEditorDayTab.listBoxEncountersObject.DataSource = null;
|
||||
safariZoneEncounterEditorNightTab.listBoxEncountersObject.DataSource = null;
|
||||
listBoxObjectRequirements.DataSource = null;
|
||||
listBoxObjectOptionalRequirements.DataSource = null;
|
||||
}
|
||||
|
||||
public void SetData(SafariZoneEncounterGroup safariZoneEncounterGroup) {
|
||||
this.safariZoneEncounterGroup = safariZoneEncounterGroup;
|
||||
safariZoneEncounterEditorMorningTab.listBoxEncounters.DataSource = this.safariZoneEncounterGroup.MorningEncounters;
|
||||
safariZoneEncounterEditorDayTab.listBoxEncounters.DataSource = this.safariZoneEncounterGroup.DayEncounters;
|
||||
safariZoneEncounterEditorNightTab.listBoxEncounters.DataSource = this.safariZoneEncounterGroup.NightEncounters;
|
||||
|
||||
safariZoneEncounterEditorMorningTab.listBoxEncountersObject.DataSource = this.safariZoneEncounterGroup.MorningEncountersObject;
|
||||
safariZoneEncounterEditorDayTab.listBoxEncountersObject.DataSource = this.safariZoneEncounterGroup.DayEncountersObject;
|
||||
safariZoneEncounterEditorNightTab.listBoxEncountersObject.DataSource = this.safariZoneEncounterGroup.NightEncountersObject;
|
||||
listBoxObjectRequirements.DataSource = this.safariZoneEncounterGroup.ObjectRequirements;
|
||||
listBoxObjectOptionalRequirements.DataSource = this.safariZoneEncounterGroup.OptionalObjectRequirements;
|
||||
}
|
||||
|
||||
private void listBoxObjectRequirements_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneObjectRequirement safariZoneObjectRequirement = (SafariZoneObjectRequirement)listBoxObjectRequirements.SelectedItem;
|
||||
if (safariZoneObjectRequirement == null) return;
|
||||
comboBoxObjectRequirementType.SelectedIndex = safariZoneObjectRequirement.typeID;
|
||||
numericUpDownObjectRequirementQty.Value = safariZoneObjectRequirement.quantity;
|
||||
}
|
||||
|
||||
private void comboBoxObjectRequirementType_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
// if (comboBoxObjectRequirementType.SelectedIndex == 0) comboBoxObjectRequirementType.SelectedIndex = 1; //no requirement is not valid
|
||||
SafariZoneObjectRequirement safariZoneObjectRequirement = (SafariZoneObjectRequirement)listBoxObjectRequirements.SelectedItem;
|
||||
if (safariZoneObjectRequirement == null) return;
|
||||
safariZoneObjectRequirement.typeID = (byte)comboBoxObjectRequirementType.SelectedIndex;
|
||||
listBoxObjectRequirements.RefreshItem(listBoxObjectRequirements.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownObjectRequirementQty_ValueChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneObjectRequirement safariZoneObjectRequirement = (SafariZoneObjectRequirement)listBoxObjectRequirements.SelectedItem;
|
||||
if (safariZoneObjectRequirement == null) return;
|
||||
safariZoneObjectRequirement.quantity = (byte)numericUpDownObjectRequirementQty.Value;
|
||||
listBoxObjectRequirements.RefreshItem(listBoxObjectRequirements.SelectedIndex);
|
||||
}
|
||||
|
||||
private void listBoxObjectOptionalRequirements_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneObjectRequirement safariZoneObjectRequirement = (SafariZoneObjectRequirement)listBoxObjectOptionalRequirements.SelectedItem;
|
||||
if (safariZoneObjectRequirement == null) return;
|
||||
comboBoxOptionalObjectRequirementType.SelectedIndex = safariZoneObjectRequirement.typeID;
|
||||
numericUpDownObjectOptionalRequirementQty.Value = safariZoneObjectRequirement.quantity;
|
||||
}
|
||||
|
||||
private void comboBoxOptionalObjectRequirementType_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneObjectRequirement safariZoneObjectRequirement = (SafariZoneObjectRequirement)listBoxObjectOptionalRequirements.SelectedItem;
|
||||
if (safariZoneObjectRequirement == null) return;
|
||||
safariZoneObjectRequirement.typeID = (byte)comboBoxOptionalObjectRequirementType.SelectedIndex;
|
||||
listBoxObjectOptionalRequirements.RefreshItem(listBoxObjectOptionalRequirements.SelectedIndex);
|
||||
}
|
||||
|
||||
private void numericUpDownObjectOptionalRequirementQty_ValueChanged(object sender, EventArgs e) {
|
||||
if (Helpers.HandlersDisabled) return;
|
||||
SafariZoneObjectRequirement safariZoneObjectRequirement = (SafariZoneObjectRequirement)listBoxObjectOptionalRequirements.SelectedItem;
|
||||
if (safariZoneObjectRequirement == null) return;
|
||||
safariZoneObjectRequirement.quantity = (byte)numericUpDownObjectOptionalRequirementQty.Value;
|
||||
listBoxObjectOptionalRequirements.RefreshItem(listBoxObjectOptionalRequirements.SelectedIndex);
|
||||
}
|
||||
|
||||
private void buttonAddObjectEncounter_Click(object sender, EventArgs e) {
|
||||
if (this.safariZoneEncounterGroup == null) return;
|
||||
if (listBoxObjectOptionalRequirements.SelectedIndex == -1) return;
|
||||
safariZoneEncounterGroup.MorningEncountersObject.Add(new SafariZoneEncounter());
|
||||
safariZoneEncounterGroup.DayEncountersObject.Add(new SafariZoneEncounter());
|
||||
safariZoneEncounterGroup.NightEncountersObject.Add(new SafariZoneEncounter());
|
||||
safariZoneEncounterGroup.ObjectRequirements.Add(new SafariZoneObjectRequirement(1, 1));
|
||||
safariZoneEncounterGroup.OptionalObjectRequirements.Add(new SafariZoneObjectRequirement(0, 0));
|
||||
safariZoneEncounterGroup.ObjectSlots = (byte)safariZoneEncounterGroup.ObjectRequirements.Count; //all the list counts should be the same
|
||||
}
|
||||
|
||||
private void buttonRemoveObjectEncounter_Click(object sender, EventArgs e) {
|
||||
if (this.safariZoneEncounterGroup == null) return;
|
||||
if (listBoxObjectOptionalRequirements.SelectedIndex == -1) return;
|
||||
safariZoneEncounterGroup.MorningEncountersObject.RemoveAt(safariZoneEncounterGroup.MorningEncountersObject.Count - 1);
|
||||
safariZoneEncounterGroup.DayEncountersObject.RemoveAt(safariZoneEncounterGroup.DayEncountersObject.Count - 1);
|
||||
safariZoneEncounterGroup.NightEncountersObject.RemoveAt(safariZoneEncounterGroup.NightEncountersObject.Count - 1);
|
||||
safariZoneEncounterGroup.ObjectRequirements.RemoveAt(safariZoneEncounterGroup.ObjectRequirements.Count - 1);
|
||||
safariZoneEncounterGroup.OptionalObjectRequirements.RemoveAt(safariZoneEncounterGroup.OptionalObjectRequirements.Count - 1);
|
||||
safariZoneEncounterGroup.ObjectSlots = (byte)safariZoneEncounterGroup.ObjectRequirements.Count; //all the list counts should be the same
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/Editors/SafariZoneEncounterGroupEditor.resx
Normal file
120
DS_Map/Editors/SafariZoneEncounterGroupEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
917
DS_Map/Editors/ScriptEditor.Designer.cs
generated
Normal file
917
DS_Map/Editors/ScriptEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,917 @@
|
|||
|
||||
namespace DSPRE.Editors
|
||||
{
|
||||
partial class ScriptEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.selectScriptFileComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.scriptEditorTabControl = new System.Windows.Forms.TabControl();
|
||||
this.scriptsTabPage = new System.Windows.Forms.TabPage();
|
||||
this.PanelSearchScripts = new System.Windows.Forms.Panel();
|
||||
this.BtnNextFindScript = new System.Windows.Forms.Button();
|
||||
this.BtnPrevFindScript = new System.Windows.Forms.Button();
|
||||
this.BtnCloseFindScript = new System.Windows.Forms.Button();
|
||||
this.panelFindScriptTextBox = new System.Windows.Forms.TextBox();
|
||||
this.scintillaScriptsPanel = new System.Windows.Forms.Panel();
|
||||
this.functionsTabPage = new System.Windows.Forms.TabPage();
|
||||
this.PanelSearchFunctions = new System.Windows.Forms.Panel();
|
||||
this.BtnNextFindFunc = new System.Windows.Forms.Button();
|
||||
this.BtnPrevFindFunc = new System.Windows.Forms.Button();
|
||||
this.BtnCloseFindFunc = new System.Windows.Forms.Button();
|
||||
this.panelFindFunctionTextBox = new System.Windows.Forms.TextBox();
|
||||
this.scintillaFunctionsPanel = new System.Windows.Forms.Panel();
|
||||
this.actionsTabPage = new System.Windows.Forms.TabPage();
|
||||
this.PanelSearchActions = new System.Windows.Forms.Panel();
|
||||
this.BtnNextFindActions = new System.Windows.Forms.Button();
|
||||
this.BtnPrevFindActions = new System.Windows.Forms.Button();
|
||||
this.BtnCloseFindActions = new System.Windows.Forms.Button();
|
||||
this.panelFindActionTextBox = new System.Windows.Forms.TextBox();
|
||||
this.scintillaActionsPanel = new System.Windows.Forms.Panel();
|
||||
this.addScriptFileButton = new System.Windows.Forms.Button();
|
||||
this.removeScriptFileButton = new System.Windows.Forms.Button();
|
||||
this.saveScriptFileButton = new System.Windows.Forms.Button();
|
||||
this.exportScriptFileButton = new System.Windows.Forms.Button();
|
||||
this.importScriptFileButton = new System.Windows.Forms.Button();
|
||||
this.groupBox8 = new System.Windows.Forms.GroupBox();
|
||||
this.searchInScriptsButton = new System.Windows.Forms.Button();
|
||||
this.searchOnlyCurrentScriptCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.scrollToBlockStartcheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.scriptSearchCaseSensitiveCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.searchInScriptsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label31 = new System.Windows.Forms.Label();
|
||||
this.searchProgressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.label30 = new System.Windows.Forms.Label();
|
||||
this.label29 = new System.Windows.Forms.Label();
|
||||
this.searchInScriptsResultListBox = new System.Windows.Forms.ListBox();
|
||||
this.groupBox24 = new System.Windows.Forms.GroupBox();
|
||||
this.ScriptNavigatorTabControl = new System.Windows.Forms.TabControl();
|
||||
this.ScriptsNavTab = new System.Windows.Forms.TabPage();
|
||||
this.scriptsNavListbox = new System.Windows.Forms.ListBox();
|
||||
this.FunctionsNavTab = new System.Windows.Forms.TabPage();
|
||||
this.functionsNavListbox = new System.Windows.Forms.ListBox();
|
||||
this.ActionsNavTab = new System.Windows.Forms.TabPage();
|
||||
this.actionsNavListbox = new System.Windows.Forms.ListBox();
|
||||
this.openFindScriptEditorButton = new System.Windows.Forms.Button();
|
||||
this.expandScriptTextButton = new System.Windows.Forms.Button();
|
||||
this.compressScriptTextButton = new System.Windows.Forms.Button();
|
||||
this.scriptEditorWordWrapCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.scriptEditorWhitespacesCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox26 = new System.Windows.Forms.GroupBox();
|
||||
this.scriptEditorNumberFormatNoPreference = new System.Windows.Forms.RadioButton();
|
||||
this.scriptEditorNumberFormatDecimal = new System.Windows.Forms.RadioButton();
|
||||
this.scriptEditorNumberFormatHex = new System.Windows.Forms.RadioButton();
|
||||
this.viewLevelScriptButton = new System.Windows.Forms.Button();
|
||||
this.locateCurrentScriptFile = new System.Windows.Forms.Button();
|
||||
this.scriptEditorTabControl.SuspendLayout();
|
||||
this.scriptsTabPage.SuspendLayout();
|
||||
this.PanelSearchScripts.SuspendLayout();
|
||||
this.functionsTabPage.SuspendLayout();
|
||||
this.PanelSearchFunctions.SuspendLayout();
|
||||
this.actionsTabPage.SuspendLayout();
|
||||
this.PanelSearchActions.SuspendLayout();
|
||||
this.groupBox8.SuspendLayout();
|
||||
this.groupBox24.SuspendLayout();
|
||||
this.ScriptNavigatorTabControl.SuspendLayout();
|
||||
this.ScriptsNavTab.SuspendLayout();
|
||||
this.FunctionsNavTab.SuspendLayout();
|
||||
this.ActionsNavTab.SuspendLayout();
|
||||
this.groupBox26.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// selectScriptFileComboBox
|
||||
//
|
||||
this.selectScriptFileComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.selectScriptFileComboBox.FormattingEnabled = true;
|
||||
this.selectScriptFileComboBox.Location = new System.Drawing.Point(7, 24);
|
||||
this.selectScriptFileComboBox.Name = "selectScriptFileComboBox";
|
||||
this.selectScriptFileComboBox.Size = new System.Drawing.Size(152, 21);
|
||||
this.selectScriptFileComboBox.TabIndex = 0;
|
||||
this.selectScriptFileComboBox.SelectedIndexChanged += new System.EventHandler(this.selectScriptFileComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(5, 8);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(53, 13);
|
||||
this.label5.TabIndex = 1;
|
||||
this.label5.Text = "Script File";
|
||||
//
|
||||
// scriptEditorTabControl
|
||||
//
|
||||
this.scriptEditorTabControl.Controls.Add(this.scriptsTabPage);
|
||||
this.scriptEditorTabControl.Controls.Add(this.functionsTabPage);
|
||||
this.scriptEditorTabControl.Controls.Add(this.actionsTabPage);
|
||||
this.scriptEditorTabControl.Location = new System.Drawing.Point(481, 22);
|
||||
this.scriptEditorTabControl.Name = "scriptEditorTabControl";
|
||||
this.scriptEditorTabControl.SelectedIndex = 0;
|
||||
this.scriptEditorTabControl.Size = new System.Drawing.Size(692, 591);
|
||||
this.scriptEditorTabControl.TabIndex = 18;
|
||||
this.scriptEditorTabControl.SelectedIndexChanged += new System.EventHandler(this.scriptEditorTabControl_TabIndexChanged);
|
||||
//
|
||||
// scriptsTabPage
|
||||
//
|
||||
this.scriptsTabPage.Controls.Add(this.PanelSearchScripts);
|
||||
this.scriptsTabPage.Controls.Add(this.scintillaScriptsPanel);
|
||||
this.scriptsTabPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.scriptsTabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.scriptsTabPage.Name = "scriptsTabPage";
|
||||
this.scriptsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.scriptsTabPage.Size = new System.Drawing.Size(684, 565);
|
||||
this.scriptsTabPage.TabIndex = 0;
|
||||
this.scriptsTabPage.Text = "Scripts";
|
||||
this.scriptsTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PanelSearchScripts
|
||||
//
|
||||
this.PanelSearchScripts.BackColor = System.Drawing.Color.White;
|
||||
this.PanelSearchScripts.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.PanelSearchScripts.Controls.Add(this.BtnNextFindScript);
|
||||
this.PanelSearchScripts.Controls.Add(this.BtnPrevFindScript);
|
||||
this.PanelSearchScripts.Controls.Add(this.BtnCloseFindScript);
|
||||
this.PanelSearchScripts.Controls.Add(this.panelFindScriptTextBox);
|
||||
this.PanelSearchScripts.Location = new System.Drawing.Point(386, 3);
|
||||
this.PanelSearchScripts.Name = "PanelSearchScripts";
|
||||
this.PanelSearchScripts.Size = new System.Drawing.Size(292, 40);
|
||||
this.PanelSearchScripts.TabIndex = 14;
|
||||
this.PanelSearchScripts.Visible = false;
|
||||
//
|
||||
// BtnNextFindScript
|
||||
//
|
||||
this.BtnNextFindScript.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnNextFindScript.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnNextFindScript.Image = global::DSPRE.Properties.Resources.arrowdown;
|
||||
this.BtnNextFindScript.Location = new System.Drawing.Point(233, 4);
|
||||
this.BtnNextFindScript.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnNextFindScript.Name = "BtnNextFindScript";
|
||||
this.BtnNextFindScript.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnNextFindScript.TabIndex = 32;
|
||||
this.BtnNextFindScript.Tag = "Find next (Enter)";
|
||||
this.BtnNextFindScript.UseVisualStyleBackColor = true;
|
||||
this.BtnNextFindScript.Click += new System.EventHandler(this.BtnNextFindScript_Click);
|
||||
//
|
||||
// BtnPrevFindScript
|
||||
//
|
||||
this.BtnPrevFindScript.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnPrevFindScript.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnPrevFindScript.Image = global::DSPRE.Properties.Resources.arrowup;
|
||||
this.BtnPrevFindScript.Location = new System.Drawing.Point(205, 4);
|
||||
this.BtnPrevFindScript.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnPrevFindScript.Name = "BtnPrevFindScript";
|
||||
this.BtnPrevFindScript.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnPrevFindScript.TabIndex = 31;
|
||||
this.BtnPrevFindScript.Tag = "Find previous (Shift+Enter)";
|
||||
this.BtnPrevFindScript.UseVisualStyleBackColor = true;
|
||||
this.BtnPrevFindScript.Click += new System.EventHandler(this.BtnPrevFindScript_Click);
|
||||
//
|
||||
// BtnCloseFindScript
|
||||
//
|
||||
this.BtnCloseFindScript.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnCloseFindScript.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnCloseFindScript.Image = global::DSPRE.Properties.Resources.Cross;
|
||||
this.BtnCloseFindScript.Location = new System.Drawing.Point(261, 4);
|
||||
this.BtnCloseFindScript.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnCloseFindScript.Name = "BtnCloseFindScript";
|
||||
this.BtnCloseFindScript.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnCloseFindScript.TabIndex = 33;
|
||||
this.BtnCloseFindScript.Tag = "Close (Esc)";
|
||||
this.BtnCloseFindScript.UseVisualStyleBackColor = true;
|
||||
this.BtnCloseFindScript.Click += new System.EventHandler(this.BtnCloseFindScript_Click);
|
||||
//
|
||||
// panelFindScriptTextBox
|
||||
//
|
||||
this.panelFindScriptTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.panelFindScriptTextBox.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.panelFindScriptTextBox.Location = new System.Drawing.Point(10, 6);
|
||||
this.panelFindScriptTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panelFindScriptTextBox.Name = "panelFindScriptTextBox";
|
||||
this.panelFindScriptTextBox.Size = new System.Drawing.Size(189, 25);
|
||||
this.panelFindScriptTextBox.TabIndex = 30;
|
||||
this.panelFindScriptTextBox.TextChanged += new System.EventHandler(this.panelFindScriptTextBox_TextChanged);
|
||||
this.panelFindScriptTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.scriptTxtFind_KeyDown);
|
||||
//
|
||||
// scintillaScriptsPanel
|
||||
//
|
||||
this.scintillaScriptsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.scintillaScriptsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.scintillaScriptsPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.scintillaScriptsPanel.Name = "scintillaScriptsPanel";
|
||||
this.scintillaScriptsPanel.Size = new System.Drawing.Size(678, 559);
|
||||
this.scintillaScriptsPanel.TabIndex = 19;
|
||||
//
|
||||
// functionsTabPage
|
||||
//
|
||||
this.functionsTabPage.Controls.Add(this.PanelSearchFunctions);
|
||||
this.functionsTabPage.Controls.Add(this.scintillaFunctionsPanel);
|
||||
this.functionsTabPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.functionsTabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.functionsTabPage.Name = "functionsTabPage";
|
||||
this.functionsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.functionsTabPage.Size = new System.Drawing.Size(684, 565);
|
||||
this.functionsTabPage.TabIndex = 1;
|
||||
this.functionsTabPage.Text = "Functions";
|
||||
this.functionsTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PanelSearchFunctions
|
||||
//
|
||||
this.PanelSearchFunctions.BackColor = System.Drawing.Color.White;
|
||||
this.PanelSearchFunctions.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.PanelSearchFunctions.Controls.Add(this.BtnNextFindFunc);
|
||||
this.PanelSearchFunctions.Controls.Add(this.BtnPrevFindFunc);
|
||||
this.PanelSearchFunctions.Controls.Add(this.BtnCloseFindFunc);
|
||||
this.PanelSearchFunctions.Controls.Add(this.panelFindFunctionTextBox);
|
||||
this.PanelSearchFunctions.Location = new System.Drawing.Point(386, 3);
|
||||
this.PanelSearchFunctions.Name = "PanelSearchFunctions";
|
||||
this.PanelSearchFunctions.Size = new System.Drawing.Size(292, 40);
|
||||
this.PanelSearchFunctions.TabIndex = 16;
|
||||
this.PanelSearchFunctions.Visible = false;
|
||||
//
|
||||
// BtnNextFindFunc
|
||||
//
|
||||
this.BtnNextFindFunc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnNextFindFunc.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnNextFindFunc.Image = global::DSPRE.Properties.Resources.arrowdown;
|
||||
this.BtnNextFindFunc.Location = new System.Drawing.Point(233, 4);
|
||||
this.BtnNextFindFunc.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnNextFindFunc.Name = "BtnNextFindFunc";
|
||||
this.BtnNextFindFunc.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnNextFindFunc.TabIndex = 36;
|
||||
this.BtnNextFindFunc.Tag = "Find next (Enter)";
|
||||
this.BtnNextFindFunc.UseVisualStyleBackColor = true;
|
||||
this.BtnNextFindFunc.Click += new System.EventHandler(this.BtnNextFindFunc_Click);
|
||||
//
|
||||
// BtnPrevFindFunc
|
||||
//
|
||||
this.BtnPrevFindFunc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnPrevFindFunc.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnPrevFindFunc.Image = global::DSPRE.Properties.Resources.arrowup;
|
||||
this.BtnPrevFindFunc.Location = new System.Drawing.Point(205, 4);
|
||||
this.BtnPrevFindFunc.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnPrevFindFunc.Name = "BtnPrevFindFunc";
|
||||
this.BtnPrevFindFunc.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnPrevFindFunc.TabIndex = 35;
|
||||
this.BtnPrevFindFunc.Tag = "Find previous (Shift+Enter)";
|
||||
this.BtnPrevFindFunc.UseVisualStyleBackColor = true;
|
||||
this.BtnPrevFindFunc.Click += new System.EventHandler(this.BtnPrevFindFunc_Click);
|
||||
//
|
||||
// BtnCloseFindFunc
|
||||
//
|
||||
this.BtnCloseFindFunc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnCloseFindFunc.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnCloseFindFunc.Image = global::DSPRE.Properties.Resources.Cross;
|
||||
this.BtnCloseFindFunc.Location = new System.Drawing.Point(261, 4);
|
||||
this.BtnCloseFindFunc.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnCloseFindFunc.Name = "BtnCloseFindFunc";
|
||||
this.BtnCloseFindFunc.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnCloseFindFunc.TabIndex = 37;
|
||||
this.BtnCloseFindFunc.Tag = "Close (Esc)";
|
||||
this.BtnCloseFindFunc.UseVisualStyleBackColor = true;
|
||||
this.BtnCloseFindFunc.Click += new System.EventHandler(this.BtnCloseFindFunc_Click);
|
||||
//
|
||||
// panelFindFunctionTextBox
|
||||
//
|
||||
this.panelFindFunctionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.panelFindFunctionTextBox.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.panelFindFunctionTextBox.Location = new System.Drawing.Point(10, 6);
|
||||
this.panelFindFunctionTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panelFindFunctionTextBox.Name = "panelFindFunctionTextBox";
|
||||
this.panelFindFunctionTextBox.Size = new System.Drawing.Size(189, 25);
|
||||
this.panelFindFunctionTextBox.TabIndex = 34;
|
||||
this.panelFindFunctionTextBox.TextChanged += new System.EventHandler(this.panelFindFunctionTextBox_TextChanged);
|
||||
this.panelFindFunctionTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.functionTxtFind_KeyDown);
|
||||
//
|
||||
// scintillaFunctionsPanel
|
||||
//
|
||||
this.scintillaFunctionsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.scintillaFunctionsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.scintillaFunctionsPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.scintillaFunctionsPanel.Name = "scintillaFunctionsPanel";
|
||||
this.scintillaFunctionsPanel.Size = new System.Drawing.Size(678, 559);
|
||||
this.scintillaFunctionsPanel.TabIndex = 20;
|
||||
//
|
||||
// actionsTabPage
|
||||
//
|
||||
this.actionsTabPage.Controls.Add(this.PanelSearchActions);
|
||||
this.actionsTabPage.Controls.Add(this.scintillaActionsPanel);
|
||||
this.actionsTabPage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.actionsTabPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.actionsTabPage.Name = "actionsTabPage";
|
||||
this.actionsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.actionsTabPage.Size = new System.Drawing.Size(684, 565);
|
||||
this.actionsTabPage.TabIndex = 2;
|
||||
this.actionsTabPage.Text = "Actions";
|
||||
this.actionsTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PanelSearchActions
|
||||
//
|
||||
this.PanelSearchActions.BackColor = System.Drawing.Color.White;
|
||||
this.PanelSearchActions.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.PanelSearchActions.Controls.Add(this.BtnNextFindActions);
|
||||
this.PanelSearchActions.Controls.Add(this.BtnPrevFindActions);
|
||||
this.PanelSearchActions.Controls.Add(this.BtnCloseFindActions);
|
||||
this.PanelSearchActions.Controls.Add(this.panelFindActionTextBox);
|
||||
this.PanelSearchActions.Location = new System.Drawing.Point(386, 3);
|
||||
this.PanelSearchActions.Name = "PanelSearchActions";
|
||||
this.PanelSearchActions.Size = new System.Drawing.Size(292, 40);
|
||||
this.PanelSearchActions.TabIndex = 16;
|
||||
this.PanelSearchActions.Visible = false;
|
||||
//
|
||||
// BtnNextFindActions
|
||||
//
|
||||
this.BtnNextFindActions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnNextFindActions.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnNextFindActions.Image = global::DSPRE.Properties.Resources.arrowdown;
|
||||
this.BtnNextFindActions.Location = new System.Drawing.Point(233, 4);
|
||||
this.BtnNextFindActions.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnNextFindActions.Name = "BtnNextFindActions";
|
||||
this.BtnNextFindActions.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnNextFindActions.TabIndex = 40;
|
||||
this.BtnNextFindActions.Tag = "Find next (Enter)";
|
||||
this.BtnNextFindActions.UseVisualStyleBackColor = true;
|
||||
this.BtnNextFindActions.Click += new System.EventHandler(this.BtnNextFindActions_Click);
|
||||
//
|
||||
// BtnPrevFindActions
|
||||
//
|
||||
this.BtnPrevFindActions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnPrevFindActions.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnPrevFindActions.Image = global::DSPRE.Properties.Resources.arrowup;
|
||||
this.BtnPrevFindActions.Location = new System.Drawing.Point(205, 4);
|
||||
this.BtnPrevFindActions.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnPrevFindActions.Name = "BtnPrevFindActions";
|
||||
this.BtnPrevFindActions.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnPrevFindActions.TabIndex = 39;
|
||||
this.BtnPrevFindActions.Tag = "Find previous (Shift+Enter)";
|
||||
this.BtnPrevFindActions.UseVisualStyleBackColor = true;
|
||||
this.BtnPrevFindActions.Click += new System.EventHandler(this.BtnPrevFindActions_Click);
|
||||
//
|
||||
// BtnCloseFindActions
|
||||
//
|
||||
this.BtnCloseFindActions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.BtnCloseFindActions.ForeColor = System.Drawing.Color.White;
|
||||
this.BtnCloseFindActions.Image = global::DSPRE.Properties.Resources.Cross;
|
||||
this.BtnCloseFindActions.Location = new System.Drawing.Point(261, 4);
|
||||
this.BtnCloseFindActions.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.BtnCloseFindActions.Name = "BtnCloseFindActions";
|
||||
this.BtnCloseFindActions.Size = new System.Drawing.Size(25, 30);
|
||||
this.BtnCloseFindActions.TabIndex = 41;
|
||||
this.BtnCloseFindActions.Tag = "Close (Esc)";
|
||||
this.BtnCloseFindActions.UseVisualStyleBackColor = true;
|
||||
this.BtnCloseFindActions.Click += new System.EventHandler(this.BtnCloseFindActions_Click);
|
||||
//
|
||||
// panelFindActionTextBox
|
||||
//
|
||||
this.panelFindActionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.panelFindActionTextBox.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.panelFindActionTextBox.Location = new System.Drawing.Point(10, 6);
|
||||
this.panelFindActionTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panelFindActionTextBox.Name = "panelFindActionTextBox";
|
||||
this.panelFindActionTextBox.Size = new System.Drawing.Size(189, 25);
|
||||
this.panelFindActionTextBox.TabIndex = 38;
|
||||
this.panelFindActionTextBox.TextChanged += new System.EventHandler(this.panelFindActionTextBox_TextChanged);
|
||||
this.panelFindActionTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.actionTxtFind_KeyDown);
|
||||
//
|
||||
// scintillaActionsPanel
|
||||
//
|
||||
this.scintillaActionsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.scintillaActionsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.scintillaActionsPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.scintillaActionsPanel.Name = "scintillaActionsPanel";
|
||||
this.scintillaActionsPanel.Size = new System.Drawing.Size(678, 559);
|
||||
this.scintillaActionsPanel.TabIndex = 21;
|
||||
//
|
||||
// addScriptFileButton
|
||||
//
|
||||
this.addScriptFileButton.Image = global::DSPRE.Properties.Resources.addIcon;
|
||||
this.addScriptFileButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.addScriptFileButton.Location = new System.Drawing.Point(369, 667);
|
||||
this.addScriptFileButton.Name = "addScriptFileButton";
|
||||
this.addScriptFileButton.Size = new System.Drawing.Size(106, 25);
|
||||
this.addScriptFileButton.TabIndex = 4;
|
||||
this.addScriptFileButton.Text = "Add Script File";
|
||||
this.addScriptFileButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.addScriptFileButton.UseVisualStyleBackColor = true;
|
||||
this.addScriptFileButton.Click += new System.EventHandler(this.addScriptFileButton_Click);
|
||||
//
|
||||
// removeScriptFileButton
|
||||
//
|
||||
this.removeScriptFileButton.Image = global::DSPRE.Properties.Resources.deleteIcon;
|
||||
this.removeScriptFileButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.removeScriptFileButton.Location = new System.Drawing.Point(369, 694);
|
||||
this.removeScriptFileButton.Name = "removeScriptFileButton";
|
||||
this.removeScriptFileButton.Size = new System.Drawing.Size(106, 25);
|
||||
this.removeScriptFileButton.TabIndex = 5;
|
||||
this.removeScriptFileButton.Text = "Remove Last";
|
||||
this.removeScriptFileButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.removeScriptFileButton.UseVisualStyleBackColor = true;
|
||||
this.removeScriptFileButton.Click += new System.EventHandler(this.removeScriptFileButton_Click);
|
||||
//
|
||||
// saveScriptFileButton
|
||||
//
|
||||
this.saveScriptFileButton.Image = global::DSPRE.Properties.Resources.saveButton;
|
||||
this.saveScriptFileButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.saveScriptFileButton.Location = new System.Drawing.Point(6, 50);
|
||||
this.saveScriptFileButton.Name = "saveScriptFileButton";
|
||||
this.saveScriptFileButton.Size = new System.Drawing.Size(154, 23);
|
||||
this.saveScriptFileButton.TabIndex = 1;
|
||||
this.saveScriptFileButton.Text = "&Save Current File";
|
||||
this.saveScriptFileButton.UseVisualStyleBackColor = true;
|
||||
this.saveScriptFileButton.Click += new System.EventHandler(this.saveScriptFileButton_Click);
|
||||
//
|
||||
// exportScriptFileButton
|
||||
//
|
||||
this.exportScriptFileButton.Image = global::DSPRE.Properties.Resources.exportArrow;
|
||||
this.exportScriptFileButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.exportScriptFileButton.Location = new System.Drawing.Point(294, 667);
|
||||
this.exportScriptFileButton.Name = "exportScriptFileButton";
|
||||
this.exportScriptFileButton.Size = new System.Drawing.Size(70, 52);
|
||||
this.exportScriptFileButton.TabIndex = 3;
|
||||
this.exportScriptFileButton.Text = "&Export \r\nFile";
|
||||
this.exportScriptFileButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.exportScriptFileButton.UseVisualStyleBackColor = true;
|
||||
this.exportScriptFileButton.Click += new System.EventHandler(this.exportScriptFileButton_Click);
|
||||
//
|
||||
// importScriptFileButton
|
||||
//
|
||||
this.importScriptFileButton.Image = global::DSPRE.Properties.Resources.importArrow;
|
||||
this.importScriptFileButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.importScriptFileButton.Location = new System.Drawing.Point(219, 667);
|
||||
this.importScriptFileButton.Name = "importScriptFileButton";
|
||||
this.importScriptFileButton.Size = new System.Drawing.Size(70, 52);
|
||||
this.importScriptFileButton.TabIndex = 2;
|
||||
this.importScriptFileButton.Text = "&Import\r\nFile";
|
||||
this.importScriptFileButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.importScriptFileButton.UseVisualStyleBackColor = true;
|
||||
this.importScriptFileButton.Click += new System.EventHandler(this.importScriptFileButton_Click);
|
||||
//
|
||||
// groupBox8
|
||||
//
|
||||
this.groupBox8.Controls.Add(this.searchInScriptsButton);
|
||||
this.groupBox8.Controls.Add(this.searchOnlyCurrentScriptCheckBox);
|
||||
this.groupBox8.Controls.Add(this.scrollToBlockStartcheckBox);
|
||||
this.groupBox8.Controls.Add(this.scriptSearchCaseSensitiveCheckBox);
|
||||
this.groupBox8.Controls.Add(this.searchInScriptsTextBox);
|
||||
this.groupBox8.Controls.Add(this.label31);
|
||||
this.groupBox8.Controls.Add(this.searchProgressBar);
|
||||
this.groupBox8.Controls.Add(this.label30);
|
||||
this.groupBox8.Controls.Add(this.label29);
|
||||
this.groupBox8.Controls.Add(this.searchInScriptsResultListBox);
|
||||
this.groupBox8.Location = new System.Drawing.Point(2, 315);
|
||||
this.groupBox8.Name = "groupBox8";
|
||||
this.groupBox8.Size = new System.Drawing.Size(472, 298);
|
||||
this.groupBox8.TabIndex = 18;
|
||||
this.groupBox8.TabStop = false;
|
||||
this.groupBox8.Text = "Search for commands:";
|
||||
//
|
||||
// searchInScriptsButton
|
||||
//
|
||||
this.searchInScriptsButton.Image = global::DSPRE.Properties.Resources.SearchMiniIcon;
|
||||
this.searchInScriptsButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.searchInScriptsButton.Location = new System.Drawing.Point(272, 27);
|
||||
this.searchInScriptsButton.Name = "searchInScriptsButton";
|
||||
this.searchInScriptsButton.Size = new System.Drawing.Size(69, 36);
|
||||
this.searchInScriptsButton.TabIndex = 13;
|
||||
this.searchInScriptsButton.Text = "Search";
|
||||
this.searchInScriptsButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.searchInScriptsButton.UseVisualStyleBackColor = true;
|
||||
this.searchInScriptsButton.Click += new System.EventHandler(this.searchInScriptsButton_Click);
|
||||
//
|
||||
// searchOnlyCurrentScriptCheckBox
|
||||
//
|
||||
this.searchOnlyCurrentScriptCheckBox.AutoSize = true;
|
||||
this.searchOnlyCurrentScriptCheckBox.Location = new System.Drawing.Point(347, 15);
|
||||
this.searchOnlyCurrentScriptCheckBox.Name = "searchOnlyCurrentScriptCheckBox";
|
||||
this.searchOnlyCurrentScriptCheckBox.Size = new System.Drawing.Size(84, 17);
|
||||
this.searchOnlyCurrentScriptCheckBox.TabIndex = 14;
|
||||
this.searchOnlyCurrentScriptCheckBox.Text = "Only Current";
|
||||
this.searchOnlyCurrentScriptCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.searchOnlyCurrentScriptCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// scrollToBlockStartcheckBox
|
||||
//
|
||||
this.scrollToBlockStartcheckBox.AutoSize = true;
|
||||
this.scrollToBlockStartcheckBox.Location = new System.Drawing.Point(347, 61);
|
||||
this.scrollToBlockStartcheckBox.Name = "scrollToBlockStartcheckBox";
|
||||
this.scrollToBlockStartcheckBox.Size = new System.Drawing.Size(116, 17);
|
||||
this.scrollToBlockStartcheckBox.TabIndex = 16;
|
||||
this.scrollToBlockStartcheckBox.Text = "Scroll to block start";
|
||||
this.scrollToBlockStartcheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// scriptSearchCaseSensitiveCheckBox
|
||||
//
|
||||
this.scriptSearchCaseSensitiveCheckBox.AutoSize = true;
|
||||
this.scriptSearchCaseSensitiveCheckBox.Location = new System.Drawing.Point(347, 38);
|
||||
this.scriptSearchCaseSensitiveCheckBox.Name = "scriptSearchCaseSensitiveCheckBox";
|
||||
this.scriptSearchCaseSensitiveCheckBox.Size = new System.Drawing.Size(83, 17);
|
||||
this.scriptSearchCaseSensitiveCheckBox.TabIndex = 15;
|
||||
this.scriptSearchCaseSensitiveCheckBox.Text = "Match Case";
|
||||
this.scriptSearchCaseSensitiveCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// searchInScriptsTextBox
|
||||
//
|
||||
this.searchInScriptsTextBox.Location = new System.Drawing.Point(11, 36);
|
||||
this.searchInScriptsTextBox.Name = "searchInScriptsTextBox";
|
||||
this.searchInScriptsTextBox.Size = new System.Drawing.Size(255, 20);
|
||||
this.searchInScriptsTextBox.TabIndex = 12;
|
||||
this.searchInScriptsTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchInScriptsTextBox_KeyDown);
|
||||
//
|
||||
// label31
|
||||
//
|
||||
this.label31.AutoSize = true;
|
||||
this.label31.Location = new System.Drawing.Point(11, 261);
|
||||
this.label31.Name = "label31";
|
||||
this.label31.Size = new System.Drawing.Size(48, 13);
|
||||
this.label31.TabIndex = 37;
|
||||
this.label31.Text = "Progress";
|
||||
//
|
||||
// searchProgressBar
|
||||
//
|
||||
this.searchProgressBar.Location = new System.Drawing.Point(11, 277);
|
||||
this.searchProgressBar.Name = "searchProgressBar";
|
||||
this.searchProgressBar.Size = new System.Drawing.Size(452, 14);
|
||||
this.searchProgressBar.TabIndex = 36;
|
||||
//
|
||||
// label30
|
||||
//
|
||||
this.label30.AutoSize = true;
|
||||
this.label30.Location = new System.Drawing.Point(11, 68);
|
||||
this.label30.Name = "label30";
|
||||
this.label30.Size = new System.Drawing.Size(42, 13);
|
||||
this.label30.TabIndex = 35;
|
||||
this.label30.Text = "Results";
|
||||
//
|
||||
// label29
|
||||
//
|
||||
this.label29.AutoSize = true;
|
||||
this.label29.Location = new System.Drawing.Point(11, 20);
|
||||
this.label29.Name = "label29";
|
||||
this.label29.Size = new System.Drawing.Size(77, 13);
|
||||
this.label29.TabIndex = 33;
|
||||
this.label29.Text = "Line to search:";
|
||||
//
|
||||
// searchInScriptsResultListBox
|
||||
//
|
||||
this.searchInScriptsResultListBox.Location = new System.Drawing.Point(11, 84);
|
||||
this.searchInScriptsResultListBox.Name = "searchInScriptsResultListBox";
|
||||
this.searchInScriptsResultListBox.Size = new System.Drawing.Size(452, 173);
|
||||
this.searchInScriptsResultListBox.TabIndex = 17;
|
||||
this.searchInScriptsResultListBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchInScriptsResultListBox_KeyDown);
|
||||
this.searchInScriptsResultListBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.searchInScripts_GoToEntryResult);
|
||||
//
|
||||
// groupBox24
|
||||
//
|
||||
this.groupBox24.Controls.Add(this.ScriptNavigatorTabControl);
|
||||
this.groupBox24.Location = new System.Drawing.Point(3, 75);
|
||||
this.groupBox24.Name = "groupBox24";
|
||||
this.groupBox24.Size = new System.Drawing.Size(472, 234);
|
||||
this.groupBox24.TabIndex = 42;
|
||||
this.groupBox24.TabStop = false;
|
||||
this.groupBox24.Text = "Navigator";
|
||||
//
|
||||
// ScriptNavigatorTabControl
|
||||
//
|
||||
this.ScriptNavigatorTabControl.Controls.Add(this.ScriptsNavTab);
|
||||
this.ScriptNavigatorTabControl.Controls.Add(this.FunctionsNavTab);
|
||||
this.ScriptNavigatorTabControl.Controls.Add(this.ActionsNavTab);
|
||||
this.ScriptNavigatorTabControl.Location = new System.Drawing.Point(6, 16);
|
||||
this.ScriptNavigatorTabControl.Name = "ScriptNavigatorTabControl";
|
||||
this.ScriptNavigatorTabControl.SelectedIndex = 0;
|
||||
this.ScriptNavigatorTabControl.Size = new System.Drawing.Size(456, 209);
|
||||
this.ScriptNavigatorTabControl.TabIndex = 8;
|
||||
//
|
||||
// ScriptsNavTab
|
||||
//
|
||||
this.ScriptsNavTab.Controls.Add(this.scriptsNavListbox);
|
||||
this.ScriptsNavTab.Location = new System.Drawing.Point(4, 22);
|
||||
this.ScriptsNavTab.Name = "ScriptsNavTab";
|
||||
this.ScriptsNavTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.ScriptsNavTab.Size = new System.Drawing.Size(448, 183);
|
||||
this.ScriptsNavTab.TabIndex = 0;
|
||||
this.ScriptsNavTab.Text = "Scripts";
|
||||
this.ScriptsNavTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// scriptsNavListbox
|
||||
//
|
||||
this.scriptsNavListbox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.scriptsNavListbox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.scriptsNavListbox.ItemHeight = 15;
|
||||
this.scriptsNavListbox.Location = new System.Drawing.Point(3, 3);
|
||||
this.scriptsNavListbox.Name = "scriptsNavListbox";
|
||||
this.scriptsNavListbox.Size = new System.Drawing.Size(442, 177);
|
||||
this.scriptsNavListbox.TabIndex = 9;
|
||||
this.scriptsNavListbox.SelectedIndexChanged += new System.EventHandler(this.scriptsNavListbox_SelectedIndexChanged);
|
||||
//
|
||||
// FunctionsNavTab
|
||||
//
|
||||
this.FunctionsNavTab.Controls.Add(this.functionsNavListbox);
|
||||
this.FunctionsNavTab.Location = new System.Drawing.Point(4, 22);
|
||||
this.FunctionsNavTab.Name = "FunctionsNavTab";
|
||||
this.FunctionsNavTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.FunctionsNavTab.Size = new System.Drawing.Size(448, 183);
|
||||
this.FunctionsNavTab.TabIndex = 1;
|
||||
this.FunctionsNavTab.Text = "Functions";
|
||||
this.FunctionsNavTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// functionsNavListbox
|
||||
//
|
||||
this.functionsNavListbox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.functionsNavListbox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.functionsNavListbox.ItemHeight = 15;
|
||||
this.functionsNavListbox.Location = new System.Drawing.Point(3, 3);
|
||||
this.functionsNavListbox.Name = "functionsNavListbox";
|
||||
this.functionsNavListbox.Size = new System.Drawing.Size(442, 177);
|
||||
this.functionsNavListbox.TabIndex = 10;
|
||||
this.functionsNavListbox.SelectedIndexChanged += new System.EventHandler(this.functionsNavListbox_SelectedIndexChanged);
|
||||
//
|
||||
// ActionsNavTab
|
||||
//
|
||||
this.ActionsNavTab.Controls.Add(this.actionsNavListbox);
|
||||
this.ActionsNavTab.Location = new System.Drawing.Point(4, 22);
|
||||
this.ActionsNavTab.Name = "ActionsNavTab";
|
||||
this.ActionsNavTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.ActionsNavTab.Size = new System.Drawing.Size(448, 183);
|
||||
this.ActionsNavTab.TabIndex = 2;
|
||||
this.ActionsNavTab.Text = "Actions";
|
||||
this.ActionsNavTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// actionsNavListbox
|
||||
//
|
||||
this.actionsNavListbox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.actionsNavListbox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.actionsNavListbox.ItemHeight = 15;
|
||||
this.actionsNavListbox.Location = new System.Drawing.Point(3, 3);
|
||||
this.actionsNavListbox.Name = "actionsNavListbox";
|
||||
this.actionsNavListbox.Size = new System.Drawing.Size(442, 177);
|
||||
this.actionsNavListbox.TabIndex = 11;
|
||||
this.actionsNavListbox.SelectedIndexChanged += new System.EventHandler(this.actionsNavListbox_SelectedIndexChanged);
|
||||
//
|
||||
// openFindScriptEditorButton
|
||||
//
|
||||
this.openFindScriptEditorButton.Image = global::DSPRE.Properties.Resources.SearchMiniIcon;
|
||||
this.openFindScriptEditorButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.openFindScriptEditorButton.Location = new System.Drawing.Point(1079, 11);
|
||||
this.openFindScriptEditorButton.Name = "openFindScriptEditorButton";
|
||||
this.openFindScriptEditorButton.Size = new System.Drawing.Size(24, 24);
|
||||
this.openFindScriptEditorButton.TabIndex = 27;
|
||||
this.openFindScriptEditorButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.openFindScriptEditorButton.UseVisualStyleBackColor = true;
|
||||
this.openFindScriptEditorButton.Click += new System.EventHandler(this.openFindScriptEditorButton_Click);
|
||||
//
|
||||
// expandScriptTextButton
|
||||
//
|
||||
this.expandScriptTextButton.Image = global::DSPRE.Properties.Resources.expandArrow;
|
||||
this.expandScriptTextButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.expandScriptTextButton.Location = new System.Drawing.Point(1107, 11);
|
||||
this.expandScriptTextButton.Name = "expandScriptTextButton";
|
||||
this.expandScriptTextButton.Size = new System.Drawing.Size(24, 24);
|
||||
this.expandScriptTextButton.TabIndex = 28;
|
||||
this.expandScriptTextButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.expandScriptTextButton.UseVisualStyleBackColor = true;
|
||||
this.expandScriptTextButton.Click += new System.EventHandler(this.ScriptEditorExpandButton_Click);
|
||||
//
|
||||
// compressScriptTextButton
|
||||
//
|
||||
this.compressScriptTextButton.Image = global::DSPRE.Properties.Resources.compressArrow;
|
||||
this.compressScriptTextButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.compressScriptTextButton.Location = new System.Drawing.Point(1135, 11);
|
||||
this.compressScriptTextButton.Name = "compressScriptTextButton";
|
||||
this.compressScriptTextButton.Size = new System.Drawing.Size(24, 24);
|
||||
this.compressScriptTextButton.TabIndex = 29;
|
||||
this.compressScriptTextButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.compressScriptTextButton.UseVisualStyleBackColor = true;
|
||||
this.compressScriptTextButton.Click += new System.EventHandler(this.ScriptEditorCollapseButton_Click);
|
||||
//
|
||||
// scriptEditorWordWrapCheckbox
|
||||
//
|
||||
this.scriptEditorWordWrapCheckbox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.scriptEditorWordWrapCheckbox.AutoSize = true;
|
||||
this.scriptEditorWordWrapCheckbox.Checked = true;
|
||||
this.scriptEditorWordWrapCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.scriptEditorWordWrapCheckbox.Location = new System.Drawing.Point(907, 12);
|
||||
this.scriptEditorWordWrapCheckbox.Name = "scriptEditorWordWrapCheckbox";
|
||||
this.scriptEditorWordWrapCheckbox.Size = new System.Drawing.Size(72, 23);
|
||||
this.scriptEditorWordWrapCheckbox.TabIndex = 25;
|
||||
this.scriptEditorWordWrapCheckbox.Text = "Word Wrap";
|
||||
this.scriptEditorWordWrapCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.scriptEditorWordWrapCheckbox.UseVisualStyleBackColor = true;
|
||||
this.scriptEditorWordWrapCheckbox.CheckedChanged += new System.EventHandler(this.scriptEditorWordWrapCheckbox_CheckedChanged);
|
||||
//
|
||||
// scriptEditorWhitespacesCheckbox
|
||||
//
|
||||
this.scriptEditorWhitespacesCheckbox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.scriptEditorWhitespacesCheckbox.AutoSize = true;
|
||||
this.scriptEditorWhitespacesCheckbox.Location = new System.Drawing.Point(981, 12);
|
||||
this.scriptEditorWhitespacesCheckbox.Name = "scriptEditorWhitespacesCheckbox";
|
||||
this.scriptEditorWhitespacesCheckbox.Size = new System.Drawing.Size(79, 23);
|
||||
this.scriptEditorWhitespacesCheckbox.TabIndex = 26;
|
||||
this.scriptEditorWhitespacesCheckbox.Text = "Whitespaces";
|
||||
this.scriptEditorWhitespacesCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.scriptEditorWhitespacesCheckbox.UseVisualStyleBackColor = true;
|
||||
this.scriptEditorWhitespacesCheckbox.CheckedChanged += new System.EventHandler(this.viewWhiteSpacesButton_Click);
|
||||
//
|
||||
// groupBox26
|
||||
//
|
||||
this.groupBox26.Controls.Add(this.scriptEditorNumberFormatNoPreference);
|
||||
this.groupBox26.Controls.Add(this.scriptEditorNumberFormatDecimal);
|
||||
this.groupBox26.Controls.Add(this.scriptEditorNumberFormatHex);
|
||||
this.groupBox26.Location = new System.Drawing.Point(700, 4);
|
||||
this.groupBox26.Name = "groupBox26";
|
||||
this.groupBox26.Size = new System.Drawing.Size(190, 36);
|
||||
this.groupBox26.TabIndex = 50;
|
||||
this.groupBox26.TabStop = false;
|
||||
this.groupBox26.Text = "Number Format Preference";
|
||||
//
|
||||
// scriptEditorNumberFormatNoPreference
|
||||
//
|
||||
this.scriptEditorNumberFormatNoPreference.AutoSize = true;
|
||||
this.scriptEditorNumberFormatNoPreference.Checked = true;
|
||||
this.scriptEditorNumberFormatNoPreference.Location = new System.Drawing.Point(11, 14);
|
||||
this.scriptEditorNumberFormatNoPreference.Name = "scriptEditorNumberFormatNoPreference";
|
||||
this.scriptEditorNumberFormatNoPreference.Size = new System.Drawing.Size(47, 17);
|
||||
this.scriptEditorNumberFormatNoPreference.TabIndex = 22;
|
||||
this.scriptEditorNumberFormatNoPreference.TabStop = true;
|
||||
this.scriptEditorNumberFormatNoPreference.Text = "Auto";
|
||||
this.scriptEditorNumberFormatNoPreference.UseVisualStyleBackColor = true;
|
||||
this.scriptEditorNumberFormatNoPreference.CheckedChanged += new System.EventHandler(this.UpdateScriptNumberFormatNoPref);
|
||||
//
|
||||
// scriptEditorNumberFormatDecimal
|
||||
//
|
||||
this.scriptEditorNumberFormatDecimal.AutoSize = true;
|
||||
this.scriptEditorNumberFormatDecimal.Location = new System.Drawing.Point(121, 14);
|
||||
this.scriptEditorNumberFormatDecimal.Name = "scriptEditorNumberFormatDecimal";
|
||||
this.scriptEditorNumberFormatDecimal.Size = new System.Drawing.Size(63, 17);
|
||||
this.scriptEditorNumberFormatDecimal.TabIndex = 24;
|
||||
this.scriptEditorNumberFormatDecimal.Text = "Decimal";
|
||||
this.scriptEditorNumberFormatDecimal.UseVisualStyleBackColor = true;
|
||||
this.scriptEditorNumberFormatDecimal.CheckedChanged += new System.EventHandler(this.UpdateScriptNumberFormatDec);
|
||||
//
|
||||
// scriptEditorNumberFormatHex
|
||||
//
|
||||
this.scriptEditorNumberFormatHex.AutoSize = true;
|
||||
this.scriptEditorNumberFormatHex.Location = new System.Drawing.Point(68, 14);
|
||||
this.scriptEditorNumberFormatHex.Name = "scriptEditorNumberFormatHex";
|
||||
this.scriptEditorNumberFormatHex.Size = new System.Drawing.Size(44, 17);
|
||||
this.scriptEditorNumberFormatHex.TabIndex = 23;
|
||||
this.scriptEditorNumberFormatHex.Text = "Hex";
|
||||
this.scriptEditorNumberFormatHex.UseVisualStyleBackColor = true;
|
||||
this.scriptEditorNumberFormatHex.CheckedChanged += new System.EventHandler(this.UpdateScriptNumberFormatHex);
|
||||
//
|
||||
// viewLevelScriptButton
|
||||
//
|
||||
this.viewLevelScriptButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.viewLevelScriptButton.Location = new System.Drawing.Point(481, 681);
|
||||
this.viewLevelScriptButton.Name = "viewLevelScriptButton";
|
||||
this.viewLevelScriptButton.Size = new System.Drawing.Size(91, 25);
|
||||
this.viewLevelScriptButton.TabIndex = 6;
|
||||
this.viewLevelScriptButton.Text = "View level script";
|
||||
this.viewLevelScriptButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.viewLevelScriptButton.UseVisualStyleBackColor = true;
|
||||
this.viewLevelScriptButton.Click += new System.EventHandler(this.viewLevelScriptButton_Click);
|
||||
//
|
||||
// locateCurrentScriptFile
|
||||
//
|
||||
this.locateCurrentScriptFile.Image = global::DSPRE.Properties.Resources.open_file;
|
||||
this.locateCurrentScriptFile.Location = new System.Drawing.Point(423, 29);
|
||||
this.locateCurrentScriptFile.Name = "locateCurrentScriptFile";
|
||||
this.locateCurrentScriptFile.Size = new System.Drawing.Size(42, 40);
|
||||
this.locateCurrentScriptFile.TabIndex = 7;
|
||||
this.locateCurrentScriptFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.locateCurrentScriptFile.UseVisualStyleBackColor = true;
|
||||
this.locateCurrentScriptFile.Click += new System.EventHandler(this.locateCurrentScriptFile_Click);
|
||||
//
|
||||
// ScriptEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.locateCurrentScriptFile);
|
||||
this.Controls.Add(this.groupBox24);
|
||||
this.Controls.Add(this.viewLevelScriptButton);
|
||||
this.Controls.Add(this.selectScriptFileComboBox);
|
||||
this.Controls.Add(this.groupBox26);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.scriptEditorWhitespacesCheckbox);
|
||||
this.Controls.Add(this.scriptEditorWordWrapCheckbox);
|
||||
this.Controls.Add(this.addScriptFileButton);
|
||||
this.Controls.Add(this.compressScriptTextButton);
|
||||
this.Controls.Add(this.removeScriptFileButton);
|
||||
this.Controls.Add(this.expandScriptTextButton);
|
||||
this.Controls.Add(this.saveScriptFileButton);
|
||||
this.Controls.Add(this.openFindScriptEditorButton);
|
||||
this.Controls.Add(this.exportScriptFileButton);
|
||||
this.Controls.Add(this.importScriptFileButton);
|
||||
this.Controls.Add(this.groupBox8);
|
||||
this.Controls.Add(this.scriptEditorTabControl);
|
||||
this.Name = "ScriptEditor";
|
||||
this.Size = new System.Drawing.Size(1177, 735);
|
||||
this.scriptEditorTabControl.ResumeLayout(false);
|
||||
this.scriptsTabPage.ResumeLayout(false);
|
||||
this.PanelSearchScripts.ResumeLayout(false);
|
||||
this.PanelSearchScripts.PerformLayout();
|
||||
this.functionsTabPage.ResumeLayout(false);
|
||||
this.PanelSearchFunctions.ResumeLayout(false);
|
||||
this.PanelSearchFunctions.PerformLayout();
|
||||
this.actionsTabPage.ResumeLayout(false);
|
||||
this.PanelSearchActions.ResumeLayout(false);
|
||||
this.PanelSearchActions.PerformLayout();
|
||||
this.groupBox8.ResumeLayout(false);
|
||||
this.groupBox8.PerformLayout();
|
||||
this.groupBox24.ResumeLayout(false);
|
||||
this.ScriptNavigatorTabControl.ResumeLayout(false);
|
||||
this.ScriptsNavTab.ResumeLayout(false);
|
||||
this.FunctionsNavTab.ResumeLayout(false);
|
||||
this.ActionsNavTab.ResumeLayout(false);
|
||||
this.groupBox26.ResumeLayout(false);
|
||||
this.groupBox26.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
private System.Windows.Forms.CheckBox scrollToBlockStartcheckBox;
|
||||
|
||||
#endregion
|
||||
|
||||
public System.Windows.Forms.ComboBox selectScriptFileComboBox;
|
||||
private System.Windows.Forms.Label label5;
|
||||
public System.Windows.Forms.TabControl scriptEditorTabControl;
|
||||
private System.Windows.Forms.TabPage scriptsTabPage;
|
||||
private System.Windows.Forms.Panel PanelSearchScripts;
|
||||
private System.Windows.Forms.Button BtnNextFindScript;
|
||||
private System.Windows.Forms.Button BtnPrevFindScript;
|
||||
private System.Windows.Forms.Button BtnCloseFindScript;
|
||||
private System.Windows.Forms.TextBox panelFindScriptTextBox;
|
||||
private System.Windows.Forms.Panel scintillaScriptsPanel;
|
||||
private System.Windows.Forms.TabPage functionsTabPage;
|
||||
private System.Windows.Forms.Panel PanelSearchFunctions;
|
||||
private System.Windows.Forms.Button BtnNextFindFunc;
|
||||
private System.Windows.Forms.Button BtnPrevFindFunc;
|
||||
private System.Windows.Forms.Button BtnCloseFindFunc;
|
||||
private System.Windows.Forms.TextBox panelFindFunctionTextBox;
|
||||
private System.Windows.Forms.Panel scintillaFunctionsPanel;
|
||||
private System.Windows.Forms.TabPage actionsTabPage;
|
||||
private System.Windows.Forms.Panel PanelSearchActions;
|
||||
private System.Windows.Forms.Button BtnNextFindActions;
|
||||
private System.Windows.Forms.Button BtnPrevFindActions;
|
||||
private System.Windows.Forms.Button BtnCloseFindActions;
|
||||
private System.Windows.Forms.TextBox panelFindActionTextBox;
|
||||
private System.Windows.Forms.Panel scintillaActionsPanel;
|
||||
private System.Windows.Forms.Button addScriptFileButton;
|
||||
private System.Windows.Forms.Button removeScriptFileButton;
|
||||
private System.Windows.Forms.Button saveScriptFileButton;
|
||||
private System.Windows.Forms.Button exportScriptFileButton;
|
||||
private System.Windows.Forms.Button importScriptFileButton;
|
||||
private System.Windows.Forms.GroupBox groupBox8;
|
||||
private System.Windows.Forms.CheckBox searchOnlyCurrentScriptCheckBox;
|
||||
private System.Windows.Forms.CheckBox scriptSearchCaseSensitiveCheckBox;
|
||||
private System.Windows.Forms.TextBox searchInScriptsTextBox;
|
||||
private System.Windows.Forms.Label label31;
|
||||
private System.Windows.Forms.ProgressBar searchProgressBar;
|
||||
private System.Windows.Forms.Label label30;
|
||||
private System.Windows.Forms.Label label29;
|
||||
private System.Windows.Forms.Button searchInScriptsButton;
|
||||
private System.Windows.Forms.ListBox searchInScriptsResultListBox;
|
||||
private System.Windows.Forms.GroupBox groupBox24;
|
||||
private System.Windows.Forms.TabControl ScriptNavigatorTabControl;
|
||||
private System.Windows.Forms.TabPage ScriptsNavTab;
|
||||
private System.Windows.Forms.ListBox scriptsNavListbox;
|
||||
private System.Windows.Forms.TabPage FunctionsNavTab;
|
||||
private System.Windows.Forms.ListBox functionsNavListbox;
|
||||
private System.Windows.Forms.TabPage ActionsNavTab;
|
||||
private System.Windows.Forms.ListBox actionsNavListbox;
|
||||
private System.Windows.Forms.Button openFindScriptEditorButton;
|
||||
private System.Windows.Forms.Button expandScriptTextButton;
|
||||
private System.Windows.Forms.Button compressScriptTextButton;
|
||||
private System.Windows.Forms.CheckBox scriptEditorWordWrapCheckbox;
|
||||
private System.Windows.Forms.CheckBox scriptEditorWhitespacesCheckbox;
|
||||
private System.Windows.Forms.GroupBox groupBox26;
|
||||
private System.Windows.Forms.RadioButton scriptEditorNumberFormatNoPreference;
|
||||
private System.Windows.Forms.RadioButton scriptEditorNumberFormatDecimal;
|
||||
private System.Windows.Forms.RadioButton scriptEditorNumberFormatHex;
|
||||
private System.Windows.Forms.Button viewLevelScriptButton;
|
||||
private System.Windows.Forms.Button locateCurrentScriptFile;
|
||||
}
|
||||
}
|
||||
1047
DS_Map/Editors/ScriptEditor.cs
Normal file
1047
DS_Map/Editors/ScriptEditor.cs
Normal file
File diff suppressed because it is too large
Load Diff
120
DS_Map/Editors/ScriptEditor.resx
Normal file
120
DS_Map/Editors/ScriptEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -2,12 +2,13 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class EvolutionsEditor : Form {
|
||||
private bool disableHandlers = false;
|
||||
|
||||
private readonly string[] fileNames;
|
||||
private PokemonEditor _parent;
|
||||
private readonly string[] pokeNames;
|
||||
private readonly string[] moveNames;
|
||||
private readonly string[] itemNames;
|
||||
|
|
@ -19,7 +20,8 @@ namespace DSPRE {
|
|||
private static readonly string formName = "Evolutions Editor";
|
||||
|
||||
private (ComboBox m, Label l, NumericUpDown p, ComboBox t)[] evoRows;
|
||||
public EvolutionsEditor() {
|
||||
public EvolutionsEditor(Control parent, PokemonEditor pokeEditor) {
|
||||
this._parent = pokeEditor;
|
||||
this.pokeNames = RomInfo.GetPokemonNames();
|
||||
this.moveNames = RomInfo.GetAttackNames();
|
||||
this.itemNames = RomInfo.GetItemNames();
|
||||
|
|
@ -30,8 +32,10 @@ namespace DSPRE {
|
|||
|
||||
this.fileNames = fileNames.ToArray();
|
||||
InitializeComponent();
|
||||
|
||||
disableHandlers = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Size = parent.Size;
|
||||
this.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
evoRows = new (ComboBox m, Label l, NumericUpDown p, ComboBox t)[EvolutionFile.numEvolutions] {
|
||||
(evoMethodComboBox1, descLabel1, evoParamUpDown1, evoTargetMonComboBox1),
|
||||
|
|
@ -56,42 +60,42 @@ namespace DSPRE {
|
|||
|
||||
pokemonNameInputComboBox.Items.AddRange(this.fileNames);
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
pokemonNameInputComboBox.SelectedIndex = 1;
|
||||
}
|
||||
|
||||
private void pokemonNameInputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
Update();
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
this._parent.TrySyncIndices((ComboBox)sender);
|
||||
Helpers.DisableHandlers();
|
||||
if (CheckDiscardChanges()) {
|
||||
int newNumber = pokemonNameInputComboBox.SelectedIndex;
|
||||
monNumberNumericUpDown.Value = newNumber;
|
||||
ChangeLoadedFile(newNumber);
|
||||
|
||||
}
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
private void monNumberNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
Update();
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
this._parent.TrySyncIndices((NumericUpDown)sender);
|
||||
Helpers.DisableHandlers();
|
||||
if (CheckDiscardChanges()) {
|
||||
|
||||
int newNumber = (int)monNumberNumericUpDown.Value;
|
||||
pokemonNameInputComboBox.SelectedIndex = newNumber;
|
||||
ChangeLoadedFile(newNumber);
|
||||
|
||||
}
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
private void ChangeLoadedFile(int toLoad) {
|
||||
|
||||
public void ChangeLoadedFile(int toLoad) {
|
||||
currentLoadedId = toLoad;
|
||||
currentLoadedFile = new EvolutionFile(currentLoadedId);
|
||||
|
||||
|
|
@ -153,12 +157,12 @@ namespace DSPRE {
|
|||
return ed;
|
||||
}
|
||||
|
||||
private bool CheckDiscardChanges() {
|
||||
public bool CheckDiscardChanges() {
|
||||
if (!dirty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DialogResult res = MessageBox.Show("There are unsaved changes to the current Evolution data.\nDiscard and proceed?", "Unsaved changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
DialogResult res = MessageBox.Show("Evolutions Editor\nThere are unsaved changes to the current Evolution data.\nDiscard and proceed?", "Evolutions Editor - Unsaved changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (res.Equals(DialogResult.Yes)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -233,7 +237,7 @@ namespace DSPRE {
|
|||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
EvolutionMethod method = (EvolutionMethod)m.SelectedIndex;
|
||||
EvolutionParamMeaning type = EvolutionFile.evoDescriptions[method];
|
||||
|
|
@ -291,7 +295,7 @@ namespace DSPRE {
|
|||
throw new Exception("Unknown evolution parameter type: " + type);
|
||||
}
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
private void evoParamUpDown1_ValueChanged(object sender, EventArgs e) {
|
||||
|
|
|
|||
4
DS_Map/EvolutionsEditor.designer.cs
generated
4
DS_Map/EvolutionsEditor.designer.cs
generated
|
|
@ -585,8 +585,6 @@
|
|||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Button saveDataButton;
|
||||
private System.Windows.Forms.PictureBox pokemonPictureBox;
|
||||
private System.Windows.Forms.NumericUpDown monNumberNumericUpDown;
|
||||
private InputComboBox pokemonNameInputComboBox;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label paramLabel;
|
||||
|
|
@ -619,5 +617,7 @@
|
|||
private System.Windows.Forms.Label descLabel5;
|
||||
private System.Windows.Forms.Label descLabel6;
|
||||
private System.Windows.Forms.Label descLabel7;
|
||||
public InputComboBox pokemonNameInputComboBox;
|
||||
public System.Windows.Forms.NumericUpDown monNumberNumericUpDown;
|
||||
}
|
||||
}
|
||||
71
DS_Map/ExtensionMethods.cs
Normal file
71
DS_Map/ExtensionMethods.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class ExtensionMethods {
|
||||
/// <summary>
|
||||
/// Increment the progress bar value, without using Windows Aero animation
|
||||
/// </summary>
|
||||
public static void IncrementNoAnimation(this ProgressBar pb, int amount = 1) {
|
||||
pb.Value += amount;
|
||||
if (pb.Value != pb.Maximum) pb.Value++;
|
||||
pb.Value--;
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/a/10939890
|
||||
/// <summary>
|
||||
/// Sets the progress bar value, without using Windows Aero animation
|
||||
/// </summary>
|
||||
public static void SetProgressNoAnimation(this ProgressBar pb, int value) {
|
||||
// Don't redraw if nothing is changing.
|
||||
if (value == pb.Value)
|
||||
return;
|
||||
|
||||
// To get around this animation, we need to move the progress bar backwards.
|
||||
if (value == pb.Maximum) {
|
||||
// Special case (can't set value > Maximum).
|
||||
pb.Value = value; // Set the value
|
||||
pb.Value = value - 1; // Move it backwards
|
||||
}
|
||||
else {
|
||||
pb.Value = value + 1; // Move past
|
||||
}
|
||||
|
||||
pb.Value = value; // Move to correct value
|
||||
}
|
||||
|
||||
/*
|
||||
searchInScriptsButton.BeginInvoke(new Action(() => {
|
||||
}));
|
||||
|
||||
BackgroundWorker bw = new BackgroundWorker();
|
||||
bw.DoWork += (_sender, args) => {
|
||||
this.UIThread(() => {
|
||||
});
|
||||
};
|
||||
|
||||
//easier to set up
|
||||
searchInScriptsButton.BeginInvoke(new Action(() => {
|
||||
searchProgressBar.Value += 1;
|
||||
}));
|
||||
|
||||
//smoother if you put the control updates in the UIThread
|
||||
//same as BeginInvoke if you put the entire logic in UIThread
|
||||
BackgroundWorker bw = new BackgroundWorker();
|
||||
bw.DoWork += (_sender, args) => {
|
||||
this.UIThread(() => {
|
||||
searchProgressBar.Value += 1;
|
||||
});
|
||||
};
|
||||
bw.RunWorkerAsync();
|
||||
*/
|
||||
public static void UIThread(this Control control, Action code) {
|
||||
if (control.InvokeRequired) {
|
||||
control.BeginInvoke(code);
|
||||
return;
|
||||
}
|
||||
|
||||
code.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,8 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
using Tao.Platform.Windows;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class Extensions {
|
||||
|
|
@ -142,4 +144,33 @@ namespace DSPRE {
|
|||
}
|
||||
public static Bitmap Resize(this Bitmap source, float factor) => source.Resize((int)(source.Width * factor), (int)(source.Height * factor));
|
||||
}
|
||||
|
||||
public class ListBox2 : ListBox {
|
||||
public new void RefreshItem(int index) {
|
||||
base.RefreshItem(index);
|
||||
}
|
||||
}
|
||||
|
||||
public class SimpleOpenGlControl2 : SimpleOpenGlControl {
|
||||
private bool designMode;
|
||||
|
||||
public SimpleOpenGlControl2() : base() {
|
||||
designMode = LicenseManager.UsageMode == LicenseUsageMode.Designtime;
|
||||
}
|
||||
|
||||
public new bool DesignMode { get { return designMode; } }
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e) {
|
||||
//if the control is allowed to paint in design mode, a message box prevents working with it
|
||||
//"No device or rendering context available!"
|
||||
if (DesignMode) {
|
||||
e.Graphics.Clear(this.BackColor);
|
||||
if (this.BackgroundImage != null)
|
||||
e.Graphics.DrawImage(this.BackgroundImage, this.ClientRectangle, 0, 0, this.BackgroundImage.Width, this.BackgroundImage.Height, GraphicsUnit.Pixel);
|
||||
e.Graphics.Flush();
|
||||
return;
|
||||
};
|
||||
base.OnPaint(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
245
DS_Map/Filesystem.cs
Normal file
245
DS_Map/Filesystem.cs
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
using System.IO;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class Filesystem {
|
||||
public static string eventFiles { get { return RomInfo.gameDirs[RomInfo.DirNames.eventFiles].unpackedDir; } }
|
||||
public static string OWSprites { get { return RomInfo.gameDirs[RomInfo.DirNames.OWSprites].unpackedDir; } }
|
||||
public static string mapTextures { get { return RomInfo.gameDirs[RomInfo.DirNames.mapTextures].unpackedDir; } }
|
||||
public static string buildingTextures { get { return RomInfo.gameDirs[RomInfo.DirNames.buildingTextures].unpackedDir; } }
|
||||
public static string dynamicHeaders { get { return RomInfo.gameDirs[RomInfo.DirNames.dynamicHeaders].unpackedDir; } }
|
||||
public static string dynamicHeadersPacked { get { return RomInfo.gameDirs[RomInfo.DirNames.dynamicHeaders].packedDir; } }
|
||||
public static string scripts { get { return RomInfo.gameDirs[RomInfo.DirNames.scripts].unpackedDir; } }
|
||||
public static string maps { get { return RomInfo.gameDirs[RomInfo.DirNames.maps].unpackedDir; } }
|
||||
public static string matrices { get { return RomInfo.gameDirs[RomInfo.DirNames.matrices].unpackedDir; } }
|
||||
public static string buildingConfigFiles { get { return RomInfo.gameDirs[RomInfo.DirNames.buildingConfigFiles].unpackedDir; } }
|
||||
public static string areaData { get { return RomInfo.gameDirs[RomInfo.DirNames.areaData].unpackedDir; } }
|
||||
public static string textArchives { get { return RomInfo.gameDirs[RomInfo.DirNames.textArchives].unpackedDir; } }
|
||||
public static string trainerProperties { get { return RomInfo.gameDirs[RomInfo.DirNames.trainerProperties].unpackedDir; } }
|
||||
public static string trainerParty { get { return RomInfo.gameDirs[RomInfo.DirNames.trainerParty].unpackedDir; } }
|
||||
public static string trainerGraphics { get { return RomInfo.gameDirs[RomInfo.DirNames.trainerGraphics].unpackedDir; } }
|
||||
public static string encounters { get { return RomInfo.gameDirs[RomInfo.DirNames.encounters].unpackedDir; } }
|
||||
public static string headbutt { get { return RomInfo.gameDirs[RomInfo.DirNames.headbutt].unpackedDir; } }
|
||||
public static string safariZone { get { return RomInfo.gameDirs[RomInfo.DirNames.safariZone].unpackedDir; } }
|
||||
public static string monIcons { get { return RomInfo.gameDirs[RomInfo.DirNames.monIcons].unpackedDir; } }
|
||||
public static string synthOverlay { get { return RomInfo.gameDirs[RomInfo.DirNames.synthOverlay].unpackedDir; } }
|
||||
public static string interiorBuildingModels { get { return RomInfo.gameDirs[RomInfo.DirNames.interiorBuildingModels].unpackedDir; } }
|
||||
public static string exteriorBuildingModels { get { return RomInfo.gameDirs[RomInfo.DirNames.exteriorBuildingModels].unpackedDir; } }
|
||||
|
||||
public static string GetBuildingModelsDirPath(bool interior) {
|
||||
if (interior) {
|
||||
return interiorBuildingModels;
|
||||
} else {
|
||||
return exteriorBuildingModels;
|
||||
}
|
||||
}
|
||||
|
||||
public static string expArmPath { get { return Path.Combine(synthOverlay, PatchToolboxDialog.expandedARMfileID.ToString("D4")); } }
|
||||
|
||||
public static string GetPath(string path, int id, string format = "D4") {
|
||||
return Path.Combine(path, id.ToString(format));
|
||||
}
|
||||
|
||||
public static string GetPath(string path, string prefix, int id, string ext, string format = "D4") {
|
||||
return Path.Combine(path, prefix + id.ToString(format) + "." + ext);
|
||||
}
|
||||
|
||||
static string[] GetBuildingModelFiles(bool interior) {
|
||||
return Directory.GetFiles(Filesystem.GetBuildingModelsDirPath(interior));
|
||||
}
|
||||
|
||||
public static string GetBuildingModelPath(bool interior, int id) {
|
||||
return GetPath(Filesystem.GetBuildingModelsDirPath(interior), id);
|
||||
}
|
||||
|
||||
public static int GetBuildingCount(bool interior) {
|
||||
return GetBuildingModelFiles(interior).Length;
|
||||
}
|
||||
|
||||
public static string[] GetAreaDataFiles() {
|
||||
return Directory.GetFiles(Filesystem.areaData);
|
||||
}
|
||||
|
||||
public static string GetAreaDataPath(int id) {
|
||||
return GetPath(Filesystem.areaData, id);
|
||||
}
|
||||
|
||||
public static int GetAreaDataCount() {
|
||||
return GetAreaDataFiles().Length;
|
||||
}
|
||||
|
||||
public static string GetTexturePath(bool useMapTiles, int textureID) {
|
||||
string path = Filesystem.GetMapTexturePath(textureID);
|
||||
string path2 = Filesystem.GetBuildingTexturePath(textureID);
|
||||
string tilesetPath = useMapTiles ? path : path2;
|
||||
return tilesetPath;
|
||||
}
|
||||
|
||||
static string[] GetMapTextureFiles() {
|
||||
return Directory.GetFiles(Filesystem.mapTextures);
|
||||
}
|
||||
|
||||
public static string GetMapTexturePath(int id) {
|
||||
return GetPath(Filesystem.mapTextures, id);
|
||||
}
|
||||
|
||||
public static int GetMapTexturesCount() {
|
||||
return GetMapTextureFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetBuildingTextureFiles() {
|
||||
return Directory.GetFiles(Filesystem.buildingTextures);
|
||||
}
|
||||
|
||||
public static string GetBuildingTexturePath(int id) {
|
||||
return GetPath(Filesystem.buildingTextures, id);
|
||||
}
|
||||
|
||||
public static int GetBuildingTexturesCount() {
|
||||
return GetBuildingTextureFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetMatrixFiles() {
|
||||
return Directory.GetFiles(Filesystem.matrices);
|
||||
}
|
||||
|
||||
public static string GetMatrixPath(int id) {
|
||||
return GetPath(Filesystem.matrices, id);
|
||||
}
|
||||
|
||||
public static int GetMatrixCount() {
|
||||
return GetMatrixFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetTextArchiveFiles() {
|
||||
return Directory.GetFiles(Filesystem.textArchives);
|
||||
}
|
||||
|
||||
public static string GetTextArchivePath(int id) {
|
||||
return GetPath(Filesystem.textArchives, id);
|
||||
}
|
||||
|
||||
public static int GetTextArchivesCount() {
|
||||
return GetTextArchiveFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetMapFiles() {
|
||||
return Directory.GetFiles(Filesystem.maps);
|
||||
}
|
||||
|
||||
public static string GetMapPath(int id) {
|
||||
return GetPath(Filesystem.maps, id);
|
||||
}
|
||||
|
||||
public static int GetMapCount() {
|
||||
return GetMapFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetScriptFiles() {
|
||||
return Directory.GetFiles(Filesystem.scripts);
|
||||
}
|
||||
|
||||
public static string GetScriptPath(int id) {
|
||||
return GetPath(Filesystem.scripts, id);
|
||||
}
|
||||
|
||||
public static int GetScriptCount() {
|
||||
return GetScriptFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetEventFiles() {
|
||||
return Directory.GetFiles(Filesystem.eventFiles);
|
||||
}
|
||||
|
||||
public static string GetEventPath(int id) {
|
||||
return GetPath(Filesystem.eventFiles, id);
|
||||
}
|
||||
|
||||
public static int GetEventFileCount() {
|
||||
return GetEventFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetTrainerPropertiesFiles() {
|
||||
return Directory.GetFiles(Filesystem.trainerProperties);
|
||||
}
|
||||
|
||||
public static string GetTrainerPropertiesPath(int id) {
|
||||
return GetPath(Filesystem.trainerProperties, id);
|
||||
}
|
||||
|
||||
public static int GetTrainerPropertiesCount() {
|
||||
return GetTrainerPropertiesFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetDynamicHeaderFiles() {
|
||||
return Directory.GetFiles(Filesystem.dynamicHeaders);
|
||||
}
|
||||
|
||||
public static string GetDynamicHeaderPath(int id) {
|
||||
return GetPath(Filesystem.dynamicHeaders, id);
|
||||
}
|
||||
|
||||
public static int GetDynamicHeadersCount() {
|
||||
return GetDynamicHeaderFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetEncounterFiles() {
|
||||
return Directory.GetFiles(Filesystem.encounters);
|
||||
}
|
||||
|
||||
public static string GetEncounterPath(int id) {
|
||||
return GetPath(Filesystem.encounters, id);
|
||||
}
|
||||
|
||||
public static int GetEncountersCount() {
|
||||
return GetEncounterFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetSafariZoneFiles() {
|
||||
return Directory.GetFiles(Filesystem.safariZone);
|
||||
}
|
||||
|
||||
public static string GetSafariZonePath(int id) {
|
||||
return GetPath(Filesystem.safariZone, id);
|
||||
}
|
||||
|
||||
public static int GetSafariZoneCount() {
|
||||
return GetSafariZoneFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetHeadbuttFiles() {
|
||||
return Directory.GetFiles(Filesystem.headbutt);
|
||||
}
|
||||
|
||||
public static string GetHeadbuttPath(int id) {
|
||||
return GetPath(Filesystem.headbutt, id);
|
||||
}
|
||||
|
||||
public static int GetHeadbuttCount() {
|
||||
return GetHeadbuttFiles().Length;
|
||||
}
|
||||
|
||||
public static string GetOWSpritePath(int id) {
|
||||
return GetPath(Filesystem.OWSprites, id);
|
||||
}
|
||||
|
||||
public static string GetBuildingConfigPath(int id) {
|
||||
return GetPath(Filesystem.buildingConfigFiles, id);
|
||||
}
|
||||
|
||||
public static string GetTrainerPartyPath(int id) {
|
||||
return GetPath(Filesystem.trainerParty, id);
|
||||
}
|
||||
|
||||
public static string GetTrainerGraphicsPath(int id) {
|
||||
return GetPath(Filesystem.trainerGraphics, id);
|
||||
}
|
||||
|
||||
public static string GetMonIconPath(int id, string format = "D4") {
|
||||
return GetPath(Filesystem.monIcons, id, format);
|
||||
}
|
||||
|
||||
public static string GetSynthOerlayPath(int id) {
|
||||
return GetPath(Filesystem.synthOverlay, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
375
DS_Map/Helpers.cs
Normal file
375
DS_Map/Helpers.cs
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Tao.OpenGl;
|
||||
using LibNDSFormats.NSBMD;
|
||||
using LibNDSFormats.NSBTX;
|
||||
using DSPRE.ROMFiles;
|
||||
using Images;
|
||||
using Ekona.Images;
|
||||
using ScintillaNET;
|
||||
using ScintillaNET.Utils;
|
||||
using Tao.Platform.Windows;
|
||||
using NSMBe4.DSFileSystem;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class Helpers {
|
||||
static MainProgram MainProgram;
|
||||
|
||||
public static RomInfo romInfo;
|
||||
public static bool hideBuildings = new bool();
|
||||
|
||||
public static NSBMDGlRenderer mapRenderer;
|
||||
|
||||
public static ToolStripProgressBar toolStripProgressBar { get { return MainProgram.toolStripProgressBar; } }
|
||||
|
||||
public static void Initialize(MainProgram mainProgram) {
|
||||
MainProgram = mainProgram;
|
||||
mapRenderer = new NSBMDGlRenderer();
|
||||
}
|
||||
|
||||
static bool disableHandlersOld;
|
||||
static bool disableHandlers;
|
||||
|
||||
public static bool HandlersDisabled { get { return disableHandlers == true; } }
|
||||
public static bool HandlersEnabled { get { return disableHandlers == false; } }
|
||||
|
||||
public static void BackUpDisableHandler() {
|
||||
disableHandlersOld = disableHandlers;
|
||||
}
|
||||
|
||||
public static void RestoreDisableHandler() {
|
||||
disableHandlers = disableHandlersOld;
|
||||
}
|
||||
|
||||
public static void DisableHandlers() {
|
||||
disableHandlers = true;
|
||||
}
|
||||
|
||||
public static void EnableHandlers() {
|
||||
disableHandlers = false;
|
||||
}
|
||||
|
||||
public static void statusLabelMessage(string msg = "Ready") {
|
||||
ToolStripStatusLabel statusLabel = MainProgram.statusLabel;
|
||||
statusLabel.Text = msg;
|
||||
statusLabel.Font = new Font(statusLabel.Font, FontStyle.Regular);
|
||||
statusLabel.ForeColor = Color.Black;
|
||||
statusLabel.Invalidate();
|
||||
}
|
||||
|
||||
public static void statusLabelError(string errorMsg, bool severe = true) {
|
||||
ToolStripStatusLabel statusLabel = MainProgram.statusLabel;
|
||||
statusLabel.Text = errorMsg;
|
||||
statusLabel.Font = new Font(statusLabel.Font, FontStyle.Bold);
|
||||
statusLabel.ForeColor = severe ? Color.Red : Color.DarkOrange;
|
||||
statusLabel.Invalidate();
|
||||
}
|
||||
|
||||
//Locate File - buttons
|
||||
public static void ExplorerSelect(string path) {
|
||||
if (System.IO.File.Exists(path)) {
|
||||
Process.Start("explorer.exe", "/select" + "," + "\"" + path + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] GetTrainerNames() {
|
||||
List<string> trainerList = new List<string>();
|
||||
|
||||
/* Store all trainer names and classes */
|
||||
TextArchive trainerClasses = new TextArchive(RomInfo.trainerClassMessageNumber);
|
||||
TextArchive trainerNames = new TextArchive(RomInfo.trainerNamesMessageNumber);
|
||||
|
||||
int trainerCount = Filesystem.GetTrainerPropertiesCount();
|
||||
for (int i = 0; i < trainerCount; i++) {
|
||||
string path = Filesystem.GetTrainerPropertiesPath(i);
|
||||
int classMessageID = BitConverter.ToUInt16(DSUtils.ReadFromFile(path, startOffset: 1, 2), 0);
|
||||
string currentTrainerName;
|
||||
|
||||
if (i < trainerNames.messages.Count) {
|
||||
currentTrainerName = trainerNames.messages[i];
|
||||
} else {
|
||||
currentTrainerName = TrainerFile.NAME_NOT_FOUND;
|
||||
}
|
||||
|
||||
trainerList.Add("[" + i.ToString("D2") + "] " + trainerClasses.messages[classMessageID] + " " + currentTrainerName);
|
||||
}
|
||||
|
||||
return trainerList.ToArray();
|
||||
}
|
||||
|
||||
public static void MW_LoadModelTextures(NSBMD model, string textureFolder, int fileID) {
|
||||
if (fileID < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
string texturePath = Filesystem.GetPath(textureFolder, fileID);
|
||||
model.materials = NSBTXLoader.LoadNsbtx(new MemoryStream(System.IO.File.ReadAllBytes(texturePath)), out model.Textures, out model.Palettes);
|
||||
try {
|
||||
model.MatchTextures();
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
public static void MW_LoadModelTextures(MapFile mapFile, int fileID) {
|
||||
MW_LoadModelTextures(mapFile.mapModel, Filesystem.mapTextures, fileID);
|
||||
}
|
||||
|
||||
public static void MW_LoadModelTextures(Building building, int fileID) {
|
||||
MW_LoadModelTextures(building.NSBMDFile, Filesystem.buildingTextures, fileID);
|
||||
}
|
||||
|
||||
public static void SetupRenderer(float ang, float dist, float elev, float perspective, int width, int height) {
|
||||
//TODO: improve this
|
||||
Gl.glEnable(Gl.GL_RESCALE_NORMAL);
|
||||
Gl.glEnable(Gl.GL_COLOR_MATERIAL);
|
||||
Gl.glEnable(Gl.GL_DEPTH_TEST);
|
||||
Gl.glEnable(Gl.GL_NORMALIZE);
|
||||
Gl.glDisable(Gl.GL_CULL_FACE);
|
||||
Gl.glFrontFace(Gl.GL_CCW);
|
||||
Gl.glClearDepth(1);
|
||||
Gl.glEnable(Gl.GL_ALPHA_TEST);
|
||||
Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Gl.glEnable(Gl.GL_BLEND);
|
||||
Gl.glAlphaFunc(Gl.GL_GREATER, 0f);
|
||||
Gl.glClearColor(51f / 255f, 51f / 255f, 51f / 255f, 1f);
|
||||
Gl.glViewport(0, 0, width, height);
|
||||
float aspect = width / height; //(vp[2] - vp[0]) / (vp[3] - vp[1]);
|
||||
Gl.glMatrixMode(Gl.GL_PROJECTION);
|
||||
Gl.glLoadIdentity();
|
||||
Glu.gluPerspective(perspective, aspect, 0.2f, 500.0f); //0.02f, 32.0f);
|
||||
Gl.glTranslatef(0, 0, -dist);
|
||||
Gl.glRotatef(elev, 1, 0, 0);
|
||||
Gl.glRotatef(ang, 0, 1, 0);
|
||||
Gl.glMatrixMode(Gl.GL_MODELVIEW);
|
||||
Gl.glLoadIdentity();
|
||||
Gl.glTranslatef(0, 0, -dist);
|
||||
Gl.glRotatef(elev, 1, 0, 0);
|
||||
Gl.glRotatef(-ang, 0, 1, 0);
|
||||
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLightfv(Gl.GL_LIGHT2, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLightfv(Gl.GL_LIGHT3, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLoadIdentity();
|
||||
Gl.glBindTexture(Gl.GL_TEXTURE_2D, 0);
|
||||
Gl.glColor3f(1.0f, 1.0f, 1.0f);
|
||||
Gl.glDepthMask(Gl.GL_TRUE);
|
||||
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
public static void RenderMap(ref MapFile mapFile, int width, int height, float ang, float dist, float elev, float perspective, bool mapTexturesON = true, bool buildingTexturesON = true) {
|
||||
#region Useless variables that the rendering API still needs
|
||||
|
||||
MKDS_Course_Editor.NSBTA.NSBTA.NSBTA_File ani = new MKDS_Course_Editor.NSBTA.NSBTA.NSBTA_File();
|
||||
MKDS_Course_Editor.NSBTP.NSBTP.NSBTP_File tp = new MKDS_Course_Editor.NSBTP.NSBTP.NSBTP_File();
|
||||
MKDS_Course_Editor.NSBCA.NSBCA.NSBCA_File ca = new MKDS_Course_Editor.NSBCA.NSBCA.NSBCA_File();
|
||||
int[] aniframeS = new int[0];
|
||||
|
||||
#endregion
|
||||
|
||||
/* Adjust rendering settings */
|
||||
SetupRenderer(ang, dist, elev, perspective, width, height);
|
||||
|
||||
/* Render the map model */
|
||||
NSBMD model = mapFile.mapModel;
|
||||
mapRenderer.Model = model.models[0];
|
||||
|
||||
// int scale = 64;
|
||||
float scale = 0.015625f;
|
||||
Gl.glScalef(mapRenderer.Model.modelScale * scale, mapRenderer.Model.modelScale * scale, mapRenderer.Model.modelScale * scale);
|
||||
|
||||
/* Determine if map textures must be rendered */
|
||||
if (mapTexturesON) {
|
||||
Gl.glEnable(Gl.GL_TEXTURE_2D);
|
||||
} else {
|
||||
Gl.glDisable(Gl.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
// Render map model
|
||||
mapRenderer.RenderModel("", ani, aniframeS, aniframeS, aniframeS, aniframeS, aniframeS, ca, false, -1, 0.0f, 0.0f, dist, elev, ang, true, tp, model);
|
||||
|
||||
if (hideBuildings) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (buildingTexturesON) {
|
||||
Gl.glEnable(Gl.GL_TEXTURE_2D);
|
||||
} else {
|
||||
Gl.glDisable(Gl.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
for (int i = 0; i < mapFile.buildings.Count; i++) {
|
||||
Building building = mapFile.buildings[i];
|
||||
model = building.NSBMDFile;
|
||||
if (model is null) {
|
||||
Console.WriteLine("Null building can't be rendered");
|
||||
} else {
|
||||
mapRenderer.Model = model.models[0];
|
||||
ScaleTranslateRotateBuilding(building);
|
||||
mapRenderer.RenderModel("", ani, aniframeS, aniframeS, aniframeS, aniframeS, aniframeS, ca, false, -1, 0.0f, 0.0f, dist, elev, ang, true, tp, model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap GrabMapScreenshot(int width, int height) {
|
||||
Bitmap bmp = new Bitmap(width, height);
|
||||
System.Drawing.Imaging.BitmapData data = bmp.LockBits(new Rectangle(0, 0, width, height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
||||
Gl.glReadPixels(0, 0, width, height, Gl.GL_BGR, Gl.GL_UNSIGNED_BYTE, data.Scan0);
|
||||
bmp.UnlockBits(data);
|
||||
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private static void ScaleTranslateRotateBuilding(Building building) {
|
||||
float fullXcoord = building.xPosition + building.xFraction / 65536f;
|
||||
float fullYcoord = building.yPosition + building.yFraction / 65536f;
|
||||
float fullZcoord = building.zPosition + building.zFraction / 65536f;
|
||||
|
||||
float scaleFactor = building.NSBMDFile.models[0].modelScale / 1024;
|
||||
float translateFactor = 256 / building.NSBMDFile.models[0].modelScale;
|
||||
|
||||
Gl.glScalef(scaleFactor * building.width, scaleFactor * building.height, scaleFactor * building.length);
|
||||
Gl.glTranslatef(fullXcoord * translateFactor / building.width, fullYcoord * translateFactor / building.height, fullZcoord * translateFactor / building.length);
|
||||
Gl.glRotatef(Building.U16ToDeg(building.xRotation), 1, 0, 0);
|
||||
Gl.glRotatef(Building.U16ToDeg(building.yRotation), 0, 1, 0);
|
||||
Gl.glRotatef(Building.U16ToDeg(building.zRotation), 0, 0, 1);
|
||||
}
|
||||
|
||||
public static Image GetPokePic(int species, int w, int h, PaletteBase paletteBase, ImageBase imageBase, SpriteBase spriteBase) {
|
||||
bool fiveDigits = false; // some extreme future proofing
|
||||
try {
|
||||
string path = Filesystem.GetMonIconPath(0);
|
||||
paletteBase = new NCLR(path, 0, Path.GetFileName(path));
|
||||
} catch (FileNotFoundException) {
|
||||
string path = Filesystem.GetMonIconPath(0, "D5");
|
||||
paletteBase = new NCLR(path, 0, Path.GetFileName(path));
|
||||
fiveDigits = true;
|
||||
}
|
||||
|
||||
// read arm9 table to grab pal ID
|
||||
int paletteId = 0;
|
||||
byte[] iconPalTableBuf;
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case RomInfo.GameFamilies.DP:
|
||||
iconPalTableBuf = ARM9.ReadBytes(0x6B838, 4);
|
||||
break;
|
||||
case RomInfo.GameFamilies.Plat:
|
||||
iconPalTableBuf = ARM9.ReadBytes(0x79F80, 4);
|
||||
break;
|
||||
case RomInfo.GameFamilies.HGSS:
|
||||
default:
|
||||
iconPalTableBuf = ARM9.ReadBytes(0x74408, 4);
|
||||
break;
|
||||
}
|
||||
|
||||
int iconPalTableAddress = (iconPalTableBuf[3] & 0xFF) << 24 | (iconPalTableBuf[2] & 0xFF) << 16 | (iconPalTableBuf[1] & 0xFF) << 8 | (iconPalTableBuf[0] & 0xFF) /* << 0 */;
|
||||
string iconTablePath;
|
||||
|
||||
int iconPalTableOffsetFromFileStart;
|
||||
if (iconPalTableAddress >= RomInfo.synthOverlayLoadAddress) {
|
||||
// if the pointer shows the table was moved to the synthetic overlay
|
||||
iconPalTableOffsetFromFileStart = iconPalTableAddress - (int)RomInfo.synthOverlayLoadAddress;
|
||||
iconTablePath = Filesystem.expArmPath;
|
||||
} else {
|
||||
iconPalTableOffsetFromFileStart = iconPalTableAddress - 0x02000000;
|
||||
iconTablePath = RomInfo.arm9Path;
|
||||
}
|
||||
|
||||
using (DSUtils.EasyReader idReader = new DSUtils.EasyReader(iconTablePath, iconPalTableOffsetFromFileStart + species)) {
|
||||
paletteId = idReader.ReadByte();
|
||||
}
|
||||
|
||||
if (paletteId != 0) {
|
||||
paletteBase.Palette[0] = paletteBase.Palette[paletteId]; // update pal 0 to be the new pal
|
||||
}
|
||||
|
||||
// grab tiles
|
||||
int spriteFileID = species + 7;
|
||||
if (fiveDigits) {
|
||||
string path = Filesystem.GetMonIconPath(spriteFileID, "D5");
|
||||
imageBase = new NCGR(path, spriteFileID, Path.GetFileName(path));
|
||||
} else {
|
||||
string path = Filesystem.GetMonIconPath(spriteFileID);
|
||||
imageBase = new NCGR(path, spriteFileID, Path.GetFileName(path));
|
||||
}
|
||||
|
||||
// grab sprite
|
||||
const int ncerFileId = 2;
|
||||
if (fiveDigits) {
|
||||
string path = Filesystem.GetMonIconPath(ncerFileId, "D5");
|
||||
spriteBase = new NCER(path, ncerFileId, Path.GetFileName(path));
|
||||
} else {
|
||||
string path = Filesystem.GetMonIconPath(ncerFileId);
|
||||
spriteBase = new NCER(path, ncerFileId, Path.GetFileName(path));
|
||||
}
|
||||
|
||||
// copy this from the trainer
|
||||
int bank0OAMcount = spriteBase.Banks[0].oams.Length;
|
||||
int[] OAMenabled = new int[bank0OAMcount];
|
||||
for (int i = 0; i < OAMenabled.Length; i++) {
|
||||
OAMenabled[i] = i;
|
||||
}
|
||||
|
||||
// finally compose image
|
||||
try {
|
||||
return spriteBase.Get_Image(imageBase, paletteBase, 0, w, h, false, false, false, true, true, -1, OAMenabled);
|
||||
} catch (FormatException) {
|
||||
return Properties.Resources.IconPokeball;
|
||||
}
|
||||
// default:
|
||||
//partyPokemonPictureBoxList[partyPos].Image = cb.SelectedIndex > 0 ? (Image)Properties.PokePics.ResourceManager.GetObject(FixPokenameString(PokeDatabase.System.pokeNames[(ushort)cb.SelectedIndex])) : global::DSPRE.Properties.Resources.IconPokeball;
|
||||
}
|
||||
|
||||
public static void GenerateKeystrokes(string keys, Scintilla textArea) {
|
||||
//Example
|
||||
//GenerateKeystrokes("+{TAB}");
|
||||
HotKeyManager.Enable = false;
|
||||
textArea.Focus();
|
||||
SendKeys.Send(keys);
|
||||
HotKeyManager.Enable = true;
|
||||
}
|
||||
|
||||
public static void PictureBoxDisable(object sender, PaintEventArgs e) {
|
||||
if (sender is PictureBox pict && pict.Image != null && (!pict.Enabled)) {
|
||||
using (Bitmap img = new Bitmap(pict.Image, pict.ClientSize)) {
|
||||
ControlPaint.DrawImageDisabled(e.Graphics, img, 0, 0, pict.BackColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> getHeaderListBoxNames() {
|
||||
List<string> headerListBoxNames = new List<string>();
|
||||
|
||||
using (DSUtils.EasyReader reader = new DSUtils.EasyReader(RomInfo.internalNamesPath)) {
|
||||
int headerCount = RomInfo.GetHeaderCount();
|
||||
for (int i = 0; i < headerCount; i++) {
|
||||
byte[] row = reader.ReadBytes(RomInfo.internalNameLength);
|
||||
string internalName = Encoding.ASCII.GetString(row); //.TrimEnd();
|
||||
headerListBoxNames.Add(MapHeader.BuildName(i, internalName));
|
||||
}
|
||||
}
|
||||
|
||||
return headerListBoxNames;
|
||||
}
|
||||
|
||||
public static List<string> getInternalNames() {
|
||||
List<string> internalNames = new List<string>();
|
||||
|
||||
using (DSUtils.EasyReader reader = new DSUtils.EasyReader(RomInfo.internalNamesPath)) {
|
||||
int headerCount = RomInfo.GetHeaderCount();
|
||||
for (int i = 0; i < headerCount; i++) {
|
||||
byte[] row = reader.ReadBytes(RomInfo.internalNameLength);
|
||||
string internalName = Encoding.ASCII.GetString(row); //.TrimEnd();
|
||||
internalNames.Add(internalName.TrimEnd('\0'));
|
||||
}
|
||||
}
|
||||
|
||||
return internalNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
4
DS_Map/LearnsetEditor.Designer.cs
generated
4
DS_Map/LearnsetEditor.Designer.cs
generated
|
|
@ -333,9 +333,7 @@
|
|||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.PictureBox pokemonPictureBox;
|
||||
private System.Windows.Forms.NumericUpDown monNumberNumericUpDown;
|
||||
private System.Windows.Forms.Button saveDataButton;
|
||||
private InputComboBox pokemonNameInputComboBox;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
|
|
@ -349,5 +347,7 @@
|
|||
private InputComboBox moveInputComboBox;
|
||||
private System.Windows.Forms.Label descriptorLabel;
|
||||
private System.Windows.Forms.Label statusLabel;
|
||||
public InputComboBox pokemonNameInputComboBox;
|
||||
public System.Windows.Forms.NumericUpDown monNumberNumericUpDown;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,16 +6,16 @@ using System.Linq;
|
|||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using static ScintillaNET.Style;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
|
||||
using MessageBox = System.Windows.Forms.MessageBox;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class LearnsetEditor : Form {
|
||||
private bool disableHandlers = false;
|
||||
|
||||
private readonly string[] fileNames;
|
||||
private readonly string[] pokenames;
|
||||
private readonly string[] moveNames;
|
||||
|
||||
private PokemonEditor _parent;
|
||||
private readonly string[] editButtonNames = new string[] {
|
||||
"Edit",
|
||||
"Confirm"
|
||||
|
|
@ -33,12 +33,14 @@ namespace DSPRE {
|
|||
private static bool dirty = false;
|
||||
private static readonly string formName = "Learnset Editor";
|
||||
|
||||
public LearnsetEditor(string[] moveNames) {
|
||||
public LearnsetEditor(string[] moveNames, Control parent, PokemonEditor pokeEditor) {
|
||||
this.moveNames = moveNames;
|
||||
|
||||
this._parent = pokeEditor;
|
||||
InitializeComponent();
|
||||
|
||||
disableHandlers = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Size = parent.Size;
|
||||
this.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
BindingList<string> listMoveNames = new BindingList<string>(moveNames);
|
||||
moveInputComboBox.DataSource = listMoveNames;
|
||||
|
|
@ -62,7 +64,7 @@ namespace DSPRE {
|
|||
descriptorLabel.Text = "";
|
||||
statusLabel.Text = "";
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
pokemonNameInputComboBox.SelectedIndex = 1;
|
||||
}
|
||||
|
|
@ -75,12 +77,12 @@ namespace DSPRE {
|
|||
this.Text = formName;
|
||||
}
|
||||
}
|
||||
private bool CheckDiscardChanges() {
|
||||
public bool CheckDiscardChanges() {
|
||||
if (!dirty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DialogResult res = MessageBox.Show(this, "There are unsaved changes to the current Pokémon data.\nDiscard and proceed?", "Unsaved changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
DialogResult res = MessageBox.Show(this, "Learnsets Editor\nThere are unsaved changes to the current Learnset data.\nDiscard and proceed?", "Learnset Editor - Unsaved changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (res.Equals(DialogResult.Yes)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -94,7 +96,7 @@ namespace DSPRE {
|
|||
private string ElemToString((ushort level, ushort move) elem) {
|
||||
return $"Lv. {elem.level}: {moveNames[elem.move]}";
|
||||
}
|
||||
private void ChangeLoadedFile(int toLoad) {
|
||||
public void ChangeLoadedFile(int toLoad) {
|
||||
currentLoadedId = toLoad;
|
||||
currentLoadedFile = new LearnsetData(currentLoadedId);
|
||||
PopulateAllFromCurrentFile();
|
||||
|
|
@ -125,34 +127,33 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void pokemonNameInputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
Update();
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
this._parent.TrySyncIndices((ComboBox)sender);
|
||||
Helpers.DisableHandlers();
|
||||
if (CheckDiscardChanges()) {
|
||||
int newNumber = pokemonNameInputComboBox.SelectedIndex;
|
||||
monNumberNumericUpDown.Value = newNumber;
|
||||
ChangeLoadedFile(newNumber);
|
||||
|
||||
ChangeLoadedFile(newNumber);
|
||||
}
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
private void monNumberNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
return;
|
||||
Update();
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
this._parent.TrySyncIndices((NumericUpDown)sender);
|
||||
Helpers.DisableHandlers();
|
||||
if (CheckDiscardChanges()) {
|
||||
|
||||
int newNumber = (int)monNumberNumericUpDown.Value;
|
||||
pokemonNameInputComboBox.SelectedIndex = newNumber;
|
||||
ChangeLoadedFile(newNumber);
|
||||
|
||||
ChangeLoadedFile(newNumber);
|
||||
}
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
private void moveInputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
|
|
@ -209,6 +210,7 @@ namespace DSPRE {
|
|||
PopulateAllFromCurrentFile();
|
||||
movesListBox.SelectedIndex = currentLoadedFile.list.FindIndex(x => x == newEntry);
|
||||
UpdateAddEditStatus();
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
private void deleteMoveButton_Click(object sender, EventArgs e) {
|
||||
|
|
@ -232,6 +234,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
UpdateByEditMode();
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
private void editMoveButton_Click(object sender, EventArgs e) {
|
||||
|
|
@ -272,6 +275,7 @@ namespace DSPRE {
|
|||
}
|
||||
UpdateByEditMode();
|
||||
addMoveButton.Enabled = (editMode == false && CheckValidEntry());
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
private void UpdateByEditMode() {
|
||||
|
|
|
|||
1334
DS_Map/Main Window.Designer.cs
generated
1334
DS_Map/Main Window.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -117,96 +117,6 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="mainTabImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>239, 17</value>
|
||||
</metadata>
|
||||
<data name="mainTabImageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM
|
||||
EgAAAk1TRnQBSQFMAgEBCgEAAagBGwGoARsBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
|
||||
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
|
||||
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
|
||||
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
|
||||
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
|
||||
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
|
||||
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
|
||||
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
|
||||
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
|
||||
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
|
||||
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
|
||||
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
|
||||
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
|
||||
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
|
||||
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
|
||||
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
|
||||
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
|
||||
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
|
||||
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
|
||||
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
|
||||
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
|
||||
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
|
||||
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
|
||||
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
|
||||
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMABLwEAAS8KwAGvAIA
|
||||
BOkBvAMABOkBvCoAASYBHgQAArwBAATpBAAE6QG8KgABJgEeAgABJgEeAQABvAEAAukBvAIABLwBAALp
|
||||
AbwtAAG8ASYBHgMAAukBvAEABAsCvALpAbwsAAEmAR4CAAG8AgAC6QG8AgsBvAEAAgsBvALpAbwmAAO8
|
||||
AgABJgEeAgABvAMAAukBvAILArwCCwEAAukBvCUAAc0BCgEAAbwBAAEmAR4BAAHsAwABvAEAAukBvAUL
|
||||
AgAC6QG8JQABzQEKAQACvAEmAR4BAAESArwBAAG8AQAC6QG8AgsCvAMAAukBvCQAAc0BCgMAAbwBAAEm
|
||||
AR4GAALpAbwBAAILA7wBAALpAbwkAAHNAQoBEgHsAQABEgG8CAAC6QG8AgADCwIAAukBvCQAAc0BCgES
|
||||
AgABEgG8CAAC6QO8BAABvALpAbwjAAHNAQoBAAG8AwABvAgABOkBvAMABOkBvAEAAbwhAAHNAQoBAAG8
|
||||
AwAB7AG8BwAE6QQABOkBGwExAZkhAAFlGwADMT0AARsBMQEbKQAB7AESAe8FAAH0EQAKEhgAAvMC6wHv
|
||||
AewB6wHzBQAB6gH0BQAC8gH0BgADEgZKAxIUAAHzAfEBvALsAQcBvAEHAewB6wEHBAABDgESAe0EAAHw
|
||||
ASIBKQHrAfMFAAESAkoGbgJKARIDAAEPBwABDwUAAQ8BAAG8AfcB7QGSAe8BvAEHAfAB9AHyAesB6gQA
|
||||
AQ4BbQHtAwABBwEjAisBKgHrAfMDAAESAUoBbgFKBm4BSgFuAUoBEgEAAQ8J7wEPAwAB7wIAAW0C9wHw
|
||||
AbwB8wLyAvQB7QHrAQcDAAEHARUB6gPtASkBKwElAR8BJQEqAesB9AIAARIBSgFuAUoGkwFKAW4BSgES
|
||||
AgAB7wEBAR8G7wMAAu8CAAG8Ae8B8QH0AfYB8gLwAfQB9gHvAewBbQMAAfQBEAHrAUoBMAEDASUBFwH5
|
||||
AiABJQEqAeoCAAESAUoBkwFuBkkBbgGTAUoBEgIAAe8CAQEfBe8BAAIPAu8CAAHyAe8C9gH3AW0B6wHy
|
||||
AfQB9gHzAesB7AEHAgAB9AEQAXMBRQEkASAB+QEXAfkBIAEfASABMQEiAfQBAAESAZMBbgFJBmwBSQFu
|
||||
AZMBEgIAAe8BAQEfBu8DAALvAwAB7wHzAbwBkgHwAfcB9gH3Ae0BBwHrAewB7wMAAfIBEQFFAR8CIAH5
|
||||
ARcB+QEgAR8BMQEiAfQBAAESAZMBSQJsBHECbAFJAZMBEgEAAQ8J7wEPAwAB7wMAAQcB8AFEASUBGgKS
|
||||
AfIC8wH0ARIB6wHyAgAB8gFDAewBRQEfASAB+QEXASYBMQE3ATABFAIAAUkBbgFsAXEBlwRxAZcBcQFs
|
||||
AW4BEgIAAQ8HAAEPBQABDwIAAfQBbQEsASUB6wH0AvEC7wHyAusBvAIAAfMBbQHrAUUBHwIgAfkBMQFR
|
||||
Am0B8wIAAUkCbAGXAnEClwJxAZcCbAFJAgABFQEPARUDAAEVAQ8BFQgAARwBLAErAeoBBwG8Au8B9AK8
|
||||
AfMCbQMAAfABEwFFAR8BJAIrAVEBvAUAAUkBbAJxBpcCcQFsAUkBAAEVAfcBBwH3ARUBAAEVAfcBBwH3
|
||||
ARUGAAHvAisBSwHvAQcBvAHxBAcB9AGLAeoDAAHwAREBSwEkASMBAwFKAfAHAAFsAXEDlwJ4A5cBcQFs
|
||||
AgABDwEHAQABBwEPAQABDwEHAQABBwEPBQAB7wErASwBRQK8AQcB7wEHAbwB8AEZAtsBbAEHAwAB8AEj
|
||||
AisBDgHwAfEIAAFJAXEClwF4BZcBcQFJAgABFQH3AQcB9wEVAQABFQH3AQcB9wEVBQABEgEsAUUB8gHz
|
||||
Ae8B8gHxAbsC2gGzAosB8wQAAfABIwE3ATEBDgsAAUkBcQKXAXgDlwFxAUkEAAEVAQ8BFQMAARUBDwEV
|
||||
BwABEgG8AgABBwGzAdQBswJsAe8IAAHvAg4B8wwAAWwBcQSXAXEBbBkAAQcCEgG8HQAEcRcAAfQL8wH0
|
||||
EwAN8xMAAQcL7wEHAgAPEAEAAQcNswEHBwAEQwcAAe8BAAG7BrMBuwIAAe8CAAEQBjgBEAbTARABAAGz
|
||||
DQABswUAAkME8AJDBQAB7wEAAbMGAAGzAgAB7wIAARACOAMAATgBEALTAgAC0wEQAQABsw0AAbMEAAFD
|
||||
CPABQwQAAe8BAAGtAQABlwJWAZcBAAGzAgAB7wIAARADOAEAAjgBEAHTAQAC0wEAAdMBEAEAAbMBAAFW
|
||||
CVABVgEAAbMDAAFDA/ABkgJDAZID8AFDAwAB7wEAAa0BAARWAQABswH0AQAB7wIAARACOAIAAjgBEAHT
|
||||
AQAC0wEAAdMBEAEAAbMBAAtWAQABswMAAUMB8AGSARIBQwHwAZIBQwESAZIB8AFDAwAB7wEAAa0BAARW
|
||||
AQABswH0AQAB7wIAARADOAEAAjgBEALTAgAC0wEQAQABswEAC1YBAAGzAgABQwHwARICYwFDAQAB8AFD
|
||||
AmMBEgHwAUMCAAHvAQABrQEABHgBAAGzAfQBAAHvAgABEAY4ARAG0wEQAQABswEAC1YBAAGzAgABQwES
|
||||
BEcCQwRHARIBQwIAAe8BAAGtBgABswHzAQAB7wIADxABAAGzAQALVgEAAbMCAAFDDEcBQwIAAe8BAAG7
|
||||
Aq0EswG7AfMBAAHvAgABEAZHARAGAAEQAQABswEAC1YBAAGzAgABQwxHAUMCAAHvAQAB8wP0AfMB9AQA
|
||||
Ae8CAAEQAkcCAAJHARAGAAEQAQABswEAC1YBAAGzAwABQwJHApQGRwFDAwAB7wEAAXQCMgEsAXQBAAG8
|
||||
AvcBAAHvAgABEAFHAQACRwEAAUcBEAYAARABAAGzAQABVgl4AVYBAAGzAwABQwFHBJQFRwFDAwAB7wEA
|
||||
ASwDwwFTAQAB9wIAAfMB8AIAARABRwEAAkcBAAFHARAGAAEQAQABswEAC3gBAAGzBAABQwSUBEcBQwQA
|
||||
Ae8BAAF0AywBdAEAAfcBAAHzAfADAAEQAkcCAAJHARAGAAEQAQABswEAC3gBAAGzBQACQwGUA0cCQwUA
|
||||
Ae8IAAHzAfAEAAEQBkcBEAYAARABAAGzDQABswcABEMHAAEHCO8BBwUADxABAAEJDbMBCREAAUIBTQE+
|
||||
BwABPgMAASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD/wEAAv8CwwQAAf8BgQKDBAAB/wEAAYcBgwQA
|
||||
Af8BMAGMASMEAAH/AeEBiAEDBAAB/wHBAYEBAwQAAfEBgwGAASMEAAHhAQ4BgAFjBAAB4AEAAYAB4wQA
|
||||
AcABgQGIASMEAAHAAX8BjAFjBAABxAF/AYMBwwQAAYQBfwGDAYIEAAGEAT8BhwGABAABjAF/Af8B+AQA
|
||||
A/8B+AQAAf8BjwG/Af8B4AEHAv8B+AEHAo8BwAEDAv8BwAEHAY8BBwHAAQMBgAE8AYABBwGOAQMBgAEB
|
||||
AQABGAGAAQMBgAEBAYABAQIAAYABAwGAAQEBgAEBAgABgAEBAYABAAGAAQECAAHAAQEBwAEAAYABAQEA
|
||||
ARgBwAEAAcABAQGAAQEBgAE8AcABAAHAAQEBgAEBAY4BPwHAAQAB4AEPAYABAQEEAR8BgAEAAeABHwHA
|
||||
AQMBJAGfAgAB4AE/AcABAwEEAR8BAAEBAeAB/wHgAQcBjgE/AZgBDwHwAf8B8AEPAv8B+AF/Av8B/AE/
|
||||
Av8BgAEDAv8BgAEDAv8BgAEDAQABAQEAAQEB/AE/AaABGwEAAQEBfwH9AfABDwGvAdsBAAExAX8B/QHg
|
||||
AQcBqAFbAQABSQFAAQUBwAEDAagBSwEAAUkBQAEFAcABAwGoAUsBAAExAUABBQGBAQEBqAFLAQABAQFA
|
||||
AQUBgAEBAa8BywEAAQEBQAEFAYABAQGgAQsBAAH9AUABBQGAAQEBoAF7ARgBxQFAAQUBwAEDAaABiwEk
|
||||
Ae0BQAEFAcABAwGgAbMBJAHNAUABBQHgAQcBoAGnARgB7QFAAQUB8AEPAb8BzwEAAf0BfwH9AfwBPwGA
|
||||
AR8BAAEBAQABAQL/Cw==
|
||||
</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="worldmapCoordsPasteButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
|
@ -1036,6 +946,96 @@
|
|||
p3S+M+m1V1me9QgCUQNXX2YRT1sYHBiEP3wHVbp3PF3cB40GbrzN86xHENrScf1NDsl8FaI4jODMHOgS
|
||||
SOacfYAmbr5XeNYjGH7yDReXv+JeNIUhUYwFpmZjDz+nMLf5B3b2rcZ5tju4ntjtFw4T54j+v2g/t9NH
|
||||
9AiCIPwGJelqUAd/T3AAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="mainTabImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>239, 17</value>
|
||||
</metadata>
|
||||
<data name="mainTabImageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM
|
||||
EgAAAk1TRnQBSQFMAgEBCgEAAXgBHAF4ARwBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
|
||||
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
|
||||
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
|
||||
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
|
||||
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
|
||||
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
|
||||
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
|
||||
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
|
||||
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
|
||||
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
|
||||
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
|
||||
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
|
||||
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
|
||||
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
|
||||
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
|
||||
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
|
||||
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
|
||||
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
|
||||
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
|
||||
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
|
||||
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
|
||||
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
|
||||
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
|
||||
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
|
||||
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMABLwEAAS8KwAGvAIA
|
||||
BOkBvAMABOkBvCoAASYBHgQAArwBAATpBAAE6QG8KgABJgEeAgABJgEeAQABvAEAAukBvAIABLwBAALp
|
||||
AbwtAAG8ASYBHgMAAukBvAEABAsCvALpAbwsAAEmAR4CAAG8AgAC6QG8AgsBvAEAAgsBvALpAbwmAAO8
|
||||
AgABJgEeAgABvAMAAukBvAILArwCCwEAAukBvCUAAc0BCgEAAbwBAAEmAR4BAAHsAwABvAEAAukBvAUL
|
||||
AgAC6QG8JQABzQEKAQACvAEmAR4BAAESArwBAAG8AQAC6QG8AgsCvAMAAukBvCQAAc0BCgMAAbwBAAEm
|
||||
AR4GAALpAbwBAAILA7wBAALpAbwkAAHNAQoBEgHsAQABEgG8CAAC6QG8AgADCwIAAukBvCQAAc0BCgES
|
||||
AgABEgG8CAAC6QO8BAABvALpAbwjAAHNAQoBAAG8AwABvAgABOkBvAMABOkBvAEAAbwhAAHNAQoBAAG8
|
||||
AwAB7AG8BwAE6QQABOkBGwExAZkhAAFlGwADMT0AARsBMQEbKQAB7AESAe8FAAH0EQAKEhgAAvMC6wHv
|
||||
AewB6wHzBQAB6gH0BQAC8gH0BgADEgZKAxIUAAHzAfEBvALsAQcBvAEHAewB6wEHBAABDgESAe0EAAHw
|
||||
ASIBKQHrAfMFAAESAkoGbgJKARIDAAEPBwABDwUAAQ8BAAG8AfcB7QGSAe8BvAEHAfAB9AHyAesB6gQA
|
||||
AQ4BbQHtAwABBwEjAisBKgHrAfMDAAESAUoBbgFKBm4BSgFuAUoBEgEAAQ8J7wEPAwAB7wIAAW0C9wHw
|
||||
AbwB8wLyAvQB7QHrAQcDAAEHARUB6gPtASkBKwElAR8BJQEqAesB9AIAARIBSgFuAUoGkwFKAW4BSgES
|
||||
AgAB7wEBAR8G7wMAAu8CAAG8Ae8B8QH0AfYB8gLwAfQB9gHvAewBbQMAAfQBEAHrAUoBMAEDASUBFwH5
|
||||
AiABJQEqAeoCAAESAUoBkwFuBkkBbgGTAUoBEgIAAe8CAQEfBe8BAAIPAu8CAAHyAe8C9gH3AW0B6wHy
|
||||
AfQB9gHzAesB7AEHAgAB9AEQAXMBRQEkASAB+QEXAfkBIAEfASABMQEiAfQBAAESAZMBbgFJBmwBSQFu
|
||||
AZMBEgIAAe8BAQEfBu8DAALvAwAB7wHzAbwBkgHwAfcB9gH3Ae0BBwHrAewB7wMAAfIBEQFFAR8CIAH5
|
||||
ARcB+QEgAR8BMQEiAfQBAAESAZMBSQJsBHECbAFJAZMBEgEAAQ8J7wEPAwAB7wMAAQcB8AFEASUBGgKS
|
||||
AfIC8wH0ARIB6wHyAgAB8gFDAewBRQEfASAB+QEXASYBMQE3ATABFAIAAUkBbgFsAXEBlwRxAZcBcQFs
|
||||
AW4BEgIAAQ8HAAEPBQABDwIAAfQBbQEsASUB6wH0AvEC7wHyAusBvAIAAfMBbQHrAUUBHwIgAfkBMQFR
|
||||
Am0B8wIAAUkCbAGXAnEClwJxAZcCbAFJAgABFQEPARUDAAEVAQ8BFQgAARwBLAErAeoBBwG8Au8B9AK8
|
||||
AfMCbQMAAfABEwFFAR8BJAIrAVEBvAUAAUkBbAJxBpcCcQFsAUkBAAEVAfcBBwH3ARUBAAEVAfcBBwH3
|
||||
ARUGAAHvAisBSwHvAQcBvAHxBAcB9AGLAeoDAAHwAREBSwEkASMBAwFKAfAHAAFsAXEDlwJ4A5cBcQFs
|
||||
AgABDwEHAQABBwEPAQABDwEHAQABBwEPBQAB7wErASwBRQK8AQcB7wEHAbwB8AEZAtsBbAEHAwAB8AEj
|
||||
AisBDgHwAfEIAAFJAXEClwF4BZcBcQFJAgABFQH3AQcB9wEVAQABFQH3AQcB9wEVBQABEgEsAUUB8gHz
|
||||
Ae8B8gHxAbsC2gGzAosB8wQAAfABIwE3ATEBDgsAAUkBcQKXAXgDlwFxAUkEAAEVAQ8BFQMAARUBDwEV
|
||||
BwABEgG8AgABBwGzAdQBswJsAe8IAAHvAg4B8wwAAWwBcQSXAXEBbBkAAQcCEgG8HQAEcRcAAfQL8wH0
|
||||
EwAN8xMAAQcL7wEHAgAPEAEAAQcNswEHBwAEQwcAAe8BAAG7BrMBuwIAAe8CAAEQBjgBEAbTARABAAGz
|
||||
DQABswUAAkME8AJDBQAB7wEAAbMGAAGzAgAB7wIAARACOAMAATgBEALTAgAC0wEQAQABsw0AAbMEAAFD
|
||||
CPABQwQAAe8BAAGtAQABlwJWAZcBAAGzAgAB7wIAARADOAEAAjgBEAHTAQAC0wEAAdMBEAEAAbMBAAFW
|
||||
CVABVgEAAbMDAAFDA/ABkgJDAZID8AFDAwAB7wEAAa0BAARWAQABswH0AQAB7wIAARACOAIAAjgBEAHT
|
||||
AQAC0wEAAdMBEAEAAbMBAAtWAQABswMAAUMB8AGSARIBQwHwAZIBQwESAZIB8AFDAwAB7wEAAa0BAARW
|
||||
AQABswH0AQAB7wIAARADOAEAAjgBEALTAgAC0wEQAQABswEAC1YBAAGzAgABQwHwARICYwFDAQAB8AFD
|
||||
AmMBEgHwAUMCAAHvAQABrQEABHgBAAGzAfQBAAHvAgABEAY4ARAG0wEQAQABswEAC1YBAAGzAgABQwES
|
||||
BEcCQwRHARIBQwIAAe8BAAGtBgABswHzAQAB7wIADxABAAGzAQALVgEAAbMCAAFDDEcBQwIAAe8BAAG7
|
||||
Aq0EswG7AfMBAAHvAgABEAZHARAGAAEQAQABswEAC1YBAAGzAgABQwxHAUMCAAHvAQAB8wP0AfMB9AQA
|
||||
Ae8CAAEQAkcCAAJHARAGAAEQAQABswEAC1YBAAGzAwABQwJHApQGRwFDAwAB7wEAAXQCMgEsAXQBAAG8
|
||||
AvcBAAHvAgABEAFHAQACRwEAAUcBEAYAARABAAGzAQABVgl4AVYBAAGzAwABQwFHBJQFRwFDAwAB7wEA
|
||||
ASwDwwFTAQAB9wIAAfMB8AIAARABRwEAAkcBAAFHARAGAAEQAQABswEAC3gBAAGzBAABQwSUBEcBQwQA
|
||||
Ae8BAAF0AywBdAEAAfcBAAHzAfADAAEQAkcCAAJHARAGAAEQAQABswEAC3gBAAGzBQACQwGUA0cCQwUA
|
||||
Ae8IAAHzAfAEAAEQBkcBEAYAARABAAGzDQABswcABEMHAAEHCO8BBwUADxABAAEJDbMBCREAAUIBTQE+
|
||||
BwABPgMAASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD/wEAAv8CwwQAAf8BgQKDBAAB/wEAAYcBgwQA
|
||||
Af8BMAGMASMEAAH/AeEBiAEDBAAB/wHBAYEBAwQAAfEBgwGAASMEAAHhAQ4BgAFjBAAB4AEAAYAB4wQA
|
||||
AcABgQGIASMEAAHAAX8BjAFjBAABxAF/AYMBwwQAAYQBfwGDAYIEAAGEAT8BhwGABAABjAF/Af8B+AQA
|
||||
A/8B+AQAAf8BjwG/Af8B4AEHAv8B+AEHAo8BwAEDAv8BwAEHAY8BBwHAAQMBgAE8AYABBwGOAQMBgAEB
|
||||
AQABGAGAAQMBgAEBAYABAQIAAYABAwGAAQEBgAEBAgABgAEBAYABAAGAAQECAAHAAQEBwAEAAYABAQEA
|
||||
ARgBwAEAAcABAQGAAQEBgAE8AcABAAHAAQEBgAEBAY4BPwHAAQAB4AEPAYABAQEEAR8BgAEAAeABHwHA
|
||||
AQMBJAGfAgAB4AE/AcABAwEEAR8BAAEBAeAB/wHgAQcBjgE/AZgBDwHwAf8B8AEPAv8B+AF/Av8B/AE/
|
||||
Av8BgAEDAv8BgAEDAv8BgAEDAQABAQEAAQEB/AE/AaABGwEAAQEBfwH9AfABDwGvAdsBAAExAX8B/QHg
|
||||
AQcBqAFbAQABSQFAAQUBwAEDAagBSwEAAUkBQAEFAcABAwGoAUsBAAExAUABBQGBAQEBqAFLAQABAQFA
|
||||
AQUBgAEBAa8BywEAAQEBQAEFAYABAQGgAQsBAAH9AUABBQGAAQEBoAF7ARgBxQFAAQUBwAEDAaABiwEk
|
||||
Ae0BQAEFAcABAwGgAbMBJAHNAUABBQHgAQcBoAGnARgB7QFAAQUB8AEPAb8BzwEAAf0BfwH9AfwBPwGA
|
||||
AR8BAAEBAQABAQL/Cw==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
|
@ -1047,11 +1047,8 @@
|
|||
<metadata name="mainToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>386, 19</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>533, 20</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>62</value>
|
||||
<value>144</value>
|
||||
</metadata>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
|
|
|||
34
DS_Map/MoveEditor.Designer.cs
generated
Normal file
34
DS_Map/MoveEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
namespace DSPRE {
|
||||
partial class MoveEditor {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "MoveEditor";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
17
DS_Map/MoveEditor.cs
Normal file
17
DS_Map/MoveEditor.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class MoveEditor : Form {
|
||||
public MoveEditor() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -461,8 +461,7 @@ namespace DSPRE {
|
|||
|
||||
private void ApplyItemStandardizeButton_Click(object sender, EventArgs e) {
|
||||
DialogResult d = MessageBox.Show("This process will apply the following changes:\n\n" +
|
||||
"- Item scripts will be rearranged to follow the natural, ascending index order.\n\n" +
|
||||
"- Any unsaved change to the current Event File will be discarded.\n\n",
|
||||
"- Item scripts will be rearranged to follow the natural, ascending index order.\n\n",
|
||||
"Confirm to proceed", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
|
||||
if (d == DialogResult.Yes) {
|
||||
|
|
@ -478,31 +477,25 @@ namespace DSPRE {
|
|||
ScriptFile itemScriptFile = new ScriptFile(RomInfo.itemScriptFileNumber);
|
||||
|
||||
// Create map for: script no. -> vanilla item
|
||||
int[] vanillaItemsArray = new int[itemScriptFile.allScripts.Count - 1];
|
||||
int[] vanillaItemsArray = new int[itemScriptFile.allScripts.Count];
|
||||
|
||||
for (int i = 0; i < itemScriptFile.allScripts.Count - 1; i++) {
|
||||
vanillaItemsArray[i] = BitConverter.ToInt16(itemScriptFile.allScripts[i].commands[0].cmdParams[1], 0);
|
||||
};
|
||||
}
|
||||
|
||||
// Parse all event files and fix instances of ground items according to the new order
|
||||
int cnt = RomInfo.GetEventFileCount();
|
||||
(int min, int max) itemScriptRange = (7000, 8000);
|
||||
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
bool dirty = false;
|
||||
|
||||
for (int i = 0; i < Filesystem.GetEventFileCount(); i++) {
|
||||
EventFile eventFile = new EventFile(i);
|
||||
|
||||
for (int j = 0; j < eventFile.overworlds.Count; j++) {
|
||||
// If ow is marked as an item, or in the rare case it is not but script no. falls within item script range:
|
||||
bool isItem = eventFile.overworlds[j].type == (ushort)Overworld.OwType.ITEM
|
||||
|| (eventFile.overworlds[j].scriptNumber >= itemScriptRange.min
|
||||
&& eventFile.overworlds[j].scriptNumber <= itemScriptRange.max);
|
||||
|| (eventFile.overworlds[j].scriptNumber >= 7000
|
||||
&& eventFile.overworlds[j].scriptNumber <= 8000);
|
||||
|
||||
if (isItem) {
|
||||
int itemScriptID = eventFile.overworlds[j].scriptNumber - (itemScriptRange.min - 1);
|
||||
eventFile.overworlds[j].scriptNumber = (ushort)(itemScriptRange.min + vanillaItemsArray[itemScriptID - 1]);
|
||||
dirty = true;
|
||||
int itemScriptID = eventFile.overworlds[j].scriptNumber - 6999;
|
||||
eventFile.overworlds[j].scriptNumber = (ushort)(7000 + vanillaItemsArray[itemScriptID - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -530,7 +523,7 @@ namespace DSPRE {
|
|||
|
||||
// Sort scripts in the Script File according to item indices
|
||||
int itemCount = new TextArchive(RomInfo.itemNamesTextNumber).messages.Count;
|
||||
CommandContainer executeGive = new CommandContainer((uint)itemCount + 1, itemScriptFile.allScripts[itemScriptFile.allScripts.Count - 1]);
|
||||
ScriptCommandContainer executeGive = new ScriptCommandContainer((uint)itemCount, itemScriptFile.allScripts[itemScriptFile.allScripts.Count - 1]);
|
||||
|
||||
itemScriptFile.allScripts.Clear();
|
||||
|
||||
|
|
@ -542,11 +535,11 @@ namespace DSPRE {
|
|||
new ScriptCommand("Jump Function_#1")
|
||||
};
|
||||
|
||||
itemScriptFile.allScripts.Add(new CommandContainer((ushort)(i + 1), ScriptFile.containerTypes.Script, commandList: cmdList));
|
||||
itemScriptFile.allScripts.Add(new ScriptCommandContainer((ushort)(i + 1), ScriptFile.ContainerTypes.Script, commandList: cmdList));
|
||||
}
|
||||
|
||||
itemScriptFile.allScripts.Add(executeGive);
|
||||
itemScriptFile.allFunctions[0].usedScript = itemCount + 1;
|
||||
itemScriptFile.allFunctions[0].usedScriptID = itemCount + 1;
|
||||
|
||||
itemScriptFile.SaveToFileDefaultDir(RomInfo.itemScriptFileNumber, showSuccessMessage: false);
|
||||
MessageBox.Show("Operation successful.", "Process completed.", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
|
|
|||
4
DS_Map/PersonalDataEditor.Designer.cs
generated
4
DS_Map/PersonalDataEditor.Designer.cs
generated
|
|
@ -1513,9 +1513,7 @@
|
|||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.PictureBox pokemonPictureBox;
|
||||
private System.Windows.Forms.NumericUpDown monNumberNumericUpDown;
|
||||
private System.Windows.Forms.Button saveDataButton;
|
||||
private InputComboBox pokemonNameInputComboBox;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel11;
|
||||
|
|
@ -1605,5 +1603,7 @@
|
|||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10;
|
||||
private InputComboBox type2InputComboBox;
|
||||
private InputComboBox type1InputComboBox;
|
||||
public InputComboBox pokemonNameInputComboBox;
|
||||
public System.Windows.Forms.NumericUpDown monNumberNumericUpDown;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,10 +6,10 @@ using System.ComponentModel;
|
|||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class PersonalDataEditor : Form {
|
||||
private bool disableHandlers = false;
|
||||
|
||||
private readonly string[] fileNames;
|
||||
private readonly string[] pokenames;
|
||||
|
|
@ -18,14 +18,19 @@ namespace DSPRE {
|
|||
private PokemonPersonalData currentLoadedFile = null;
|
||||
|
||||
private static bool dirty = false;
|
||||
private bool modifiedAbilities = false;
|
||||
private static readonly string formName = "Personal Data Editor";
|
||||
|
||||
public PersonalDataEditor(string[] itemNames, string[] abilityNames) {
|
||||
PokemonEditor _parent;
|
||||
|
||||
public PersonalDataEditor(string[] itemNames, string[] abilityNames, System.Windows.Forms.Control parent, PokemonEditor pokeEditor) {
|
||||
this.fileNames = RomInfo.GetPokemonNames().ToArray();;
|
||||
|
||||
this._parent = pokeEditor;
|
||||
InitializeComponent();
|
||||
|
||||
disableHandlers = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Size = parent.Size;
|
||||
this.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
BindingList<string> listItemNames = new BindingList<string>(itemNames);
|
||||
item1InputComboBox.DataSource = new BindingSource(listItemNames, string.Empty);
|
||||
|
|
@ -65,7 +70,7 @@ namespace DSPRE {
|
|||
pokemonNameInputComboBox.Items.AddRange(this.fileNames);
|
||||
/* ---------------- */
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
|
||||
pokemonNameInputComboBox.SelectedIndex = 1;
|
||||
|
|
@ -80,7 +85,7 @@ namespace DSPRE {
|
|||
}
|
||||
}
|
||||
private void baseHpNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseHP = (byte)baseHpNumericUpDown.Value;
|
||||
|
|
@ -88,14 +93,14 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void baseAtkNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseAtk = (byte)baseAtkNumericUpDown.Value;
|
||||
setDirty(true);
|
||||
}
|
||||
private void baseDefNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseDef = (byte)baseDefNumericUpDown.Value;
|
||||
|
|
@ -103,7 +108,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void baseSpAtkNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseSpAtk = (byte)baseSpAtkNumericUpDown.Value;
|
||||
|
|
@ -111,7 +116,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void baseSpDefNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseSpDef = (byte)baseSpDefNumericUpDown.Value;
|
||||
|
|
@ -119,7 +124,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void baseSpeedNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseSpeed = (byte)baseSpeedNumericUpDown.Value;
|
||||
|
|
@ -127,7 +132,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void evHpNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.evHP = (byte)evHpNumericUpDown.Value;
|
||||
|
|
@ -135,7 +140,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void evAtkNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.evAtk = (byte)evAtkNumericUpDown.Value;
|
||||
|
|
@ -143,7 +148,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void evDefNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.evDef = (byte)evDefNumericUpDown.Value;
|
||||
|
|
@ -151,7 +156,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void evSpAtkNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.evSpAtk = (byte)evSpAtkNumericUpDown.Value;
|
||||
|
|
@ -159,7 +164,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void evSpDefNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.evSpDef = (byte)evSpDefNumericUpDown.Value;
|
||||
|
|
@ -167,7 +172,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void evSpeedNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.evSpeed = (byte)evSpeedNumericUpDown.Value;
|
||||
|
|
@ -176,7 +181,7 @@ namespace DSPRE {
|
|||
|
||||
|
||||
private void type1InputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.type1 = (PokemonType)type1InputComboBox.SelectedIndex;
|
||||
|
|
@ -184,7 +189,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void type2InputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.type2 = (PokemonType)type2InputComboBox.SelectedIndex;
|
||||
|
|
@ -192,7 +197,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void growthCurveInputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.growthCurve = (PokemonGrowthCurve)growthCurveInputComboBox.SelectedIndex;
|
||||
|
|
@ -200,7 +205,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void baseExpYieldNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.givenExp = (byte)baseExpYieldNumericUpDown.Value;
|
||||
|
|
@ -208,7 +213,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void dexColorInputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.color = (PokemonDexColor)dexColorInputComboBox.SelectedIndex;
|
||||
|
|
@ -216,7 +221,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void flipFlagCheckBox_CheckedChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.flip = flipFlagCheckBox.Checked;
|
||||
|
|
@ -224,7 +229,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void escapeRateNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.escapeRate = (byte)escapeRateNumericUpDown.Value;
|
||||
|
|
@ -232,7 +237,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void catchRateNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.catchRate = (byte)catchRateNumericUpDown.Value;
|
||||
|
|
@ -240,7 +245,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void genderProbabilityNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.genderVec = (byte)genderProbabilityNumericUpDown.Value;
|
||||
|
|
@ -266,21 +271,23 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void ability1InputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.firstAbility = (byte)ability1InputComboBox.SelectedIndex;
|
||||
setDirty(true);
|
||||
modifiedAbilities = true;
|
||||
}
|
||||
private void ability2InputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.secondAbility = (byte)ability2InputComboBox.SelectedIndex;
|
||||
setDirty(true);
|
||||
modifiedAbilities = true;
|
||||
}
|
||||
private void eggGroup1InputCombobox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.eggGroup1 = (byte)eggGroup1InputCombobox.SelectedIndex;
|
||||
|
|
@ -288,7 +295,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void eggGroup2InputCombobox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.eggGroup2 = (byte)eggGroup2InputCombobox.SelectedIndex;
|
||||
|
|
@ -296,7 +303,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void eggStepsNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.eggSteps = (byte)eggStepsNumericUpDown.Value;
|
||||
|
|
@ -304,7 +311,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void item1InputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.item1 = (ushort)item1InputComboBox.SelectedIndex;
|
||||
|
|
@ -312,7 +319,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void item2InputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.item2 = (ushort)item2InputComboBox.SelectedIndex;
|
||||
|
|
@ -320,7 +327,7 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void baseFriendshipNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentLoadedFile.baseFriendship = (byte)baseFriendshipNumericUpDown.Value;
|
||||
|
|
@ -387,15 +394,19 @@ namespace DSPRE {
|
|||
}
|
||||
private void saveDataButton_Click(object sender, EventArgs e) {
|
||||
currentLoadedFile.SaveToFileDefaultDir(currentLoadedId, true);
|
||||
if (modifiedAbilities) {
|
||||
EditorPanels.MainProgram.RefreshAbilities(currentLoadedId);
|
||||
modifiedAbilities = false;
|
||||
}
|
||||
setDirty(false);
|
||||
}
|
||||
//-------------------------------
|
||||
private bool CheckDiscardChanges() {
|
||||
public bool CheckDiscardChanges() {
|
||||
if (!dirty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DialogResult res = MessageBox.Show("There are unsaved changes to the current Pokémon data.\nDiscard and proceed?", "Unsaved changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
DialogResult res = MessageBox.Show("Personal Editor\nThere are unsaved changes to the current Personal data.\nDiscard and proceed?", "Personal Editor - Unsaved changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
if (res.Equals(DialogResult.Yes)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -408,33 +419,36 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void pokemonNameInputComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
Update();
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
this._parent.TrySyncIndices((System.Windows.Forms.ComboBox)sender);
|
||||
Helpers.DisableHandlers();
|
||||
if (CheckDiscardChanges()) {
|
||||
int newNumber = pokemonNameInputComboBox.SelectedIndex;
|
||||
monNumberNumericUpDown.Value = newNumber;
|
||||
ChangeLoadedFile(newNumber);
|
||||
}
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
private void monNumberNumericUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
return;
|
||||
Update();
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
this._parent.TrySyncIndices((NumericUpDown)sender);
|
||||
Helpers.DisableHandlers();
|
||||
if (CheckDiscardChanges()) {
|
||||
int newNumber = (int)monNumberNumericUpDown.Value;
|
||||
pokemonNameInputComboBox.SelectedIndex = newNumber;
|
||||
ChangeLoadedFile(newNumber);
|
||||
}
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
private void ChangeLoadedFile(int toLoad) {
|
||||
|
||||
public void ChangeLoadedFile(int toLoad) {
|
||||
currentLoadedId = toLoad;
|
||||
currentLoadedFile = new PokemonPersonalData(currentLoadedId);
|
||||
|
||||
|
|
|
|||
143
DS_Map/PokemonEditor.Designer.cs
generated
Normal file
143
DS_Map/PokemonEditor.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
namespace DSPRE {
|
||||
partial class PokemonEditor {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.tabControl = new System.Windows.Forms.TabControl();
|
||||
this.personalPage = new System.Windows.Forms.TabPage();
|
||||
this.learnsetPage = new System.Windows.Forms.TabPage();
|
||||
this.evoPage = new System.Windows.Forms.TabPage();
|
||||
this.syncChangesCheckbox = new System.Windows.Forms.CheckBox();
|
||||
this.syncChangesLabel = new System.Windows.Forms.Label();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.tabControl.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl
|
||||
//
|
||||
this.tabControl.Controls.Add(this.personalPage);
|
||||
this.tabControl.Controls.Add(this.learnsetPage);
|
||||
this.tabControl.Controls.Add(this.evoPage);
|
||||
this.tabControl.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.tabControl.Location = new System.Drawing.Point(0, 29);
|
||||
this.tabControl.Name = "tabControl";
|
||||
this.tabControl.SelectedIndex = 0;
|
||||
this.tabControl.Size = new System.Drawing.Size(1032, 552);
|
||||
this.tabControl.TabIndex = 0;
|
||||
//
|
||||
// personalPage
|
||||
//
|
||||
this.personalPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.personalPage.Name = "personalPage";
|
||||
this.personalPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.personalPage.Size = new System.Drawing.Size(1024, 526);
|
||||
this.personalPage.TabIndex = 0;
|
||||
this.personalPage.Text = "Personal Editor";
|
||||
this.personalPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// learnsetPage
|
||||
//
|
||||
this.learnsetPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.learnsetPage.Name = "learnsetPage";
|
||||
this.learnsetPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.learnsetPage.Size = new System.Drawing.Size(792, 387);
|
||||
this.learnsetPage.TabIndex = 1;
|
||||
this.learnsetPage.Text = "Learnset Editor";
|
||||
this.learnsetPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// evoPage
|
||||
//
|
||||
this.evoPage.Location = new System.Drawing.Point(4, 22);
|
||||
this.evoPage.Name = "evoPage";
|
||||
this.evoPage.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.evoPage.Size = new System.Drawing.Size(792, 387);
|
||||
this.evoPage.TabIndex = 2;
|
||||
this.evoPage.Text = "Evolution Editor";
|
||||
this.evoPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// syncChangesCheckbox
|
||||
//
|
||||
this.syncChangesCheckbox.AutoSize = true;
|
||||
this.syncChangesCheckbox.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.syncChangesCheckbox.Location = new System.Drawing.Point(3, 3);
|
||||
this.syncChangesCheckbox.Name = "syncChangesCheckbox";
|
||||
this.syncChangesCheckbox.Size = new System.Drawing.Size(171, 17);
|
||||
this.syncChangesCheckbox.TabIndex = 1;
|
||||
this.syncChangesCheckbox.Text = "Synchronize Chosen Pokemon";
|
||||
this.syncChangesCheckbox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// syncChangesLabel
|
||||
//
|
||||
this.syncChangesLabel.AutoSize = true;
|
||||
this.syncChangesLabel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.syncChangesLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.syncChangesLabel.ForeColor = System.Drawing.SystemColors.Highlight;
|
||||
this.syncChangesLabel.Location = new System.Drawing.Point(180, 10);
|
||||
this.syncChangesLabel.Name = "syncChangesLabel";
|
||||
this.syncChangesLabel.Size = new System.Drawing.Size(555, 13);
|
||||
this.syncChangesLabel.TabIndex = 2;
|
||||
this.syncChangesLabel.Text = "When this checkbox is marked changinging the pokemon in any of the tabs will sync" +
|
||||
"hronize it accross the other tabs";
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.Controls.Add(this.syncChangesCheckbox);
|
||||
this.flowLayoutPanel1.Controls.Add(this.syncChangesLabel);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(1032, 23);
|
||||
this.flowLayoutPanel1.TabIndex = 3;
|
||||
//
|
||||
// PokemonEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.ClientSize = new System.Drawing.Size(1032, 581);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.Controls.Add(this.tabControl);
|
||||
this.DoubleBuffered = true;
|
||||
this.Name = "PokemonEditor";
|
||||
this.Text = "PokemonEditor";
|
||||
this.tabControl.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TabControl tabControl;
|
||||
private System.Windows.Forms.TabPage personalPage;
|
||||
private System.Windows.Forms.TabPage learnsetPage;
|
||||
private System.Windows.Forms.TabPage evoPage;
|
||||
private System.Windows.Forms.CheckBox syncChangesCheckbox;
|
||||
private System.Windows.Forms.Label syncChangesLabel;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
}
|
||||
}
|
||||
89
DS_Map/PokemonEditor.cs
Normal file
89
DS_Map/PokemonEditor.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.RomInfo;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class PokemonEditor : Form {
|
||||
PersonalDataEditor personalEditor;
|
||||
LearnsetEditor learnsetEditor;
|
||||
EvolutionsEditor evoEditor;
|
||||
|
||||
public PokemonEditor(string[] itemNames, string[] abilityNames, string[] moveNames) {
|
||||
InitializeComponent();
|
||||
IsMdiContainer = true;
|
||||
|
||||
personalEditor = new PersonalDataEditor(itemNames, abilityNames, personalPage, this);
|
||||
personalEditor.TopLevel = false;
|
||||
personalEditor.Show();
|
||||
personalPage.Controls.Add(personalEditor);
|
||||
|
||||
learnsetEditor = new LearnsetEditor(moveNames, learnsetPage, this);
|
||||
learnsetEditor.TopLevel = false;
|
||||
learnsetEditor.Show();
|
||||
learnsetPage.Controls.Add(learnsetEditor);
|
||||
|
||||
evoEditor = new EvolutionsEditor(evoPage, this);
|
||||
evoEditor.TopLevel = false;
|
||||
evoEditor.Show();
|
||||
evoPage.Controls.Add(evoEditor);
|
||||
}
|
||||
|
||||
public void TrySyncIndices(ComboBox sender) {
|
||||
if(!syncChangesCheckbox.Checked) {
|
||||
return;
|
||||
}
|
||||
|
||||
Helpers.BackUpDisableHandler();
|
||||
Helpers.DisableHandlers();
|
||||
if (personalEditor.CheckDiscardChanges()) {
|
||||
personalEditor.pokemonNameInputComboBox.SelectedIndex = sender.SelectedIndex;
|
||||
personalEditor.monNumberNumericUpDown.Value = sender.SelectedIndex;
|
||||
personalEditor.ChangeLoadedFile(sender.SelectedIndex);
|
||||
}
|
||||
if (learnsetEditor.CheckDiscardChanges()) {
|
||||
learnsetEditor.pokemonNameInputComboBox.SelectedIndex = sender.SelectedIndex;
|
||||
learnsetEditor.monNumberNumericUpDown.Value = sender.SelectedIndex;
|
||||
learnsetEditor.ChangeLoadedFile(sender.SelectedIndex);
|
||||
}
|
||||
if (evoEditor.CheckDiscardChanges()) {
|
||||
evoEditor.pokemonNameInputComboBox.SelectedIndex = sender.SelectedIndex;
|
||||
evoEditor.monNumberNumericUpDown.Value = sender.SelectedIndex;
|
||||
evoEditor.ChangeLoadedFile(sender.SelectedIndex);
|
||||
}
|
||||
Helpers.RestoreDisableHandler();
|
||||
}
|
||||
|
||||
public void TrySyncIndices(NumericUpDown sender) {
|
||||
if (!syncChangesCheckbox.Checked) {
|
||||
return;
|
||||
}
|
||||
|
||||
Helpers.BackUpDisableHandler();
|
||||
Helpers.DisableHandlers();
|
||||
if (personalEditor.CheckDiscardChanges()) {
|
||||
personalEditor.pokemonNameInputComboBox.SelectedIndex = (int)sender.Value;
|
||||
personalEditor.monNumberNumericUpDown.Value = sender.Value;
|
||||
personalEditor.ChangeLoadedFile((int)sender.Value);
|
||||
}
|
||||
if (learnsetEditor.CheckDiscardChanges()) {
|
||||
learnsetEditor.pokemonNameInputComboBox.SelectedIndex = (int)sender.Value;
|
||||
learnsetEditor.monNumberNumericUpDown.Value = sender.Value;
|
||||
learnsetEditor.ChangeLoadedFile((int)sender.Value);
|
||||
}
|
||||
if (evoEditor.CheckDiscardChanges()) {
|
||||
evoEditor.pokemonNameInputComboBox.SelectedIndex = (int)sender.Value;
|
||||
evoEditor.monNumberNumericUpDown.Value = sender.Value;
|
||||
evoEditor.ChangeLoadedFile((int)sender.Value);
|
||||
}
|
||||
Helpers.RestoreDisableHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DS_Map/PokemonEditor.resx
Normal file
120
DS_Map/PokemonEditor.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
|
|
@ -4,11 +4,11 @@ using System.Runtime.InteropServices;
|
|||
// Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
|
||||
// associate a un assembly.
|
||||
[assembly: AssemblyTitle("DSPRE Reloaded 1.11.1")]
|
||||
[assembly: AssemblyTitle("DSPRE Reloaded 1.12.3")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DSPRE Reloaded 1.11.1")]
|
||||
[assembly: AssemblyProduct("DSPRE Reloaded 1.12.3")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
|
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
// usando l'asterisco '*' come illustrato di seguito:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.11.1")]
|
||||
[assembly: AssemblyFileVersion("1.11.1")]
|
||||
[assembly: AssemblyVersion("1.12.3")]
|
||||
[assembly: AssemblyFileVersion("1.12.3")]
|
||||
|
|
|
|||
27
DS_Map/ROMFiles/HeadbuttEncounter.cs
Normal file
27
DS_Map/ROMFiles/HeadbuttEncounter.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class HeadbuttEncounter {
|
||||
public ushort pokemonID;
|
||||
public byte minLevel;
|
||||
public byte maxLevel;
|
||||
|
||||
public HeadbuttEncounter() {
|
||||
maxLevel = 0;
|
||||
minLevel = 0;
|
||||
pokemonID = 0;
|
||||
}
|
||||
|
||||
public HeadbuttEncounter(BinaryReader br) {
|
||||
this.pokemonID = br.ReadUInt16();
|
||||
this.minLevel = br.ReadByte();
|
||||
this.maxLevel = br.ReadByte();
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
string[] pokemonNames = RomInfo.GetPokemonNames();
|
||||
string pokemon = pokemonNames[pokemonID];
|
||||
return $"{pokemonID,4} {pokemon,10}: {minLevel,3} - {maxLevel,3}";
|
||||
}
|
||||
}
|
||||
}
|
||||
136
DS_Map/ROMFiles/HeadbuttEncounterFile.cs
Normal file
136
DS_Map/ROMFiles/HeadbuttEncounterFile.cs
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
//https://hirotdk.neocities.org/FileSpecs.html#Headbutt
|
||||
public class HeadbuttEncounterFile {
|
||||
public ushort ID;
|
||||
|
||||
//get encounter tables, 12 normal pokemon definitions, 6 special pokemon definitions, 4 bytes per definition
|
||||
const int normalEncountersCount = 12;
|
||||
const int specialEncountersCount = 6;
|
||||
|
||||
public byte normalTreeGroupsCount;
|
||||
public byte specialTreeGroupsCount;
|
||||
public List<HeadbuttEncounter> normalEncounters;
|
||||
public List<HeadbuttEncounter> specialEncounters;
|
||||
public BindingList<HeadbuttTreeGroup> normalTreeGroups;
|
||||
public BindingList<HeadbuttTreeGroup> specialTreeGroups;
|
||||
|
||||
public HeadbuttEncounterFile(ushort id) {
|
||||
this.ID = id;
|
||||
string path = Filesystem.GetHeadbuttPath(id);
|
||||
parse_file(path);
|
||||
}
|
||||
|
||||
public HeadbuttEncounterFile(string path) {
|
||||
parse_file(path);
|
||||
}
|
||||
|
||||
public void parse_file(string path) {
|
||||
FileStream fs = new FileStream(path, FileMode.Open);
|
||||
using (BinaryReader br = new BinaryReader(fs)) {
|
||||
//get the number of tree group definitions
|
||||
normalTreeGroupsCount = br.ReadByte();
|
||||
br.ReadByte(); //padding
|
||||
specialTreeGroupsCount = br.ReadByte();
|
||||
br.ReadByte(); //padding
|
||||
|
||||
normalEncounters = new List<HeadbuttEncounter>();
|
||||
specialEncounters = new List<HeadbuttEncounter>();
|
||||
|
||||
normalTreeGroups = new BindingList<HeadbuttTreeGroup>();
|
||||
specialTreeGroups = new BindingList<HeadbuttTreeGroup>();
|
||||
|
||||
//if there are no trees defined in either section, there are no encounters or trees defined
|
||||
bool hasTrees = normalTreeGroupsCount > 0 || specialTreeGroupsCount > 0;
|
||||
if (!hasTrees) {
|
||||
for (int i = 0; i < normalEncountersCount; i++) {
|
||||
normalEncounters.Add(new HeadbuttEncounter());
|
||||
}
|
||||
|
||||
for (int i = 0; i < specialEncountersCount; i++) {
|
||||
specialEncounters.Add(new HeadbuttEncounter());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < normalEncountersCount; i++) {
|
||||
normalEncounters.Add(new HeadbuttEncounter(br));
|
||||
}
|
||||
|
||||
for (int i = 0; i < specialEncountersCount; i++) {
|
||||
specialEncounters.Add(new HeadbuttEncounter(br));
|
||||
}
|
||||
|
||||
//tree groups have 6 sets of xy global coordinates x treeGroupsCount
|
||||
//coordinates need to be converted to matrix and local coordinates to be useful
|
||||
for (int i = 0; i < normalTreeGroupsCount; i++) {
|
||||
normalTreeGroups.Add(new HeadbuttTreeGroup(br));
|
||||
}
|
||||
|
||||
for (int i = 0; i < specialTreeGroupsCount; i++) {
|
||||
specialTreeGroups.Add(new HeadbuttTreeGroup(br));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] ToByteArray() {
|
||||
MemoryStream newData = new MemoryStream();
|
||||
using (BinaryWriter writer = new BinaryWriter(newData)) {
|
||||
writer.Write((byte)normalTreeGroups.Count);
|
||||
writer.Write((byte)0);
|
||||
writer.Write((byte)specialTreeGroups.Count);
|
||||
writer.Write((byte)0);
|
||||
|
||||
foreach (HeadbuttEncounter encounter in normalEncounters) {
|
||||
writer.Write((UInt16)encounter.pokemonID);
|
||||
writer.Write((byte)encounter.minLevel);
|
||||
writer.Write((byte)encounter.maxLevel);
|
||||
}
|
||||
|
||||
foreach (HeadbuttEncounter encounter in specialEncounters) {
|
||||
writer.Write((UInt16)encounter.pokemonID);
|
||||
writer.Write((byte)encounter.minLevel);
|
||||
writer.Write((byte)encounter.maxLevel);
|
||||
}
|
||||
|
||||
foreach (var treeGroup in normalTreeGroups) {
|
||||
foreach (var tree in treeGroup.trees) {
|
||||
writer.Write((UInt16)tree.globalX);
|
||||
writer.Write((UInt16)tree.globalY);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var treeGroup in specialTreeGroups) {
|
||||
foreach (var tree in treeGroup.trees) {
|
||||
writer.Write((UInt16)tree.globalX);
|
||||
writer.Write((UInt16)tree.globalY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newData.ToArray();
|
||||
}
|
||||
|
||||
public bool SaveToFile() {
|
||||
string path = Filesystem.GetHeadbuttPath(ID);
|
||||
return SaveToFile(path);
|
||||
}
|
||||
|
||||
public bool SaveToFile(int id) {
|
||||
string path = Filesystem.GetHeadbuttPath(id);
|
||||
return SaveToFile(path);
|
||||
}
|
||||
|
||||
|
||||
public bool SaveToFile(string path, bool showSuccessMessage = true) {
|
||||
byte[] romFileToByteArray = ToByteArray();
|
||||
File.WriteAllBytes(path, romFileToByteArray);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
DS_Map/ROMFiles/HeadbuttEncounterMap.cs
Normal file
36
DS_Map/ROMFiles/HeadbuttEncounterMap.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
namespace DSPRE.ROMFiles {
|
||||
//This class is in case a MapHeader uses the same MapFile more than once
|
||||
//ToString is the matrix x,y and mapID
|
||||
class HeadbuttEncounterMap {
|
||||
public readonly int mapID;
|
||||
public readonly int x;
|
||||
public readonly int y;
|
||||
|
||||
public HeadbuttEncounterMap(int mapID, int x, int y) {
|
||||
this.mapID = mapID;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return $"{mapID} - {x},{y}";
|
||||
}
|
||||
|
||||
public override bool Equals(object obj) {
|
||||
// If the passed object is null
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj is HeadbuttEncounterMap) {
|
||||
return this.ToString() == ((HeadbuttEncounterMap)obj).ToString();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return this.x.GetHashCode() ^ y.GetHashCode() ^ mapID.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
103
DS_Map/ROMFiles/HeadbuttTree.cs
Normal file
103
DS_Map/ROMFiles/HeadbuttTree.cs
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class HeadbuttTree {
|
||||
public bool picked = false;
|
||||
|
||||
private ushort _globalX;
|
||||
private ushort _globalY;
|
||||
private ushort _matrixX;
|
||||
private ushort _matrixY;
|
||||
private ushort _mapX;
|
||||
private ushort _mapY;
|
||||
|
||||
public bool unused { get { return globalX == ushort.MaxValue && globalY == ushort.MaxValue; } }
|
||||
|
||||
public enum Types {
|
||||
Normal,
|
||||
Special,
|
||||
}
|
||||
|
||||
public HeadbuttTree(BinaryReader br) {
|
||||
this.globalX = br.ReadUInt16();
|
||||
this.globalY = br.ReadUInt16();
|
||||
}
|
||||
|
||||
public HeadbuttTree(ushort globalX = ushort.MaxValue, ushort globalY = ushort.MaxValue) {
|
||||
this.globalX = globalX;
|
||||
this.globalY = globalY;
|
||||
}
|
||||
|
||||
public HeadbuttTree(HeadbuttTree original) {
|
||||
this.globalX = original.globalX;
|
||||
this.globalY = original.globalY;
|
||||
}
|
||||
|
||||
public ushort globalX {
|
||||
get { return _globalX; }
|
||||
set {
|
||||
_globalX = value;
|
||||
_matrixX = (ushort)(_globalX / MapFile.mapSize);
|
||||
_mapX = (ushort)(_globalX % MapFile.mapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public ushort globalY {
|
||||
get { return _globalY; }
|
||||
set {
|
||||
_globalY = value;
|
||||
_matrixY = (ushort)(_globalY / MapFile.mapSize);
|
||||
_mapY = (ushort)(_globalY % MapFile.mapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public ushort matrixX {
|
||||
get {
|
||||
return _matrixX;
|
||||
}
|
||||
set {
|
||||
_matrixX = value;
|
||||
_globalX = (ushort)(_matrixX * MapFile.mapSize + _mapX);
|
||||
_mapX = (ushort)(_globalX % MapFile.mapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public ushort matrixY {
|
||||
get {
|
||||
return _matrixY;
|
||||
}
|
||||
set {
|
||||
_matrixY = value;
|
||||
_globalY = (ushort)(_matrixY * MapFile.mapSize + _mapY);
|
||||
_mapY = (ushort)(_globalY % MapFile.mapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public ushort mapX {
|
||||
get {
|
||||
return _mapX;
|
||||
}
|
||||
set {
|
||||
_mapX = value;
|
||||
_globalX = (ushort)(_matrixX * MapFile.mapSize + _mapX);
|
||||
_matrixX = (ushort)(_globalX / MapFile.mapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public ushort mapY {
|
||||
get {
|
||||
return _mapY;
|
||||
}
|
||||
set {
|
||||
_mapY = value;
|
||||
_globalY = (ushort)(_matrixY * MapFile.mapSize + _mapY);
|
||||
_matrixY = (ushort)(_globalY / MapFile.mapSize);
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
string suffix = unused ? "unused" : $"globalX: {globalX}, globalY: {globalY}";
|
||||
return $"{nameof(HeadbuttTree)} - {suffix}";
|
||||
}
|
||||
}
|
||||
}
|
||||
32
DS_Map/ROMFiles/HeadbuttTreeGroup.cs
Normal file
32
DS_Map/ROMFiles/HeadbuttTreeGroup.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class HeadbuttTreeGroup {
|
||||
const int treeCount = 6; //number of trees in each tree group
|
||||
|
||||
public List<HeadbuttTree> trees = new List<HeadbuttTree>();
|
||||
|
||||
public HeadbuttTreeGroup(BinaryReader br) {
|
||||
for (int j = 0; j < treeCount; j++) {
|
||||
trees.Add(new HeadbuttTree(br));
|
||||
}
|
||||
}
|
||||
|
||||
public HeadbuttTreeGroup() {
|
||||
for (int j = 0; j < treeCount; j++) {
|
||||
trees.Add(new HeadbuttTree());
|
||||
}
|
||||
}
|
||||
|
||||
public HeadbuttTreeGroup(HeadbuttTreeGroup original) {
|
||||
foreach (HeadbuttTree headbuttTree in original.trees) {
|
||||
trees.Add(new HeadbuttTree(headbuttTree));
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return $"{nameof(HeadbuttTreeGroup)}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using DSPRE.ROMFiles;
|
||||
using static DSPRE.RomInfo;
|
||||
|
|
@ -10,6 +11,31 @@ namespace DSPRE {
|
|||
|
||||
public readonly UniqueList<(byte level, ushort move)> list;
|
||||
|
||||
public ushort[] GetLearnsetAtLevel(int atLevel) {
|
||||
ushort[] learnset = new ushort[4] {0, 0 , 0, 0};
|
||||
foreach ((ushort level, ushort move) in list)
|
||||
{
|
||||
if (level <= atLevel)
|
||||
{
|
||||
if (learnset[0] == 0) {
|
||||
learnset[0] = move;
|
||||
} else if (learnset[1] == 0) {
|
||||
learnset[1] = move;
|
||||
} else if (learnset[2] == 0) {
|
||||
learnset[2] = move;
|
||||
} else if (learnset[3] == 0) {
|
||||
learnset[3] = move;
|
||||
} else {
|
||||
learnset[0] = learnset[1];
|
||||
learnset[1] = learnset[2];
|
||||
learnset[2] = learnset[3];
|
||||
learnset[3] = move;
|
||||
}
|
||||
}
|
||||
}
|
||||
return learnset;
|
||||
}
|
||||
|
||||
public LearnsetData(Stream stream) {
|
||||
int numEntries = (int)(stream.Length / sizeof(ushort));
|
||||
list = new UniqueList<(byte level, ushort move)>(numEntries - 1);
|
||||
|
|
|
|||
139
DS_Map/ROMFiles/LevelScriptFile.cs
Normal file
139
DS_Map/ROMFiles/LevelScriptFile.cs
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class LevelScriptFile {
|
||||
public int ID;
|
||||
public BindingList<LevelScriptTrigger> bufferSet = new BindingList<LevelScriptTrigger>();
|
||||
|
||||
public LevelScriptFile() { }
|
||||
|
||||
public LevelScriptFile(int id) {
|
||||
this.ID = id;
|
||||
string path1 = Filesystem.scripts;
|
||||
string path = Path.Combine(path1, this.ID.ToString("D4"));
|
||||
parse_file(path);
|
||||
}
|
||||
|
||||
public void parse_file(string path) {
|
||||
FileStream fs = new FileStream(path, FileMode.Open);
|
||||
using (BinaryReader br = new BinaryReader(fs)) {
|
||||
bool hasConditionalStructure = false;
|
||||
|
||||
//conditionalStructureOffset is used to ensure the structure of the file is correct
|
||||
int conditionalStructureOffset = -1;
|
||||
|
||||
while (true) {
|
||||
//first byte is the script type
|
||||
//if not a valid script type, break loop
|
||||
byte triggerType = br.ReadByte();
|
||||
if (!LevelScriptTrigger.IsValidTriggerType(triggerType)) break;
|
||||
|
||||
//subtract triggerType length from conditionalStructureOffset
|
||||
if (hasConditionalStructure) conditionalStructureOffset -= sizeof(byte);
|
||||
|
||||
//if trigger type is a variable value, that doesn't immediately mean we're processing that trigger
|
||||
//the trigger data is processed last if it is there
|
||||
if (triggerType == LevelScriptTrigger.VARIABLEVALUE) {
|
||||
hasConditionalStructure = true;
|
||||
conditionalStructureOffset = (int)br.ReadUInt32();
|
||||
continue;
|
||||
}
|
||||
|
||||
//map screen load trigger doesn't have a value or variable
|
||||
uint scriptToTrigger = br.ReadUInt32();
|
||||
bufferSet.Add(new MapScreenLoadTrigger(triggerType, (int)scriptToTrigger));
|
||||
|
||||
//subtract scriptToTrigger length from conditionalStructureOffset
|
||||
if (hasConditionalStructure) conditionalStructureOffset -= sizeof(UInt32);
|
||||
}
|
||||
|
||||
//the earliest position a trigger can be
|
||||
const int SMALLEST_TRIGGER_SIZE = 5;
|
||||
|
||||
//if triggerType is invalid
|
||||
//and next uint16 == 0
|
||||
//and the file stream length is shorter than the earliest position a trigger can be
|
||||
if (br.BaseStream.Position == 1 && br.ReadUInt16() == 0 && fs.Length < SMALLEST_TRIGGER_SIZE) {
|
||||
return;
|
||||
throw new InvalidDataException("This level script does nothing."); // "Interesting..."
|
||||
}
|
||||
|
||||
//br.BaseStream.Position == 3
|
||||
//triggerType is valid,
|
||||
//stream position is earlier than the first possible trigger, or
|
||||
//there is no start script condition specified
|
||||
if (br.BaseStream.Position < SMALLEST_TRIGGER_SIZE) {
|
||||
throw new InvalidDataException("Parser failure: The input file you attempted to load is either malformed or not a Level Script file.");
|
||||
}
|
||||
|
||||
//there are no instances of a variable value trigger
|
||||
if (!hasConditionalStructure) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if there's a variable value trigger but the offset is incorrect, the file is corrupt
|
||||
if (conditionalStructureOffset != 1) {
|
||||
throw new InvalidDataException($"Field error: The Level Script file you attempted to load is broken. {conditionalStructureOffset}");
|
||||
}
|
||||
|
||||
//get the variable value trigger parts
|
||||
while (true) {
|
||||
//there are no variables below 1
|
||||
int variableID = br.ReadUInt16();
|
||||
if (variableID <= 0) break;
|
||||
|
||||
int varExpectedValue = br.ReadUInt16();
|
||||
int scriptToTrigger = br.ReadUInt16();
|
||||
bufferSet.Add(new VariableValueTrigger(scriptToTrigger, variableID, varExpectedValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public long write_file(string path, bool word_alignment_padding = false) {
|
||||
FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
|
||||
using (BinaryWriter bw = new BinaryWriter(fs)) {
|
||||
HashSet<MapScreenLoadTrigger> mapScreenLoadTriggers = new HashSet<MapScreenLoadTrigger>();
|
||||
HashSet<VariableValueTrigger> variableValueTriggers = new HashSet<VariableValueTrigger>();
|
||||
|
||||
foreach (LevelScriptTrigger item in bufferSet) {
|
||||
if (item is VariableValueTrigger variableValueTrigger) {
|
||||
variableValueTriggers.Add(variableValueTrigger);
|
||||
}
|
||||
else if (item is MapScreenLoadTrigger mapScreenLoadTrigger) {
|
||||
mapScreenLoadTriggers.Add(mapScreenLoadTrigger);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (MapScreenLoadTrigger item in mapScreenLoadTriggers) {
|
||||
bw.Write((byte)item.triggerType);
|
||||
bw.Write((UInt32)item.scriptTriggered);
|
||||
}
|
||||
|
||||
if (variableValueTriggers.Count > 0) {
|
||||
bw.Write((byte)LevelScriptTrigger.VARIABLEVALUE);
|
||||
bw.Write((UInt32)1);
|
||||
bw.Write((byte)0);
|
||||
foreach (VariableValueTrigger item in variableValueTriggers) {
|
||||
bw.Write((UInt16)item.variableToWatch);
|
||||
bw.Write((UInt16)item.expectedValue);
|
||||
bw.Write((UInt16)item.scriptTriggered);
|
||||
}
|
||||
}
|
||||
|
||||
bw.Write((UInt16)0);
|
||||
|
||||
if (word_alignment_padding) {
|
||||
long missing_bytes = bw.BaseStream.Position % 4;
|
||||
for (int i = 0; i < 4 - missing_bytes; i++) {
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
}
|
||||
|
||||
return bw.BaseStream.Position;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
DS_Map/ROMFiles/LevelScriptTrigger.cs
Normal file
31
DS_Map/ROMFiles/LevelScriptTrigger.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class LevelScriptTrigger {
|
||||
public const int VARIABLEVALUE = 1;
|
||||
public const int MAPCHANGE = 2;
|
||||
public const int SCREENRESET = 3;
|
||||
public const int LOADGAME = 4;
|
||||
|
||||
private static int[] _triggerTypes;
|
||||
public int triggerType { get; set; }
|
||||
public int scriptTriggered { get; set; }
|
||||
|
||||
public LevelScriptTrigger(int triggerType, int scriptTriggered) {
|
||||
this.triggerType = triggerType;
|
||||
this.scriptTriggered = scriptTriggered;
|
||||
}
|
||||
|
||||
public static bool IsValidTriggerType(byte triggerType) {
|
||||
if (_triggerTypes == null) {
|
||||
_triggerTypes = new[] { VARIABLEVALUE, MAPCHANGE, SCREENRESET, LOADGAME };
|
||||
}
|
||||
|
||||
return Array.IndexOf(_triggerTypes, triggerType) != -1;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return "Starts Script " + scriptTriggered;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -354,6 +354,24 @@ namespace DSPRE.ROMFiles {
|
|||
public void LoadModelData(string dir) {
|
||||
LoadModelDataFromID((int)modelID, dir);
|
||||
}
|
||||
|
||||
public void LoadModelData(bool interior) {
|
||||
string modelPath = Filesystem.GetBuildingModelPath(interior, (int)modelID);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(modelPath) || !File.Exists(modelPath)) {
|
||||
MessageBox.Show("Building " + modelID + " could not be found in\n" + '"' + Path.GetDirectoryName(modelPath) + '"', "Building not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
using (Stream fs = new FileStream(modelPath, FileMode.Open)) {
|
||||
this.NSBMDFile = NSBMDLoader.LoadNSBMD(fs);
|
||||
}
|
||||
} catch (FileNotFoundException) {
|
||||
MessageBox.Show("Building " + modelID + " could not be found in\n" + '"' + Path.GetDirectoryName(modelPath) + '"', "Building not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadModelDataFromID(int modelID, string bmDir) {
|
||||
string modelPath = bmDir + "\\" + modelID.ToString("D4");
|
||||
|
||||
|
|
|
|||
|
|
@ -128,37 +128,84 @@ namespace DSPRE.ROMFiles {
|
|||
#endregion Fields
|
||||
|
||||
#region Methods (1)
|
||||
public static MapHeader LoadFromByteArray(byte[] headerData, ushort headerNumber, GameFamilies gameFamily = GameFamilies.NULL) {
|
||||
public static string BuildName(int headerID, string name) {
|
||||
return headerID.ToString("D3") + MapHeader.nameSeparator + name;
|
||||
}
|
||||
|
||||
public static MapHeader LoadFromByteArray(byte[] headerData, ushort headerNumber, RomInfo.GameFamilies gameFamily = RomInfo.GameFamilies.NULL) {
|
||||
/* Encapsulate header data into the class appropriate for the gameVersion */
|
||||
if (headerData.Length < MapHeader.length) {
|
||||
MessageBox.Show("File of header " + headerNumber + " is too small and can't store header data.", "Header file too small", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (gameFamily == GameFamilies.NULL) {
|
||||
if (gameFamily == RomInfo.GameFamilies.NULL) {
|
||||
gameFamily = RomInfo.gameFamily;
|
||||
}
|
||||
|
||||
switch (gameFamily) {
|
||||
case GameFamilies.DP:
|
||||
case RomInfo.GameFamilies.DP:
|
||||
return new HeaderDP(headerNumber, new MemoryStream(headerData));
|
||||
case GameFamilies.Plat:
|
||||
case RomInfo.GameFamilies.Plat:
|
||||
return new HeaderPt(headerNumber, new MemoryStream(headerData));
|
||||
default:
|
||||
return new HeaderHGSS(headerNumber, new MemoryStream(headerData));
|
||||
}
|
||||
}
|
||||
public static MapHeader LoadFromFile(string filename, ushort headerNumber, long offsetInFile, GameFamilies gameFamily = GameFamilies.NULL) {
|
||||
|
||||
public static MapHeader LoadFromFile(string filename, ushort headerNumber, long offsetInFile, RomInfo.GameFamilies gameFamily = RomInfo.GameFamilies.NULL) {
|
||||
/* Calculate header offset and load data */
|
||||
byte[] headerData = DSUtils.ReadFromFile(filename, offsetInFile, MapHeader.length);
|
||||
return LoadFromByteArray(headerData, headerNumber, gameFamily);
|
||||
}
|
||||
public static MapHeader LoadFromARM9(ushort headerNumber, GameFamilies gameFamily = GameFamilies.NULL) {
|
||||
|
||||
public static MapHeader LoadFromARM9(ushort headerNumber, RomInfo.GameFamilies gameFamily = RomInfo.GameFamilies.NULL) {
|
||||
long headerOffset = RomInfo.headerTableOffset + MapHeader.length * headerNumber;
|
||||
return LoadFromFile(RomInfo.arm9Path, headerNumber, headerOffset, gameFamily);
|
||||
}
|
||||
|
||||
|
||||
public static MapHeader GetMapHeader(ushort headerNumber) {
|
||||
MapHeader mapHeader;
|
||||
|
||||
//Dynamic headers patch unsupported in DP
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP)) {
|
||||
return MapHeader.LoadFromARM9(headerNumber);
|
||||
}
|
||||
|
||||
/* Check if dynamic headers patch has been applied, and load header from arm9 or a/0/5/0 accordingly */
|
||||
if (PatchToolboxDialog.flag_DynamicHeadersPatchApplied) {
|
||||
string path = Filesystem.GetDynamicHeaderPath(headerNumber);
|
||||
mapHeader = MapHeader.LoadFromFile(path, headerNumber, 0);
|
||||
} else {
|
||||
mapHeader = MapHeader.LoadFromARM9(headerNumber);
|
||||
}
|
||||
|
||||
return mapHeader;
|
||||
}
|
||||
|
||||
public static int GetHeaderCount() {
|
||||
int headerCount;
|
||||
if (PatchToolboxDialog.flag_DynamicHeadersPatchApplied) {
|
||||
headerCount = Filesystem.GetDynamicHeadersCount();
|
||||
} else {
|
||||
headerCount = RomInfo.GetHeaderCount();
|
||||
}
|
||||
|
||||
return headerCount;
|
||||
}
|
||||
|
||||
public void SaveFile() {
|
||||
/* Check if dynamic headers patch has been applied, and save header to arm9 or a/0/5/0 accordingly */
|
||||
if (PatchToolboxDialog.flag_DynamicHeadersPatchApplied) {
|
||||
string path = Filesystem.GetDynamicHeaderPath(ID);
|
||||
DSUtils.WriteToFile(path, this.ToByteArray(), 0, 0, fmode: FileMode.Create);
|
||||
} else {
|
||||
uint headerOffset = (uint)(RomInfo.headerTableOffset + MapHeader.length * this.ID);
|
||||
ARM9.WriteBytes(this.ToByteArray(), headerOffset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
|
|
|||
35
DS_Map/ROMFiles/MapScreenLoadTrigger.cs
Normal file
35
DS_Map/ROMFiles/MapScreenLoadTrigger.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
namespace DSPRE.ROMFiles {
|
||||
public class MapScreenLoadTrigger : LevelScriptTrigger {
|
||||
public MapScreenLoadTrigger(int type, int scriptTriggered) : base(type, scriptTriggered) { }
|
||||
|
||||
public override string ToString() {
|
||||
switch (triggerType) {
|
||||
case LevelScriptTrigger.MAPCHANGE:
|
||||
return base.ToString() + " upon entering the LS map.";
|
||||
case LevelScriptTrigger.SCREENRESET:
|
||||
return base.ToString() + " when a fadescreen happens in the LS map.";
|
||||
case LevelScriptTrigger.LOADGAME:
|
||||
return base.ToString() + " when the game resumes in the LS map.";
|
||||
default:
|
||||
return base.ToString() + " under unknown circumstances.";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Equals(object obj) {
|
||||
// If the passed object is null
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj is MapScreenLoadTrigger) {
|
||||
return this.ToString() == ((MapScreenLoadTrigger)obj).ToString();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return this.triggerType.GetHashCode() ^ scriptTriggered.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
145
DS_Map/ROMFiles/MoveFile.cs
Normal file
145
DS_Map/ROMFiles/MoveFile.cs
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
|
||||
public enum MoveTypes : short {
|
||||
Normal,
|
||||
Fighting,
|
||||
Flying,
|
||||
Poison,
|
||||
Ground,
|
||||
Rock,
|
||||
Bug,
|
||||
Ghost,
|
||||
Steel,
|
||||
Unknown,
|
||||
Fire,
|
||||
Water,
|
||||
Grass,
|
||||
Electric,
|
||||
Psychic,
|
||||
Ice,
|
||||
Dragon,
|
||||
Dark
|
||||
}
|
||||
|
||||
public enum MoveCategory {
|
||||
Physical,
|
||||
Special,
|
||||
Status
|
||||
}
|
||||
|
||||
public enum ContestCategories {
|
||||
One = 1,
|
||||
Two = 2,
|
||||
Three = 3,
|
||||
Four = 4,
|
||||
Five = 5,
|
||||
Six = 6,
|
||||
Seven = 7,
|
||||
Eight = 8,
|
||||
Nine = 9,
|
||||
Ten = 10,
|
||||
Eleven = 11,
|
||||
Twelve = 12
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum MoveTargets {
|
||||
OneOpponent = 1,
|
||||
Automatic = 2,
|
||||
Random = 4,
|
||||
BothOpponents = 16,
|
||||
BothOpponentsAndAlly = 8,
|
||||
User = 32,
|
||||
UsersSideOfField = 64,
|
||||
EntireField = 128,
|
||||
OpponentsSideOfField = 256,
|
||||
AutomaticWithAlly = 512,
|
||||
UserOrAlly = 1024,
|
||||
OneOpponentFailsIfTargetFaints = 2048
|
||||
}
|
||||
|
||||
|
||||
public struct MoveData {
|
||||
public ushort Effect; // u16
|
||||
public byte Category; // u8
|
||||
public byte Power; // u8
|
||||
|
||||
public byte Type; // u8
|
||||
public byte Accuracy; // u8
|
||||
public byte PP; // u8
|
||||
public byte EffectChance; // u8
|
||||
|
||||
public ushort Target; // u16
|
||||
public sbyte Priority; // s8
|
||||
public bool[] Flags; // u8
|
||||
|
||||
public byte ContestEffect; // u8
|
||||
public byte ContestType; // u8
|
||||
}
|
||||
|
||||
public class MoveFile : RomFile{
|
||||
|
||||
public MoveData moveData;
|
||||
|
||||
public MoveFile(Stream stream) {
|
||||
moveData = new MoveData();
|
||||
using (BinaryReader reader = new BinaryReader(stream)) {
|
||||
moveData.Effect = reader.ReadUInt16();
|
||||
moveData.Category = reader.ReadByte();
|
||||
moveData.Power = reader.ReadByte();
|
||||
moveData.Type = reader.ReadByte();
|
||||
moveData.Accuracy = reader.ReadByte();
|
||||
moveData.PP = reader.ReadByte();
|
||||
moveData.EffectChance = reader.ReadByte();
|
||||
moveData.Target = reader.ReadUInt16();
|
||||
moveData.Priority = reader.ReadSByte();
|
||||
|
||||
// Reading flags
|
||||
byte flagsByte = reader.ReadByte();
|
||||
moveData.Flags = new bool[8];
|
||||
for (int i = 0; i < 8; i++) {
|
||||
moveData.Flags[i] = (flagsByte & (1 << i)) != 0;
|
||||
}
|
||||
|
||||
moveData.ContestEffect = reader.ReadByte();
|
||||
moveData.ContestType = reader.ReadByte();
|
||||
}
|
||||
}
|
||||
|
||||
public override byte[] ToByteArray() {
|
||||
using (MemoryStream stream = new MemoryStream()) {
|
||||
using (BinaryWriter writer = new BinaryWriter(stream)) {
|
||||
writer.Write(moveData.Effect);
|
||||
writer.Write(moveData.Category);
|
||||
writer.Write(moveData.Power);
|
||||
writer.Write(moveData.Type);
|
||||
writer.Write(moveData.Accuracy);
|
||||
writer.Write(moveData.PP);
|
||||
writer.Write(moveData.EffectChance);
|
||||
writer.Write(moveData.Target);
|
||||
writer.Write(moveData.Priority);
|
||||
|
||||
// Writing flags
|
||||
byte flagsByte = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (moveData.Flags[i])
|
||||
flagsByte |= (byte)(1 << i);
|
||||
}
|
||||
writer.Write(flagsByte);
|
||||
|
||||
writer.Write(moveData.ContestEffect);
|
||||
writer.Write(moveData.ContestType);
|
||||
}
|
||||
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
35
DS_Map/ROMFiles/SafariZoneEncounter.cs
Normal file
35
DS_Map/ROMFiles/SafariZoneEncounter.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles
|
||||
{
|
||||
public class SafariZoneEncounter
|
||||
{
|
||||
public ushort pokemonID;
|
||||
public byte level;
|
||||
public SafariZoneEncounter() {
|
||||
level = 1;
|
||||
pokemonID = 0;
|
||||
}
|
||||
|
||||
public SafariZoneEncounter(BinaryReader br) {
|
||||
readEncounter(br);
|
||||
}
|
||||
|
||||
public void readEncounter(BinaryReader br) {
|
||||
this.pokemonID = br.ReadUInt16();
|
||||
this.level = br.ReadByte();
|
||||
}
|
||||
|
||||
public void writeEncounter(BinaryWriter bw) {
|
||||
bw.Write((UInt16)pokemonID);
|
||||
bw.Write((byte)level);
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
string[] pokemonNames = RomInfo.GetPokemonNames();
|
||||
string pokemon = pokemonNames[pokemonID];
|
||||
return $"{pokemonID,4} {pokemon,10}: {level,3}";
|
||||
}
|
||||
}
|
||||
}
|
||||
101
DS_Map/ROMFiles/SafariZoneEncounterFile.cs
Normal file
101
DS_Map/ROMFiles/SafariZoneEncounterFile.cs
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class SafariZoneEncounterFile {
|
||||
public static Dictionary<int, string> Names = new Dictionary<int, string>() {
|
||||
{0, "Plains"},
|
||||
{1, "Meadow"},
|
||||
{2, "Savannah"},
|
||||
{3, "Peak"},
|
||||
{4, "Rocky Beach"},
|
||||
{5, "Wetland"},
|
||||
{6, "Forest"},
|
||||
{7, "Swamp"},
|
||||
{8, "Marshland"},
|
||||
{9, "Wasteland"},
|
||||
{10, "Mountain"},
|
||||
{11, "Desert"},
|
||||
};
|
||||
|
||||
public int ID;
|
||||
|
||||
public SafariZoneEncounterGroup grassEncounterGroup = new SafariZoneEncounterGroup();
|
||||
public SafariZoneEncounterGroup surfEncounterGroup = new SafariZoneEncounterGroup();
|
||||
public SafariZoneEncounterGroup oldRodEncounterGroup = new SafariZoneEncounterGroup();
|
||||
public SafariZoneEncounterGroup goodRodEncounterGroup = new SafariZoneEncounterGroup();
|
||||
public SafariZoneEncounterGroup superRodEncounterGroup = new SafariZoneEncounterGroup();
|
||||
|
||||
public SafariZoneEncounterFile(int id) {
|
||||
this.ID = id;
|
||||
string path = Filesystem.GetSafariZonePath(id);
|
||||
parse_file(path);
|
||||
}
|
||||
|
||||
public SafariZoneEncounterFile(string path) {
|
||||
parse_file(path);
|
||||
}
|
||||
|
||||
public void parse_file(string path) {
|
||||
FileStream fs = new FileStream(path, FileMode.Open);
|
||||
using (BinaryReader br = new BinaryReader(fs)) {
|
||||
if (br.BaseStream.Length < 5) return;
|
||||
//#1 Section - Object Arrangement Allocation
|
||||
grassEncounterGroup.readObjectSlots(br);
|
||||
surfEncounterGroup.readObjectSlots(br);
|
||||
oldRodEncounterGroup.readObjectSlots(br);
|
||||
goodRodEncounterGroup.readObjectSlots(br);
|
||||
superRodEncounterGroup.readObjectSlots(br);
|
||||
|
||||
br.ReadByte();
|
||||
br.ReadByte();
|
||||
br.ReadByte();
|
||||
|
||||
grassEncounterGroup.readGroup(br);
|
||||
surfEncounterGroup.readGroup(br);
|
||||
oldRodEncounterGroup.readGroup(br);
|
||||
goodRodEncounterGroup.readGroup(br);
|
||||
superRodEncounterGroup.readGroup(br);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] ToByteArray() {
|
||||
MemoryStream newData = new MemoryStream();
|
||||
using (BinaryWriter bw = new BinaryWriter(newData)) {
|
||||
grassEncounterGroup.writeObjectSlots(bw);
|
||||
surfEncounterGroup.writeObjectSlots(bw);
|
||||
oldRodEncounterGroup.writeObjectSlots(bw);
|
||||
goodRodEncounterGroup.writeObjectSlots(bw);
|
||||
superRodEncounterGroup.writeObjectSlots(bw);
|
||||
|
||||
bw.Write((byte)0);
|
||||
bw.Write((byte)0);
|
||||
bw.Write((byte)0);
|
||||
|
||||
grassEncounterGroup.writeGroup(bw);
|
||||
surfEncounterGroup.writeGroup(bw);
|
||||
oldRodEncounterGroup.writeGroup(bw);
|
||||
goodRodEncounterGroup.writeGroup(bw);
|
||||
superRodEncounterGroup.writeGroup(bw);
|
||||
}
|
||||
return newData.ToArray();
|
||||
}
|
||||
|
||||
public bool SaveToFile() {
|
||||
string path = Filesystem.GetSafariZonePath(ID);
|
||||
return SaveToFile(path);
|
||||
}
|
||||
|
||||
public bool SaveToFile(int id) {
|
||||
string path = Filesystem.GetSafariZonePath(id);
|
||||
return SaveToFile(path);
|
||||
}
|
||||
|
||||
|
||||
public bool SaveToFile(string path, bool showSuccessMessage = true) {
|
||||
byte[] romFileToByteArray = ToByteArray();
|
||||
File.WriteAllBytes(path, romFileToByteArray);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
108
DS_Map/ROMFiles/SafariZoneEncounterGroup.cs
Normal file
108
DS_Map/ROMFiles/SafariZoneEncounterGroup.cs
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles
|
||||
{
|
||||
public class SafariZoneEncounterGroup
|
||||
{
|
||||
private const int EncounterSlots = 10;
|
||||
|
||||
public byte ObjectSlots;
|
||||
public BindingList<SafariZoneEncounter> MorningEncounters = new BindingList<SafariZoneEncounter>();
|
||||
public BindingList<SafariZoneEncounter> DayEncounters = new BindingList<SafariZoneEncounter>();
|
||||
public BindingList<SafariZoneEncounter> NightEncounters = new BindingList<SafariZoneEncounter>();
|
||||
public BindingList<SafariZoneEncounter> MorningEncountersObject = new BindingList<SafariZoneEncounter>();
|
||||
public BindingList<SafariZoneEncounter> DayEncountersObject = new BindingList<SafariZoneEncounter>();
|
||||
public BindingList<SafariZoneEncounter> NightEncountersObject = new BindingList<SafariZoneEncounter>();
|
||||
public BindingList<SafariZoneObjectRequirement> ObjectRequirements = new BindingList<SafariZoneObjectRequirement>();
|
||||
public BindingList<SafariZoneObjectRequirement> OptionalObjectRequirements = new BindingList<SafariZoneObjectRequirement>();
|
||||
|
||||
public void readObjectSlots(BinaryReader br) {
|
||||
ObjectSlots = br.ReadByte();
|
||||
}
|
||||
|
||||
public void writeObjectSlots(BinaryWriter bw) {
|
||||
bw.Write((byte)ObjectSlots);
|
||||
}
|
||||
|
||||
public void readGroup(BinaryReader br) {
|
||||
//#2 Section - Tall Grass Encounters
|
||||
for (int i = 0; i < EncounterSlots; i++) {
|
||||
MorningEncounters.Add(new SafariZoneEncounter(br));
|
||||
br.ReadByte();
|
||||
}
|
||||
|
||||
for (int i = 0; i < EncounterSlots; i++) {
|
||||
DayEncounters.Add(new SafariZoneEncounter(br));
|
||||
br.ReadByte();
|
||||
}
|
||||
|
||||
for (int i = 0; i < EncounterSlots; i++) {
|
||||
NightEncounters.Add(new SafariZoneEncounter(br));
|
||||
br.ReadByte();
|
||||
}
|
||||
|
||||
//#3 Section - Tall Grass Encounters (Object Arrangement)
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
MorningEncountersObject.Add(new SafariZoneEncounter(br));
|
||||
br.ReadByte();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
DayEncountersObject.Add(new SafariZoneEncounter(br));
|
||||
br.ReadByte();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
NightEncountersObject.Add(new SafariZoneEncounter(br));
|
||||
br.ReadByte();
|
||||
}
|
||||
|
||||
//#4 Section - Object Arrangement Requirements (Tall Grass)
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
ObjectRequirements.Add(new SafariZoneObjectRequirement(br));
|
||||
OptionalObjectRequirements.Add(new SafariZoneObjectRequirement(br));
|
||||
}
|
||||
}
|
||||
|
||||
public void writeGroup(BinaryWriter bw) {
|
||||
//#2 Section - Tall Grass Encounters
|
||||
for (int i = 0; i < MorningEncounters.Count; i++) {
|
||||
MorningEncounters[i].writeEncounter(bw);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < EncounterSlots; i++) {
|
||||
DayEncounters[i].writeEncounter(bw);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < EncounterSlots; i++) {
|
||||
NightEncounters[i].writeEncounter(bw);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
|
||||
//#3 Section - Tall Grass Encounters (Object Arrangement)
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
MorningEncountersObject[i].writeEncounter(bw);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
DayEncountersObject[i].writeEncounter(bw);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
NightEncountersObject[i].writeEncounter(bw);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
|
||||
//#4 Section - Object Arrangement Requirements (Tall Grass)
|
||||
for (int i = 0; i < ObjectSlots; i++) {
|
||||
ObjectRequirements[i].writeRequirement(bw);
|
||||
OptionalObjectRequirements[i].writeRequirement(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
DS_Map/ROMFiles/SafariZoneObjectRequirement.cs
Normal file
40
DS_Map/ROMFiles/SafariZoneObjectRequirement.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class SafariZoneObjectRequirement {
|
||||
public static Dictionary<int, string> ObjectTypes = new Dictionary<int, string>() {
|
||||
{ 0, "No Requirement" },
|
||||
{ 1, "Plains" },
|
||||
{ 2, "Forest" },
|
||||
{ 3, "Peak" },
|
||||
{ 4, "Waterside" },
|
||||
};
|
||||
|
||||
public byte typeID;
|
||||
public byte quantity;
|
||||
|
||||
public SafariZoneObjectRequirement(byte typeID = 0, byte quantity = 0) {
|
||||
this.typeID = typeID;
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public SafariZoneObjectRequirement(BinaryReader br) {
|
||||
readRequirement(br);
|
||||
}
|
||||
|
||||
public void readRequirement(BinaryReader br) {
|
||||
typeID = br.ReadByte();
|
||||
quantity = br.ReadByte();
|
||||
}
|
||||
|
||||
public void writeRequirement(BinaryWriter bw) {
|
||||
bw.Write((byte)typeID);
|
||||
bw.Write((byte)quantity);
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return $"{typeID} {ObjectTypes[typeID]}: {quantity}";
|
||||
}
|
||||
}
|
||||
}
|
||||
13
DS_Map/ROMFiles/ScriptActionContainer.cs
Normal file
13
DS_Map/ROMFiles/ScriptActionContainer.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class ScriptActionContainer {
|
||||
public List<ScriptAction> commands;
|
||||
public uint manualUserID;
|
||||
|
||||
public ScriptActionContainer(uint actionNumber, List<ScriptAction> commands = null) {
|
||||
manualUserID = actionNumber;
|
||||
this.commands = commands;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,41 +4,25 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.ROMFiles.Event;
|
||||
using static DSPRE.ROMFiles.ScriptFile;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public enum ParamTypeEnum { INTEGER, VARIABLE, FLEX, OW_ID, OW_MOVEMENT_TYPE, OW_DIRECTION, FUNCTION_ID, ACTION_ID, CMD_NUMBER };
|
||||
public class CommandContainer {
|
||||
public List<ScriptCommand> commands;
|
||||
public uint manualUserID;
|
||||
public int usedScript; //useScript ID referenced by this Script/Function
|
||||
public containerTypes containerType;
|
||||
internal static readonly string functionStart;
|
||||
|
||||
#region Constructors (2)
|
||||
public CommandContainer(uint scriptNumber, containerTypes containerType, int useScript = -1, List<ScriptCommand> commandList = null) {
|
||||
manualUserID = scriptNumber;
|
||||
this.usedScript = useScript;
|
||||
this.containerType = containerType;
|
||||
commands = commandList;
|
||||
}
|
||||
public CommandContainer(uint newID, CommandContainer toCopy) {
|
||||
manualUserID = newID;
|
||||
usedScript = toCopy.usedScript;
|
||||
containerType = toCopy.containerType;
|
||||
commands = new List<ScriptCommand>(toCopy.commands); //command parameters need to be copied recursively
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class ScriptCommand {
|
||||
#region Fields (4)
|
||||
enum ParamTypeEnum {
|
||||
INTEGER,
|
||||
VARIABLE,
|
||||
FLEX,
|
||||
OW_ID,
|
||||
OW_MOVEMENT_TYPE,
|
||||
OW_DIRECTION,
|
||||
FUNCTION_ID,
|
||||
ACTION_ID,
|
||||
CMD_NUMBER
|
||||
};
|
||||
|
||||
public ushort? id;
|
||||
public List<byte[]> cmdParams;
|
||||
public string name;
|
||||
#endregion
|
||||
|
||||
#region Constructors (2)
|
||||
public ScriptCommand(ushort id, List<byte[]> parametersList) {
|
||||
if (parametersList is null) {
|
||||
this.id = null;
|
||||
|
|
@ -50,20 +34,20 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
switch (id) {
|
||||
case 0x0016: // Jump
|
||||
case 0x001A: // Call
|
||||
case 0x0016: // Jump
|
||||
case 0x001A: // Call
|
||||
name += $" {FormatNumber(parametersList[0], ParamTypeEnum.FUNCTION_ID)}";
|
||||
break;
|
||||
case 0x0017: // JumpIfObjID
|
||||
case 0x0018: // JumpIfEventID
|
||||
case 0x0017: // JumpIfObjID
|
||||
case 0x0018: // JumpIfEventID
|
||||
name += $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)} {FormatNumber(parametersList[1])}";
|
||||
break;
|
||||
case 0x0019: // JumpIfPlayerDir
|
||||
case 0x0019: // JumpIfPlayerDir
|
||||
name += $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_DIRECTION)} {FormatNumber(parametersList[1], ParamTypeEnum.ACTION_ID)}";
|
||||
break;
|
||||
case 0x001C: // JumpIf
|
||||
case 0x001D: // CallIf
|
||||
{
|
||||
case 0x001C: // JumpIf
|
||||
case 0x001D: // CallIf
|
||||
{
|
||||
string number = FormatNumber(parametersList[1], ParamTypeEnum.FUNCTION_ID);
|
||||
|
||||
if (RomInfo.ScriptComparisonOperatorsDict.TryGetValue(parametersList[0][0], out string v)) {
|
||||
|
|
@ -71,131 +55,150 @@ namespace DSPRE.ROMFiles {
|
|||
} else {
|
||||
name += $" {parametersList[0][0]} {number}";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 0x005E: // Movement
|
||||
case 0x005E: // Movement
|
||||
name += $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)} {FormatNumber(parametersList[1], ParamTypeEnum.ACTION_ID)}";
|
||||
break;
|
||||
case 0x006A: // GetOverworldPosition
|
||||
case 0x006A: // GetOverworldPosition
|
||||
name += FormatCmd_Overworld_TwoParams(parametersList);
|
||||
break;
|
||||
case 0x0062: // Lock
|
||||
case 0x0063: // Release
|
||||
case 0x0064: // AddOW
|
||||
case 0x0065: // RemoveOW
|
||||
case 0x0062: // Lock
|
||||
case 0x0063: // Release
|
||||
case 0x0064: // AddOW
|
||||
case 0x0065: // RemoveOW
|
||||
name += $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)}";
|
||||
break;
|
||||
case 0x006D: // SetOverworldMovement
|
||||
case 0x006D: // SetOverworldMovement
|
||||
name += FormatCmd_Overworld_Move(parametersList);
|
||||
break;
|
||||
|
||||
case 0x00B0: // Warp [HGSS]
|
||||
case 0x00B0: // Warp [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Warp(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0152: // SetOverworldDefaultPosition [HGSS]
|
||||
case 0x0152: // SetOverworldDefaultPosition [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_TwoParams(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0153: // SetOverworldPosition [HGSS]
|
||||
case 0x0153: // SetOverworldPosition [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_3Coords_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0154: // SetOverworldDefaultMovement [HGSS]
|
||||
case 0x0154: // SetOverworldDefaultMovement [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_Move(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0155: // SetOverworldDefaultDirection [DPPt]
|
||||
case 0x0155: // SetOverworldDefaultDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0158: // SetOverworldDirection [DPPt]
|
||||
case 0x0158: // SetOverworldDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 0x00BE: // Warp [DPPt]
|
||||
case 0x00BE: // Warp [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Warp(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0186: // SetOverworldDefaultPosition [DPPt]
|
||||
case 0x0186: // SetOverworldDefaultPosition [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_TwoParams(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0187: // SetOverworldPosition [DPPt]
|
||||
case 0x0187: // SetOverworldPosition [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_3Coords_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0188: // SetOverworldDefaultMovement [DPPt]
|
||||
case 0x0188: // SetOverworldDefaultMovement [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_Move(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x0189: // SetOverworldDefaultDirection [DPPt]
|
||||
case 0x0189: // SetOverworldDefaultDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x018C: // SetOverworldDirection [DPPt]
|
||||
case 0x018C: // SetOverworldDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
for (int i = 0; i < parametersList.Count; i++) {
|
||||
name += $" {FormatNumber(parametersList[i])}";
|
||||
}
|
||||
break;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
this.id = id;
|
||||
this.cmdParams = parametersList;
|
||||
}
|
||||
|
||||
private string FormatCmd_Warp(List<byte[]> parametersList) {
|
||||
return $" {FormatNumber(parametersList[0])} {FormatNumber(parametersList[1])} {FormatNumber(parametersList[2])} {FormatNumber(parametersList[3])} {FormatNumber(parametersList[4], ParamTypeEnum.OW_DIRECTION)}";
|
||||
}
|
||||
|
||||
private string FormatCmd_Overworld_TwoParams(List<byte[]> parametersList) {
|
||||
return $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)} {FormatNumber(parametersList[1])} {FormatNumber(parametersList[2])}";
|
||||
}
|
||||
|
||||
private string FormatCmd_Overworld_Move(List<byte[]> parametersList) {
|
||||
return $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)} {FormatNumber(parametersList[1], ParamTypeEnum.OW_MOVEMENT_TYPE)}";
|
||||
}
|
||||
|
||||
private string FormatCmd_Overworld_3Coords_Dir(List<byte[]> parametersList) {
|
||||
return $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)} {FormatNumber(parametersList[1])} {FormatNumber(parametersList[2])} {FormatNumber(parametersList[3])} {FormatNumber(parametersList[4], ParamTypeEnum.OW_DIRECTION)}";
|
||||
}
|
||||
|
||||
private string FormatCmd_Overworld_Dir(List<byte[]> parametersList) {
|
||||
return $" {FormatNumber(parametersList[0], ParamTypeEnum.OW_ID)} {FormatNumber(parametersList[1], ParamTypeEnum.OW_DIRECTION)}";
|
||||
}
|
||||
|
|
@ -212,7 +215,6 @@ namespace DSPRE.ROMFiles {
|
|||
} else {
|
||||
try {
|
||||
id = ushort.Parse(nameParts[0].PurgeSpecial(ScriptFile.specialChars), nameParts[0].GetNumberStyle());
|
||||
//id = ushort.Parse(nameParts[0].Substring(nameParts[0].("_")+1), Properties.Settings.Default.scriptEditorFormatPreference, CultureInfo.InvariantCulture);
|
||||
} catch {
|
||||
string details;
|
||||
if (wholeLine.Contains(':') && wholeLine.ContainsNumber()) {
|
||||
|
|
@ -223,7 +225,7 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
MessageBox.Show("This Script file could not be saved." +
|
||||
$"\nParser failed to interpret line {lineNumber}: \"{wholeLine}\".\n\n{details}", "Parser error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"\nParser failed to interpret line {lineNumber}: \"{wholeLine}\".\n\n{details}", "Parser error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +237,7 @@ namespace DSPRE.ROMFiles {
|
|||
int paramLength = 0;
|
||||
int paramsProcessed = 0;
|
||||
|
||||
if (parametersSizeArr.First() == 0xFF) {
|
||||
if (parametersSizeArr.First() == 0xFF) {
|
||||
int firstParamValue = int.Parse(nameParts[1].PurgeSpecial(ScriptFile.specialChars), nameParts[1].GetNumberStyle());
|
||||
byte firstParamSize = parametersSizeArr[1];
|
||||
|
||||
|
|
@ -262,7 +264,7 @@ namespace DSPRE.ROMFiles {
|
|||
// 5, 3, (2, 2, 2) => this will be the parameters subarray
|
||||
// 6, 1, 2
|
||||
// },
|
||||
byte[] subParametersSize = parametersSizeArr.SubArray(i + 2, paramLength++);
|
||||
byte[] subParametersSize = parametersSizeArr.SubArray(i + 2, paramLength++);
|
||||
|
||||
//Create a slightly bigger temp array
|
||||
byte[] temp = new byte[1 + subParametersSize.Length];
|
||||
|
|
@ -271,26 +273,28 @@ namespace DSPRE.ROMFiles {
|
|||
temp[0] = firstParamSize;
|
||||
|
||||
//Then copy the whole subarray of parameter sizes
|
||||
Array.Copy(subParametersSize, 0, temp, 1, temp.Length-1);
|
||||
Array.Copy(subParametersSize, 0, temp, 1, temp.Length - 1);
|
||||
|
||||
//Replace the original parametersSizeArr with the new array
|
||||
parametersSizeArr = temp;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
i += 2 + paramLength;
|
||||
optionsCount++;
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
MessageBox.Show($"Command {nameParts[0]} is a special Script Command.\n" +
|
||||
$"The value of the first parameter must be a number in the range [0 - {optionsCount}].\n\n" +
|
||||
$"Line {lineNumber}: {wholeLine}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"The value of the first parameter must be a number in the range [0 - {optionsCount}].\n\n" +
|
||||
$"Line {lineNumber}: {wholeLine}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
id = null;
|
||||
return;
|
||||
}
|
||||
} else if (parametersSizeArr.Length == 1 && parametersSizeArr.First() == 0) {
|
||||
paramLength = 0;
|
||||
} else {
|
||||
} else {
|
||||
paramLength = parametersSizeArr.Length;
|
||||
}
|
||||
|
||||
|
|
@ -304,7 +308,7 @@ namespace DSPRE.ROMFiles {
|
|||
/* Convert strings of parameters to the correct datatypes */
|
||||
NumberStyles numStyle = nameParts[i + 1].GetNumberStyle();
|
||||
nameParts[i + 1] = nameParts[i + 1].PurgeSpecial(ScriptFile.specialChars);
|
||||
|
||||
|
||||
int result = 0;
|
||||
|
||||
try {
|
||||
|
|
@ -312,9 +316,9 @@ namespace DSPRE.ROMFiles {
|
|||
} catch {
|
||||
if (string.IsNullOrWhiteSpace(nameParts[i + 1])) {
|
||||
MessageBox.Show($"You must specify an Overworld ID, Script, Function or Action number.\n\n" +
|
||||
$"Line {lineNumber}: {wholeLine}", "Unspecified identifier", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"Line {lineNumber}: {wholeLine}", "Unspecified identifier", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
id = null;
|
||||
} else {
|
||||
} else {
|
||||
var first = ScriptDatabase.specialOverworlds.FirstOrDefault(x => x.Value.IgnoreCaseEquals(nameParts[i + 1]));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(first.Value)) {
|
||||
|
|
@ -322,7 +326,7 @@ namespace DSPRE.ROMFiles {
|
|||
|
||||
if (string.IsNullOrWhiteSpace(res.Value)) {
|
||||
MessageBox.Show($"Argument {nameParts[i + 1]} couldn't be parsed as a valid Condition, Overworld ID, Direction ID, Script, Function or Action number.\n\n" +
|
||||
$"Line {lineNumber}: {wholeLine}", "Invalid identifier", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"Line {lineNumber}: {wholeLine}", "Invalid identifier", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
id = null;
|
||||
} else {
|
||||
result = res.Key;
|
||||
|
|
@ -343,14 +347,12 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
} else {
|
||||
MessageBox.Show($"Wrong number of parameters for command {nameParts[0]} at line {lineNumber}.\n" +
|
||||
$"Received: {nameParts.Length - 1}\n" +
|
||||
$"Expected: {paramLength}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"Received: {nameParts.Length - 1}\n" +
|
||||
$"Expected: {paramLength}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
id = null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Utilities
|
||||
private string FormatNumber(byte[] par, ParamTypeEnum paramType = ParamTypeEnum.INTEGER) {
|
||||
//number acquisition
|
||||
uint num;
|
||||
|
|
@ -365,8 +367,10 @@ namespace DSPRE.ROMFiles {
|
|||
} else {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
return FormatNumber(num, paramType);
|
||||
}
|
||||
|
||||
private string FormatNumber(uint num, ParamTypeEnum paramType = ParamTypeEnum.INTEGER) {
|
||||
//differentiate depending on param type
|
||||
string formatOverride;
|
||||
|
|
@ -387,36 +391,37 @@ namespace DSPRE.ROMFiles {
|
|||
return "CMD_" + prefix + num.ToString(formatOverride + '3');
|
||||
|
||||
case ParamTypeEnum.FUNCTION_ID:
|
||||
return containerTypes.Function.ToString() + "#" + num;
|
||||
return ScriptFile.ContainerTypes.Function.ToString() + "#" + num;
|
||||
|
||||
case ParamTypeEnum.ACTION_ID:
|
||||
return containerTypes.Action.ToString() + "#" + num;
|
||||
return ScriptFile.ContainerTypes.Action.ToString() + "#" + num;
|
||||
|
||||
case ParamTypeEnum.OW_MOVEMENT_TYPE:
|
||||
if (num < 4000) {
|
||||
outp += "Move.";
|
||||
}
|
||||
|
||||
goto default;
|
||||
|
||||
case ParamTypeEnum.OW_ID:
|
||||
{
|
||||
case ParamTypeEnum.OW_ID: {
|
||||
if (ScriptDatabase.specialOverworlds.TryGetValue((ushort)num, out string output)) {
|
||||
return output;
|
||||
} else {
|
||||
if (num < 4000) {
|
||||
outp += $"{EventType.Overworld}.";
|
||||
outp += $"{Event.EventType.Overworld}.";
|
||||
}
|
||||
|
||||
goto default;
|
||||
}
|
||||
}
|
||||
case ParamTypeEnum.OW_DIRECTION:
|
||||
{
|
||||
case ParamTypeEnum.OW_DIRECTION: {
|
||||
if (ScriptDatabase.overworldDirections.TryGetValue((byte)num, out string output)) {
|
||||
return output;
|
||||
} else {
|
||||
if (num < 4000) {
|
||||
outp += $"Direction.";
|
||||
}
|
||||
|
||||
goto default;
|
||||
}
|
||||
}
|
||||
|
|
@ -427,15 +432,16 @@ namespace DSPRE.ROMFiles {
|
|||
prefix = "0x";
|
||||
}
|
||||
}
|
||||
|
||||
outp += prefix + num.ToString(formatOverride);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return outp;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return name + " (" + ((ushort)id).ToString("X") + ")";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
25
DS_Map/ROMFiles/ScriptCommandContainer.cs
Normal file
25
DS_Map/ROMFiles/ScriptCommandContainer.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
public class ScriptCommandContainer {
|
||||
public List<ScriptCommand> commands;
|
||||
public uint manualUserID;
|
||||
public int usedScriptID; //useScript ID referenced by this Script/Function
|
||||
public ScriptFile.ContainerTypes containerType;
|
||||
internal static readonly string functionStart;
|
||||
|
||||
public ScriptCommandContainer(uint scriptNumber, ScriptFile.ContainerTypes containerType, int usedScriptID = -1, List<ScriptCommand> commandList = null) {
|
||||
manualUserID = scriptNumber;
|
||||
this.usedScriptID = usedScriptID;
|
||||
this.containerType = containerType;
|
||||
commands = commandList;
|
||||
}
|
||||
|
||||
public ScriptCommandContainer(uint newID, ScriptCommandContainer toCopy) {
|
||||
manualUserID = newID;
|
||||
usedScriptID = toCopy.usedScriptID;
|
||||
containerType = toCopy.containerType;
|
||||
commands = new List<ScriptCommand>(toCopy.commands); //command parameters need to be copied recursively
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,67 +1,64 @@
|
|||
using DSPRE.Resources;
|
||||
using ScintillaNET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.ROMFiles.ScriptFile;
|
||||
using static DSPRE.RomInfo;
|
||||
|
||||
namespace DSPRE.ROMFiles {
|
||||
/// <summary>
|
||||
/// Class to store script file data in Pokémon NDS games
|
||||
/// </summary>
|
||||
public class ScriptFile : RomFile {
|
||||
#region Constants
|
||||
//this enum doesn't really make much sense now but it will, once scripts can be called and jumped to
|
||||
public enum containerTypes { Function, Action, Script };
|
||||
public enum ContainerTypes {
|
||||
Function,
|
||||
Action,
|
||||
Script
|
||||
};
|
||||
|
||||
public struct ContainerReference {
|
||||
public uint ID;
|
||||
public uint offsetInFile;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields (3)
|
||||
public List<CommandContainer> allScripts = new List<CommandContainer>();
|
||||
public List<CommandContainer> allFunctions = new List<CommandContainer>();
|
||||
public List<ActionContainer> allActions = new List<ActionContainer>();
|
||||
public int? fileID = null;
|
||||
public List<ScriptCommandContainer> allScripts = new List<ScriptCommandContainer>();
|
||||
public List<ScriptCommandContainer> allFunctions = new List<ScriptCommandContainer>();
|
||||
public List<ScriptActionContainer> allActions = new List<ScriptActionContainer>();
|
||||
public int fileID = -1;
|
||||
public bool isLevelScript = new bool();
|
||||
|
||||
public static readonly char[] specialChars = { 'x', 'X', '#', '.', '_' };
|
||||
#endregion
|
||||
public bool hasNoScripts { get { return fileID == int.MaxValue; } }
|
||||
|
||||
#region Constructors (1)
|
||||
public static readonly char[] specialChars = { 'x', 'X', '#', '.', '_' };
|
||||
|
||||
public ScriptFile(Stream fs, bool readFunctions = true, bool readActions = true) {
|
||||
List<int> scriptOffsets = new List<int>();
|
||||
List<int> functionOffsets = new List<int>();
|
||||
List<int> movementOffsets = new List<int>();
|
||||
|
||||
using (BinaryReader scrReader = new BinaryReader(fs)) {
|
||||
using (BinaryReader br = new BinaryReader(fs)) {
|
||||
/* Read script offsets from the header */
|
||||
isLevelScript = true; // Is Level Script as long as magic number FD13 doesn't exist
|
||||
try {
|
||||
while (true) {
|
||||
uint checker = scrReader.ReadUInt16();
|
||||
scrReader.BaseStream.Position -= 0x2;
|
||||
uint value = scrReader.ReadUInt32();
|
||||
uint checker = br.ReadUInt16();
|
||||
br.BaseStream.Position -= 0x2;
|
||||
uint value = br.ReadUInt32();
|
||||
|
||||
if (value == 0 && scriptOffsets.Count == 0) {
|
||||
isLevelScript = true;
|
||||
break;
|
||||
} else if (checker == 0xFD13) {
|
||||
scrReader.BaseStream.Position -= 0x4;
|
||||
}
|
||||
|
||||
if (checker == 0xFD13) {
|
||||
br.BaseStream.Position -= 0x4;
|
||||
isLevelScript = false;
|
||||
break;
|
||||
} else {
|
||||
int offsetFromStart = (int)(value + scrReader.BaseStream.Position); // Don't change order of addition
|
||||
scriptOffsets.Add(offsetFromStart);
|
||||
}
|
||||
|
||||
int offsetFromStart = (int)(value + br.BaseStream.Position); // Don't change order of addition
|
||||
scriptOffsets.Add(offsetFromStart);
|
||||
}
|
||||
} catch (EndOfStreamException) {
|
||||
if (!isLevelScript) {
|
||||
|
|
@ -78,12 +75,12 @@ namespace DSPRE.ROMFiles {
|
|||
int index = scriptOffsets.FindIndex(x => x == scriptOffsets[(int)current]); // Check for UseScript
|
||||
|
||||
if (index == current) {
|
||||
scrReader.BaseStream.Position = scriptOffsets[(int)current];
|
||||
br.BaseStream.Position = scriptOffsets[(int)current];
|
||||
|
||||
List<ScriptCommand> cmdList = new List<ScriptCommand>();
|
||||
bool endScript = new bool();
|
||||
while (!endScript) {
|
||||
ScriptCommand cmd = ReadCommand(scrReader, ref functionOffsets, ref movementOffsets);
|
||||
ScriptCommand cmd = ReadCommand(br, ref functionOffsets, ref movementOffsets);
|
||||
if (cmd.cmdParams is null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -94,23 +91,24 @@ namespace DSPRE.ROMFiles {
|
|||
endScript = true;
|
||||
}
|
||||
}
|
||||
allScripts.Add(new CommandContainer(current + 1, containerTypes.Script, commandList: cmdList));
|
||||
|
||||
allScripts.Add(new ScriptCommandContainer(current + 1, ContainerTypes.Script, commandList: cmdList));
|
||||
} else {
|
||||
allScripts.Add(new CommandContainer(current + 1, containerTypes.Script, useScript: index + 1));
|
||||
allScripts.Add(new ScriptCommandContainer(current + 1, ContainerTypes.Script, usedScriptID: index + 1));
|
||||
}
|
||||
}
|
||||
|
||||
/* Read functions */
|
||||
if (readFunctions) {
|
||||
for (uint current = 0; current < functionOffsets.Count; current++) {
|
||||
scrReader.BaseStream.Position = functionOffsets[(int)current];
|
||||
br.BaseStream.Position = functionOffsets[(int)current];
|
||||
int posInList = scriptOffsets.IndexOf(functionOffsets[(int)current]); // Check for UseScript
|
||||
|
||||
if (posInList == -1) {
|
||||
List<ScriptCommand> cmdList = new List<ScriptCommand>();
|
||||
bool endFunction = new bool();
|
||||
while (!endFunction) {
|
||||
ScriptCommand command = ReadCommand(scrReader, ref functionOffsets, ref movementOffsets);
|
||||
ScriptCommand command = ReadCommand(br, ref functionOffsets, ref movementOffsets);
|
||||
if (command.cmdParams is null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -120,9 +118,10 @@ namespace DSPRE.ROMFiles {
|
|||
endFunction = true;
|
||||
}
|
||||
}
|
||||
allFunctions.Add(new CommandContainer(current + 1, containerTypes.Function, commandList: cmdList));
|
||||
|
||||
allFunctions.Add(new ScriptCommandContainer(current + 1, ContainerTypes.Function, commandList: cmdList));
|
||||
} else {
|
||||
allFunctions.Add(new CommandContainer(current + 1, containerTypes.Function, useScript: posInList + 1));
|
||||
allFunctions.Add(new ScriptCommandContainer(current + 1, ContainerTypes.Function, usedScriptID: posInList + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -130,53 +129,65 @@ namespace DSPRE.ROMFiles {
|
|||
if (readActions) {
|
||||
/* Read movements */
|
||||
for (uint current = 0; current < movementOffsets.Count; current++) {
|
||||
scrReader.BaseStream.Position = movementOffsets[(int)current];
|
||||
br.BaseStream.Position = movementOffsets[(int)current];
|
||||
|
||||
List<ScriptAction> cmdList = new List<ScriptAction>();
|
||||
bool endMovement = new bool();
|
||||
while (!endMovement) {
|
||||
ushort id = scrReader.ReadUInt16();
|
||||
ushort id = br.ReadUInt16();
|
||||
if (id == 0xFE) {
|
||||
endMovement = true;
|
||||
cmdList.Add(new ScriptAction(id, 0));
|
||||
} else {
|
||||
cmdList.Add(new ScriptAction(id, scrReader.ReadUInt16()));
|
||||
cmdList.Add(new ScriptAction(id, br.ReadUInt16()));
|
||||
}
|
||||
}
|
||||
allActions.Add(new ActionContainer(current + 1, actionCommandsList: cmdList));
|
||||
|
||||
allActions.Add(new ScriptActionContainer(current + 1, commands: cmdList));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public ScriptFile(int fileID, bool readFunctions = true, bool readActions = true) :
|
||||
this(new FileStream(RomInfo.gameDirs[DirNames.scripts].unpackedDir + "\\" + fileID.ToString("D4"), FileMode.Open), readFunctions, readActions) {
|
||||
|
||||
public ScriptFile(int fileID, bool readFunctions = true, bool readActions = true) : this(getFileStream(fileID), readFunctions, readActions) {
|
||||
this.fileID = fileID;
|
||||
}
|
||||
public ScriptFile(List<CommandContainer> scripts, List<CommandContainer> functions, List<ActionContainer> movements, int fileID = -1) {
|
||||
|
||||
static FileStream getFileStream(int fileID) {
|
||||
string path = Filesystem.GetScriptPath(fileID);
|
||||
return new FileStream(path, FileMode.OpenOrCreate);
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
string prefix = isLevelScript ? "Level " : "";
|
||||
return $"{prefix}Script File " + this.fileID;
|
||||
}
|
||||
|
||||
public ScriptFile(List<ScriptCommandContainer> scripts, List<ScriptCommandContainer> functions, List<ScriptActionContainer> movements, int fileID = -1) {
|
||||
allScripts = scripts;
|
||||
allFunctions = functions;
|
||||
allActions = movements;
|
||||
isLevelScript = false;
|
||||
}
|
||||
|
||||
public ScriptFile(IEnumerable<string> scriptLines, IEnumerable<string> functionLines, IEnumerable<string> actionLines, int fileID = -1) {
|
||||
//TODO: give user the possibility to jump to/call a script
|
||||
//once it's done, this Predicate below will be the only one needed, since there will be no distinction between
|
||||
//a script and a function
|
||||
bool functionEndCondition(List<(int linenum, string text)> source, int x, ushort? id) {
|
||||
return source[x].text.TrimEnd().IgnoreCaseEquals(RomInfo.ScriptCommandNamesDict[0x0002]) //End
|
||||
|| source[x].text.IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + ' ' + containerTypes.Function.ToString(), StringComparison.InvariantCultureIgnoreCase) >= 0 //Jump Function_#
|
||||
|| source[x].text.TrimEnd().IgnoreCaseEquals(RomInfo.ScriptCommandNamesDict[0x001B])
|
||||
|| ScriptDatabase.endCodes.Contains(id);
|
||||
} //Return
|
||||
|| source[x].text.IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + ' ' + ContainerTypes.Function.ToString(), StringComparison.InvariantCultureIgnoreCase) >= 0 //Jump Function_#
|
||||
|| source[x].text.TrimEnd().IgnoreCaseEquals(RomInfo.ScriptCommandNamesDict[0x001B])
|
||||
|| ScriptDatabase.endCodes.Contains(id);
|
||||
} //Return
|
||||
|
||||
bool scriptEndCondition(List<(int linenum, string text)> source, int x, ushort? id) {
|
||||
return source[x].text.TrimEnd().IgnoreCaseEquals(RomInfo.ScriptCommandNamesDict[0x0002]) //End
|
||||
|| source[x].text.IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + ' ' + containerTypes.Function.ToString()) >= 0 //Jump Function_#
|
||||
|| ScriptDatabase.endCodes.Contains(id);
|
||||
return source[x].text.TrimEnd().IgnoreCaseEquals(RomInfo.ScriptCommandNamesDict[0x0002]) //End
|
||||
|| source[x].text.IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + ' ' + ContainerTypes.Function.ToString()) >= 0 //Jump Function_#
|
||||
|| ScriptDatabase.endCodes.Contains(id);
|
||||
}
|
||||
|
||||
allScripts = ReadCommandsFromLines(scriptLines.ToList(), containerTypes.Script, scriptEndCondition); //Jump + whitespace
|
||||
allScripts = ReadCommandsFromLines(scriptLines.ToList(), ContainerTypes.Script, scriptEndCondition); //Jump + whitespace
|
||||
if (allScripts is null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -187,7 +198,7 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
if (functionLines != null) {
|
||||
allFunctions = ReadCommandsFromLines(functionLines.ToList(), containerTypes.Function, functionEndCondition); //Jump + whitespace
|
||||
allFunctions = ReadCommandsFromLines(functionLines.ToList(), ContainerTypes.Function, functionEndCondition); //Jump + whitespace
|
||||
if (allFunctions is null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -202,9 +213,7 @@ namespace DSPRE.ROMFiles {
|
|||
|
||||
this.fileID = fileID;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods (1)
|
||||
private ScriptCommand ReadCommand(BinaryReader dataReader, ref List<int> functionOffsets, ref List<int> actionOffsets) {
|
||||
ushort id = dataReader.ReadUInt16();
|
||||
List<byte[]> parameterList = new List<byte[]>();
|
||||
|
|
@ -223,15 +232,15 @@ namespace DSPRE.ROMFiles {
|
|||
case 0x19: //JumpIfPlayerDir
|
||||
case 0x1C: //JumpIf
|
||||
case 0x1D: //CallIf
|
||||
//in the case of JumpIf and CallIf, the first param is a comparisonOperator
|
||||
//for JumpIfPlayerDir it's a directionID
|
||||
//for JumpIfObjID, it's an EventID
|
||||
//in the case of JumpIf and CallIf, the first param is a comparisonOperator
|
||||
//for JumpIfPlayerDir it's a directionID
|
||||
//for JumpIfObjID, it's an EventID
|
||||
parameterList.Add(new byte[] { dataReader.ReadByte() });
|
||||
ProcessRelativeJump(dataReader, ref parameterList, ref functionOffsets);
|
||||
break;
|
||||
case 0x5E: // Movement
|
||||
case 0x2A1: // Movement2
|
||||
//in the case of Movement, the first param is an overworld ID
|
||||
//in the case of Movement, the first param is an overworld ID
|
||||
parameterList.Add(BitConverter.GetBytes(dataReader.ReadUInt16()));
|
||||
ProcessRelativeJump(dataReader, ref parameterList, ref actionOffsets);
|
||||
break;
|
||||
|
|
@ -342,11 +351,13 @@ namespace DSPRE.ROMFiles {
|
|||
} else {
|
||||
goto default;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
addParametersToList(ref parameterList, id, dataReader);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case GameFamilies.HGSS:
|
||||
switch (id) {
|
||||
|
|
@ -377,7 +388,7 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
break;
|
||||
case 0x1D1: // Number of parameters differ depending on the first parameter value
|
||||
{
|
||||
{
|
||||
short parameter1 = dataReader.ReadInt16();
|
||||
parameterList.Add(BitConverter.GetBytes(parameter1));
|
||||
switch (parameter1) {
|
||||
|
|
@ -403,7 +414,7 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
break;
|
||||
case 0x1E9: // Number of parameters differ depending on the first parameter value
|
||||
{
|
||||
{
|
||||
short parameter1 = dataReader.ReadInt16();
|
||||
parameterList.Add(BitConverter.GetBytes(parameter1));
|
||||
switch (parameter1) {
|
||||
|
|
@ -433,8 +444,10 @@ namespace DSPRE.ROMFiles {
|
|||
addParametersToList(ref parameterList, id, dataReader);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return new ScriptCommand(id, parameterList);
|
||||
}
|
||||
|
||||
|
|
@ -462,28 +475,30 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
} catch (NullReferenceException) {
|
||||
MessageBox.Show("Script command " + id + "can't be handled for now." +
|
||||
Environment.NewLine + "Reference offset 0x" + dataReader.BaseStream.Position.ToString("X"), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Environment.NewLine + "Reference offset 0x" + dataReader.BaseStream.Position.ToString("X"), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
parameterList = null;
|
||||
return;
|
||||
} catch {
|
||||
MessageBox.Show("Error: ID Read - " + id +
|
||||
Environment.NewLine + "Reference offset 0x" + dataReader.BaseStream.Position.ToString("X"), "Unrecognized script command", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Environment.NewLine + "Reference offset 0x" + dataReader.BaseStream.Position.ToString("X"), "Unrecognized script command", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
parameterList = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
private void AddReference(ref List<ScriptReference> references, ushort commandID, List<byte[]> parameterList, int pos, CommandContainer cont) {
|
||||
|
||||
private void AddReference(ref List<ScriptReference> references, ushort commandID, List<byte[]> parameterList, int pos, ScriptCommandContainer cont) {
|
||||
if (ScriptDatabase.commandsWithRelativeJump.TryGetValue(commandID, out int parameterWithRelativeJump)) {
|
||||
uint invokedID = BitConverter.ToUInt32(parameterList[parameterWithRelativeJump], 0); // Jump, Call
|
||||
uint invokedID = BitConverter.ToUInt32(parameterList[parameterWithRelativeJump], 0); // Jump, Call
|
||||
|
||||
if (commandID == 0x005E)
|
||||
references.Add(new ScriptReference(cont.containerType, cont.manualUserID, containerTypes.Action, invokedID, pos - 4));
|
||||
references.Add(new ScriptReference(cont.containerType, cont.manualUserID, ContainerTypes.Action, invokedID, pos - 4));
|
||||
else {
|
||||
references.Add(new ScriptReference(cont.containerType, cont.manualUserID, containerTypes.Function, invokedID, pos - 4));
|
||||
references.Add(new ScriptReference(cont.containerType, cont.manualUserID, ContainerTypes.Function, invokedID, pos - 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
private List<CommandContainer> ReadCommandsFromLines(List<string> linelist, containerTypes containerType, Func<List<(int linenum, string text)>, int, ushort?, bool> endConditions) {
|
||||
|
||||
private List<ScriptCommandContainer> ReadCommandsFromLines(List<string> linelist, ContainerTypes containerType, Func<List<(int linenum, string text)>, int, ushort?, bool> endConditions) {
|
||||
List<(int linenum, string text)> lineSource = new List<(int linenum, string text)>();
|
||||
|
||||
for (int l = 0; l < linelist.Count; l++) {
|
||||
|
|
@ -493,7 +508,7 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
}
|
||||
|
||||
List<CommandContainer> ls = new List<CommandContainer>();
|
||||
List<ScriptCommandContainer> ls = new List<ScriptCommandContainer>();
|
||||
int i = 0;
|
||||
|
||||
try {
|
||||
|
|
@ -516,12 +531,13 @@ namespace DSPRE.ROMFiles {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
scriptNumber = uint.Parse(lineSource[i++].text.Substring(positionOfScriptNumber).Split()[0].Replace(":", ""));
|
||||
}
|
||||
|
||||
if (lineSource[i].text.IndexOf("UseScript", StringComparison.InvariantCultureIgnoreCase) >= 0) {
|
||||
int useScriptNumber = short.Parse(lineSource[i].text.Substring(1 + lineSource[i].text.IndexOf('#')));
|
||||
ls.Add(new CommandContainer(scriptNumber, containerType, useScriptNumber));
|
||||
ls.Add(new ScriptCommandContainer(scriptNumber, containerType, useScriptNumber));
|
||||
i++;
|
||||
} else {
|
||||
/* Read script commands */
|
||||
|
|
@ -535,23 +551,25 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
cmdList.Add(lastRead);
|
||||
} while (!endConditions(lineSource, i++, lastRead.id));
|
||||
}
|
||||
while (!endConditions(lineSource, i++, lastRead.id));
|
||||
|
||||
ls.Add(new CommandContainer(scriptNumber, containerType, commandList: cmdList));
|
||||
ls.Add(new ScriptCommandContainer(scriptNumber, containerType, commandList: cmdList));
|
||||
}
|
||||
|
||||
scriptNumber = 0;
|
||||
}
|
||||
} catch (ArgumentOutOfRangeException) {
|
||||
MessageBox.Show($"Unexpectedly reached end of lines.\n\n" +
|
||||
$"Last line index: {lineSource[i].linenum}.\n" +
|
||||
$"Managed to parse {ls.Count} Command Containers.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"Last line index: {lineSource[i].linenum}.\n" +
|
||||
$"Managed to parse {ls.Count} Command Containers.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
return ls;
|
||||
}
|
||||
|
||||
private List<ActionContainer> ReadActionsFromLines(List<string> linelist) {
|
||||
private List<ScriptActionContainer> ReadActionsFromLines(List<string> linelist) {
|
||||
List<(int linenum, string text)> lineSource = new List<(int linenum, string text)>();
|
||||
|
||||
for (int l = 0; l < linelist.Count; l++) {
|
||||
|
|
@ -561,7 +579,7 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
}
|
||||
|
||||
List<ActionContainer> ls = new List<ActionContainer>();
|
||||
List<ScriptActionContainer> ls = new List<ScriptActionContainer>();
|
||||
int i = 0;
|
||||
|
||||
try {
|
||||
|
|
@ -570,7 +588,7 @@ namespace DSPRE.ROMFiles {
|
|||
while (i < lineSource.Count) {
|
||||
if (actionNumber == 0) {
|
||||
int positionOfActionNumber;
|
||||
int positionOfActionKeyword = lineSource[i].text.IndexOf(containerTypes.Action.ToString(), StringComparison.InvariantCultureIgnoreCase);
|
||||
int positionOfActionKeyword = lineSource[i].text.IndexOf(ContainerTypes.Action.ToString(), StringComparison.InvariantCultureIgnoreCase);
|
||||
|
||||
if (positionOfActionKeyword > 0) {
|
||||
MessageBox.Show("Unrecognized container keyword: \"" + lineSource[i] + '"', "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
|
|
@ -584,6 +602,7 @@ namespace DSPRE.ROMFiles {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
actionNumber = uint.Parse(lineSource[i].text.Substring(positionOfActionNumber).Split()[0].Replace(":", ""));
|
||||
i++;
|
||||
}
|
||||
|
|
@ -597,23 +616,22 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
cmdList.Add(toAdd);
|
||||
}
|
||||
while (!lineSource[i++].text.IgnoreCaseEquals(RomInfo.ScriptActionNamesDict[0x00FE]));
|
||||
|
||||
} while (!lineSource[i++].text.IgnoreCaseEquals(RomInfo.ScriptActionNamesDict[0x00FE]));
|
||||
|
||||
ls.Add(new ActionContainer(actionNumber, actionCommandsList: cmdList));
|
||||
ls.Add(new ScriptActionContainer(actionNumber, commands: cmdList));
|
||||
actionNumber = 0;
|
||||
}
|
||||
} catch (ArgumentOutOfRangeException) {
|
||||
MessageBox.Show($"Unexpectedly reached end of lines.\n\n" +
|
||||
$"Last line index: {i}.\n" +
|
||||
$"Managed to parse {ls.Count} Command Containers.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
$"Last line index: {i}.\n" +
|
||||
$"Managed to parse {ls.Count} Command Containers.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
return ls;
|
||||
}
|
||||
|
||||
#region Output
|
||||
public override byte[] ToByteArray() {
|
||||
MemoryStream newData = new MemoryStream();
|
||||
using (BinaryWriter writer = new BinaryWriter(newData)) {
|
||||
|
|
@ -627,11 +645,11 @@ namespace DSPRE.ROMFiles {
|
|||
try {
|
||||
writer.BaseStream.Position += allScripts.Count * 0x4;
|
||||
writer.Write((ushort)0xFD13); // Signal the end of header section
|
||||
List<CommandContainer> useScriptCallers = new List<CommandContainer>();
|
||||
List<ScriptCommandContainer> useScriptCallers = new List<ScriptCommandContainer>();
|
||||
|
||||
/* Write scripts */
|
||||
foreach (CommandContainer currentScript in allScripts) {
|
||||
if (currentScript.usedScript == -1) {
|
||||
foreach (ScriptCommandContainer currentScript in allScripts) {
|
||||
if (currentScript.usedScriptID == -1) {
|
||||
scriptOffsets.Add(new ContainerReference() {
|
||||
ID = currentScript.manualUserID,
|
||||
offsetInFile = (uint)writer.BaseStream.Position
|
||||
|
|
@ -657,22 +675,22 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
int scriptsCount = scriptOffsets.Count;
|
||||
foreach (CommandContainer caller in useScriptCallers) {
|
||||
foreach (ScriptCommandContainer caller in useScriptCallers) {
|
||||
for (int i = 0; i < scriptsCount; i++) {
|
||||
ContainerReference scriptReference = scriptOffsets[i];
|
||||
|
||||
if (scriptReference.ID == caller.usedScript) {
|
||||
if (scriptReference.ID == caller.usedScriptID) {
|
||||
scriptOffsets.Add(new ContainerReference() {
|
||||
ID = caller.manualUserID,
|
||||
offsetInFile = scriptReference.offsetInFile
|
||||
});// If script has UseScript, copy offset
|
||||
}); // If script has UseScript, copy offset
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Write functions */
|
||||
foreach (CommandContainer currentFunction in allFunctions) {
|
||||
if (currentFunction.usedScript == -1) {
|
||||
foreach (ScriptCommandContainer currentFunction in allFunctions) {
|
||||
if (currentFunction.usedScriptID == -1) {
|
||||
functionOffsets.Add(new ContainerReference() {
|
||||
ID = currentFunction.manualUserID,
|
||||
offsetInFile = (uint)writer.BaseStream.Position
|
||||
|
|
@ -694,20 +712,16 @@ namespace DSPRE.ROMFiles {
|
|||
AddReference(ref refList, (ushort)currentCmd.id, parameterList, (int)writer.BaseStream.Position, currentFunction);
|
||||
}
|
||||
} else {
|
||||
int functionUsescript = currentFunction.usedScript - 1;
|
||||
|
||||
//Find script with same ID as the function's referenced UseScript
|
||||
int scriptUsedByFunction = scriptOffsets.FindIndex(ind => ind.ID == currentFunction.usedScript);
|
||||
|
||||
if (functionUsescript >= scriptOffsets.Count || scriptUsedByFunction < 0) {
|
||||
MessageBox.Show($"Function #{currentFunction.manualUserID} refers to Script {currentFunction.usedScript}, which does not exist.\n" +
|
||||
$"This Script File can't be saved.", "Can't resolve UseScript reference", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
int functionUsescript = currentFunction.usedScriptID - 1;
|
||||
if (functionUsescript >= scriptOffsets.Count) {
|
||||
MessageBox.Show($"Function #{currentFunction.manualUserID} refers to Script {currentFunction.usedScriptID}, which does not exist.\n" +
|
||||
$"This Script File can't be saved.", "Can't resolve UseScript reference", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
functionOffsets.Add(new ContainerReference() {
|
||||
ID = currentFunction.manualUserID,
|
||||
offsetInFile = scriptOffsets[scriptUsedByFunction].offsetInFile
|
||||
offsetInFile = scriptOffsets[currentFunction.usedScriptID - 1].offsetInFile
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -718,13 +732,13 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
/* Write movements */
|
||||
foreach (ActionContainer currentAction in allActions) {
|
||||
foreach (ScriptActionContainer currentAction in allActions) {
|
||||
actionOffsets.Add(new ContainerReference() {
|
||||
ID = currentAction.manualUserID,
|
||||
offsetInFile = (uint)writer.BaseStream.Position
|
||||
});
|
||||
|
||||
foreach (ScriptAction currentCmd in currentAction.actionCommandsList) {
|
||||
foreach (ScriptAction currentCmd in currentAction.commands) {
|
||||
writer.Write((ushort)currentCmd.id);
|
||||
writer.Write((ushort)currentCmd.repetitionCount);
|
||||
}
|
||||
|
|
@ -738,7 +752,6 @@ namespace DSPRE.ROMFiles {
|
|||
writer.Write(scriptOffsets[i].offsetInFile - (uint)writer.BaseStream.Position - 0x4);
|
||||
}
|
||||
|
||||
|
||||
SortedSet<uint> undeclaredFuncs = new SortedSet<uint>();
|
||||
SortedSet<uint> undeclaredActions = new SortedSet<uint>();
|
||||
|
||||
|
|
@ -751,7 +764,7 @@ namespace DSPRE.ROMFiles {
|
|||
writer.BaseStream.Position = refList[i].invokedAt; //place seek head on parameter that is supposed to store the jump address
|
||||
ContainerReference result;
|
||||
|
||||
if (refList[i].typeOfInvoked is containerTypes.Action) { //isApplyMovement
|
||||
if (refList[i].typeOfInvoked is ContainerTypes.Action) { //isApplyMovement
|
||||
result = actionOffsets.Find(entry => entry.ID == refList[i].invokedID);
|
||||
|
||||
if (result.Equals(default(ContainerReference))) {
|
||||
|
|
@ -770,12 +783,10 @@ namespace DSPRE.ROMFiles {
|
|||
int relativeOffset = (int)(result.offsetInFile - refList[i].invokedAt - 4);
|
||||
writer.Write(relativeOffset);
|
||||
|
||||
|
||||
if (FunctionIsInvoked(refList, uninvokedFuncs, refList[i].invokedID, 0)) {
|
||||
uninvokedFuncs.Remove(refList[i].invokedID);
|
||||
}
|
||||
|
||||
|
||||
//if (refList[i].callerType != containerTypes.Function ||
|
||||
// (refList[i].callerType == refList[i].invokedType && refList[i].callerID == refList[i].invokedID) ||
|
||||
// !uninvokedFuncs.Contains(refList[i].callerID)) { //remove reference if caller is a script, or if caller calls itself, or if caller is a function that's been invoked already
|
||||
|
|
@ -792,11 +803,13 @@ namespace DSPRE.ROMFiles {
|
|||
errorMsg += "These Functions have been invoked but not declared: " + Environment.NewLine + string.Join(separator: ",", errorFunctionsUndeclared);
|
||||
errorMsg += Environment.NewLine;
|
||||
}
|
||||
|
||||
if (undeclaredActions.Count > 0) {
|
||||
string[] errorActionsUndeclared = undeclaredActions.ToArray().Select(x => x.ToString()).ToArray();
|
||||
errorMsg += "These Actions have been referenced but not declared: " + Environment.NewLine + string.Join(separator: ",", errorActionsUndeclared);
|
||||
errorMsg += Environment.NewLine;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(errorMsg)) {
|
||||
MessageBox.Show(errorMsg + Environment.NewLine + "This Script File has not been overwritten since it can not be saved.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
errorMsg = "";
|
||||
|
|
@ -811,6 +824,7 @@ namespace DSPRE.ROMFiles {
|
|||
errorMsg += Environment.NewLine;
|
||||
errorMsg += Environment.NewLine;
|
||||
}
|
||||
|
||||
if (unreferencedActions.Count > 0) {
|
||||
string[] orphanedActions = unreferencedActions.ToArray().Select(x => x.ToString()).ToArray();
|
||||
errorMsg += "Unused Action IDs detected: " + Environment.NewLine + string.Join(", ", orphanedActions);
|
||||
|
|
@ -819,6 +833,7 @@ namespace DSPRE.ROMFiles {
|
|||
errorMsg += Environment.NewLine;
|
||||
errorMsg += Environment.NewLine;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(errorMsg)) {
|
||||
MessageBox.Show(errorMsg + Environment.NewLine + "Remember that every unused Function or Action is always lost upon reloading the Script File.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
errorMsg = "";
|
||||
|
|
@ -835,8 +850,8 @@ namespace DSPRE.ROMFiles {
|
|||
private bool FunctionIsInvoked(List<ScriptReference> refList, SortedSet<uint> uninvokedFuncsSet, uint funcID, int callCount = 0, uint? excludedCaller = null) {
|
||||
if (callCount >= 30) {
|
||||
MessageBox.Show("Something went very wrong saving this Script File!" +
|
||||
"\nIt is recommended that you backup its code somewhere, to avoid losing progress.",
|
||||
"Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
"\nIt is recommended that you backup its code somewhere, to avoid losing progress.",
|
||||
"Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -860,12 +875,12 @@ namespace DSPRE.ROMFiles {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (sr.typeOfCaller is containerTypes.Script) {
|
||||
if (sr.typeOfCaller is ContainerTypes.Script) {
|
||||
Console.WriteLine("Function " + funcID + " is directly called by Script " + sr.callerID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sr.typeOfCaller is containerTypes.Function) {
|
||||
if (sr.typeOfCaller is ContainerTypes.Function) {
|
||||
if (FunctionIsInvoked(refList, uninvokedFuncsSet, sr.callerID, ++callCount, excludedCaller: sr.invokedID)) { //check if caller function is invoked as well
|
||||
Console.WriteLine("Function " + funcID + " is called by Function " + sr.callerID);
|
||||
return true;
|
||||
|
|
@ -877,8 +892,9 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
public bool SaveToFileDefaultDir(int IDtoReplace, bool showSuccessMessage = true) {
|
||||
return SaveToFileDefaultDir(DirNames.scripts, IDtoReplace, showSuccessMessage);
|
||||
return SaveToFileDefaultDir(RomInfo.DirNames.scripts, IDtoReplace, showSuccessMessage);
|
||||
}
|
||||
|
||||
public void SaveToFileExplorePath(string suggestedFileName, bool blindmode) {
|
||||
SaveFileDialog sf = new SaveFileDialog {
|
||||
Filter = "Gen IV Script File (*.scr)|*.scr"
|
||||
|
|
@ -893,7 +909,8 @@ namespace DSPRE.ROMFiles {
|
|||
}
|
||||
|
||||
if (blindmode) {
|
||||
File.Copy(RomInfo.gameDirs[DirNames.scripts].unpackedDir + "\\" + ((int)fileID).ToString("D4"), sf.FileName, overwrite: true);
|
||||
string path = Filesystem.GetScriptPath(fileID);
|
||||
File.Copy(path, sf.FileName, overwrite: true);
|
||||
|
||||
string msg = "";
|
||||
if (!isLevelScript) {
|
||||
|
|
@ -905,28 +922,5 @@ namespace DSPRE.ROMFiles {
|
|||
this.SaveToFile(sf.FileName, showSuccessMessage: true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
internal class ScriptReference {
|
||||
public containerTypes typeOfCaller { get; private set; }
|
||||
public uint callerID { get; private set; }
|
||||
public containerTypes typeOfInvoked { get; private set; }
|
||||
public uint invokedID { get; private set; }
|
||||
public int invokedAt { get; private set; }
|
||||
|
||||
public ScriptReference(containerTypes typeOfCaller, uint callerID, containerTypes invokedType, uint invokedID, int invokedAt) {
|
||||
this.typeOfCaller = typeOfCaller;
|
||||
this.callerID = callerID;
|
||||
this.typeOfInvoked = invokedType;
|
||||
this.invokedID = invokedID;
|
||||
|
||||
this.invokedAt = invokedAt;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return typeOfCaller + " " + callerID + " invokes " + typeOfInvoked + " " + invokedID + " at " + invokedAt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
22
DS_Map/ROMFiles/ScriptReference.cs
Normal file
22
DS_Map/ROMFiles/ScriptReference.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
namespace DSPRE.ROMFiles {
|
||||
internal class ScriptReference {
|
||||
public ScriptFile.ContainerTypes typeOfCaller { get; private set; }
|
||||
public uint callerID { get; private set; }
|
||||
public ScriptFile.ContainerTypes typeOfInvoked { get; private set; }
|
||||
public uint invokedID { get; private set; }
|
||||
public int invokedAt { get; private set; }
|
||||
|
||||
public ScriptReference(ScriptFile.ContainerTypes typeOfCaller, uint callerID, ScriptFile.ContainerTypes invokedType, uint invokedID, int invokedAt) {
|
||||
this.typeOfCaller = typeOfCaller;
|
||||
this.callerID = callerID;
|
||||
this.typeOfInvoked = invokedType;
|
||||
this.invokedID = invokedID;
|
||||
|
||||
this.invokedAt = invokedAt;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return typeOfCaller + " " + callerID + " invokes " + typeOfInvoked + " " + invokedID + " at " + invokedAt;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
DS_Map/ROMFiles/VariableValueTrigger.cs
Normal file
32
DS_Map/ROMFiles/VariableValueTrigger.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
namespace DSPRE.ROMFiles {
|
||||
public class VariableValueTrigger : LevelScriptTrigger {
|
||||
public int variableToWatch { get; set; }
|
||||
public int expectedValue { get; set; }
|
||||
|
||||
public VariableValueTrigger(int scriptIDtoTrigger, int variableToWatch, int expectedValue) : base(VARIABLEVALUE, scriptIDtoTrigger) {
|
||||
this.variableToWatch = variableToWatch;
|
||||
this.expectedValue = expectedValue;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return base.ToString() + " when Var " + variableToWatch + " == " + expectedValue;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj) {
|
||||
// If the passed object is null
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj is VariableValueTrigger)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.ToString() == ((VariableValueTrigger)obj).ToString();
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return this.triggerType.GetHashCode() ^ variableToWatch.GetHashCode() ^ expectedValue.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
855
DS_Map/Resources/HGSSCommands.md
Normal file
855
DS_Map/Resources/HGSSCommands.md
Normal file
|
|
@ -0,0 +1,855 @@
|
|||
| | New proposed names | Parameters | Function | Notes |
|
||||
| ---- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 0000 | Nop | \- | Nothing | |
|
||||
| 0001 | Dummy | \- | Nothing | Has exactly the same ASM code as Nop. |
|
||||
| 0002 | End | \- | End script execution | |
|
||||
| 0003 | WaitTime | u16: Time; Var: ??? | Stop script execution for Time frames | The Var's purpose is unknown. Command uses ScrReg 0 as countdown. |
|
||||
| 0004 | RegValueSet | u8: Script Register; u8: Value | Assigns Value to Script Register value | |
|
||||
| 0005 | RegDataSet | u8: Script Register; u32: Value | Assigns Value to Script Register value | |
|
||||
| 0006 | RegAdrsSet | u8: Script Register; u32: Address | Assigns data in Address offset to Script Register value | |
|
||||
| 0007 | AdrsValueSet | u32: Address; u8: Value | Assigns Value to the Address offset | |
|
||||
| 0008 | AdrsRegSet | u32: Address; u8: Script Register | Assigns Script Register value to the Address offset | |
|
||||
| 0009 | RegRegSet | u8: Script Register 1; u8: Script Register 2 | Assigns Script Register 2 value to Script Register 1 value | |
|
||||
| 000A | AdrsAdrsSet | u32: Address 1; u32: Address 2 | Assigns data in Address 2 to the Address 1 offset | |
|
||||
| 000B | CompareRegs | u8: Script Register; u8: Script Register | Compares two Script Register | |
|
||||
| 000C | CompareRegValue | u8: Script Register; u8: Value | Compares Script Register value with Value | |
|
||||
| 000D | CompareRegAdrs | u8: Script Register; u32: Address | Compares Script Register value with data in Address | |
|
||||
| 000E | CompareAdrsReg | u32: Address; u8: Script Register | Compares data in Address with Script Register value | |
|
||||
| 000F | CompareAdrsValue | u32: Address; u8: Value | Compares data in Address with Value | |
|
||||
| 0010 | CompareAdrsAdrs | u32: Address 1; u32: Address 2 | Compares data in Address 1 with data in Address 2 | |
|
||||
| 0011 | CompareVarValue | Var: Variable; u16: Value | Compares Variable value with Value | |
|
||||
| 0012 | CompareVars | Var: Variable 1; Var: Variable 2 | Compares Variable 1 value with Variable 2 value | |
|
||||
| 0013 | ParallelCommonScript | u16: ??? | ??? | Somehow related with parallel common script execution. |
|
||||
| 0014 | CommonScript | u16: Global Script ID | Calls Global Script ID script | The Common Script table is located at 0xFA48C in IPKS arm9.bin, ordered from highest to lowest with structure: u16 Global Script ID | u16 Script file | u16 Text file. The executed script inside script file is determined as: used Global Script ID \- tabulated Global Script ID. |
|
||||
| 0015 | LocalScript | \- | Returns to the invoking script/function after a Common Script | |
|
||||
| 0016 | Jump | u32: Relative Jump | Jumps to a function, Relative Jump bytes forward or backward | Relative Jump can have negative values (backward jump). |
|
||||
| 0017 | JumpIfObjID | u8: Event ID; u32: Relative Jump | Jumps to a function, Relative Jump bytes forward or backward, if invoking event has Event ID as ID | |
|
||||
| 0018 | JumpIfBgID | u8: ???; u32: Relative Jump | ??? | Maybe jumps to a function if invoking event has a specific ID. |
|
||||
| 0019 | JumpIfPlayerDir | u8: Player Direction; u32: Relative Jump | Jumps to a function, Relative Jump bytes forward or backward, if player is looking in Player Direction | Supposed. Needs to be tested in game. |
|
||||
| 001A | Call | u32: Relative Jump | Calls a function, Relative Jump bytes forward or backward | Can be used to make loops when calling the own invoking function. |
|
||||
| 001B | Return | \- | Returns to the invoking script/function after a Call | |
|
||||
| 001C | JumpIf | u8: Condition; u32: Relative Jump | If Condition in the condition table, jumps to a function | Ask AdAstra for the condition list. Condition table is updated after a IfVarValue, IfVarVar, CheckFlag... |
|
||||
| 001D | CallIf | u8: Condition; u32: Relative Jump | If Condition in the condition table, calls a function | |
|
||||
| 001E | SetFlag | u16: Flag | Sets Flag to 1 | |
|
||||
| 001F | ClearFlag | u16: Flag | Sets Flag to 0 | |
|
||||
| 0020 | CheckFlag | u16: Flag | Checks if Flag is set | It updates the internal condition flag and maybe part of the condition table. |
|
||||
| 0021 | SetFlagFromVar | Var: Flag | Sets the flag whose ID is stored in Flag | |
|
||||
| 0022 | ClearFlagFromVar | Var: Flag | Clears the flag whose ID is stored in Flag | |
|
||||
| 0023 | FlagStatusToVar | Var: Flag; Var: Variable | Checks if Flag is set and store the result in Variable | |
|
||||
| 0024 | SetTrainerFlag | Flex: Trainer ID | Sets the flag of Trainer ID, so marks it as beaten trainer | So this trainer will not battle against you. Used in every Gym after the leader is beaten. |
|
||||
| 0025 | ClearTrainerFlag | Flex: Trainer ID | Clears the flag of Trainer ID, so marks it as unbeaten trainer | So this trainer can be challenged again. |
|
||||
| 0026 | CheckTrainerFlag | Flex: Trainer ID | Checks if Trainer ID has been beaten | It updates the internal condition flag and maybe part of the condition table. |
|
||||
| 0027 | IncrementVar | Var: Variable; Flex: Operand | Stores the operation Variable \+ Operand in Variable | |
|
||||
| 0028 | DecrementVar | Var: Variable; Flex: Operand | Stores the operation Variable \- Operand in Variable | |
|
||||
| 0029 | SetVar | Var: Variable; u16: Value | Stores Value in Variable | |
|
||||
| 002A | SetVarFromVariable | Var: Variable 1; Var: Variable 2 | Assigns value of Variable 2 to Variable 1 | |
|
||||
| 002B | SetVarFromFlexible | Var: Variable; Flex: Flexible Value | Stores Flexible Value (or its value if variable) in Variable | |
|
||||
| 002C | MessageAll | u8: Text Slot | Display line Text Slot from the text file, all at once | |
|
||||
| 002D | Message | u8: Text Slot | Display line Text Slot from the text file | |
|
||||
| 002E | MessageFlex | Flex: Text Slot | Display line Text Slot from the text file | Unlike 002D, this command also accepts a variable as the input field. |
|
||||
| 002F | MessageNoSkip | Flex: Text Slot | ??? | |
|
||||
| 0030 | | u8: Text Slot | ??? | |
|
||||
| 0031 | WaitAB | \- | Waits for button A or button B to be pressed | Somehow it uses ScrReg 0 as countdown. |
|
||||
| 0032 | WaitButton | \- | Waits for a button to be pressed | It seems only A, B, X and direction pad buttons work. |
|
||||
| 0033 | WaitABPad | \- | Waits for button A, button B or pad buttons to be pressed | Supposed. Needs to be tested in game. |
|
||||
| 0034 | OpenMessage | \- | ??? | |
|
||||
| 0035 | CloseMessage | \- | Closes message box | SDSME name is misleading, for no button is needed to be pressed. |
|
||||
| 0036 | FreezeMessage | \- | ??? | Probably keeps the message box alive after a script. ASM differs with CloseMessage only in a BL instruction. |
|
||||
| 0037 | SetIconBoard | u8: Text Slot; u8: Type; u16: Icon; u16: ??? | Prepares an icon board message box displaying Text Slot message, of Type type, and with Icon image if chosen type supports it | Type values from 0 to 3 are: brown (with icon), green (with icon), gray and blue. |
|
||||
| 0038 | SetTextBoard | u8: Type; u16: Icon | Prepares a text board message box of Type type, and with Icon image if chosen type supports it | Type values from 0 to 3 are: brown (with icon), green (with icon), gray and blue. |
|
||||
| 0039 | ShowBoard | u8: Process | Triggers different Process processes for the board | Process value 0 keeps the board, value 1 creates the board, value 2 hides the board, value 3 shows the board and value 4 deletes the board. |
|
||||
| 003A | WaitBoard | \- | Waits the board last process to end | Supposed. |
|
||||
| 003B | BoardMessage | u8: Text Slot; u16: Variable | Displays Text Slot message in the current text box, stores the current text box status in Variable | |
|
||||
| 003C | CloseBoard | Var: Variable | Returns 1 to Variable if the player has pressed a button so the board must close, 0 otherwise | Variable is stored in ScrReg 0. Command waits for a button to be pressed and stores result in Variable. |
|
||||
| 003D | Menu | \- | | |
|
||||
| 003E | | u8: ???; u8: ???; u8: ???; u8: ???; u8: ???; u8: ??? | | |
|
||||
| 003F | YesNoBox | Var: Variable | Opens a Yes-No dialog and stores user response in Variable | Variable is stored in ScrReg 0. |
|
||||
| 0040 | MultiStandardText | u8: X; u8: Y; u8: Cursor; u8: Cancel; Var: Selection | Prepares a multiple selection menu at X and Y screen position, with Cursor default selected option and possibility of cancelling depending on Cancel, with text bank #321, returns selected slot ID in Selection | If Cancel is 1, the user can select the last option by pressing B button. |
|
||||
| 0041 | MultiLocalText | u8: X; u8: Y; u8: Cursor; u8: Cancel; Var: Selection | Prepares a multiple selection menu at X and Y screen position, with Cursor default selected option and possibility of cancelling depending on Cancel, with local texts, returns selected slot ID in Selection | If Cancel is 1, the user can select the last option by pressing B button. |
|
||||
| 0042 | AddMultiOption | u8: Text Slot; u8: Multi Slot | Adds an option with Multi Slot ID showing Text Slot text | |
|
||||
| 0043 | ShowMulti | \- | Shows the prepared multi in screen | The game will hide it when the player has selected an option. |
|
||||
| 0044 | ListStandardText | u8: X; u8: Y; u8: Cursor; u8: Cancel; Var: Selection | Prepares a multiple selection list at X and Y screen position, with Cursor default selected option and possibility of cancelling depending on Cancel, with text bank #321, returns selected slot ID in Selection | If Cancel is 1, the user can select the last option by pressing B button. The difference between a Multi and a List seems to be that lists are scrollable. |
|
||||
| 0045 | ListLocalText | u8: X; u8: Y; u8: Cursor; u8: Cancel; Var: Selection | Prepares a multiple selection list at X and Y screen position, with Cursor default selected option and possibility of cancelling depending on Cancel, with local texts, returns selected slot ID in Selection | If Cancel is 1, the user can select the last option by pressing B button. The difference between a Multi and a List seems to be that lists are scrollable. |
|
||||
| 0046 | AddListOption | Flex: Option MSG; Flex: Highlight MSG; Flex: List Slot | Adds a new option to the list, with List Slot ID and showing text line Option MSG. It also displays text line Highlight MSG when that option is highlighted. | If Highlight MSG is set to 255 [0xFF], no message will be displayed when the option is highlighted.<br>This command relies on an open message box in order to display the highlight messages.<br><br>Trying to highlight an option with Highlight MSG different than 255 [0xFF] will result in a crash if no message box is already being displayed. |
|
||||
| 0047 | ShowList | \- | Shows the prepared list in screen | The game will hide it when the player has selected an option. |
|
||||
| 0048 | MultiColumn | u8: Columns | Splits the multi window in Columns different columns | |
|
||||
| 0049 | PlayFanfare | Flex: Sound | Plays Sound | |
|
||||
| 004A | StopFanfare | Flex: Sound | Stops Sound | |
|
||||
| 004B | WaitFanfare | Flex: Sound | Waits Sound to finish | |
|
||||
| 004C | PlayCry | Flex: Pokémon; Flex: Unused | Plays a Pokémon cry | |
|
||||
| 004D | WaitCry | \- | Waits the current cry to finish | |
|
||||
| 004E | PlaySound | u16: Sound | Pauses current music, then Plays Sound | |
|
||||
| 004F | WaitSound | \- | Waits for Sound to finish, then resumes music | |
|
||||
| 0050 | PlayMusic | u16: Music | Plays Music | |
|
||||
| 0051 | StopMusic | u16: Unused | Stops current music | Parameter is ignored because the game identifies what music is playing. |
|
||||
| 0052 | PlayDefaultMusic | \- | Plays map default music | |
|
||||
| 0053 | SetMusic | u16: Music | ??? | |
|
||||
| 0054 | FadeOutMusic | u16: Volume; u16: Time | Fades out the current music to Volume in Time frames | |
|
||||
| 0055 | FadeInMusic | u16: Time | Fades in the current music to normal volume in Time frames | |
|
||||
| 0056 | SetMusicPauseStatus \* | u8: SSEQ Player ID; u8: Status | ??? | |
|
||||
| 0057 | TempMusic \* | u16: Music ID | ??? | |
|
||||
| 0058 | SetBGMFlag \* | u8: ??? | ??? | Seems to set a flag related to the music system. |
|
||||
| 0059 | CheckChatotCry | Var: Variable | Checks if Chatot has custom sound, stores answer in Variable | Returns 0 or 1 to the specified Variable. Not for a specific Chatot but for all (they share a custom sound). |
|
||||
| 005A | StartChatotCry | Var: Variable | Starts Chatot microphone record, stores answer in Variable | Returns 0 or 1 to the specified Variable depending on successful recording. |
|
||||
| 005B | StopChatotCry | \- | Stops recording Chatot custom sound | |
|
||||
| 005C | SaveChatotCry | \- | ??? | Maybe saves the custom Chatot sound in the savegame. |
|
||||
| 005D | | \- | ??? | |
|
||||
| 005E | Movement | Flex: Event ID; u32: Relative Jump | Applies movement at Relative Jump to Event ID | Movements must be halfword-aligned in the script file. If you're using an old tool which doesn't align them, force the alignment with a TextPlayerName 0x0 or some unnoticeable command of 3, 5, 7 or 9 bytes length. |
|
||||
| 005F | WaitMovement | \- | Waits for all movements to finish | |
|
||||
| 0060 | LockAll | \- | Locks every event in the map | |
|
||||
| 0061 | ReleaseAll | \- | Releases every event in the map | |
|
||||
| 0062 | Lock | u16: Event ID | Locks Event ID | |
|
||||
| 0063 | Release | u16: Event ID | Releases Event ID | |
|
||||
| 0064 | AddOW | Flex: Event ID | Add Event ID overworld in the map | It is probable that, if executing this having Event ID overworld already in the map, it gets duplicated. |
|
||||
| 0065 | RemoveOW | Flex: Event ID | Removes Event ID overworld from the map | |
|
||||
| 0066 | LockCamera | Flex: X; Flex: Y | Locks the camera at position X and Y | Seems to place a invisible NPC at coords X and Y. It appears that both must be the current player position. |
|
||||
| 0067 | ReleaseCamera | \- | Releases the camera | |
|
||||
| 0068 | FacePlayer | \- | Makes the invoking event look at the player | In fact it simply takes the current player direction and makes the NPC look at the opposite direction. |
|
||||
| 0069 | GetPlayerPosition | Var: X; Var: Y | Saves the current player position in X and Y | |
|
||||
| 006A | GetOWPosition | Flex: Event ID; Var: X; Var: Y | Saves the current Event ID position in X and Y | If Event ID is deleted (via RemoveOW) it gives 0xFF for both coordinates. |
|
||||
| 006B | SetFollowingOverworld \* | Flex: X; Flex: Z; Flex: Y | ??? | Maybe teleports the player to other coords? |
|
||||
| 006C | KeepOverworld | Flex: Event ID; u8: Value | If Value is 1, prevents Event ID from disappearing when entering on a new map header | |
|
||||
| 006D | SetOWMovement | Flex: Event ID; u16: Movement | Changes the Event ID's movement number to Movement | |
|
||||
| 006E | GiveMoney | u32: Money | Adds Money to the player's money | |
|
||||
| 006F | TakeMoney | u32: Money | Subtracts Money from the player's money | |
|
||||
| 0070 | CompareMoney | Var: Variable; u32: Money | Stores 1 into Variable if the player has Money or more money. Stores 0 otherwise. | |
|
||||
| 0071 | ShowMoney | Flex: X; Flex: Y | Shows the money box at X and Y coordinates of the screen | Each X and Y unit implies 8 pixels. Values of 0 or higher than the screen may glitch the screen. |
|
||||
| 0072 | HideMoney | \- | Hides the money box | |
|
||||
| 0073 | UpdateMoney | \- | Updates the current money in the money box | |
|
||||
| 0074 | ShowSpecialCurrency | u8: Currency; Flex: X Coord; Flex: Y Coord | Shows the Currency box at X and Y coordinates of the screen. | Currency:<br><br>0 = Coins<br>1 = Battle Points<br>2 = Athlete Points |
|
||||
| 0075 | HideSpecialCurrency | \- | Hides the currently displayed special currency box. | |
|
||||
| 0076 | UpdateSpecialCurrency | u16: Currency | Updates the current Currency in the currency box. | Currency types are the same as above [0074]. |
|
||||
| 0077 | CheckCoins | Var: Variable | Stores the current casino coin amount in Variable | |
|
||||
| 0078 | GiveCoins | Flex: Coins | Adds Coins to the player's casino coins | |
|
||||
| 0079 | TakeCoins | Flex: Coins | Subtracts Coins from the player's casino coins | |
|
||||
| 007A | GiveAthletePoints | Flex: Amount | Adds the given Amount to the player's Athlete Points | |
|
||||
| 007B | TakeAthletePoints | Flex: Amount | Subtracts the given Amount from the player's Athlete Points | |
|
||||
| 007C | CompareAthletePoints | Var: Result; Flex: Amount | Stores 1 into Variable if the player has the given Amount of Athlete Points or more. Stores 0 otherwise. | |
|
||||
| 007D | GiveItem | Flex: Item; Flex: Amount; Var: Variable | Adds Amount of Item item, stores 1 in Variable if the player had less than 1000 - Amount (100 - Amount if TM/HM), stores 0 otherwise | Both Item and Amount are flexible, but if you use CommonScript 0x7F1 after that (as it is meant to be) you must place these two values in 0x8004 and 0x8005 in order to make the script work properly. |
|
||||
| 007E | TakeItem | Flex: Item; Flex: Amount; Var: Variable | Subs Amount of Item item, stores 1 in Variable if the player had at least Amount items in the bag, stores 0 otherwise | |
|
||||
| 007F | CheckItemSpace | Flex: Item; Flex: Amount; Var: Variable | Stores 1 in Variable if the player has less than 1000 - Amount of Item items (100 - Amount if TM/HM), stores 0 otherwise | |
|
||||
| 0080 | CheckItem | Flex: Item; Flex: Amount; Var: Variable | Stores 1 in Variable if the player has at least Amount of Item items in the bag, stores 0 otherwise | Even if the Amount to check for is 0, the check will return 0 if you don't have the item at all. |
|
||||
| 0081 | CheckItemIsMachine | Flex: Item; Var: Variable | Stores 1 in Variable if Item is TM or HM, stores 0 otherwise | |
|
||||
| 0082 | GetItemPocket | Flex: Item; Var: Variable | Stores the bag pocket of Item in Variable | |
|
||||
| 0083 | SetStarter | Flex: Pokémon | Stores Pokémon as the starting Pokémon in the game save data | |
|
||||
| 0084 | GenderMessage | u8: Male Text; u8: Female Text | Displays Male Text or Female Text message depending on player's gender | |
|
||||
| 0085 | CheckSeals \* | Flex: Seal ID; Var: Number of Seals in Seal Case | Checks the number of a certain type of Ball Seals that the player has. The variable is the output of how many Seals you have. | Example: Farmhouse on Route 39 |
|
||||
| 0086 | GiveSeals \* | Flex: Seal ID; Flex: Number of Seals to be Given | Gives the player Ball Seals. | Example: Farmhouse on Route 39 |
|
||||
| 0087 | GiveRandomSeals \* | Var: Random Seal ID 1; Var: Random Seal ID 2; Var: Random Seal ID 3 | Generates three random types of Ball Seals and gives them to the player (repeats are possible). Each variable will yield a 0 if the player has no more room for the Seal(s) in the Seal Case. | Example: House in top right of Olivine City |
|
||||
| 0088 | CheckPokemonForm \* | Flex: Party Position; Var: Variable | Checks the form of the Pokemon in party slot Party Position and returns the form ID in Variable. | |
|
||||
| 0089 | GivePokemon | Flex: Pokémon; Flex: Level; Flex: Item ID; Flex: Form; Flex: Ability; Var: Variable | Gives Pokémon at level Level, store 1 in Variable if succeed and 0 otherwise | |
|
||||
| 008A | GivePokemonEgg | Flex: Pokémon; Flex: Location | Gives a Pokémon egg received from Location text slot at text bank #281 | |
|
||||
| 008B | ReplaceMove | Flex: Party Slot; Flex: Move Slot; u16: Move ID | Overwrites Move Slot of the Pokémon at the specified Party Slot with Move ID. | Party slot and move slot start at 0 rather than 1, so the ranges are 0-5 and 0-3 respectively.<br>[https://bulbapedia.bulbagarden.net/wiki/List_of_moves](https://bulbapedia.bulbagarden.net/wiki/List_of_moves) |
|
||||
| 008C | CheckPokemonHasMove | Var: Variable; Flex: Move ID; Flex: Party Slot | Checks if a Pokémon at the specified Party Slot knows a move with given Move ID.<br>Stores 1 into Variable if yes, 0 otherwise. | Example: Headbutt tutor in Ilex Forest (Script File 92, Script 3) |
|
||||
| 008D | CheckMoveInParty | Var: Variable; Flex: Move ID | Checks if any Pokémon in the party knows Move ID move, stores in Variable the position of the first Pokémon that knows it or stores 6 if no Pokémon in the party knows the move | |
|
||||
| 008E | CheckPokeGearRematch \* | Flex: Phone Number; Var: Variable | | Has something to do with rematches but not sure if it's checking if a rematch is active or the # the rematch is on. Gets used when deciding when to let Gym Leaders appear in the overworld for a photo shoot after they are defeated in the Dojo. |
|
||||
| 008F | ChooseRivalName | Var: Variable | Opens the keyboard for naming the rival, stores 1 in Variable if user cancels the proccess | |
|
||||
| 0090 | GetCounterpartSprite | Var: Variable | Stores 97 (Lyra sprite ID) into the Variable if you're playing as Ethan;<br>Stores 0 (Ethan sprite ID) into the Variable if you're playing as Lyra. | Remember that Overworld Entities with sprite IDs 101 to 116 refer to the value of vars 0x4020-0x402F for the sprite to display. |
|
||||
| 0091 | UpgradePokegear | u8: Module | Adds the worldmap to the Pokegear if Module is 1, adds the radio if Module is 2 | |
|
||||
| 0092 | RecordPokegearNumber | Flex: ??? | | |
|
||||
| 0093 | CheckPokegearNumberRegistered \* | Flex: Phone Number; Var: Variable | Stores 0 into Variable if Phone Number has not been registered, and 1 if it has been registered. | Example: Sabrina in Olivine Harbor (Script File 153, Script 7). Used frequently by Gym Leaders appearing in the overworld. |
|
||||
| 0094 | | | | |
|
||||
| 0095 | | | | |
|
||||
| 0096 | ReturnScreen | \- | Restores the normal overworld screen | |
|
||||
| 0097 | | | | |
|
||||
| 0098 | | \- | | |
|
||||
| 0099 | DressPokemon \* | \- | | |
|
||||
| 009A | ContestDressupScreen \* | \- | | |
|
||||
| 009B | DressUpArtworkScreen \* | \- | | |
|
||||
| 009C | SealCapsuleScreen \* | \- | | |
|
||||
| 009D | WorldMapScreen | \- | Opens the worldmap screen | |
|
||||
| 009E | PCBoxScreen \* | \- | | |
|
||||
| 009F | DrawScreenUnion \* | \- | | |
|
||||
| 00A0 | TrainerCaseUnion \* | \- | | |
|
||||
| 00A1 | TradeScreenUnion \* | \- | | |
|
||||
| 00A2 | RecordMixingUnion \* | \- | | |
|
||||
| 00A3 | EndGameScreen | \- | Opens the Hall of Fame and game ending screens | |
|
||||
| 00A4 | HallOfFameData \* | \- | | |
|
||||
| 00A5 | StoreGTSStatus \* | ??? | | |
|
||||
| 00A6 | InitWFC \* | ??? | | |
|
||||
| 00A7 | StarterSelectionScreen | \- | Opens the starter Pokémon selection screen | |
|
||||
| 00A8 | GetTrainerPathToPlayer \* | Flex: ??? | | |
|
||||
| 00A9 | TrainerStepTowardsPlayer \* | Flex: ???; Var: Variable | | |
|
||||
| 00AA | GetTrainerEyeType \* | Var: Variable | | |
|
||||
| 00AB | GetEyeTrainerNum \* | Flex: ???; Var: Variable | | |
|
||||
| 00AC | WritePlayerName | Var: Variable | Opens the keyboard for naming the player, stores 1 in Variable if user cancels the proccess | |
|
||||
| 00AD | WritePokemonName | Flex: Party Position; Var: Variable | Opens the keyboard for naming a Pokémon in Party Position, stores 1 in Variable if user cancels the proccess | |
|
||||
| 00AE | FadeScreen | u16: Frame Count; u16: Duration; u16: Fade Style; u16: Color | Fades screen to chosen 15-bit Color, using the chosen Fade Style. The transition will render Frame Count images, of Duration length each. | Type 0 for fade in, Type 1 for fade out. Color has 15-bit format. Transition is the number of color changes that the game does in the fading. |
|
||||
| 00AF | WaitFadeScreen | \- | Waits for the screen fade to end | |
|
||||
| 00B0 | Warp | Flex: Map; u16: Door; Flex: X; Flex: Y; Flex: Dir | Warps to X and Y position of Map header with initial Dir direction, using Door warp | When Door is 0 it doesn't use any door animation. |
|
||||
| 00B1 | RockClimbAnimation | Flex: Party Position | Uses rock climb with the Pokémon at Party Position position | |
|
||||
| 00B2 | SurfAnimation | Flex: Party Position | Uses surf with the Pokémon at Party Position position | |
|
||||
| 00B3 | WaterfallAnimation | Flex: Party Position | Uses waterfall with the Pokémon at Party Position position | |
|
||||
| 00B4 | FlyAnimation | u16: Map; Flex: X; Flex: Y | Flies to Map header map, to coordinates X and Y | |
|
||||
| 00B5 | FlashAnimation | \- | Sets weather to 12 (darkness after flash) and then updates the weather graphics | |
|
||||
| 00B6 | WhirlpoolAnimation | Flex: Party Position | Uses whirlpool with the Pokémon at Party Position position | |
|
||||
| 00B7 | CutAnimation | Flex: Party Position | Uses cut with the Pokémon at Party Position position | |
|
||||
| 00B8 | CheckBike | Var: Variable | Stores 1 in Variable if player is riding the bike, stores 0 otherwise | |
|
||||
| 00B9 | RideBike | u8: Action | Changes player form from normal to riding the bike if Action is 1, otherwise it sets the normal form to the player | |
|
||||
| 00BA | CyclingRoad | u8: Action | If Action is 1, the game sets the cycling road flag and moves the player down. Otherwise the flag is deactivated. | |
|
||||
| 00BB | CheckPlayerForm | Var: Variable | Stores in Variable the current player form | Values 0 is for normal form, value 1 for riding the bike, value 2 for surfing, value 3 for Rocket clothing |
|
||||
| 00BC | SetPlayerForm | u16: Form | Activates the Form bit in the internal player form data | The purpose of the different bits still needs to be researched. |
|
||||
| 00BD | UpdatePlayerForm | \- | Updates changes in the internal player form data in the screen | |
|
||||
| 00BE | TextPlayerName | u8: String Buffer | Stores player's name in String Buffer | |
|
||||
| 00BF | TextRivalName | u8: String Buffer | Stores rival's name in String Buffer | |
|
||||
| 00C0 | TextCounterpart | u8: String Buffer | Stores counterpart's name in String Buffer | |
|
||||
| 00C1 | TextPartyPokemon | u8: String Buffer; Flex: Party Position | Stores the name of the Pokémon in Party Position in String Buffer | |
|
||||
| 00C2 | TextItem | u8: String Buffer; Flex: Item | Stores Item's name in String Buffer | |
|
||||
| 00C3 | TextPocket | u8: String Buffer; Flex: Pocket | Stores Pocket's name in String Buffer | |
|
||||
| 00C4 | TextMachineMove | u8: String Buffer; Flex: Item | Stores the name of the move contained in Item TM/HM in String Buffer | |
|
||||
| 00C5 | TextMove | u8: String Buffer; Flex: Move | Stores battle Move's name in String Buffer | |
|
||||
| 00C6 | TextNumber | u8: String Buffer; Flex: Number | Stores a Number in String Buffer | |
|
||||
| 00C7 | TextPokeNickname | u8: String Buffer; Flex: Party Position | Stores the nickname of the Pokémon in Party Position in String Buffer | |
|
||||
| 00C8 | | | | |
|
||||
| 00C9 | TextPlayerTrainerType | u8: String Buffer | Stores player's Union Room trainer type in String Buffer | |
|
||||
| 00CA | TextPokemon | u8: String Buffer; Flex: Pokémon; u16: Unused; u8: Unused | Stores Pokémon's name in String Buffer | The two Unused parameters are for defining male/female nouns and singular/plural nouns respectively. However both don't apply in this command. |
|
||||
| 00CB | TextStarterPokemon | u8: String Buffer | Stores the name of the player' starter Pokémon in String Buffer | |
|
||||
| 00CC | TextRivalStarter | u8: String Buffer | Stores the name of the rival' starter Pokémon in String Buffer | |
|
||||
| 00CD | TextCounterpartStarter | u8: String Buffer | Stores the name of the counterpart' starter Pokémon in String Buffer | |
|
||||
| 00CE | CheckStarter | Var: Variable | Stores the starter Pokémon ID in Variable | |
|
||||
| 00CF | DummyTextGoods | u8: String Buffer; Flex: Unused | Loads an empty string in String Buffer | |
|
||||
| 00D0 | DummyTextTrap | u8: Unused; Flex: Unused | Nothing | |
|
||||
| 00D1 | DummyTextTreasure | u8: Unused; Flex: Unused | Nothing | |
|
||||
| 00D2 | TextMapName | u8: String Buffer; Flex: Map | Stores Map header name in String Buffer | |
|
||||
| 00D3 | GetSwarmInfo | Var: Map; Var: Pokémon | Selects a zone depending on a random seed, then stores the zone ID in Map and the corresponding swarm Pokémon of that zone in Pokémon | Predicted. Needs to be checked. |
|
||||
| 00D4 | TrainerID | Var: Variable | Stores the trainer ID number in Variable depending on the script ID | This means you shouldn't use this command in a normal script. |
|
||||
| 00D5 | TrainerBattle | Flex: Trainer 1; Flex: Trainer 2; u8: Result; u8: ??? | Starts a battle against Trainer 1 and, if Trainer 2 is neither 0 nor the same as Trainer 1, a double battle against both. Continues without warping to Pokemon Center/home if Result is equal to 1. | Your party will also be fully healed after the battle if Result is 1. Example: Cherrygrove City fight with Rival |
|
||||
| 00D6 | TrainerMessage | Flex: Trainer ID; Flex: Type | Displays the text of Trainer ID trainer at condition Type | The possible Type values are the following (expand the note for see them) |
|
||||
| 00D7 | TrainerMsgCheck | Var: Noticing; Var: Defeat; Var: One Pokémon | If the script ID corresponds to a single battle trainer, stores 0 in Noticing, 2 in Defeat and 0 in One Pokémon. If it corresponds to a double battle, stores 3, 5 and 6 or 7, 9 and 10 depending on whether it's the first or the second trainer | This means you shouldn't use this command in a normal script. |
|
||||
| 00D8 | TrainerRematchMsgCheck | Var: Noticing; Var: Defeat; Var: One Pokémon | If the script ID corresponds to a single battle trainer, stores 17 in Noticing, 0 in Defeat and 0 in One Pokémon. If it corresponds to a double battle, stores 18, 0 and 6 or 19, 0 and 10 depending on whether it's the first or the second trainer | This means you shouldn't use this command in a normal script. |
|
||||
| 00D9 | TrainerTypeCheck | Var: Variable | Stores 0 in Variable if the script ID corresponds to a single battle, stores 1 if it corresponds to a double battle | This means you shouldn't use this command in a normal script. |
|
||||
| 00DA | TrainerMusic | Flex: Trainer | Plays Trainer's overworld music | It checks if player is in Johto or Kanto for that. |
|
||||
| 00DB | LostBattle | \- | Return to Pokémon Center or player's house after being defeated | |
|
||||
| 00DC | CheckBattleIsLost | Var: Variable | Stores 0 in Variable if player has been defeated in battle, stores 1 otherwise | |
|
||||
| 00DD | CheckDefeatedPokemon | Var: Variable; u8: ??? | Stores 0 in Variable if player defeated or catched the wild Pokemon, stores 1 otherwise | |
|
||||
| 00DE | Check2vs2 | Var: Variable | Stores 1 in Variable if player has at least 2 not fainted Pokémon, stores 0 otherwise | |
|
||||
| 00DF | DummyTrainerBattle | \- | Starts a battle against trainer with ID 1 | |
|
||||
| 00E0 | DummyTrainerFlag | \- | Sets the trainer flag with the same ID as the invoking event | |
|
||||
| 00E1 | DummyTrainerFlagJump | u32: Relative Jump | Jumps to a function, Relative Jump bytes forward or backward, if trainer flag with the invoking event ID is set | |
|
||||
| 00E2 | | | | |
|
||||
| 00E3 | | | | |
|
||||
| 00E4 | | | | |
|
||||
| 00E5 | | | | |
|
||||
| 00E6 | | | | |
|
||||
| 00E7 | | | | |
|
||||
| 00E8 | | | | |
|
||||
| 00E9 | | | | |
|
||||
| 00EA | | | | |
|
||||
| 00EB | | | | |
|
||||
| 00EC | | | | |
|
||||
| 00ED | | | | |
|
||||
| 00EE | CheckPokerus | Var: Variable | Stores 1 in Variable if one or more Pokémon in the party are infected with the Pokérus | |
|
||||
| 00EF | GetPokemonGender | Flex: Party Position; Var: Variable | Stores 0 in Variable if Pokémon at Party Position is male, 1 if is female and 2 if gender is unknown | Unknown gender value is supposed and should be checked. |
|
||||
| 00F0 | SetElevatorWarp \* | Var: Variable | | |
|
||||
| 00F1 | GetElevatorFloor | Var: Variable | Stores in Variable the current floor in a elevator | |
|
||||
| 00F2 | ElevatorBox | u8: X; u8: Y; Var: Variable; Flex: Floor | Shows the current floor number in a box at X and Y coordinates in the screen | Each X and Y unit implies 8 pixels. Values of 0 or higher than the screen may glitch the screen. Variable and Floor parameters have not been tested. |
|
||||
| 00F3 | CountJohtoDexSeen | Var: Variable | Stores in Variable the total seen Pokemon in the Johto Pokédex | |
|
||||
| 00F4 | CountJohtoDexObtained | Var: Variable | Stores in Variable the total obtained Pokemon in the Johto Pokédex | |
|
||||
| 00F5 | CountNationalDexSeen | Var: Variable | Stores in Variable the total seen Pokemon in the National Pokédex | |
|
||||
| 00F6 | CountNationalDexObtained | Var: Variable | Stores in Variable the total obtained Pokemon in the National Pokédex | |
|
||||
| 00F7 | DummyNationalDexCheck | \- | Nothing | |
|
||||
| 00F8 | GetDexProgressMsg | u8: Mode; Var: Message; Var: Unknown | Checks the number of seen Pokémon in the Johto Pokédex (if Mode is 0) or the number of obtained Pokémon in the National Pokédex (otherwise) and stores the corresponding Professor message in Message, also storing 0x4AA in Unknown | |
|
||||
| 00F9 | WildBattle | Flex: Pokémon; Flex: Level | Starts a wild battle against a Pokémon of level Level | |
|
||||
| 00FA | WildBattleNoButtons | Flex: Pokémon; Flex: Level | Starts a first wild battle against a Pokémon of level Level | The difference between this and other similar commands is that Bag, Run and Pokémon buttons are disabled. |
|
||||
| 00FB | CatchTutorial | \- | Starts the catch tutorial battle | |
|
||||
| 00FC | | | | |
|
||||
| 00FD | CheckSaveGame | Var: Variable | Stores 0 in Variable if a different savegame exists and it's not possible to save, stores 1 if no previous savegame exists, stores 2 if game has to save a lot of data and stores 3 if game can perform a quick save | |
|
||||
| 00FE | SaveGame \* | | | |
|
||||
| 00FF | CheckPortrait \* | | | |
|
||||
| 0100 | SetPortraitTitle \* | | | |
|
||||
| 0101 | | | | |
|
||||
| 0102 | | | | |
|
||||
| 0103 | | | | |
|
||||
| 0104 | | | | |
|
||||
| 0105 | | | | |
|
||||
| 0106 | | | | |
|
||||
| 0107 | | | | |
|
||||
| 0108 | | | | |
|
||||
| 0109 | | | | |
|
||||
| 010A | | | | |
|
||||
| 010B | | | | |
|
||||
| 010C | | | | |
|
||||
| 010D | | | | |
|
||||
| 010E | | | | |
|
||||
| 010F | | | | |
|
||||
| 0110 | | | | |
|
||||
| 0111 | | | | |
|
||||
| 0112 | | | | |
|
||||
| 0113 | MartScreen | Flex: Unused | Opens the common mart shopping screen | |
|
||||
| 0114 | SpMartScreen | Flex: Mart ID | Opens the Mart ID mart shopping screen | Used in the Departament Store for a shop with specific fixed items. At 0x48188 of arm9.bin (IPKS) is the pointer to the shops table, each entry of the table being a pointer to an item table. |
|
||||
| 0115 | GoodsMartScreen | Flex: Mart ID | Opens the Mart ID goods mart shopping screen | |
|
||||
| 0116 | SealMartScreen | Flex: Mart ID | Opens the Mart ID seal mart shopping screen | |
|
||||
| 0117 | DummyLostBattle | \- | Return to Pokémon Center or player's house after being defeated | Same code as LostBattle command. |
|
||||
| 0118 | SetLastWarp | Flex: Warp ID | Sets map's Warp ID warp as the last used warp | Supposed. This would affect actions like Escape Rope use. |
|
||||
| 0119 | CheckPlayerGender | Var: Variable | Stores 0 in Variable if player is male, stores 1 if female | |
|
||||
| 011A | HealPokemon | \- | Heals every Pokémon in the player's party | That does not include the black fade nor the healing sound. |
|
||||
| 011B | EndWirelessComms \* | | | |
|
||||
| 011C | EnterBattleRoom \* | | | |
|
||||
| 011D | SetPlayerDirComm \* | | | |
|
||||
| 011E | UnionMapChange \* | | | |
|
||||
| 011F | UnionRoomSpriteScreen \* | | | |
|
||||
| 0120 | StoreUnionSprite \* | | | |
|
||||
| 0121 | SetUnionSprite \* | | | |
|
||||
| 0122 | CheckPokedex | Var: Variable | Stores 1 in Variable if player has the Pokédex, stores 0 otherwise | |
|
||||
| 0123 | GivePokedex | \- | Gives the Pokédex to the player | |
|
||||
| 0124 | CheckShoes | Var: Variable | Stores 1 in Variable if player has the running shoes, stores 0 otherwise | |
|
||||
| 0125 | GiveShoes | \- | Gives the running shoes to the player | |
|
||||
| 0126 | CheckBadge | Flex: Badge ID; Var: Variable | Checks if player has Badge ID badge, stores result in Variable | |
|
||||
| 0127 | GiveBadge | Flex: Badge ID | Gives the player Badge ID badge | |
|
||||
| 0128 | CountBadges | Var: Variable | Stores in Variable the number of badges obtained | |
|
||||
| 0129 | DummyCheckBag | Var: Variable | Stores 1 in Variable if flag 0x960 is set, stores 0 otherwise | |
|
||||
| 012A | DummyGiveBag | \- | Sets flag 0x960 | |
|
||||
| 012B | CheckPartner | Var: Variable | Stores 1 in Variable if the following event flag is activated, stores 0 otherwise | |
|
||||
| 012C | SetPartner | \- | Activates the following event flag, so you can no longer use the bike, surf, rock climb... | |
|
||||
| 012D | ClearPartner | \- | Deactivates the following event flag, so you can use the bike, surf, rock climb... again | |
|
||||
| 012E | CheckStepFlag \* | | | |
|
||||
| 012F | SetStepFlag \* | | | |
|
||||
| 0130 | ClearStepFlag \* | | | |
|
||||
| 0131 | DummyCheckGameCompleted | Var: Variable | Stores 1 in Variable if flag 0x964 is set, stores 0 otherwise | This flag is not the one that HGSS uses when the player clears the game. |
|
||||
| 0132 | DummyGameCompleted | \- | Sets flag 0x964 | This flag is not the one that HGSS uses when the player clears the game. |
|
||||
| 0133 | DoorAnimation | u16: Matrix X; u16: Matrix Y; Flex: Map X; Flex: Map Y; u8: Door ID | Prepares a building located at Map X and Map Y coordinates in a map located at Matrix X and Matrix Y in the current matrix for animation, with Door ID animation ID | |
|
||||
| 0134 | WaitDoor | u8: Door ID | Wait animation of building with Door ID animation ID | |
|
||||
| 0135 | FreeDoor | u8: Door ID | Free animation of building with Door ID animation ID | |
|
||||
| 0136 | OpenDoor | u8: Door ID | Triggers first animation of building with Door ID animation ID | |
|
||||
| 0137 | CloseDoor | u8: Door ID | Triggers second animation of building with Door ID animation ID | |
|
||||
| 0138 | GetDaycareNames | \- | Stores first daycare Pokémon nickname in string buffer 0, the second daycare Pokémon nickname in string buffer 1 and the first Pokémon trainer's name in buffer 2 | If there's only one Pokémon in the daycare, string buffer 1 does not change. If no Pokémon is in the daycare, commands does nothing. |
|
||||
| 0139 | GetDaycareStatus | Var: Variable | If daycare Pokémon have an egg, stores 1 in Variable. Otherwise it stores 0 if no Pokémon is in the daycare, 2 if only one Pokémon is in the daycare or 3 if there are two Pokémon | |
|
||||
| 013A | InitEcruteakGym \* | | | |
|
||||
| 013B | | | ??? Something to do with the Goldenrod Dept. Store Basement, probably moving around blocks or opening access to doors. | |
|
||||
| 013C | | | ??? | |
|
||||
| 013D | | | | |
|
||||
| 013E | CianwoodGymInit \* | | | |
|
||||
| 013F | CianwoodGymTurnWinch \* | | | |
|
||||
| 0140 | VermilionGymInit \* | | | |
|
||||
| 0141 | VermilionGymLockAction \* | | | |
|
||||
| 0142 | VermilionGymCanCheck \* | | | |
|
||||
| 0143 | ResetVermilionGymCans \* | | | |
|
||||
| 0144 | InitVioletGym | \- | Initializes Violet Gym internal data and 3D model animations | |
|
||||
| 0145 | VioletGymElevator | \- | Triggers model #111 to move up or down | |
|
||||
| 0146 | InitAzaleaGym \* | | | |
|
||||
| 0147 | AzaleaGymSpinarak \* | | | |
|
||||
| 0148 | AzaleaGymSwitch \* | | | |
|
||||
| 0149 | BlackthornGymInit \* | | | |
|
||||
| 014A | FuchsiaGymInit \* | | | |
|
||||
| 014B | ViridianGymInit \* | | | |
|
||||
| 014C | GetPartyCount | Var: Variable | Stores in Variable the current number of Pokémon in the party | |
|
||||
| 014D | BagScreen \* | | | |
|
||||
| 014E | BagScreenSelection \* | | | |
|
||||
| 014F | CheckPocketItems \* | | | |
|
||||
| 0150 | DummyTextBerry \* | | | |
|
||||
| 0151 | TextNature? \* | | | |
|
||||
| 0152 | SetOWDefaultPosition | Flex: Event ID; Flex: X; Flex: Y | Sets Event ID spawn position to global coords X and Y | |
|
||||
| 0153 | SetOWPosition | Flex: Event ID; Flex: X; Flex: Z; Flex: Y; Flex: Dir | Moves Event ID to global coords X, Y, Z with Dir direction | Even though some maps are higher, the Z parameter is often 0. Game seems to calculate the correct Z position if it is wrong. |
|
||||
| 0154 | SetOWDefaultMovement | Flex: Event ID; Flex: Movement ID | Sets Event ID's default move code to Movement ID | |
|
||||
| 0155 | SetOWDefaultDirection | Flex: Event ID; Flex: Direction ID | Sets Event ID's default direction to Direction ID | |
|
||||
| 0156 | SetWarpPosition | Flex: Warp ID; Flex: X; Flex: Y | Moves Warp ID to global coords X and Y | |
|
||||
| 0157 | SetSpawnablePosition | Flex: Spawnable ID; Flex: X; Flex: Y | Moves Spawnable ID to global coords X and Y | |
|
||||
| 0158 | SetOWDirection | Flex: Event ID; Flex: Direction ID | Sets Event ID's current direction to Direction ID | |
|
||||
| 0159 | AddWaitingIcon \* | | | |
|
||||
| 015A | RemoveWaitingIcon \* | | | |
|
||||
| 015B | ReturnScriptWkSet \* | | | |
|
||||
| 015C | WaitTimeOrAB | Flex: Time | Stops script execution until Time frames have passed or until user presses A or B buttons | |
|
||||
| 015D | ChoosePKMNSelection \* | | | |
|
||||
| 015E | UnionChoosePKMNSelection\* | | | |
|
||||
| 015F | GetSelectedPartySlot | Var: Variable | Stores in Variable the selected party slot in a party Pokémon screen, or 0xFF is user cancelled the selection | |
|
||||
| 0160 | SelectMove \* | | | |
|
||||
| 0161 | GetMoveSelection \* | | | |
|
||||
| 0162 | GetPartyPokemonID | Var: Party Position; Var: Variable | Stores in Variable the ID of the Pokémon at Party Position | It will return 0 if Pokémon is an egg. |
|
||||
| 0163 | CheckTradedPokemon | Var: Party Position; Var: Variable | Stores 0 in Variable if trainer ID and secret ID of the Pokémon at Party Position are the player's ones, stores 1 otherwise | |
|
||||
| 0164 | CountPartyBornPokemon | Var: Variable | Stores in Variable the number of Pokémon in the Pokémon party, excluding the eggs | |
|
||||
| 0165 | CountAlivePokemonExceptFirst | Var: Variable; Flex: Party Position | Stores in Variable how many alive Pokémon would remain in the Pokémon party if Pokémon at Party Position disappeared | Eggs are excluded from the count. |
|
||||
| 0166 | CountTotalAlivePokemon | Var: Variable | Stores in Variable the number of Pokémon in the Pokémon party and PC boxes, excluding the eggs and fainted Pokémon | As Pokémon can't be fainted in the PC boxes, only eggs are not taken into account in the PC boxes count. |
|
||||
| 0167 | CountPartyEggs | Var: Variable | Stores in Variable the number of eggs in the Pokémon party | |
|
||||
| 0168 | TakeMoneyFlex | Flex: Money | Subtracts Money from the player's money | |
|
||||
| 0169 | RetrieveDayCareMon \* | | | |
|
||||
| 016A | GiveLoanMon \* | | | |
|
||||
| 016B | CheckReturnLoanMon \* | | | |
|
||||
| 016C | DeletePartyPokemon | Flex: Party Position | Deletes the Pokémon at Party Position from the party | The Pokémon data is destroyed. |
|
||||
| 016D | RemoveDayCareEgg \* | | | |
|
||||
| 016E | GiveDayCareEgg \* | | | |
|
||||
| 016F | TextDayCareCost \* | | | |
|
||||
| 0170 | CompareMoneyFlex | Var: Variable; Flex: Money | Returns 1 to Variable if the player has Money or more money, returns 0 otherwise | |
|
||||
| 0171 | EggHatchScreen | \- | Opens the egg hatching screen with an egg in the Pokémon party that has 0 steps left for hatching | This may crash if there's no ready egg in the Pokémon party. It's better not to use this command unless you know what are you doing. |
|
||||
| 0172 | | | | |
|
||||
| 0173 | CheckDaycareLevelGain \* | Var: Variable; Flex: Position | Stores the amount of levels a Pokémon in the Daycare has gained from being in the Daycare | |
|
||||
| 0174 | GetDayCareSpeciesandNick \* | | | |
|
||||
| 0175 | GiveDayCareMon \* | | | |
|
||||
| 0176 | UnvanishOverworld | Flex: Event ID | Makes Event ID visible again if it was invisible | Can be used on Following Pokémon. Useful for scripting events that happen as soon as the player walks into a buidling and their Following Pokémon hasn't spawned yet. The Following Pokémon will "unvanish" on the same tile as the player, so account for this in movement scripts. |
|
||||
| 0177 | VanishOverworld | Flex: Event ID | Makes Event ID invisible, but still collisionable | It's a great idea to use this command in a level script for blocking doors with invisible events. |
|
||||
| 0178 | MailScreen | \- | Opens the mail screen | |
|
||||
| 0179 | CountMail | Var: Variable | Stores in Variable the current amount of mails in the mailbox | |
|
||||
| 017A | RankingView \* | | | |
|
||||
| 017B | GetTimePeriod | Var: Variable | Stores in Variable the current time period of the day | The different values are:<br>0: From 04:00 AM to 09:59 AM (Morning)<br>1: From 10:00 AM to 04:59 PM (Noon)<br>2: From 05:00 PM to 07:59 PM (Evening)<br>3: From 08:00 PM to 11:59 PM (Night)<br>4: From 00:00 AM to 03:59 AM (Midnight) |
|
||||
| 017C | GetRandom | Var: Variable; Flex: Range | Generates a random number between 0 and Range \- 1, and stores it in Variable | |
|
||||
| 017D | DummyGetRandom | Var: Variable; Flex: Range | Generates a random number between 0 and Range \- 1, and stores it in Variable | Exactly the same code as the command above. |
|
||||
| 017E | GetPokemonHappiness | Var: Variable; Flex: Party Position | Stores in Variable the happiness of Pokémon in Party Position | |
|
||||
| 017F | AddHappiness | Flex: Happiness; Flex: Party Position | Adds Happiness to the happiness of Pokémon in Party Position | |
|
||||
| 0180 | SubHappiness | Flex: Happiness; Flex: Party Position | Subs Happiness to the happiness of Pokémon in Party Position | |
|
||||
| 0181 | TextDayCareMonStats \* | | | |
|
||||
| 0182 | GetPlayerDirection | Var: Variable | Stores in Variable the direction the player is looking at | Predicted. Seeing up gives 0, seeing down gives 1, seeing left gives 2 and seeing right gives 3. |
|
||||
| 0183 | GetDayCareMonCompatibility \* | | | |
|
||||
| 0184 | CheckDayCareEgg \* | | | |
|
||||
| 0185 | CheckBornPokemonInParty | Flex: Pokémon; Var: Variable | Stores 1 in Variable if Pokémon is currently in the Pokémon party, stores 0 otherwise | Eggs do not count as Pokémon, so they will be ignored. |
|
||||
| 0186 | CheckPokemonSizeRecord | Var: Variable; Flex: Party Position | Stores 0 in Variable if Pokémon at Party Position does not have a bigger relative size than player's record, stores 1 if it's the same size and stores 2 if it has a bigger relative size | |
|
||||
| 0187 | SetPokemonSizeRecord | Flex: Party Position | Stores the relative size of Pokémon at Party Position as player's record | |
|
||||
| 0188 | TextPartyPokemonSize | Flex: Integer String Buffer; Flex: Decimal String Buffer; Flex: Party Position | Stores the integer part of Pokémon at Party Position size in Integer String Buffer (1 to 3 digits) and the decimal part of the size in Decimal String Buffer (1 digit) | |
|
||||
| 0189 | TextPokemonRecordSize | Flex: Integer String Buffer; Flex: Decimal String Buffer; Flex: Pokémon ID | Stores the integer part of player's record size, normalized to Pokémon ID range, in Integer String Buffer (1 to 3 digits) and the decimal part of the size in Decimal String Buffer (1 digit) | |
|
||||
| 018A | | | | |
|
||||
| 018B | | | | |
|
||||
| 018C | CountPokemonMoves | Var: Variable; Flex: Party Position | Stores in Variable the total amount of moves that the Pokémon at Party Position currently has | |
|
||||
| 018D | DeleteMove | Flex: Party Position; Flex: Move Slot | Deletes the move in Move Slot from the Pokémon at Party Position | |
|
||||
| 018E | GetPartyPokemonMove | Var: Variable; Flex: Party Position; Flex: Move Slot | Stores in Variable the ID of the move in Move Slot from the Pokémon at Party Position | |
|
||||
| 018F | TextPartyPokemonMove | u8: String Buffer; Flex: Party Position; Flex: Move Slot | Stores the name of the move in Move Slot from the Pokémon at Party Position in String Buffer | |
|
||||
| 0190 | Strength | Command format depends on the first parameter:<br>u8: 0<br>u8: 1<br>u8: 2; Var: Variable | Function depends on the first parameter:<br>0: Disables Strength so player can no longer move boulders<br>1: Allows the player to automatically move Strength boulders<br>2: Checks if Strength is activated, store answer in Variable | |
|
||||
| 0191 | FlashAction \* | Command format depends on the first parameter:<br>u8: 0<br>u8: 1<br>u8: 2; Var: Variable | Function depends on the first parameter:<br>0: Clears the Flash system flag<br>1: Sets the Flash system flag<br>2: Checks if Flash is activated, store answer in Variable | |
|
||||
| 0192 | DefogAction \* | Command format depends on the first parameter:<br>u8: 0<br>u8: 1<br>u8: 2; Var: Variable | Function depends on the first parameter:<br>0: Clears the Defog system flag<br>1: Sets the Defog system flag<br>2: Checks if Defog is activated, store answer in Variable | |
|
||||
| 0193 | GiveAccessory \* | | | |
|
||||
| 0194 | CheckGivenAccessory \* | | | |
|
||||
| 0195 | CheckAccessory \* | | | |
|
||||
| 0196 | GiveBGAccessory \* | | | |
|
||||
| 0197 | CheckBGAccessory \* | | | |
|
||||
| 0198 | | | | |
|
||||
| 0199 | | | | |
|
||||
| 019A | | | | |
|
||||
| 019B | | | | |
|
||||
| 019C | | | | |
|
||||
| 019D | | | | |
|
||||
| 019E | | | | |
|
||||
| 019F | | | | |
|
||||
| 01A0 | | | | |
|
||||
| 01A1 | | | | |
|
||||
| 01A2 | | | | |
|
||||
| 01A3 | | | | |
|
||||
| 01A4 | | | | |
|
||||
| 01A5 | | | | |
|
||||
| 01A6 | | | | |
|
||||
| 01A7 | CheckCompleteJohtoDex | Var: Variable | Stores 1 in Variable if every Pokémon in the Johto Pokédex has been seen, stores 0 otherwise | |
|
||||
| 01A8 | CheckCompleteNationalDex | Var: Variable | Stores 1 in Variable if every Pokémon in the National Pokédex has been caught, stores 0 otherwise | |
|
||||
| 01A9 | OpenPokedexScreen \* | | | |
|
||||
| 01AA | CheckPokemonMail \* | | | |
|
||||
| 01AB | | | | |
|
||||
| 01AC | TakePokemonMail \* | | | |
|
||||
| 01AD | CountFossils | Var: Variable | Stores in Variable the current amount of fossils in the bag | Technically it's the number of items in the bag whose ID is between 99 and 105. |
|
||||
| 01AE | PreparePokeGearCall | Var: ???; Var: ???; Var: ??? | | |
|
||||
| 01AF | StartPokeGearCall | \- | Starts the PokéGear phone call that was previously set. | |
|
||||
| 01B0 | CheckFossilPokemon | Var: Variable; Flex: Item ID | Stores in Variable the ID of the Pokémon to which Item ID fossil belongs | |
|
||||
| 01B1 | CheckFossil | Var: Position; Var: Item ID; Flex: Amount | Stores in Item ID the ID of the first fossil item in the bag that the player has at least Amount quantity of, and stores in Position the amount of fossils in the bag before the first fossil that met the quantity condition | Stores 0 in both variables if there's no fossil in the bag. |
|
||||
| 01B2 | CountPokemonUnderLevel | Var: Variable; Flex: Level | Stores in Variable the amount of Pokémon in party whose level is equal or lower than Level | Eggs are completely ignored. |
|
||||
| 01B3 | SurvivePoison | Var: Variable; Flex: Party Position | If Pokémon at Party Position is poisoned and at 1 HP, it cures the poison and stores 1 in Variable, otherwise it stores 0 | |
|
||||
| 01B4 | FinishOverworldScreen \* | | | |
|
||||
| 01B5 | DebugPoketch \* | | | |
|
||||
| 01B6 | MessageAllFromArchive \* | | | |
|
||||
| 01B7 | MessageFromArchive \* | | | |
|
||||
| 01B8 | MessageAllPutPMS \* | | | |
|
||||
| 01B9 | | | | |
|
||||
| 01BA | | | | |
|
||||
| 01BB | | | | |
|
||||
| 01BC | | | | |
|
||||
| 01BD | GetPreviousHeaderID | Var: Variable | Stores in Variable the header ID of the previous accessed map | |
|
||||
| 01BE | GetCurrentHeaderID | Var: Variable | Stores in Variable the header ID of the map the player is in | |
|
||||
| 01BF | SetSafariFlag | u8: Flag; u8: Mode | If Flag is 0 safari encounters are activated, if Flag is 1 safari encounters are deactivated, being the own safari encounters if Mode is 0 or using the Safari Zone link if 1 | |
|
||||
| 01C0 | BattleRoomWarp \* | | | |
|
||||
| 01C1 | ExitBattleRoom \* | | | |
|
||||
| 01C2 | GeonetScreen | \- | Opens the Geonet screen | |
|
||||
| 01C3 | | | | |
|
||||
| 01C4 | ShowPokemonPic | Flex: Pokémon; Flex: Gender | Opens a window with the picture of Pokémon with Gender gender and registers the Pokémon in the Pokédex as seen | 0 = Male or Genderless; 1 = Female |
|
||||
| 01C5 | HidePokemonPic | \- | Hides the window of a Pokémon picture | |
|
||||
| 01C6 | | | | |
|
||||
| 01C7 | | | | |
|
||||
| 01C8 | | | | |
|
||||
| 01C9 | GetPokemonNature \* | Var: Variable; Flex: Party Position | | |
|
||||
| 01CA | CheckPartyNature \* | Var: Variable; Flex: Nature ID | | |
|
||||
| 01CB | | | | |
|
||||
| 01CC | LoadPokegearData \* | | | |
|
||||
| 01CD | SetRebattleTrainerID \* | | | |
|
||||
| 01CE | SetRebattleGymLeaderID \* | | | |
|
||||
| 01CF | EnableMassOutbreaks \* | | | |
|
||||
| 01D0 | AddRoamingPokemon | u8: ID | Activates a roaming Pokemon depending on the ID | Uses ID to determine which roaming Pokémon must appear: 0 for Entei, 1 for Raikou, 2 for Latias and 3 for Latios. |
|
||||
| 01D1 | UnionGroup | Command format depends on the first parameter:<br>u16: 0; Flex: ID; Var: Variable<br>u16: 1; Flex: ID; Var: Variable<br>u16: 2; Flex: ID; Flex: String Buffer<br>u16: 3; Flex: ID; Flex: String Buffer<br>u16: 4; Var: Variable<br>u16: 5; Flex: ID<br>u16: 6<br>u16: 7; Var: Variable | Function depends on the first parameter:<br>0: Checks if group ID exists, returns answer in Variable<br>1: Checks if group ID is accesible, returns answer in Variable<br>2: Writes group ID name in String Buffer<br>3: Writes leader's name of Group ID in String Buffer<br>4: Opens keyboard, stores 1 in Variable if user cancels, 2 if group name already exists, 0 otherwise<br>5: Enter in group ID<br>6: Creates a group<br>7: ??? | This command is the devil. |
|
||||
| 01D2 | CheckEggMoves \* | | | |
|
||||
| 01D3 | RememberMoveScreen \* | | | |
|
||||
| 01D4 | TeachMovesScreen \* | | | |
|
||||
| 01D5 | ResponseTeachMove \* | | | |
|
||||
| 01D6 | InitTrade | u8: Trade ID | Initializes Trade ID trade data | |
|
||||
| 01D7 | GetOfferedPokemon | Var: Variable | Stores in Variable the ID of the offered Pokémon of the current trade data | |
|
||||
| 01D8 | GetRequestedPokemon | Var: Variable | Stores in Variable the ID of the requested Pokémon of the current trade data | |
|
||||
| 01D9 | TradePokemonScreen | Flex: Party Position | Opens the trade Pokémon screen, giving the Pokémon at Party Position and receiving the offered Pokémon of the current trade data | |
|
||||
| 01DA | EndTrade | \- | Frees the current trade data from the memory | |
|
||||
| 01DB | DummyInternationalDex | \- | Nothing | |
|
||||
| 01DC | DummyDimorphismDex | \- | Nothing | In fact it does activate a dimorphism flag in the Pokédex data, but since the HGSS Pokédex has the gender comparision by default, command's actual purpose is not noticeable. |
|
||||
| 01DD | NationalDex | Command format depends on the first parameter:<br>u8: 1; Var: Unused<br>u8: 2; Var: Variable | Function depends on the first parameter:<br>1: Activates the National Pokédex mode<br>2: Stores 1 in Variable if player has the National Pokédex, otherwise it stores 0 | |
|
||||
| 01DE | CountPokemonRibbons | Var: Variable; Flex: Party Position | Stores in Variable the amount of ribbons that the Pokémon in Party Position has | |
|
||||
| 01DF | CountPartyRibbons | Var: Variable | Stores in Variable the total amount of different ribbons in the current Pokémon party | |
|
||||
| 01E0 | CheckRibbon | Var: Variable; Flex: Party Position; Flex: Ribbon | Stores 1 in Variable if the Pokémon in Party Position has the Ribbon ribbon, stores 0 otherwise | |
|
||||
| 01E1 | GiveRibbon | Flex: Party Position; Flex: Ribbon | Gives the Ribbon ribbon to Pokémon in Party Position | |
|
||||
| 01E2 | TextRibbon | u8: String Buffer; Flex: Ribbon | Stores the name of the Ribbon in String Buffer | |
|
||||
| 01E3 | CountPokemonEVs | Var: Variable; Flex: Party Position | Stores in Variable the total amount of effort values of Pokémon in Party Position | Predicted. |
|
||||
| 01E4 | GetDayOfWeek | Var: Variable | Stores in Variable the current day of the week | Value 0 is the first possible value and it's for Sunday. |
|
||||
| 01E5 | ShowRulesList | Var: Variable | ??? | |
|
||||
| 01E6 | DummyGetPokemonFootprint | \- | Nothing | |
|
||||
| 01E7 | PCHealAnimation | Flex: PokéBalls | Triggers the Pokémon Center healing animation with PokéBalls number of player's Pokémon | |
|
||||
| 01E8 | ElevatorAnimation | Flex: Direction; Flex: Count | Triggers the animation of building #208 up (if Direction is 0) or down (if Direction is 1) Count consecutive times | |
|
||||
| 01E9 | MysteryGiftGive | Command format depends on the first parameter:<br>u16: 0<br>u16: 1; Var: Variable<br>u16: 2; Var: Variable<br>u16: 3; Var: Variable<br>u16: 4<br>u16: 5; Var: Text File; Var: Text Line<br>u16: 6; Var: Text File; Var: Text Line<br>u16: 7<br>u16: 8 | Function depends on the first parameter:<br>0: Initializes the data for receiving a Mystery Gift<br>1: Checks if there is a Mystery Gift, stores answer in Variable<br>2: Stores the Mystery Gift ID in Variable<br>3: Checks if player can receive the Mystery Gift, stores answer in Variable<br>4: Gives the Mystery Gift to the player<br>5: Shows the succeed text at Text File file and Text Line slot<br>6: Shows the unable text at Text File file and Text Line slot<br>7: Ends the Mystery Gift process<br>8: Saves data and ends the Mystery Gift process | This one too. |
|
||||
| 01EA | | | | |
|
||||
| 01EB | | | | |
|
||||
| 01EC | | | | |
|
||||
| 01ED | | | | |
|
||||
| 01EE | | | | |
|
||||
| 01EF | CheckVersion | Var: Variable | Returns 0x7 to Variable if game is HeartGold, 0x8 if SoulSilver | |
|
||||
| 01F0 | FirstPokemonInParty | Var: Variable | Stores in Variable the slot of the first Pokémon in the party that is not an egg | |
|
||||
| 01F1 | CheckPokemonType \* | | | |
|
||||
| 01F2 | FirstPrimoPassword \* | | | |
|
||||
| 01F3 | SecondPrimoPassword \* | | | |
|
||||
| 01F4 | PreparePCAnimation \* | | | |
|
||||
| 01F5 | OpenPCAnimation \* | | | |
|
||||
| 01F6 | ClosePCAnimation \* | | | |
|
||||
| 01F7 | GetLottoNumber | Var: Variable | Stores Lotto random number in Variable | Supposed by analogy with Platinum. |
|
||||
| 01F8 | CheckWinLotto | Var: MatchPos; Var: Digits; Var: PC; Flex: Winning Number | Takes a Winning Number as input and responds as follows.<br>If no matching Pokémon could be found or an error occurs:<br>MatchPos: 0; Digits: 0; PC: 0.<br><br>For all other cases:<br><br>If the matching Pokémon is in the Player's party, PC will be assigned 0.<br>Otherwise, if it's in the Player's Storage System, PC will be assigned 1.<br><br>MatchPos stores the zero-based position of the winning Pokémon (either as Party pos or Storage System pos, depending on the value of PC).<br><br>When there's a match, the Digits var is assigned the number of matching digits of the Winning Pokémon's PID.<br>In case of multiple matches, priority is always given to the one with the most matching digits. | Supposed by analogy with Platinum.<br><br>To retrieve the exact position of a winning Pokémon in the Storage System, first make sure PC equals 1.<br><br>The zero-based PC Page and Position indices can be calculated:<br><br>PC Page index = MatchPos / 30<br>Position in page = MatchPos % 30<br><br>where % is the modulo operator. |
|
||||
| 01F9 | InitLotto | \- | Generates two random numbers and assigns them to two system lottery variables. | Supposed by analogy with Platinum. |
|
||||
| 01FA | BufferBoxPokemonNick \* | | | |
|
||||
| 01FB | CountPCFreeSpace | Var: Variable | Stores in Variable the amount of free Pokémon slots in PC boxes | |
|
||||
| 01FC | PalParkControl \* | | | |
|
||||
| 01FD | PalParkDepositCountCheck \* | | | |
|
||||
| 01FE | PalParkBoxPokemonCaught \* | | | |
|
||||
| 01FF | PalParkScoreResult \* | | | |
|
||||
| 0200 | PlayerMovementSavingSet \* | | | |
|
||||
| 0201 | PlayerMovementSavingClear \* | | | |
|
||||
| 0202 | HallOfFameAnime \* | | | |
|
||||
| 0203 | AddTrainerScore \* | | | |
|
||||
| 0204 | TextAccessory | u8: String Buffer; Flex: Accesory | Stores Accesory's name in String Buffer | |
|
||||
| 0205 | CheckPokemonInParty | Flex: Pokémon; Var: Variable | Stores 1 in Variable if Pokémon (or its egg) is currently in the Pokémon party, stores 0 otherwise | |
|
||||
| 0206 | SetDeoxysForm | Flex: Form | Sets every Deoxys in the Pokémon party the Form form | Form 0 is Normal, form 1 is Attack, form 2 is Defense and form 3 is Speed. |
|
||||
| 0207 | CheckBurmyForms | Var: Variable | Stores in Variable the number of current different Burmy forms in the Pokémon party | Returns 0 if player has no Burmy in the party, 1 if only one different form, 2 if two different forms and 3 if has three or more Burmy with three different forms. |
|
||||
| 0208 | | \- | ??? | Sets a internal flag. |
|
||||
| 0209 | | \- | ??? | Resets a internal flag. |
|
||||
| 020A | GetHour | Var: Variable | Stores current hour from RTC in Variable | |
|
||||
| 020B | ShakeOverworld | Flex: Event ID; Flex: Count; Flex: Time; Flex: X; Flex: Y | Makes Event ID overworld shake Count times in Time frames, moving X horizontally and Y vertically each shake | Event ID must be released before this command in order to see the animation. |
|
||||
| 020C | BlinkOverworld | Flex: ???; Flex: ???; Flex: ???; Flex: ???; Flex: ??? | ??? | |
|
||||
| 020D | CheckRegis | Var: Variable | Stores 1 in Variable if player has the 3 Regis in the party, stores 0 otherwise | |
|
||||
| 020E | | | | |
|
||||
| 020F | MessageUnown | u16: Text Slot | Display line Text Slot from the text file with the Unown font | Predicted. |
|
||||
| 0210 | CheckGBACartidge | Var: Variable | Stores the current GBA cartridge ID in Variable | Stores 0 if no cartridge, 1 if Pokémon Sapphire, 2 if Pokémon Ruby, 3 if Pokémon Emerald, 4 if Pokémon FireRed and 5 if Pokémon LeafGreen. Somehow it could also set 7 if Pokémon Gold, 8 if Pokémon Silver, 10 if Pokémon Diamond, 11 if Pokémon Pearl, 12 if Pokémon Platinum and 15 if Pokémon Colosseum. |
|
||||
| 0211 | GetFirstAlivePokemonSlot | Var: Variable | Stores in Variable the slot of the first Pokémon in the party that is not an egg nor is fainted | Predicted. |
|
||||
| 0212 | SetMatrixAlternativeMap | Flex: Alternative ID; u8: Status | Permanently changes a worldmap matrix cell corresponding to Alternative ID if Status is 1, reverts the change if 0 | It only changes the map file value in the matrix, not the map header nor the map height. Seems that the only Alternative ID available values are 0 and 1, corresponding to Mahogany Town and to the Lake of Rage. |
|
||||
| 0213 | TextBackgroundName \* | | | |
|
||||
| 0214 | CheckCoinsImmediate \* | | | |
|
||||
| 0215 | CheckCoins \* | | | |
|
||||
| 0216 | AddCoins \* | | | |
|
||||
| 0217 | GetPokemonLevel | Var: Result; Flex: Party Slot | Stores into Result the level of the Pokémon at a given Party Slot. | |
|
||||
| 0218 | | | | |
|
||||
| 0219 | | | | |
|
||||
| 021A | | | | |
|
||||
| 021B | | | | |
|
||||
| 021C | | | | |
|
||||
| 021D | TextNumberSp | u8: String Buffer; Flex: Number; u8: Alignment Type; u8: Digits | Stores a Number in String Buffer with Alignment Type alignment and Digits length | Predicted. Alignment Type 0 is left-alignment, 1 is right alignment padded with spaces and 2 is right alignment padded with zeros. Digits is used only in these last two types. |
|
||||
| 021E | MonGetContestValue \* | | | |
|
||||
| 021F | CheckBirthday | Var: Variable | Stores 1 in Variable if the current day is the player's birthday, stores 0 otherwise | |
|
||||
| 0220 | MusicVolumeSet | Flex: Music ID; Flex: Volume | Identifies the BGM Player which is playing Music ID and sets its Volume | |
|
||||
| 0221 | CountSeenUnown | Var: Variable | Stores in Variable the number of different seen Unown forms | |
|
||||
| 0222 | | | | |
|
||||
| 0223 | | | | |
|
||||
| 0224 | | | | |
|
||||
| 0225 | | | | |
|
||||
| 0226 | CountHallOfFameEntries \* | | | |
|
||||
| 0227 | | | | |
|
||||
| 0228 | | | | |
|
||||
| 0229 | | | | |
|
||||
| 022A | | | | |
|
||||
| 022B | | | | |
|
||||
| 022C | | | | Related to move tutor? Possibly BP price check? |
|
||||
| 022D | CheckBattlePoints \* | | | |
|
||||
| 022E | GiveBP \* | | | |
|
||||
| 022F | TakeBP \* | | | |
|
||||
| 0230 | CompareBP \* | Flex: ???; Var: ??? | | |
|
||||
| 0231 | ShakeCamera | Flex: X Magnitude; Flex: Y Magnitude; Flex: Count; Flex: Time | Shakes the screen vertically and/or horizontally, moving the camera X Magnitude pixels horizontally and Y Magnitude pixels vertically in each shake, with Count total shakes of Time frames each one | Don't abuse this command, as it seems that camera might end up 1 pixel up or down in each animation, especially when Count is an odd number. |
|
||||
| 0232 | Battle2vs2 | Flex: Partner Trainer ID; Flex: Trainer 1 ID; Flex: Trainer 2 ID; u8: ??? | Starts a double battle with Partner Trainer ID versus Trainer 1 ID and Trainer 2 ID | Last parameter seems to always be 0x1. |
|
||||
| 0233 | | | | |
|
||||
| 0234 | | | | |
|
||||
| 0235 | | Var: ??? | ??? | |
|
||||
| 0236 | PartyPokemonTradeScreen | \- | Opens the party Pokémon screen for a trade | |
|
||||
| 0237 | GetDPPtPrizeItemIdAndCost \* | | | |
|
||||
| 0238 | | | | |
|
||||
| 0239 | | | | |
|
||||
| 023A | CheckCoinsVar \* | | | |
|
||||
| 023B | | | | |
|
||||
| 023C | GetUniqueSealsQuantity \* | | | |
|
||||
| 023D | DummyActivateMysteryGift \* | | | |
|
||||
| 023E | GetOWMovement \* | | | |
|
||||
| 023F | | | | |
|
||||
| 0240 | | | | |
|
||||
| 0241 | | | | |
|
||||
| 0242 | | | | |
|
||||
| 0243 | | | | |
|
||||
| 0244 | TextSealSingular \* | u8: String Buffer; Flex: Seal ID | Stores Seal's singular noun in String Buffer | International release exclusive(supposed). Text archive 15. |
|
||||
| 0245 | DummyLockAll \* | | | |
|
||||
| 0246 | | | | |
|
||||
| 0247 | | | | |
|
||||
| 0248 | PartyLegalCheck \* | var: Result | Checks legality of party, at least for WIFI stuff. If RESULT is 1, party check failed and you have an "illegal" mon | Used by the attendants in the PC to check your Pokemon before going into the Union Room, may be used elsewhere too |
|
||||
| 0249 | | | | |
|
||||
| 024A | | | | |
|
||||
| 024B | | \- | ??? | |
|
||||
| 024C | LastBattleCheckCaught \* | Var ??? | | |
|
||||
| 024D | WildBattleSp | Flex: Pokémon; Flex: Level; u8: Shiny Flag | Starts a wild battle against a Pokémon of level Level, and shiny if Shiny Flag is 1 | |
|
||||
| 024E | CheckTrainerCardLevel | Var: Variable | Stores in Variable the current trainer card level | |
|
||||
| 024F | DummyRideBike | \- | Nothing | Seems to allocate the bike music in the RAM but doesn't play it. |
|
||||
| 0250 | | | | |
|
||||
| 0251 | ShowSaveBox | \- | Displays the save data box (current map name, player's name, the amount of badges, the Pokédex counter and the play time) | |
|
||||
| 0252 | HideSaveBox | \- | Hides the save data box | |
|
||||
| 0253 | ScopeMode | u8: Mode | If Mode is 1, activates the scope mode, otherwise the command deactivates the scope mode | The scope mode prevents the game to do certain actions (like reseting system flags) when changing map, and probably it's related with more things. |
|
||||
| 0254 | GetFollowingPokeSize | Var: Variable | Stores 0 in Variable if the current following Pokémon is small and can follow the player indoors, stores 1 if it's big and can't follow the player indoors | In fact it returns the second byte of the following Pokémon data files, stored in a/1/4/1.narc, which is the one that the game reads for allowing Pokémon entering in buildings. This command will work even if a SendBackFollowingPoke is used and the following Pokémon is hidden at that moment. |
|
||||
| 0255 | | \- | ??? | Draws a heart icon above the following Pokémon. Maybe a dummy command? |
|
||||
| 0256 | | u16: ??? | ??? | Parameter must be 1 or 2, otherwise command won't do anything. Seems to trigger a default movement for switching current player's and following Pokémon positions (for example, when using a HM). |
|
||||
| 0257 | FollowingPokePCAnimation | \- | Triggers the animation of sending the current following Pokémon back to its PokéBall over the Pokémon Center healing counter | |
|
||||
| 0258 | SendBackFollowingPoke | \- | Triggers the animation of sending the current following Pokémon back to its PokéBall and deactivates the following Pokémon until the game is reset or a warp is used | |
|
||||
| 0259 | FollowingPokeFacePlayer | \- | Makes the invoking event look at the player, but with a size limitation | When the following Pokemon has a big size, it won't turn to the player if there is an overworld on the opposite side so it would collide. The checked flag is the second byte of the Parameter 1 field, which could be called "double size overworlds" flag, as it is also used for drawing two grass patches in the tall grass for the following Pokemon. |
|
||||
| 025A | LockFollowingPoke | u16: Operation | Releases the following Pokemon animation if Operation is 0, locks the animation otherwise | Predicted comparing ASM with Lock and Release commands. |
|
||||
| 025B | WaitFollowingPoke | \- | Waits the following Pokemon to end its last movement | Predicted comparing ASM with Lock and Release commands. |
|
||||
| 025C | SetFollowingPokeMovement | u16: Move Code | Changes the following Pokemon default movement to Move Code | The most important movement IDs are 0x30 and 0x38 (following and ghost-following behaviours respectively). |
|
||||
| 025D | SetFollowingPokePosition | u8: Position; u8: Direction | Moves the following Pokémon to one tile Position next to player and facing at Direction | For both parameters, up is 0, down is 1, left is 2 and right is 3. |
|
||||
| 025E | BallResetFollowingPoke | \- | Moves the following Pokémon to the current player's position, and triggers the animation of sending the Pokémon out of its PokéBall after the player walks a step | This is commonly used after a different event following the player, so the player sends out the following Pokémon in the next step (instead of forcing it automatically with SendOutFollowingPoke). |
|
||||
| 025F | NoBallResetFollowingPoke | \- | Moves the following Pokémon to the current player's position | Almost same as BallResetFollowingPoke, but without the PokéBall animation (exactly like when a small Pokémon spawns after the player uses a warp). |
|
||||
| 0260 | SendOutFollowingPoke | \- | Triggers the animation of sending the first non-fainted Pokémon out of its PokéBall and spawns it on the last player position | Seems to be needed for refreshing/forcing its apparition after a Warp on the same map. |
|
||||
| 0261 | | \- | ??? | It's used in a lot of scripts that involve following Pokémon movements, placed at the top of them. Seems that it resets a lot of following Pokémon movement parameters and data. |
|
||||
| 0262 | | | | |
|
||||
| 0263 | Pokeathlon \* | | | |
|
||||
| 0264 | | | | |
|
||||
| 0265 | GetPokegearContactRandomGiftBerry \* | | | |
|
||||
| 0266 | GetPokegearContactGiftItem \* | | | |
|
||||
| 0267 | CameronPhotoScreen \* | | | |
|
||||
| 0268 | | | | |
|
||||
| 0269 | | | | |
|
||||
| 026A | CheckAlbumIfFull \* | | | |
|
||||
| 026B | CheckRocketCostume \* | | | |
|
||||
| 026C | ActivateRocketCostume \* | | | |
|
||||
| 026D | | | | |
|
||||
| 026E | GetOWDirection | u16: Event ID; Var: Variable | Stores in Variable the current direction which Event ID is facing | Up is 0, Down is 1, Left is 2 and Right is 3. |
|
||||
| 026F | ApricornTreeAnimation \* | | | |
|
||||
| 0270 | ApricornTreeGetApricorn \* | | | |
|
||||
| 0271 | GiveApricornFromTree \* | | | |
|
||||
| 0272 | TextApricornName \* | | | |
|
||||
| 0273 | | | | |
|
||||
| 0274 | | | | |
|
||||
| 0275 | | | | |
|
||||
| 0276 | | | | |
|
||||
| 0277 | | | | |
|
||||
| 0278 | CountPartyMonsOfSpecies \* | | | |
|
||||
| 0279 | | | | |
|
||||
| 027A | | | | |
|
||||
| 027B | | | | |
|
||||
| 027C | | | | |
|
||||
| 027D | | | | |
|
||||
| 027E | | | | |
|
||||
| 027F | | | | |
|
||||
| 0280 | | | | |
|
||||
| 0281 | SaveWipeExtraChunks \* | | | |
|
||||
| 0282 | | Var: Variable | ??? | |
|
||||
| 0283 | | | | |
|
||||
| 0284 | | | | |
|
||||
| 0285 | | | | |
|
||||
| 0286 | | | | |
|
||||
| 0287 | GetPartySlotWithSpecies \* | var: Slot; u16 or Flex(???): Pokemon ID | Checks party for the presence of a Pokemon, and returns which slot they are in. | Assume that it checks for the first instance and then stops, so if you have multiple of the same Pokemon, it stops at the first instance and returns which slot it is in (0-5). Used in Silph Co. for Rotom |
|
||||
| 0288 | | | | |
|
||||
| 0289 | OpenScratchCardScreen \* | | | |
|
||||
| 028A | CloseScratchCard \* | | | |
|
||||
| 028B | GetScratchCardPrize \* | | | |
|
||||
| 028C | | | | |
|
||||
| 028D | MoveTutorChooseMove \* | | | |
|
||||
| 028E | TutorMoveTeachInSlot \* | | | |
|
||||
| 028F | TutorMoveGetPrice \* | | | |
|
||||
| 0290 | CheckHeadbuttCompatibility | Flex: Party Slot; Var: Variable | Stores 1 into Variable if the Pokémon at the given Party Slot can learn Headbutt. | Ilex Forest Tutor: Script File 92, Script 3 |
|
||||
| 0291 | IVCheckerJudge \* | | | |
|
||||
| 0292 | BufferStatName \* | | | |
|
||||
| 0293 | SetMonForme \* | | | |
|
||||
| 0294 | TextTrainerName \* | | | |
|
||||
| 0295 | | | | |
|
||||
| 0296 | | | | |
|
||||
| 0297 | | | | |
|
||||
| 0298 | | | | |
|
||||
| 0299 | | | | |
|
||||
| 029A | | | | |
|
||||
| 029B | | | | |
|
||||
| 029C | TextTypeName \* | | | |
|
||||
| 029D | GetItemQuantity \* | | | |
|
||||
| 029E | GetHiddenPowerType \* | | | |
|
||||
| 029F | SetFavoriteMon \* | | | |
|
||||
| 02A0 | GetFavoriteMon \* | | | |
|
||||
| 02A1 | GetOwnedRotomFormes \* | | | |
|
||||
| 02A2 | CountTranformedRotomsInParty \* | | | |
|
||||
| 02A3 | UpdateRotomForme \* | | | |
|
||||
| 02A4 | GetPartyPokemonForm \* | | | |
|
||||
| 02A5 | | | | |
|
||||
| 02A6 | | | | |
|
||||
| 02A7 | | | | |
|
||||
| 02A8 | | | | |
|
||||
| 02A9 | | | | |
|
||||
| 02AA | | | | |
|
||||
| 02AB | | | | |
|
||||
| 02AC | GetCurrentWeather | Var: Variable | Stores the current weather in Variable | |
|
||||
| 02AD | GetPlayerCoordinates \* | | | |
|
||||
| 02AE | | | | |
|
||||
| 02AF | | | | |
|
||||
| 02B0 | CheckFatefulEncounter \* | | | |
|
||||
| 02B1 | CommSanitizeParty \* | | | |
|
||||
| 02B2 | DayCareSanitizeMon \* | | | |
|
||||
| 02B3 | | | | |
|
||||
| 02B4 | TextBattleHallStreak \* | | | |
|
||||
| 02B5 | BattleHallCountUsedSpecies \* | | | |
|
||||
| 02B6 | BattleHallGetTotalStreak \* | | | |
|
||||
| 02B7 | | | | |
|
||||
| 02B8 | | | | |
|
||||
| 02B9 | | | | |
|
||||
| 02BA | FollowingPokemonIsEventTrigger \* | | | |
|
||||
| 02BB | | | | |
|
||||
| 02BC | | | | |
|
||||
| 02BD | PokemonHasItem \* | | | |
|
||||
| 02BE | BattleTowerSetUpMultiBattle \* | | | |
|
||||
| 02BF | SetPlayerVolume \* | | | |
|
||||
| 02C0 | | | | |
|
||||
| 02C1 | | | | |
|
||||
| 02C2 | | | | |
|
||||
| 02C3 | CheckPokemonIsSeen \* | | | |
|
||||
| 02C4 | FloorTrapAnimation | | Triggers Team Rocket HQ trap-floor's graphical effect in the player's current position | |
|
||||
| 02C5 | | | | |
|
||||
| 02C6 | | | | |
|
||||
| 02C7 | TalkFollowingPoke | \- | The following Pokémon triggers a random movement, and then a random following message | This seems to be the command that executes when the player talks to the following Pokémon (at script #163). Files in a/2/2/0.narc link map names to possible texts. The following Pokémon ends up locked, so a Release should be used after this command. |
|
||||
| 02C8 | | | | |
|
||||
| 02C9 | OpenAlphPuzzle \* | u8: Puzzle ID | Loads the stone-panel puzzle of Puzzle ID. | ID 0 = Kabuto, ID 1 = Aerodactyl, ID 2 = Omanyte, ID 3 = Ho-Oh<br>Appears to check Flag 2423, 2424, 2425, 2426 for the completion of puzzles 0 to 3 respectively. |
|
||||
| 02CA | OpenRuinsofAlphHiddenRoom \* | u8: Room ID | Something to do with the secret room, not the puzzle trapdoor. | ID 0 = Kabuto Room, ID 1 = Aerodactyl Room, ID 2 = Omanyte Room, ID 3 = Ho-Oh Room |
|
||||
| 02CB | UpdateDayCareMonOverworlds \* | | | |
|
||||
| 02CC | | | | |
|
||||
| 02CD | | | | |
|
||||
| 02CE | | | | |
|
||||
| 02CF | | | | |
|
||||
| 02D0 | | | | |
|
||||
| 02D1 | | | | |
|
||||
| 02D2 | | u8: ???; u8: ???; u16: ???; u16: ???; u16: ??? | ??? | |
|
||||
| 02D3 | BoatAnimation | u8: Animation; u8: ???; u16: Header; u16: X coord; u16: Y coord | Plays the S.S. Aqua animation of leaving the port. Animation is either 0 or 1, with 0 being Olivine and 1 being Vermilion. X and Y coordinates are for the destination map | |
|
||||
| 02D4 | | | | |
|
||||
| 02D5 | | | | |
|
||||
| 02D6 | | | | |
|
||||
| 02D7 | | Var: Variable | ??? | |
|
||||
| 02D8 | | u8: ???; u8: ??? | ??? | |
|
||||
| 02D9 | CheckAlivePokemon | Var: Variable | Checks if player has at least 1 not fainted Pokémon, stores the result in Variable | Predicted. |
|
||||
| 02DA | CheckFollowingPoke | Var: Variable | Checks if player has a following Pokémon, stores the result in Variable | Supposed. |
|
||||
| 02DB | | \- | ??? | |
|
||||
| 02DC | | u8: ??? | ??? | |
|
||||
| 02DD | | u8: ???; Var: ??? | ??? | |
|
||||
| 02DE | | | | |
|
||||
| 02DF | CheckKurtApricorn \* | | | If not 0, script continues to check if daily flag is reset, then gives you the apricorns |
|
||||
| 02E0 | ClearKurtApricorn \* | | | |
|
||||
| 02E1 | GiveApricornBalls \* | | | |
|
||||
| 02E2 | CheckApricornCount \* | | | |
|
||||
| 02E3 | KurtApricornMenuScreen \* | | | |
|
||||
| 02E4 | StoreApricornJuice \* | | | |
|
||||
| 02E5 | CheckJuice \* | | | |
|
||||
| 02E6 | | | | |
|
||||
| 02E7 | | | | |
|
||||
| 02E8 | CreatePokeathlonFriendshipRoomStatues \* | | | |
|
||||
| 02E9 | TextPokeathlonCourseName \* | | | |
|
||||
| 02EA | OpenTouchScreen | \- | Changes the low screen design to the green Pokéball background | |
|
||||
| 02EB | CloseTouchScreen | \- | Sets the default low screen design | |
|
||||
| 02EC | YesNoTouchScreen | Var: Variable | Opens a Yes-No selection, stores player's answer in Variable | Crashes if OpenTouchScreen is not used previously. |
|
||||
| 02ED | MultiTouchStandardText | u8: ???; u8: ???; u8: ???; u8: ???; Var: Selection | Prepares a multiple selection menu with text bank #191, returns selected slot ID in Selection | |
|
||||
| 02EE | MultiTouchLocalText | u8: ???; u8: ???; u8: ???; u8: ???; Var: Selection | Prepares a multiple selection menu with local texts, returns selected slot ID in Selection | |
|
||||
| 02EF | CreateMultiTouchBox | Flex: Text Slot; Flex: Top Screen Text;<br>Flex: Multi Box Slot | Adds a box with Multi Box Slot ID showing Text Slot text on the bottom screen and Top Screen Text on the top in a message box. Text depends on whether you use MultiTouchStandardText or MultiTouchLocalText | |
|
||||
| 02F0 | CloseMultiTouch | \- | Closes the multiple selection boxes | |
|
||||
| 02F1 | RockSmashItemCheck \* | Flex: ???; Var: ???; Var: ??? | ??? | |
|
||||
| 02F2 | | Var: ??? | ??? | |
|
||||
| 02F3 | | | | |
|
||||
| 02F4 | | | | |
|
||||
| 02F5 | | | | |
|
||||
| 02F6 | | | | |
|
||||
| 02F7 | | | | |
|
||||
| 02F8 | | | | |
|
||||
| 02F9 | | | | |
|
||||
| 02FA | | | | |
|
||||
| 02FB | | | | |
|
||||
| 02FC | | | | |
|
||||
| 02FD | | | | |
|
||||
| 02FE | | | | |
|
||||
| 02FF | | \- | ??? | |
|
||||
| 0300 | | | | |
|
||||
| 0301 | | | | |
|
||||
| 0302 | | | | |
|
||||
| 0303 | | | | |
|
||||
| 0304 | | | | |
|
||||
| 0305 | RenderCutscene \* | ???: ??? | Renders a cutscene<br>2 = Arceus stock image cutscene | |
|
||||
| 0306 | | | | |
|
||||
| 0307 | | | | |
|
||||
| 0308 | GiveTogepiEgg \* | | | |
|
||||
| 0309 | | | | |
|
||||
| 030A | GiveSpikyEaredPichu \* | \- | ??? | |
|
||||
| 030B | | | | |
|
||||
| 030C | OpenVoltorbFlip \* | | | |
|
||||
| 030D | KenyaCheckPartyOrMailbox \* | | | |
|
||||
| 030E | MartSell \* | \- | ??? | Related with the mart interface. |
|
||||
| 030F | SetFollowPokeInhibitState \* | | | |
|
||||
| 0310 | ScriptOverlayCmd \* | | | |
|
||||
| 0311 | BugContestAction \* | | | |
|
||||
| 0312 | TextBugContestWinner \* | | | |
|
||||
| 0313 | JudgeBugContest \* | | | |
|
||||
| 0314 | TextBugContestMonNick \* | | | |
|
||||
| 0315 | BugContestGetTimeLeft \* | | | |
|
||||
| 0316 | IsBugContestantRegistered \* | | | |
|
||||
| 0317 | | | | |
|
||||
| 0318 | | | | |
|
||||
| 0319 | TakeMomMoney \* | | | |
|
||||
| 031A | CheckMomMoneyBalance \* | | | |
|
||||
| 031B | ShowMomMoney | Flex: X; Flex: Y | Shows mom savings money box at X and Y coordinates of the screen | |
|
||||
| 031C | HideMomMoney | \- | Hides mom savings money box | |
|
||||
| 031D | | | | |
|
||||
| 031E | TextRulesetName \* | | | |
|
||||
| 031F | | | | |
|
||||
| 0320 | | | | |
|
||||
| 0321 | | | | |
|
||||
| 0322 | | | | |
|
||||
| 0323 | | | | |
|
||||
| 0324 | UpdateTownMap \* | u8(?): Map Type | Updates the town map to include Kanto<br>1 = Normal, Johto-only view<br>2 = Whole map, Kanto included | |
|
||||
| 0325 | | | | |
|
||||
| 0326 | | | | |
|
||||
| 0327 | | | | |
|
||||
| 0328 | | | | |
|
||||
| 0329 | | | | |
|
||||
| 032A | CelebiTimeTravelAnimation \* | | | |
|
||||
| 032B | | | | |
|
||||
| 032C | | | | |
|
||||
| 032D | MomGiftCheck \* | | | |
|
||||
| 032E | | | | |
|
||||
| 032F | | | | |
|
||||
| 0330 | UnownCircle \* | | | |
|
||||
| 0331 | | | | |
|
||||
| 0332 | InitMystriStageAnimation \* | | | |
|
||||
| 0333 | | | | |
|
||||
| 0334 | | | | |
|
||||
| 0335 | GetBuenasPassword \* | | | |
|
||||
| 0336 | | | | |
|
||||
| 0337 | | | | |
|
||||
| 0338 | | | | |
|
||||
| 0339 | GetShinyLeafCount \* | | | |
|
||||
| 033A | TryGiveShinyLeafCrown \* | | | |
|
||||
| 033B | CheckPokemonNickname \* | Flex: Party Slot; Var: Variable | Checks to see if the Pokémon at Party Slot position has a nickname. The variable will return 0 if the Pokémon does have a nickname. | Example: Script File 913, Function 35 |
|
||||
| 033C | | | | |
|
||||
| 033D | | Var: ??? | ??? | |
|
||||
| 033E | | | | |
|
||||
| 033F | | | | |
|
||||
| 0340 | | | | |
|
||||
| 0341 | | | | |
|
||||
| 0342 | | Var: Variable | ??? | |
|
||||
| 0343 | | Var: Variable | ??? | |
|
||||
| 0344 | CheckJadeOrbRequirements | Var: Variable | Stores 1 in Variable if player has both Kyogre and Groudon in the Pokémon party and they have been caught in Johto, stores 0 otherwise | |
|
||||
| 0345 | | Var: Variable | ??? | |
|
||||
| 0346 | CheckMoneyFull | u16: Money Account; Var: Variable | Stores 1 in Variable if the chosen money account is full.<br>Money account 0 = Mom's savings;<br>Money account 1 = Player; | |
|
||||
| 0347 | SystemSetSleepFlag \* | | | |
|
||||
| 0348 | | | | |
|
||||
| 0349 | | | | |
|
||||
| 034A | | | | |
|
||||
| 034B | TextItemLowercase | u8: String Buffer; Flex: Item | Stores Item's lowercase name in String Buffer | International release exclusive. |
|
||||
| 034C | TextItemPlural | u8: String Buffer; Flex: Item | Stores Item's plural noun in String Buffer | International release exclusive. |
|
||||
| 034D | TextPartyPokemonDefault | u8: String Buffer; Flex: Party position | Stores the name of the Pokémon in Party Position in String Buffer with default color tags encoding | International release exclusive. Names stored at text file 238. |
|
||||
| 034E | | | | International release exclusive. |
|
||||
| 034F | | u8: String Buffer | ??? | International release exclusive. |
|
||||
| 0350 | | u8: String Buffer; Flex: Accesory | ??? | International release exclusive. |
|
||||
| 0351 | TextTrainerClass | u8: String Buffer; Flex: Trainer class | Stores Trainer class' lowercase noun in String Buffer | International release exclusive. |
|
||||
| 0352 | TextSealPlural | u8: String Buffer; Flex: Seal | Stores Seal's plural noun in String Buffer | International release exclusive. Text archive 16. |
|
||||
| 0353 | TextCapitalize | u8: String Buffer | Capitalizes the string currently stored in String Buffer | International release exclusive. |
|
||||
| 0354 | TextFloor | u8: String Buffer; u8: Floor | Stores Floor's name in String Buffer | International release exclusive. Names stored at text file 191, lines 0x74 to 0x7A. |
|
||||
|
|
@ -156,6 +156,10 @@ namespace DSPRE.Resources {
|
|||
[0x00FE] = "End"
|
||||
};
|
||||
|
||||
public static HashSet<ushort?> movementEndCodes = new HashSet<ushort?>() {
|
||||
0x00FE,
|
||||
};
|
||||
|
||||
public static Dictionary<ushort, string> DPPtScrCmdNames = new Dictionary<ushort, string>() {
|
||||
[0x0000] = "Nop",
|
||||
[0x0001] = "Dummy",
|
||||
|
|
@ -2090,6 +2094,9 @@ namespace DSPRE.Resources {
|
|||
|
||||
[0x02C7] = "TalkFollowingPoke",
|
||||
|
||||
[0x02C9] = "OpenAlphaPuzzle",
|
||||
[0x02CA] = "OpenRuinsofAlphHiddenRoom",
|
||||
|
||||
[0x02D3] = "BoatAnimation",
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ using DSPRE.Resources;
|
|||
using System;
|
||||
using DSPRE.ROMFiles;
|
||||
using static DSPRE.RomInfo;
|
||||
using System.Windows.Shapes;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace DSPRE {
|
||||
|
||||
|
|
@ -16,12 +18,20 @@ namespace DSPRE {
|
|||
|
||||
public class RomInfo {
|
||||
public static string folderSuffix = "_DSPRE_contents";
|
||||
const string dataFolderName = @"data";
|
||||
|
||||
public static string romID { get; private set; }
|
||||
public static string fileName { get; private set; }
|
||||
public static string workDir { get; private set; }
|
||||
public static string arm9Path { get; private set; }
|
||||
public static string arm7Path { get; private set; }
|
||||
public static string overlayTablePath { get; set; }
|
||||
public static string y7Path { get; set; }
|
||||
public static string dataPath { get; set; }
|
||||
public static string overlayPath { get; set; }
|
||||
public static string unpackedPath { get; set; }
|
||||
public static string bannerPath { get; set; }
|
||||
public static string headerPath { get; set; }
|
||||
|
||||
public static GameLanguages gameLanguage { get; private set; }
|
||||
public static GameVersions gameVersion { get; private set; }
|
||||
|
|
@ -70,6 +80,8 @@ namespace DSPRE {
|
|||
|
||||
public static string internalNamesLocation { get; private set; }
|
||||
public static readonly byte internalNameLength = 16;
|
||||
public static string internalNamesPath { get; private set; }
|
||||
|
||||
public static int cameraSize { get; private set; }
|
||||
|
||||
public Dictionary<List<uint>, (Color background, Color foreground)> MapCellsColorDictionary;
|
||||
|
|
@ -132,7 +144,10 @@ namespace DSPRE {
|
|||
OWSprites,
|
||||
|
||||
scripts,
|
||||
|
||||
encounters,
|
||||
headbutt,
|
||||
safariZone,
|
||||
|
||||
trainerProperties,
|
||||
trainerParty,
|
||||
|
|
@ -153,11 +168,19 @@ namespace DSPRE {
|
|||
folderSuffix = "";
|
||||
}
|
||||
|
||||
workDir = Path.GetDirectoryName(romName) + "\\" + Path.GetFileNameWithoutExtension(romName) + folderSuffix + "\\";
|
||||
arm9Path = workDir + @"arm9.bin";
|
||||
overlayTablePath = workDir + @"y9.bin";
|
||||
overlayPath = workDir + "overlay";
|
||||
internalNamesLocation = workDir + @"data\fielddata\maptable\mapname.bin";
|
||||
string path = System.IO.Path.GetDirectoryName(romName) + "\\" + Path.GetFileNameWithoutExtension(romName) + folderSuffix + "\\";
|
||||
|
||||
workDir = path;
|
||||
arm9Path = Path.Combine(workDir, @"arm9.bin");
|
||||
arm7Path = Path.Combine(workDir, @"arm7.bin");
|
||||
overlayTablePath = Path.Combine(workDir, @"y9.bin");
|
||||
y7Path = Path.Combine(workDir, @"y7.bin");
|
||||
dataPath = Path.Combine(workDir, dataFolderName);
|
||||
overlayPath = Path.Combine(workDir, @"overlay");
|
||||
bannerPath = Path.Combine(workDir, @"banner.bin");
|
||||
headerPath = Path.Combine(workDir, @"header.bin");
|
||||
unpackedPath = Path.Combine(workDir, @"unpacked");
|
||||
internalNamesPath = Path.Combine(workDir, $@"{dataFolderName}\fielddata\maptable\mapname.bin");
|
||||
|
||||
try {
|
||||
gameVersion = PokeDatabase.System.versionsDict[id];
|
||||
|
|
@ -959,7 +982,7 @@ namespace DSPRE {
|
|||
|
||||
public string GetBuildingModelsDirPath(bool interior) => interior ? gameDirs[DirNames.interiorBuildingModels].unpackedDir : gameDirs[DirNames.exteriorBuildingModels].unpackedDir;
|
||||
public string GetRomNameFromWorkdir() => workDir.Substring(0, workDir.Length - folderSuffix.Length - 1);
|
||||
public static int GetHeaderCount() => (int)new FileInfo(internalNamesLocation).Length / internalNameLength;
|
||||
public static int GetHeaderCount() => (int)new FileInfo(internalNamesPath).Length / internalNameLength;
|
||||
public static List<string> GetLocationNames() => new TextArchive(locationNamesTextNumber).messages;
|
||||
public static string[] GetSimpleTrainerNames() => new TextArchive(trainerNamesMessageNumber).messages.ToArray();
|
||||
public static string[] GetTrainerClassNames() => new TextArchive(trainerClassMessageNumber).messages.ToArray();
|
||||
|
|
@ -1165,6 +1188,9 @@ namespace DSPRE {
|
|||
[DirNames.interiorBuildingModels] = @"data\a\1\4\8",
|
||||
[DirNames.learnsets] = @"data\a\0\3\3",
|
||||
[DirNames.evolutions] = @"data\a\0\3\4",
|
||||
|
||||
[DirNames.safariZone] = @"data\a\2\3\0",
|
||||
[DirNames.headbutt] = @"data\a\2\5\2", //both versions use the same folder with different data
|
||||
};
|
||||
|
||||
//Encounter archive is different for SS
|
||||
|
|
|
|||
454
DS_Map/WildEditorDPPt.Designer.cs
generated
454
DS_Map/WildEditorDPPt.Designer.cs
generated
|
|
@ -51,31 +51,32 @@
|
|||
this.label34 = new System.Windows.Forms.Label();
|
||||
this.radarFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.dualSlotGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.leafGreenFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label33 = new System.Windows.Forms.Label();
|
||||
this.leafGreenFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.fireRedSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label35 = new System.Windows.Forms.Label();
|
||||
this.fireRedFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.label36 = new System.Windows.Forms.Label();
|
||||
this.label37 = new System.Windows.Forms.Label();
|
||||
this.label38 = new System.Windows.Forms.Label();
|
||||
this.leafGreenSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label39 = new System.Windows.Forms.Label();
|
||||
this.sapphireFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.rubyFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.label24 = new System.Windows.Forms.Label();
|
||||
this.emeraldSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label25 = new System.Windows.Forms.Label();
|
||||
this.label32 = new System.Windows.Forms.Label();
|
||||
this.rubySecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label31 = new System.Windows.Forms.Label();
|
||||
this.label26 = new System.Windows.Forms.Label();
|
||||
this.label30 = new System.Windows.Forms.Label();
|
||||
this.emeraldFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.label27 = new System.Windows.Forms.Label();
|
||||
this.sapphireSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label28 = new System.Windows.Forms.Label();
|
||||
this.label29 = new System.Windows.Forms.Label();
|
||||
this.label37 = new System.Windows.Forms.Label();
|
||||
this.label26 = new System.Windows.Forms.Label();
|
||||
this.leafGreenSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label24 = new System.Windows.Forms.Label();
|
||||
this.label35 = new System.Windows.Forms.Label();
|
||||
this.rubyFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.label39 = new System.Windows.Forms.Label();
|
||||
this.fireRedFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.rubySecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label36 = new System.Windows.Forms.Label();
|
||||
this.label38 = new System.Windows.Forms.Label();
|
||||
this.label27 = new System.Windows.Forms.Label();
|
||||
this.label30 = new System.Windows.Forms.Label();
|
||||
this.label28 = new System.Windows.Forms.Label();
|
||||
this.sapphireFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.sapphireSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label32 = new System.Windows.Forms.Label();
|
||||
this.emeraldSecondComboBox = new DSPRE.InputComboBox();
|
||||
this.label31 = new System.Windows.Forms.Label();
|
||||
this.emeraldFirstComboBox = new DSPRE.InputComboBox();
|
||||
this.label25 = new System.Windows.Forms.Label();
|
||||
this.timeGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label16 = new System.Windows.Forms.Label();
|
||||
|
|
@ -246,6 +247,7 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.radarGroupBox.SuspendLayout();
|
||||
this.dualSlotGroupBox.SuspendLayout();
|
||||
this.tableLayoutPanel3.SuspendLayout();
|
||||
this.timeGroupBox.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
this.walkingGroupBox.SuspendLayout();
|
||||
|
|
@ -557,282 +559,308 @@
|
|||
//
|
||||
// dualSlotGroupBox
|
||||
//
|
||||
this.dualSlotGroupBox.Controls.Add(this.leafGreenFirstComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label33);
|
||||
this.dualSlotGroupBox.Controls.Add(this.fireRedSecondComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label35);
|
||||
this.dualSlotGroupBox.Controls.Add(this.fireRedFirstComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label36);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label37);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label38);
|
||||
this.dualSlotGroupBox.Controls.Add(this.leafGreenSecondComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label39);
|
||||
this.dualSlotGroupBox.Controls.Add(this.sapphireFirstComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.rubyFirstComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label24);
|
||||
this.dualSlotGroupBox.Controls.Add(this.emeraldSecondComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label25);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label32);
|
||||
this.dualSlotGroupBox.Controls.Add(this.rubySecondComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label31);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label26);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label30);
|
||||
this.dualSlotGroupBox.Controls.Add(this.emeraldFirstComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label27);
|
||||
this.dualSlotGroupBox.Controls.Add(this.sapphireSecondComboBox);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label28);
|
||||
this.dualSlotGroupBox.Controls.Add(this.label29);
|
||||
this.dualSlotGroupBox.Controls.Add(this.tableLayoutPanel3);
|
||||
this.dualSlotGroupBox.Location = new System.Drawing.Point(15, 307);
|
||||
this.dualSlotGroupBox.Name = "dualSlotGroupBox";
|
||||
this.dualSlotGroupBox.Size = new System.Drawing.Size(721, 179);
|
||||
this.dualSlotGroupBox.Size = new System.Drawing.Size(721, 182);
|
||||
this.dualSlotGroupBox.TabIndex = 190;
|
||||
this.dualSlotGroupBox.TabStop = false;
|
||||
this.dualSlotGroupBox.Text = "Dual Slot";
|
||||
//
|
||||
// tableLayoutPanel3
|
||||
//
|
||||
this.tableLayoutPanel3.ColumnCount = 8;
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.91356F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 84.08644F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 15F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 27F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 193F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 12F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 39F));
|
||||
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 197F));
|
||||
this.tableLayoutPanel3.Controls.Add(this.label33, 0, 6);
|
||||
this.tableLayoutPanel3.Controls.Add(this.leafGreenFirstComboBox, 4, 5);
|
||||
this.tableLayoutPanel3.Controls.Add(this.fireRedSecondComboBox, 1, 6);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label29, 1, 0);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label37, 3, 6);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label26, 0, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.leafGreenSecondComboBox, 4, 6);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label24, 0, 2);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label35, 0, 5);
|
||||
this.tableLayoutPanel3.Controls.Add(this.rubyFirstComboBox, 1, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label39, 3, 5);
|
||||
this.tableLayoutPanel3.Controls.Add(this.fireRedFirstComboBox, 1, 5);
|
||||
this.tableLayoutPanel3.Controls.Add(this.rubySecondComboBox, 1, 2);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label36, 4, 4);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label38, 1, 4);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label27, 4, 0);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label30, 3, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label28, 3, 2);
|
||||
this.tableLayoutPanel3.Controls.Add(this.sapphireFirstComboBox, 4, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.sapphireSecondComboBox, 4, 2);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label32, 6, 2);
|
||||
this.tableLayoutPanel3.Controls.Add(this.emeraldSecondComboBox, 7, 2);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label31, 6, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.emeraldFirstComboBox, 7, 1);
|
||||
this.tableLayoutPanel3.Controls.Add(this.label25, 7, 0);
|
||||
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 16);
|
||||
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
|
||||
this.tableLayoutPanel3.RowCount = 7;
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 80F));
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 19F));
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
|
||||
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
|
||||
this.tableLayoutPanel3.Size = new System.Drawing.Size(715, 163);
|
||||
this.tableLayoutPanel3.TabIndex = 217;
|
||||
//
|
||||
// label33
|
||||
//
|
||||
this.label33.AutoSize = true;
|
||||
this.label33.Location = new System.Drawing.Point(3, 131);
|
||||
this.label33.Name = "label33";
|
||||
this.label33.Size = new System.Drawing.Size(21, 13);
|
||||
this.label33.TabIndex = 206;
|
||||
this.label33.Text = "4%";
|
||||
//
|
||||
// leafGreenFirstComboBox
|
||||
//
|
||||
this.leafGreenFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.leafGreenFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.leafGreenFirstComboBox.FormattingEnabled = true;
|
||||
this.leafGreenFirstComboBox.Location = new System.Drawing.Point(278, 119);
|
||||
this.leafGreenFirstComboBox.Location = new System.Drawing.Point(276, 104);
|
||||
this.leafGreenFirstComboBox.Name = "leafGreenFirstComboBox";
|
||||
this.leafGreenFirstComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.leafGreenFirstComboBox.TabIndex = 207;
|
||||
this.leafGreenFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.leafGreenFirstComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label33
|
||||
//
|
||||
this.label33.AutoSize = true;
|
||||
this.label33.Location = new System.Drawing.Point(16, 150);
|
||||
this.label33.Name = "label33";
|
||||
this.label33.Size = new System.Drawing.Size(21, 13);
|
||||
this.label33.TabIndex = 206;
|
||||
this.label33.Text = "4%";
|
||||
//
|
||||
// fireRedSecondComboBox
|
||||
//
|
||||
this.fireRedSecondComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.fireRedSecondComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.fireRedSecondComboBox.FormattingEnabled = true;
|
||||
this.fireRedSecondComboBox.Location = new System.Drawing.Point(43, 146);
|
||||
this.fireRedSecondComboBox.Location = new System.Drawing.Point(39, 134);
|
||||
this.fireRedSecondComboBox.Name = "fireRedSecondComboBox";
|
||||
this.fireRedSecondComboBox.Size = new System.Drawing.Size(182, 21);
|
||||
this.fireRedSecondComboBox.TabIndex = 205;
|
||||
this.fireRedSecondComboBox.SelectedIndexChanged += new System.EventHandler(this.fireRedSecondComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label35
|
||||
// label29
|
||||
//
|
||||
this.label35.AutoSize = true;
|
||||
this.label35.Location = new System.Drawing.Point(16, 123);
|
||||
this.label35.Name = "label35";
|
||||
this.label35.Size = new System.Drawing.Size(21, 13);
|
||||
this.label35.TabIndex = 204;
|
||||
this.label35.Text = "4%";
|
||||
//
|
||||
// fireRedFirstComboBox
|
||||
//
|
||||
this.fireRedFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.fireRedFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.fireRedFirstComboBox.FormattingEnabled = true;
|
||||
this.fireRedFirstComboBox.Location = new System.Drawing.Point(43, 119);
|
||||
this.fireRedFirstComboBox.Name = "fireRedFirstComboBox";
|
||||
this.fireRedFirstComboBox.Size = new System.Drawing.Size(182, 21);
|
||||
this.fireRedFirstComboBox.TabIndex = 203;
|
||||
this.fireRedFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.fireRedFirstComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label36
|
||||
//
|
||||
this.label36.AutoSize = true;
|
||||
this.label36.Location = new System.Drawing.Point(275, 101);
|
||||
this.label36.Name = "label36";
|
||||
this.label36.Size = new System.Drawing.Size(60, 13);
|
||||
this.label36.TabIndex = 216;
|
||||
this.label36.Text = "Leaf Green";
|
||||
this.label29.AutoSize = true;
|
||||
this.label29.Location = new System.Drawing.Point(39, 0);
|
||||
this.label29.Name = "label29";
|
||||
this.label29.Size = new System.Drawing.Size(32, 9);
|
||||
this.label29.TabIndex = 200;
|
||||
this.label29.Text = "Ruby";
|
||||
//
|
||||
// label37
|
||||
//
|
||||
this.label37.AutoSize = true;
|
||||
this.label37.Location = new System.Drawing.Point(249, 150);
|
||||
this.label37.Location = new System.Drawing.Point(249, 131);
|
||||
this.label37.Name = "label37";
|
||||
this.label37.Size = new System.Drawing.Size(21, 13);
|
||||
this.label37.TabIndex = 210;
|
||||
this.label37.Text = "4%";
|
||||
//
|
||||
// label38
|
||||
// label26
|
||||
//
|
||||
this.label38.AutoSize = true;
|
||||
this.label38.Location = new System.Drawing.Point(40, 101);
|
||||
this.label38.Name = "label38";
|
||||
this.label38.Size = new System.Drawing.Size(47, 13);
|
||||
this.label38.TabIndex = 215;
|
||||
this.label38.Text = "Fire Red";
|
||||
this.label26.AutoSize = true;
|
||||
this.label26.Location = new System.Drawing.Point(3, 9);
|
||||
this.label26.Name = "label26";
|
||||
this.label26.Size = new System.Drawing.Size(21, 13);
|
||||
this.label26.TabIndex = 189;
|
||||
this.label26.Text = "4%";
|
||||
//
|
||||
// leafGreenSecondComboBox
|
||||
//
|
||||
this.leafGreenSecondComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.leafGreenSecondComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.leafGreenSecondComboBox.FormattingEnabled = true;
|
||||
this.leafGreenSecondComboBox.Location = new System.Drawing.Point(278, 146);
|
||||
this.leafGreenSecondComboBox.Location = new System.Drawing.Point(276, 134);
|
||||
this.leafGreenSecondComboBox.Name = "leafGreenSecondComboBox";
|
||||
this.leafGreenSecondComboBox.Size = new System.Drawing.Size(183, 21);
|
||||
this.leafGreenSecondComboBox.TabIndex = 209;
|
||||
this.leafGreenSecondComboBox.SelectedIndexChanged += new System.EventHandler(this.leafGreenSecondComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label39
|
||||
// label24
|
||||
//
|
||||
this.label39.AutoSize = true;
|
||||
this.label39.Location = new System.Drawing.Point(249, 123);
|
||||
this.label39.Name = "label39";
|
||||
this.label39.Size = new System.Drawing.Size(21, 13);
|
||||
this.label39.TabIndex = 208;
|
||||
this.label39.Text = "4%";
|
||||
this.label24.AutoSize = true;
|
||||
this.label24.Location = new System.Drawing.Point(3, 45);
|
||||
this.label24.Name = "label24";
|
||||
this.label24.Size = new System.Drawing.Size(21, 13);
|
||||
this.label24.TabIndex = 191;
|
||||
this.label24.Text = "4%";
|
||||
//
|
||||
// sapphireFirstComboBox
|
||||
// label35
|
||||
//
|
||||
this.sapphireFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.sapphireFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.sapphireFirstComboBox.FormattingEnabled = true;
|
||||
this.sapphireFirstComboBox.Location = new System.Drawing.Point(279, 42);
|
||||
this.sapphireFirstComboBox.Name = "sapphireFirstComboBox";
|
||||
this.sapphireFirstComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.sapphireFirstComboBox.TabIndex = 192;
|
||||
this.sapphireFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.sapphireFirstComboBox_SelectedIndexChanged);
|
||||
this.label35.AutoSize = true;
|
||||
this.label35.Location = new System.Drawing.Point(3, 101);
|
||||
this.label35.Name = "label35";
|
||||
this.label35.Size = new System.Drawing.Size(21, 13);
|
||||
this.label35.TabIndex = 204;
|
||||
this.label35.Text = "4%";
|
||||
//
|
||||
// rubyFirstComboBox
|
||||
//
|
||||
this.rubyFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.rubyFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.rubyFirstComboBox.FormattingEnabled = true;
|
||||
this.rubyFirstComboBox.Location = new System.Drawing.Point(44, 42);
|
||||
this.rubyFirstComboBox.Location = new System.Drawing.Point(39, 12);
|
||||
this.rubyFirstComboBox.Name = "rubyFirstComboBox";
|
||||
this.rubyFirstComboBox.Size = new System.Drawing.Size(182, 21);
|
||||
this.rubyFirstComboBox.TabIndex = 188;
|
||||
this.rubyFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.rubyFirstComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label24
|
||||
// label39
|
||||
//
|
||||
this.label24.AutoSize = true;
|
||||
this.label24.Location = new System.Drawing.Point(16, 73);
|
||||
this.label24.Name = "label24";
|
||||
this.label24.Size = new System.Drawing.Size(21, 13);
|
||||
this.label24.TabIndex = 191;
|
||||
this.label24.Text = "4%";
|
||||
this.label39.AutoSize = true;
|
||||
this.label39.Location = new System.Drawing.Point(249, 101);
|
||||
this.label39.Name = "label39";
|
||||
this.label39.Size = new System.Drawing.Size(21, 13);
|
||||
this.label39.TabIndex = 208;
|
||||
this.label39.Text = "4%";
|
||||
//
|
||||
// emeraldSecondComboBox
|
||||
// fireRedFirstComboBox
|
||||
//
|
||||
this.emeraldSecondComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.emeraldSecondComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.emeraldSecondComboBox.FormattingEnabled = true;
|
||||
this.emeraldSecondComboBox.Location = new System.Drawing.Point(515, 69);
|
||||
this.emeraldSecondComboBox.Name = "emeraldSecondComboBox";
|
||||
this.emeraldSecondComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.emeraldSecondComboBox.TabIndex = 198;
|
||||
this.emeraldSecondComboBox.SelectedIndexChanged += new System.EventHandler(this.emeraldSecondComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label25
|
||||
//
|
||||
this.label25.AutoSize = true;
|
||||
this.label25.Location = new System.Drawing.Point(512, 23);
|
||||
this.label25.Name = "label25";
|
||||
this.label25.Size = new System.Drawing.Size(45, 13);
|
||||
this.label25.TabIndex = 202;
|
||||
this.label25.Text = "Emerald";
|
||||
//
|
||||
// label32
|
||||
//
|
||||
this.label32.AutoSize = true;
|
||||
this.label32.Location = new System.Drawing.Point(488, 73);
|
||||
this.label32.Name = "label32";
|
||||
this.label32.Size = new System.Drawing.Size(21, 13);
|
||||
this.label32.TabIndex = 199;
|
||||
this.label32.Text = "4%";
|
||||
this.fireRedFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.fireRedFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.fireRedFirstComboBox.FormattingEnabled = true;
|
||||
this.fireRedFirstComboBox.Location = new System.Drawing.Point(39, 104);
|
||||
this.fireRedFirstComboBox.Name = "fireRedFirstComboBox";
|
||||
this.fireRedFirstComboBox.Size = new System.Drawing.Size(182, 21);
|
||||
this.fireRedFirstComboBox.TabIndex = 203;
|
||||
this.fireRedFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.fireRedFirstComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// rubySecondComboBox
|
||||
//
|
||||
this.rubySecondComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.rubySecondComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.rubySecondComboBox.FormattingEnabled = true;
|
||||
this.rubySecondComboBox.Location = new System.Drawing.Point(44, 69);
|
||||
this.rubySecondComboBox.Location = new System.Drawing.Point(39, 48);
|
||||
this.rubySecondComboBox.Name = "rubySecondComboBox";
|
||||
this.rubySecondComboBox.Size = new System.Drawing.Size(182, 21);
|
||||
this.rubySecondComboBox.TabIndex = 190;
|
||||
this.rubySecondComboBox.SelectedIndexChanged += new System.EventHandler(this.rubySecondComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label31
|
||||
// label36
|
||||
//
|
||||
this.label31.AutoSize = true;
|
||||
this.label31.Location = new System.Drawing.Point(488, 46);
|
||||
this.label31.Name = "label31";
|
||||
this.label31.Size = new System.Drawing.Size(21, 13);
|
||||
this.label31.TabIndex = 197;
|
||||
this.label31.Text = "4%";
|
||||
this.label36.AutoSize = true;
|
||||
this.label36.Location = new System.Drawing.Point(276, 84);
|
||||
this.label36.Name = "label36";
|
||||
this.label36.Size = new System.Drawing.Size(60, 13);
|
||||
this.label36.TabIndex = 216;
|
||||
this.label36.Text = "Leaf Green";
|
||||
//
|
||||
// label26
|
||||
// label38
|
||||
//
|
||||
this.label26.AutoSize = true;
|
||||
this.label26.Location = new System.Drawing.Point(16, 46);
|
||||
this.label26.Name = "label26";
|
||||
this.label26.Size = new System.Drawing.Size(21, 13);
|
||||
this.label26.TabIndex = 189;
|
||||
this.label26.Text = "4%";
|
||||
this.label38.AutoSize = true;
|
||||
this.label38.Location = new System.Drawing.Point(39, 84);
|
||||
this.label38.Name = "label38";
|
||||
this.label38.Size = new System.Drawing.Size(47, 13);
|
||||
this.label38.TabIndex = 215;
|
||||
this.label38.Text = "Fire Red";
|
||||
//
|
||||
// label27
|
||||
//
|
||||
this.label27.AutoSize = true;
|
||||
this.label27.Location = new System.Drawing.Point(276, 0);
|
||||
this.label27.Name = "label27";
|
||||
this.label27.Size = new System.Drawing.Size(49, 9);
|
||||
this.label27.TabIndex = 201;
|
||||
this.label27.Text = "Sapphire";
|
||||
//
|
||||
// label30
|
||||
//
|
||||
this.label30.AutoSize = true;
|
||||
this.label30.Location = new System.Drawing.Point(251, 46);
|
||||
this.label30.Location = new System.Drawing.Point(249, 9);
|
||||
this.label30.Name = "label30";
|
||||
this.label30.Size = new System.Drawing.Size(21, 13);
|
||||
this.label30.TabIndex = 193;
|
||||
this.label30.Text = "4%";
|
||||
//
|
||||
// emeraldFirstComboBox
|
||||
// label28
|
||||
//
|
||||
this.emeraldFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.emeraldFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.emeraldFirstComboBox.FormattingEnabled = true;
|
||||
this.emeraldFirstComboBox.Location = new System.Drawing.Point(515, 42);
|
||||
this.emeraldFirstComboBox.Name = "emeraldFirstComboBox";
|
||||
this.emeraldFirstComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.emeraldFirstComboBox.TabIndex = 196;
|
||||
this.emeraldFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.emeraldFirstComboBox_SelectedIndexChanged);
|
||||
this.label28.AutoSize = true;
|
||||
this.label28.Location = new System.Drawing.Point(249, 45);
|
||||
this.label28.Name = "label28";
|
||||
this.label28.Size = new System.Drawing.Size(21, 13);
|
||||
this.label28.TabIndex = 195;
|
||||
this.label28.Text = "4%";
|
||||
//
|
||||
// label27
|
||||
// sapphireFirstComboBox
|
||||
//
|
||||
this.label27.AutoSize = true;
|
||||
this.label27.Location = new System.Drawing.Point(276, 24);
|
||||
this.label27.Name = "label27";
|
||||
this.label27.Size = new System.Drawing.Size(49, 13);
|
||||
this.label27.TabIndex = 201;
|
||||
this.label27.Text = "Sapphire";
|
||||
this.sapphireFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.sapphireFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.sapphireFirstComboBox.FormattingEnabled = true;
|
||||
this.sapphireFirstComboBox.Location = new System.Drawing.Point(276, 12);
|
||||
this.sapphireFirstComboBox.Name = "sapphireFirstComboBox";
|
||||
this.sapphireFirstComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.sapphireFirstComboBox.TabIndex = 192;
|
||||
this.sapphireFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.sapphireFirstComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// sapphireSecondComboBox
|
||||
//
|
||||
this.sapphireSecondComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.sapphireSecondComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.sapphireSecondComboBox.FormattingEnabled = true;
|
||||
this.sapphireSecondComboBox.Location = new System.Drawing.Point(279, 69);
|
||||
this.sapphireSecondComboBox.Location = new System.Drawing.Point(276, 48);
|
||||
this.sapphireSecondComboBox.Name = "sapphireSecondComboBox";
|
||||
this.sapphireSecondComboBox.Size = new System.Drawing.Size(183, 21);
|
||||
this.sapphireSecondComboBox.TabIndex = 194;
|
||||
this.sapphireSecondComboBox.SelectedIndexChanged += new System.EventHandler(this.sapphireSecondComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label28
|
||||
// label32
|
||||
//
|
||||
this.label28.AutoSize = true;
|
||||
this.label28.Location = new System.Drawing.Point(251, 73);
|
||||
this.label28.Name = "label28";
|
||||
this.label28.Size = new System.Drawing.Size(21, 13);
|
||||
this.label28.TabIndex = 195;
|
||||
this.label28.Text = "4%";
|
||||
this.label32.AutoSize = true;
|
||||
this.label32.Location = new System.Drawing.Point(481, 45);
|
||||
this.label32.Name = "label32";
|
||||
this.label32.Size = new System.Drawing.Size(21, 13);
|
||||
this.label32.TabIndex = 199;
|
||||
this.label32.Text = "4%";
|
||||
//
|
||||
// label29
|
||||
// emeraldSecondComboBox
|
||||
//
|
||||
this.label29.AutoSize = true;
|
||||
this.label29.Location = new System.Drawing.Point(41, 24);
|
||||
this.label29.Name = "label29";
|
||||
this.label29.Size = new System.Drawing.Size(32, 13);
|
||||
this.label29.TabIndex = 200;
|
||||
this.label29.Text = "Ruby";
|
||||
this.emeraldSecondComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.emeraldSecondComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.emeraldSecondComboBox.FormattingEnabled = true;
|
||||
this.emeraldSecondComboBox.Location = new System.Drawing.Point(520, 48);
|
||||
this.emeraldSecondComboBox.Name = "emeraldSecondComboBox";
|
||||
this.emeraldSecondComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.emeraldSecondComboBox.TabIndex = 198;
|
||||
this.emeraldSecondComboBox.SelectedIndexChanged += new System.EventHandler(this.emeraldSecondComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label31
|
||||
//
|
||||
this.label31.AutoSize = true;
|
||||
this.label31.Location = new System.Drawing.Point(481, 9);
|
||||
this.label31.Name = "label31";
|
||||
this.label31.Size = new System.Drawing.Size(21, 13);
|
||||
this.label31.TabIndex = 197;
|
||||
this.label31.Text = "4%";
|
||||
//
|
||||
// emeraldFirstComboBox
|
||||
//
|
||||
this.emeraldFirstComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.emeraldFirstComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.emeraldFirstComboBox.FormattingEnabled = true;
|
||||
this.emeraldFirstComboBox.Location = new System.Drawing.Point(520, 12);
|
||||
this.emeraldFirstComboBox.Name = "emeraldFirstComboBox";
|
||||
this.emeraldFirstComboBox.Size = new System.Drawing.Size(184, 21);
|
||||
this.emeraldFirstComboBox.TabIndex = 196;
|
||||
this.emeraldFirstComboBox.SelectedIndexChanged += new System.EventHandler(this.emeraldFirstComboBox_SelectedIndexChanged);
|
||||
//
|
||||
// label25
|
||||
//
|
||||
this.label25.AutoSize = true;
|
||||
this.label25.Location = new System.Drawing.Point(520, 0);
|
||||
this.label25.Name = "label25";
|
||||
this.label25.Size = new System.Drawing.Size(45, 9);
|
||||
this.label25.TabIndex = 202;
|
||||
this.label25.Text = "Emerald";
|
||||
//
|
||||
// timeGroupBox
|
||||
//
|
||||
|
|
@ -1675,7 +1703,7 @@
|
|||
this.label70.Name = "label70";
|
||||
this.label70.Size = new System.Drawing.Size(21, 13);
|
||||
this.label70.TabIndex = 20;
|
||||
this.label70.Text = "1%";
|
||||
this.label70.Text = "5%";
|
||||
//
|
||||
// superRodOneComboBox
|
||||
//
|
||||
|
|
@ -1708,11 +1736,11 @@
|
|||
//
|
||||
this.label71.AutoSize = true;
|
||||
this.label71.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.label71.Location = new System.Drawing.Point(18, 161);
|
||||
this.label71.Location = new System.Drawing.Point(12, 161);
|
||||
this.label71.Name = "label71";
|
||||
this.label71.Size = new System.Drawing.Size(21, 13);
|
||||
this.label71.Size = new System.Drawing.Size(27, 13);
|
||||
this.label71.TabIndex = 16;
|
||||
this.label71.Text = "4%";
|
||||
this.label71.Text = "10%";
|
||||
//
|
||||
// superRodFourComboBox
|
||||
//
|
||||
|
|
@ -1786,7 +1814,7 @@
|
|||
this.label73.Name = "label73";
|
||||
this.label73.Size = new System.Drawing.Size(27, 13);
|
||||
this.label73.TabIndex = 8;
|
||||
this.label73.Text = "40%";
|
||||
this.label73.Text = "30%";
|
||||
//
|
||||
// superRodSecondFortyComboBox
|
||||
//
|
||||
|
|
@ -1934,7 +1962,7 @@
|
|||
this.label54.Name = "label54";
|
||||
this.label54.Size = new System.Drawing.Size(21, 13);
|
||||
this.label54.TabIndex = 20;
|
||||
this.label54.Text = "1%";
|
||||
this.label54.Text = "5%";
|
||||
//
|
||||
// goodRodOneComboBox
|
||||
//
|
||||
|
|
@ -1967,11 +1995,11 @@
|
|||
//
|
||||
this.label55.AutoSize = true;
|
||||
this.label55.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.label55.Location = new System.Drawing.Point(18, 161);
|
||||
this.label55.Location = new System.Drawing.Point(12, 161);
|
||||
this.label55.Name = "label55";
|
||||
this.label55.Size = new System.Drawing.Size(21, 13);
|
||||
this.label55.Size = new System.Drawing.Size(27, 13);
|
||||
this.label55.TabIndex = 16;
|
||||
this.label55.Text = "4%";
|
||||
this.label55.Text = "10%";
|
||||
//
|
||||
// goodRodFourComboBox
|
||||
//
|
||||
|
|
@ -2045,7 +2073,7 @@
|
|||
this.label57.Name = "label57";
|
||||
this.label57.Size = new System.Drawing.Size(27, 13);
|
||||
this.label57.TabIndex = 8;
|
||||
this.label57.Text = "40%";
|
||||
this.label57.Text = "30%";
|
||||
//
|
||||
// goodRodSecondFortyComboBox
|
||||
//
|
||||
|
|
@ -2193,7 +2221,7 @@
|
|||
this.label46.Name = "label46";
|
||||
this.label46.Size = new System.Drawing.Size(21, 13);
|
||||
this.label46.TabIndex = 20;
|
||||
this.label46.Text = "1%";
|
||||
this.label46.Text = "5%";
|
||||
//
|
||||
// oldRodOneComboBox
|
||||
//
|
||||
|
|
@ -2226,11 +2254,11 @@
|
|||
//
|
||||
this.label47.AutoSize = true;
|
||||
this.label47.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.label47.Location = new System.Drawing.Point(18, 161);
|
||||
this.label47.Location = new System.Drawing.Point(11, 161);
|
||||
this.label47.Name = "label47";
|
||||
this.label47.Size = new System.Drawing.Size(21, 13);
|
||||
this.label47.Size = new System.Drawing.Size(27, 13);
|
||||
this.label47.TabIndex = 16;
|
||||
this.label47.Text = "4%";
|
||||
this.label47.Text = "10%";
|
||||
//
|
||||
// oldRodFourComboBox
|
||||
//
|
||||
|
|
@ -2263,11 +2291,11 @@
|
|||
//
|
||||
this.label48.AutoSize = true;
|
||||
this.label48.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.label48.Location = new System.Drawing.Point(18, 134);
|
||||
this.label48.Location = new System.Drawing.Point(11, 134);
|
||||
this.label48.Name = "label48";
|
||||
this.label48.Size = new System.Drawing.Size(21, 13);
|
||||
this.label48.Size = new System.Drawing.Size(27, 13);
|
||||
this.label48.TabIndex = 12;
|
||||
this.label48.Text = "5%";
|
||||
this.label48.Text = "15%";
|
||||
//
|
||||
// oldRodFiveComboBox
|
||||
//
|
||||
|
|
@ -2341,7 +2369,7 @@
|
|||
this.label50.Name = "label50";
|
||||
this.label50.Size = new System.Drawing.Size(27, 13);
|
||||
this.label50.TabIndex = 4;
|
||||
this.label50.Text = "60%";
|
||||
this.label50.Text = "40%";
|
||||
//
|
||||
// oldRodSixtyComboBox
|
||||
//
|
||||
|
|
@ -2649,7 +2677,8 @@
|
|||
this.radarGroupBox.ResumeLayout(false);
|
||||
this.radarGroupBox.PerformLayout();
|
||||
this.dualSlotGroupBox.ResumeLayout(false);
|
||||
this.dualSlotGroupBox.PerformLayout();
|
||||
this.tableLayoutPanel3.ResumeLayout(false);
|
||||
this.tableLayoutPanel3.PerformLayout();
|
||||
this.timeGroupBox.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
this.tableLayoutPanel2.PerformLayout();
|
||||
|
|
@ -2942,5 +2971,6 @@
|
|||
private System.Windows.Forms.Button repairAllButton;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.RomInfo;
|
||||
|
||||
|
|
@ -9,13 +10,12 @@ namespace DSPRE {
|
|||
public partial class WildEditorDPPt : Form {
|
||||
public string encounterFileFolder { get; private set; }
|
||||
EncounterFileDPPt currentFile;
|
||||
bool disableHandlers = false;
|
||||
|
||||
|
||||
public WildEditorDPPt(string dirPath, string[] names, int encToOpen, int totalNumHeaderFiles) {
|
||||
InitializeComponent();
|
||||
encounterFileFolder = dirPath;
|
||||
|
||||
disableHandlers = true;
|
||||
Text = "DSPRE Reloaded " + GetDSPREVersion() + " - DPPt Encounters Editor";
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
MapHeader tempMapHeader;
|
||||
List<string> locationNames = RomInfo.GetLocationNames();
|
||||
|
|
@ -83,12 +83,12 @@ namespace DSPRE {
|
|||
}
|
||||
}
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
SetupControls();
|
||||
}
|
||||
private void SetupControls() {
|
||||
disableHandlers = true;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
/* Setup encounter rates controls */
|
||||
walkingRateUpDown.Value = currentFile.walkingRate;
|
||||
|
|
@ -233,7 +233,12 @@ namespace DSPRE {
|
|||
superRodOneMinLevelUpDown.Value = currentFile.superRodMinLevels[4];
|
||||
superRodOneMaxLevelUpDown.Value = currentFile.superRodMaxLevels[4];
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
|
||||
public string GetDSPREVersion() {
|
||||
return "" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor +
|
||||
"." + Assembly.GetExecutingAssembly().GetName().Version.Build;
|
||||
}
|
||||
|
||||
private void exportEncounterFileButton_Click(object sender, EventArgs e) {
|
||||
|
|
@ -255,7 +260,7 @@ namespace DSPRE {
|
|||
SetupControls();
|
||||
}
|
||||
private void selectEncounterComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -266,313 +271,313 @@ namespace DSPRE {
|
|||
currentFile.SaveToFileDefaultDir(selectEncounterComboBox.SelectedIndex);
|
||||
}
|
||||
private void walkingTwentyFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[0] = (uint)walkingTwentyFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingTwentySecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[1] = (uint)walkingTwentySecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingTenFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[2] = (uint)walkingTenFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingTenSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[3] = (uint)walkingTenSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingTenThirdComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[4] = (uint)walkingTenThirdComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingTenFourthComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[5] = (uint)walkingTenFourthComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingFiveFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[6] = (uint)walkingFiveFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingFiveSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[7] = (uint)walkingFiveSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingFourFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[8] = (uint)walkingFourFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingFourSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[9] = (uint)walkingFourSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingOneFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[10] = (uint)walkingOneFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void walkingOneSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingPokemon[11] = (uint)walkingOneSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[0] = (uint)morningFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[1] = (uint)morningSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[0] = (uint)nightFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[1] = (uint)nightSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void swarmFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.swarmPokemon[0] = (ushort)swarmFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void swarmSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.swarmPokemon[1] = (ushort)swarmSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void rubyFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rubyPokemon[0] = (uint)rubyFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void rubySecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rubyPokemon[1] = (uint)rubySecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void sapphireFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.sapphirePokemon[0] = (uint)sapphireFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void sapphireSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.sapphirePokemon[1] = (uint)sapphireSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void emeraldFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.emeraldPokemon[0] = (uint)emeraldFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void emeraldSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.emeraldPokemon[1] = (uint)emeraldSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void fireRedFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.fireRedPokemon[0] = (uint)fireRedFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void fireRedSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.fireRedPokemon[1] = (uint)fireRedSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void leafGreenFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.leafGreenPokemon[0] = (uint)leafGreenFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void leafGreenSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.leafGreenPokemon[1] = (uint)leafGreenSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void radarFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.radarPokemon[0] = (uint)radarFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void radarSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.radarPokemon[1] = (uint)radarSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void radarThirdComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.radarPokemon[2] = (uint)radarThirdComboBox.SelectedIndex;
|
||||
}
|
||||
private void radarFourthComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.radarPokemon[3] = (uint)radarFourthComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfSixtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[0] = (ushort)surfSixtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfThirtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[1] = (ushort)surfThirtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfFiveComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[2] = (ushort)surfFiveComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[3] = (ushort)surfFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[4] = (ushort)surfOneComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodSixtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[0] = (ushort)oldRodSixtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodThirtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[1] = (ushort)oldRodThirtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodFiveComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[2] = (ushort)oldRodFiveComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[3] = (ushort)oldRodFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[4] = (ushort)oldRodOneComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodFirstFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[0] = (ushort)goodRodFirstFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodSecondFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[1] = (ushort)goodRodSecondFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodFifteenComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[2] = (ushort)goodRodFifteenComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[3] = (ushort)goodRodFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[4] = (ushort)goodRodOneComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodFirstFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[0] = (ushort)superRodFirstFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodSecondFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[1] = (ushort)superRodSecondFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodFifteenComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[2] = (ushort)superRodFifteenComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[3] = (ushort)superRodFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[4] = (ushort)superRodOneComboBox.SelectedIndex;
|
||||
|
|
@ -580,73 +585,73 @@ namespace DSPRE {
|
|||
|
||||
/* Walking levels controls */
|
||||
private void walkingTwentyFirstUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[0] = (byte)walkingTwentyFirstUpDown.Value;
|
||||
}
|
||||
private void walkingTwentySecondUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[1] = (byte)walkingTwentySecondUpDown.Value;
|
||||
}
|
||||
private void walkingTenFirstUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[2] = (byte)walkingTenFirstUpDown.Value;
|
||||
}
|
||||
private void walkingTenSecondUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[3] = (byte)walkingTenSecondUpDown.Value;
|
||||
}
|
||||
private void walkingTenThirdUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[4] = (byte)walkingTenThirdUpDown.Value;
|
||||
}
|
||||
private void walkingTenFourthUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[5] = (byte)walkingTenFourthUpDown.Value;
|
||||
}
|
||||
private void walkingFiveFirstUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[6] = (byte)walkingFiveFirstUpDown.Value;
|
||||
}
|
||||
private void walkingFiveSecondUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[7] = (byte)walkingFiveSecondUpDown.Value;
|
||||
}
|
||||
private void walkingFourFirstUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[8] = (byte)walkingFourFirstUpDown.Value;
|
||||
}
|
||||
private void walkingFourSecondUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[9] = (byte)walkingFourSecondUpDown.Value;
|
||||
}
|
||||
private void walkingOneFirstUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[10] = (byte)walkingOneFirstUpDown.Value;
|
||||
}
|
||||
private void walkingOneSecondUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[11] = (byte)walkingOneSecondUpDown.Value;
|
||||
|
|
@ -654,244 +659,244 @@ namespace DSPRE {
|
|||
|
||||
/* Water levels controls */
|
||||
private void surfSixtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[0] = (byte)surfSixtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfThirtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[1] = (byte)surfThirtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfFiveMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[2] = (byte)surfFiveMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[3] = (byte)surfFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[4] = (byte)surfOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfSixtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[0] = (byte)surfSixtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfThirtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[1] = (byte)surfThirtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfFiveMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[2] = (byte)surfFiveMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[3] = (byte)surfFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[4] = (byte)surfOneMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void oldRodSixtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[0] = (byte)oldRodSixtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodThirtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[1] = (byte)oldRodThirtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFiveMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[2] = (byte)oldRodFiveMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[3] = (byte)oldRodFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[4] = (byte)oldRodOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodSixtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[0] = (byte)oldRodSixtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodThirtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[1] = (byte)oldRodThirtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFiveMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[2] = (byte)oldRodFiveMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[3] = (byte)oldRodFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[4] = (byte)oldRodOneMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void goodRodFirstFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[0] = (byte)goodRodFirstFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodSecondFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[1] = (byte)goodRodSecondFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFifteenMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[2] = (byte)goodRodFifteenMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[3] = (byte)goodRodFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[4] = (byte)goodRodOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFirstFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[0] = (byte)goodRodFirstFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodSecondFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[1] = (byte)goodRodSecondFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFifteenMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[2] = (byte)goodRodFifteenMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[3] = (byte)goodRodFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[4] = (byte)goodRodOneMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void superRodFirstFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[0] = (byte)superRodFirstFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodSecondFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[1] = (byte)superRodSecondFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFifteenMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[2] = (byte)superRodFifteenMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[3] = (byte)superRodFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[4] = (byte)superRodOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFirstFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[0] = (byte)superRodFirstFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodSecondFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[1] = (byte)superRodSecondFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFifteenMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[2] = (byte)superRodFifteenMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[3] = (byte)superRodFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[4] = (byte)superRodOneMaxLevelUpDown.Value;
|
||||
|
|
@ -899,32 +904,32 @@ namespace DSPRE {
|
|||
|
||||
/* Encounter rate controls */
|
||||
private void walkingRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingRate = (byte)walkingRateUpDown.Value;
|
||||
}
|
||||
private void surfRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfRate = (byte)surfRateUpDown.Value;
|
||||
}
|
||||
private void oldRodRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodRate = (byte)oldRodRateUpDown.Value;
|
||||
}
|
||||
private void goodRodRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodRate = (byte)goodRodRateUpDown.Value;
|
||||
}
|
||||
|
||||
private void superRodRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodRate = (byte)superRodRateUpDown.Value;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@
|
|||
<data name="pictureBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAdCAYAAADLnm6HAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wAAADsABataJCQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAPBJREFUSEvtkkEK
|
||||
vAAADrwBlbxySQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAAPBJREFUSEvtkkEK
|
||||
wjAURHOEHkFw1WWv5dalV/Eqnq0y+qeM32iaNgkUMvAIbfIzr2Lo6TlMzsMwE3vVLih9TNNCUxEtv4/j
|
||||
i6YiKGAxuZ3eVBfBpfrlnqoivny+XhZUAhQX+VeuqAQoIrK23ONFsGaLbC0nnAOUACpiVd9h+R4Bwnkl
|
||||
KYGNmASIlaxB7wBJAfxsJUV0FvBuq/wMN/lP5rOXALEyj57Xu7FaZTx6eKuInvF3WU06LM4V0fec56xd
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
<data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABgAAAAXCAYAAAARIY8tAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
vwAADr8BOAVTJAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAA95JREFUSEutlN1P
|
||||
vAAADrwBlbxySQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAAA95JREFUSEutlN1P
|
||||
U3cYx3+ZjBcdirhCi1Rooe2v7Tmnp7RnVkUSTRR8i9FoBibuhmxTb4wXxt0srXOsM6DUFwxJFSFGeVES
|
||||
fEGLL6QGozDdINuy7M7/wItlN7vZ43menv56KiSS6C/5htPn+3w/z++c8zuwxS4+xEZ0AcozxPYb5Y+z
|
||||
dGB/U2r5662PPweUNlaSxpphf/jCXbc8sUDrdC0pcncZ3Ylhv3/xQTas63+zDIvWYga8m897jPyybYQn
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
<data name="pictureBox7.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAK
|
||||
7QAACu0BAohJwQAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAABOElE
|
||||
6QAACukB/XXO0wAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAABOElE
|
||||
QVRIS7WToRLCMBBE+aRKPiOyks9AViKRfAYSWcknIJFIZF1gM7OZzeUKDVPEm1w2e7dNC5sY419xxTWp
|
||||
hK7rYh9CxMr6OAzvo9K3lGKDgawxmMNZ86yFXOhwRUPmPJ/IxadmnCHkOo7NIbn41qghLd+k2CwNaXld
|
||||
lYBGxZ7zmyx9Xa6o2CHYt4S4osUL8VAPqQQPbUZ97bfxOewS4+2eOJ0vbkixsXhPhj2HA+w53PPnQvGM
|
||||
|
|
@ -178,7 +178,7 @@
|
|||
<data name="pictureBox6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAe
|
||||
vwAAHr8BQ/1smgAAAAd0SU1FB9UDGhMWCY0H+k0AAAEJSURBVEhLtZKxEcIwDEUZhzIlJSOkpGQEyoyQ
|
||||
vAAAHrwB7kRN9wAAAAd0SU1FB9UDGhMWCY0H+k0AAAEJSURBVEhLtZKxEcIwDEUZhzIlJSOkpGQEyoyQ
|
||||
ERgjJSVlRkjJCJTpzH3fSafYki3nQvGOb1nRi4BTCOGvqMUjUYtd14XHeA74pAzSPg9ZAQMp0+Bpvkbk
|
||||
nZfNwRpAkuV7b5ZsDqWHcbdHwsHz0B4JB+8DrRIOXoH80UHt38XBKwAtW3BoEQCvhMNeQe1r4mAJUC/d
|
||||
1bbgoDWgtq5rmG8XdQAJSltwSAfgjMESSzIMU0S73zRSpvN7+cQ3w/Dn9DIFfT9GigJgSazhBEm0LbJG
|
||||
|
|
@ -189,7 +189,7 @@
|
|||
<data name="pictureBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAK
|
||||
7QAACu0BAohJwQAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAABFElE
|
||||
6QAACukB/XXO0wAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAABFElE
|
||||
QVRIS7WUvQ3CMBSEKSkZJSVlxmCElIxAyQgZgzJlSkagzBjpjC7SWc+PI/4RFJ+cd7bvU4LEIYTwV2RI
|
||||
uq4LxO+VIkOA0mUaNq79qVkiQ0DBPPabYLjdmyQyJChk+fxamiQytKBwfExRUvu5ZEhYhBWCcTjGT1Yq
|
||||
kSHwBZhRTgnWEokMv12kBG+AFeQkH0HuAvbtW+QkyZArJzWSZCgVgFJJcoHPpeAOfw+sEPme5DCfa7AS
|
||||
|
|
|
|||
2715
DS_Map/WildEditorHGSS.Designer.cs
generated
2715
DS_Map/WildEditorHGSS.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -2,6 +2,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.RomInfo;
|
||||
|
||||
|
|
@ -9,14 +10,13 @@ namespace DSPRE {
|
|||
public partial class WildEditorHGSS : Form {
|
||||
public string encounterFileFolder { get; private set; }
|
||||
EncounterFileHGSS currentFile;
|
||||
bool disableHandlers = false;
|
||||
|
||||
public WildEditorHGSS(string dirPath, string[] names, int encToOpen, int totalNumHeaderFiles) {
|
||||
InitializeComponent();
|
||||
encounterFileFolder = dirPath;
|
||||
|
||||
disableHandlers = true;
|
||||
|
||||
Helpers.DisableHandlers();
|
||||
Text = "DSPRE Reloaded " + GetDSPREVersion() + " - HGSS Encounters Editor";
|
||||
MapHeader tempMapHeader;
|
||||
List<string> locationNames = RomInfo.GetLocationNames();
|
||||
Dictionary<int, string> EncounterFileLocationName = new Dictionary<int, string>();
|
||||
|
|
@ -81,13 +81,18 @@ namespace DSPRE {
|
|||
}
|
||||
}
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
|
||||
SetupControls();
|
||||
}
|
||||
|
||||
public string GetDSPREVersion() {
|
||||
return "" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor +
|
||||
"." + Assembly.GetExecutingAssembly().GetName().Version.Build;
|
||||
}
|
||||
|
||||
public void SetupControls() {
|
||||
disableHandlers = true;
|
||||
Helpers.DisableHandlers();
|
||||
|
||||
/* Setup encounter rates controls */
|
||||
walkingRateUpDown.Value = currentFile.walkingRate;
|
||||
|
|
@ -255,7 +260,7 @@ namespace DSPRE {
|
|||
superRodOneMinLevelUpDown.Value = currentFile.superRodMinLevels[4];
|
||||
superRodOneMaxLevelUpDown.Value = currentFile.superRodMaxLevels[4];
|
||||
|
||||
disableHandlers = false;
|
||||
Helpers.EnableHandlers();
|
||||
}
|
||||
private void exportEncounterFileButton_Click(object sender, EventArgs e) {
|
||||
currentFile.SaveToFileExplorePath("Encounter File " + selectEncounterComboBox.SelectedIndex);
|
||||
|
|
@ -276,7 +281,7 @@ namespace DSPRE {
|
|||
SetupControls();
|
||||
}
|
||||
private void selectEncounterComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -288,546 +293,546 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void walkingRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingRate = (byte)walkingRateUpDown.Value;
|
||||
}
|
||||
private void rockSmashRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashRate = (byte)rockSmashRateUpDown.Value;
|
||||
}
|
||||
private void surfRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfRate = (byte)surfRateUpDown.Value;
|
||||
}
|
||||
private void oldRodRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodRate = (byte)oldRodRateUpDown.Value;
|
||||
}
|
||||
private void goodRodRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodRate = (byte)goodRodRateUpDown.Value;
|
||||
}
|
||||
private void superRodRateUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodRate = (byte)superRodRateUpDown.Value;
|
||||
}
|
||||
private void morningTwentyFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[0] = (ushort)morningTwentyFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningTwentySecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[1] = (ushort)morningTwentySecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningTenFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[2] = (ushort)morningTenFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningTenSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[3] = (ushort)morningTenSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningTenThirdComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[4] = (ushort)morningTenThirdComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningTenFourthComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[5] = (ushort)morningTenFourthComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningFiveFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[6] = (ushort)morningFiveFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningFiveSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[7] = (ushort)morningFiveSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningFourFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[8] = (ushort)morningFourFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningFourSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[9] = (ushort)morningFourSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningOneFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[10] = (ushort)morningOneFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void morningOneSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.morningPokemon[11] = (ushort)morningOneSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayTwentyFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[0] = (ushort)dayTwentyFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayTwentySecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[1] = (ushort)dayTwentySecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayTenFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[2] = (ushort)dayTenFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayTenSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[3] = (ushort)dayTenSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayTenThirdComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[4] = (ushort)dayTenThirdComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayTenFourthComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[5] = (ushort)dayTenFourthComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayFiveFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[6] = (ushort)dayFiveFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayFiveSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[7] = (ushort)dayFiveSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayFourFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[8] = (ushort)dayFourFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayFourSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[9] = (ushort)dayFourSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayOneFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[10] = (ushort)dayOneFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void dayOneSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.dayPokemon[11] = (ushort)dayOneSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightTwentyFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[0] = (ushort)nightTwentyFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightTwentySecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[1] = (ushort)nightTwentySecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightTenFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[2] = (ushort)nightTenFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightTenSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[3] = (ushort)nightTenSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightTenThirdComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[4] = (ushort)nightTenThirdComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightTenFourthComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[5] = (ushort)nightTenFourthComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightFiveFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[6] = (ushort)nightFiveFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightFiveSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[7] = (ushort)nightFiveSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightFourFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[8] = (ushort)nightFourFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightFourSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[9] = (ushort)nightFourSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightOneFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[10] = (ushort)nightOneFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void nightOneSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.nightPokemon[11] = (ushort)nightOneSecondComboBox.SelectedIndex;
|
||||
}
|
||||
|
||||
private void twentyFirstLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[0] = (byte)twentyFirstLevelUpDown.Value;
|
||||
}
|
||||
private void twentySecondLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[1] = (byte)twentySecondLevelUpDown.Value;
|
||||
}
|
||||
private void tenFirstLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[2] = (byte)tenFirstLevelUpDown.Value;
|
||||
}
|
||||
private void tenSecondLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[3] = (byte)tenSecondLevelUpDown.Value;
|
||||
}
|
||||
private void tenThirdLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[4] = (byte)tenThirdLevelUpDown.Value;
|
||||
}
|
||||
private void tenFourthLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[5] = (byte)tenFourthLevelUpDown.Value;
|
||||
}
|
||||
private void fiveFirstLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[6] = (byte)fiveFirstLevelUpDown.Value;
|
||||
}
|
||||
private void fiveSecondLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[7] = (byte)fiveSecondLevelUpDown.Value;
|
||||
}
|
||||
private void fourFirstLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[8] = (byte)fourFirstLevelUpDown.Value;
|
||||
}
|
||||
private void fourSecondLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[9] = (byte)fourSecondLevelUpDown.Value;
|
||||
}
|
||||
private void oneFirstLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[10] = (byte)oneFirstLevelUpDown.Value;
|
||||
}
|
||||
private void oneSecondLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.walkingLevels[11] = (byte)oneSecondLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void hoennFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.hoennMusicPokemon[0] = (ushort)hoennFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void hoennSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.hoennMusicPokemon[1] = (ushort)hoennSecondComboBox.SelectedIndex;
|
||||
}
|
||||
private void sinnohFirstComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.sinnohMusicPokemon[0] = (ushort)sinnohFirstComboBox.SelectedIndex;
|
||||
}
|
||||
private void sinnohSecondComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.sinnohMusicPokemon[1] = (ushort)sinnohSecondComboBox.SelectedIndex;
|
||||
}
|
||||
|
||||
private void rockSmashNinetyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashPokemon[0] = (ushort)rockSmashNinetyComboBox.SelectedIndex;
|
||||
}
|
||||
private void rockSmashTenComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashPokemon[1] = (ushort)rockSmashTenComboBox.SelectedIndex;
|
||||
}
|
||||
private void rockSmashNinetyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashMinLevels[0] = (byte)rockSmashNinetyMinLevelUpDown.Value;
|
||||
}
|
||||
private void rockSmashTenMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashMinLevels[1] = (byte)rockSmashTenMinLevelUpDown.Value;
|
||||
}
|
||||
private void rockSmashNinetyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashMaxLevels[0] = (byte)rockSmashNinetyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void rockSmashTenMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashMaxLevels[1] = (byte)rockSmashNinetyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void rockSmashNinetyMaxLevelUpDown_ValueChanged_1(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashMaxLevels[0] = (byte)rockSmashNinetyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void rockSmashTenMaxLevelUpDown_ValueChanged_1(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.rockSmashMaxLevels[1] = (byte)rockSmashTenMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void grassSwarmComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.swarmPokemon[0] = (ushort)grassSwarmComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfSwarmComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.swarmPokemon[1] = (ushort)surfSwarmComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodSwarmComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.swarmPokemon[2] = (ushort)goodRodSwarmComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodSwarmComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.swarmPokemon[3] = (ushort)superRodSwarmComboBox.SelectedIndex;
|
||||
}
|
||||
|
||||
private void surfSixtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[0] = (ushort)surfSixtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfThirtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[1] = (ushort)surfThirtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfFiveComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[2] = (ushort)surfFiveComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[3] = (ushort)surfFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void surfOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfPokemon[4] = (ushort)surfOneComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodSixtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[0] = (ushort)oldRodSixtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodThirtyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[1] = (ushort)oldRodThirtyComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodFiveComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[2] = (ushort)oldRodFiveComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[3] = (ushort)oldRodFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void oldRodOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodPokemon[4] = (ushort)oldRodOneComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodFirstFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[0] = (ushort)goodRodFirstFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodSecondFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[1] = (ushort)goodRodSecondFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodFifteenComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[2] = (ushort)goodRodFifteenComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[3] = (ushort)goodRodFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void goodRodOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodPokemon[4] = (ushort)goodRodOneComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodFirstFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[0] = (ushort)superRodFirstFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodSecondFortyComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[1] = (ushort)superRodSecondFortyComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodFifteenComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[2] = (ushort)superRodFifteenComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodFourComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[3] = (ushort)superRodFourComboBox.SelectedIndex;
|
||||
}
|
||||
private void superRodOneComboBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodPokemon[4] = (ushort)superRodOneComboBox.SelectedIndex;
|
||||
|
|
@ -835,129 +840,129 @@ namespace DSPRE {
|
|||
|
||||
/* Water levels controls */
|
||||
private void surfSixtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[0] = (byte)surfSixtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfThirtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[1] = (byte)surfThirtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfFiveMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[2] = (byte)surfFiveMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[3] = (byte)surfFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMinLevels[4] = (byte)surfOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void surfSixtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[0] = (byte)surfSixtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfThirtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[1] = (byte)surfThirtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfFiveMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[2] = (byte)surfFiveMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[3] = (byte)surfFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void surfOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.surfMaxLevels[4] = (byte)surfOneMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void oldRodSixtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[0] = (byte)oldRodSixtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodThirtyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[1] = (byte)oldRodThirtyMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFiveMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[2] = (byte)oldRodFiveMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[3] = (byte)oldRodFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMinLevels[4] = (byte)oldRodOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodSixtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[0] = (byte)oldRodSixtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodThirtyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[1] = (byte)oldRodThirtyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFiveMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[2] = (byte)oldRodFiveMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[3] = (byte)oldRodFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void oldRodOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.oldRodMaxLevels[4] = (byte)oldRodOneMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void goodRodFirstFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -965,117 +970,117 @@ namespace DSPRE {
|
|||
}
|
||||
|
||||
private void goodRodSecondFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentFile.goodRodMinLevels[1] = (byte)goodRodSecondFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFifteenMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[2] = (byte)goodRodFifteenMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[3] = (byte)goodRodFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMinLevels[4] = (byte)goodRodOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFirstFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[0] = (byte)goodRodFirstFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodSecondFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[1] = (byte)goodRodSecondFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFifteenMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[2] = (byte)goodRodFifteenMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[3] = (byte)goodRodFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void goodRodOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.goodRodMaxLevels[4] = (byte)goodRodOneMaxLevelUpDown.Value;
|
||||
}
|
||||
|
||||
private void superRodFirstFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[0] = (byte)superRodFirstFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodSecondFortyMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[1] = (byte)superRodSecondFortyMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFifteenMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[2] = (byte)superRodFifteenMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFourMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[3] = (byte)superRodFourMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodOneMinLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMinLevels[4] = (byte)superRodOneMinLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFirstFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[0] = (byte)superRodFirstFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodSecondFortyMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[1] = (byte)superRodSecondFortyMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFifteenMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[2] = (byte)superRodFifteenMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodFourMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[3] = (byte)superRodFourMaxLevelUpDown.Value;
|
||||
}
|
||||
private void superRodOneMaxLevelUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
if (disableHandlers) {
|
||||
if (Helpers.HandlersDisabled) {
|
||||
return;
|
||||
}
|
||||
currentFile.superRodMaxLevels[4] = (byte)superRodOneMaxLevelUpDown.Value;
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="jacobslusser.ScintillaNET" version="3.6.3" targetFramework="net48" />
|
||||
<package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.2" targetFramework="net48" />
|
||||
<package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net48" />
|
||||
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net48" />
|
||||
</packages>
|
||||
Loading…
Reference in New Issue
Block a user