Skip to content

Commit

Permalink
Add option to download event outbreak data
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu098vm committed Aug 12, 2024
1 parent 655f0a5 commit c877ce0
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 17 deletions.
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=Port:
ConnectionForm.chkOutbreaksMain=Download Mass Outbreaks Paldea Data (?)
ConnectionForm.chkOutbreaksDLC=Download Mass Outbreaks Kitakami Data (?)
ConnectionForm.chkOutbreaksDLC2=Download Mass Outbreaks Blueberry Data (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=Connect
ConnectionForm.btnDisconnect=Disconnect

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=Device disconnected.
ToolTipSyncOutbreaksMain=Syncronize Paldea Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC1=Syncronize Kitakami Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC2=Syncronize Blueberry Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=All raids have been Shinified.

TeraShiny.Any=Any
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=Port:
ConnectionForm.chkOutbreaksMain=Download Mass Outbreaks Paldea Data (?)
ConnectionForm.chkOutbreaksDLC=Download Mass Outbreaks Kitakami Data (?)
ConnectionForm.chkOutbreaksDLC2=Download Mass Outbreaks Blueberry Data (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=Connect
ConnectionForm.btnDisconnect=Disconnect

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=Device disconnected.
ToolTipSyncOutbreaksMain=Syncronize Paldea Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC1=Syncronize Kitakami Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC2=Syncronize Blueberry Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=All raids have been Shinified.

TeraShiny.Any=Any
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=Puerto:
ConnectionForm.chkOutbreaksMain=Descargar Apariciones Masivas (Paldea) (?)
ConnectionForm.chkOutbreaksDLC=Descargar Apariciones Masivas (Noroteo) (?)
ConnectionForm.chkOutbreaksDLC2=Descargar Apariciones Masivas (Arándano) (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=Conectar
ConnectionForm.btnDisconnect=Desconectar

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=Dispositivo desconectado.
ToolTipSyncOutbreaksMain=Sincronizar datos de Aparición Masiva (Paldea) desde dispositivo remoto. Puede requerir una considerable cantidad de tiempo.
ToolTipSyncOutbreaksDLC1=Sincronizar datos de Aparición Masiva (Noroteo) desde dispositivo remoto. Puede requerir una considerable cantidad de tiempo.
ToolTipSyncOutbreaksDLC2=Sincronizar datos de Aparición Masiva (Arándano) desde dispositivo remoto. Puede requerir una considerable cantidad de tiempo.
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=Ahora todas las raids son Variocolor.

TeraShiny.Any=Cualquiera
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=Port:
ConnectionForm.chkOutbreaksMain=Download Mass Outbreaks Paldea Data (?)
ConnectionForm.chkOutbreaksDLC=Download Mass Outbreaks Kitakami Data (?)
ConnectionForm.chkOutbreaksDLC2=Download Mass Outbreaks Blueberry Data (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=Connect
ConnectionForm.btnDisconnect=Disconnect

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=Device disconnected.
ToolTipSyncOutbreaksMain=Syncronize Paldea Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC1=Syncronize Kitakami Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC2=Syncronize Blueberry Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=All raids have been Shinified.

TeraShiny.Any=Any
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=Porta:
ConnectionForm.chkOutbreaksMain=Scarica i dati delle Comparse Massicce di Paldea (?)
ConnectionForm.chkOutbreaksDLC=Scarica i dati delle Comparse Massicce di Nordivia (?)
ConnectionForm.chkOutbreaksDLC2=Scarica i dati delle Comparse Massice dell'Is. Mirtillo (?)
ConnectionForm.chkOutbreakEvent=Scarica i dati delle Comparse Massicce Evento (?)
ConnectionForm.btnConnect=Connetti
ConnectionForm.btnDisconnect=Disconnetti

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=Dispositivo disconnesso.
ToolTipSyncOutbreaksMain=Sincronizza i dati delle Comparse Massicce (Paldea) dal dispositivo remoto. Pu� richiedere un significativo quantitativo di tempo.
ToolTipSyncOutbreaksDLC1=Sincronizza i dati delle Comparse Massicce (Nordivia) dal dispositivo remoto. Pu� richiedere un significativo quantitativo di tempo.
ToolTipSyncOutbreaksDLC2=Sincronizza i dati delle Comparse Massicce (Is. Mirtillo) dal dispositivo remoto. Pu� richiedere un significativo quantitativo di tempo.
ToolTipSyncOutbreaksEvent=Sincronizza i dati delle Comparse Massicce (Eventi) dal dispositivo remoto. Pu� richiedere un significativo quantitativo di tempo.
ShinifiedAll=Tutti i Raid sono stati resi Shiny.

TeraShiny.Any=Qualsiasi
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_ja.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=Port:
ConnectionForm.chkOutbreaksMain=Download Mass Outbreaks Paldea Data (?)
ConnectionForm.chkOutbreaksDLC=Download Mass Outbreaks Kitakami Data (?)
ConnectionForm.chkOutbreaksDLC2=Download Mass Outbreaks Blueberry Data (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=Connect
ConnectionForm.btnDisconnect=Disconnect

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=Device disconnected.
ToolTipSyncOutbreaksMain=Syncronize Paldea Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC1=Syncronize Kitakami Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksDLC2=Syncronize Blueberry Outbreaks data from the remote device. Might require a sgnificant amount of time.
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=All raids have been Shinified.

TeraShiny.Any=Any
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=포트:
ConnectionForm.chkOutbreaksMain=대량발생 데이터 다운로드 (Paldea) (?)
ConnectionForm.chkOutbreaksDLC=대량발생 데이터 다운로드 (Kitakami) (?)
ConnectionForm.chkOutbreaksDLC2=대량발생 데이터 다운로드 (Blueberry) (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=연결
ConnectionForm.btnDisconnect=연결 끊기

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=연결이 끊겼습니다
ToolTipSyncOutbreaksMain=스위치에서 대량발생 데이터를 동기화합니다. 상당한 시간이 소요될 수 있습니다 (Paldea).
ToolTipSyncOutbreaksDLC1=스위치에서 대량발생 데이터를 동기화합니다. 상당한 시간이 소요될 수 있습니다 (Kitakami).
ToolTipSyncOutbreaksDLC2=스위치에서 대량발생 데이터를 동기화합니다. 상당한 시간이 소요될 수 있습니다 (Blueberry).
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=All raids have been Shinified.

TeraShiny.Any=모두
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_zh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=端口:
ConnectionForm.chkOutbreaksMain=从远程设备下载宝可梦大量出现数据 (帕底亚) (?)
ConnectionForm.chkOutbreaksDLC=从远程设备下载宝可梦大量出现数据 (北上乡) (?)
ConnectionForm.chkOutbreaksDLC2=从远程设备下载宝可梦大量出现数据 (蓝莓学院) (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=连接
ConnectionForm.btnDisconnect=断开

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=设备已断开
ToolTipSyncOutbreaksMain=同步远程设备的宝可梦大量出现数据。可能需要相当长的时间 (帕底亚)。
ToolTipSyncOutbreaksDLC1=同步远程设备的宝可梦大量出现数据。可能需要相当长的时间 (北上乡)。
ToolTipSyncOutbreaksDLC2=同步远程设备的宝可梦大量出现数据。可能需要相当长的时间 (蓝莓学院)。
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=所有太晶洞窟异色已经生成。

TeraShiny.Any=任意
Expand Down
2 changes: 2 additions & 0 deletions TeraFinder.Core/Resources/translations/lang_zh2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ ConnectionForm.lblPort=端口:
ConnectionForm.chkOutbreaksMain=從遠程終端下載寶可夢大量出現數據 (Paldea) (?)
ConnectionForm.chkOutbreaksDLC=從遠程終端下載寶可夢大量出現數據 (Kitakami) (?)
ConnectionForm.chkOutbreaksDLC2=從遠程終端下載寶可夢大量出現數據 (Blueberry) (?)
ConnectionForm.chkOutbreakEvent=Download Mass Outbreaks Event Data (?)
ConnectionForm.btnConnect=連接
ConnectionForm.btnDisconnect=斷開

Expand Down Expand Up @@ -272,6 +273,7 @@ DisconnectionSuccess=終端已斷開
ToolTipSyncOutbreaksMain=同步遠程終端的寶可夢大量出現數據。可能需要相當長的時間 (Paldea)。
ToolTipSyncOutbreaksDLC1=同步遠程終端的寶可夢大量出現數據。可能需要相當長的時間 (Kitakami)。
ToolTipSyncOutbreaksDLC2=同步遠程終端的寶可夢大量出現數據。可能需要相當長的時間 (Blueberry)。
ToolTipSyncOutbreaksEvent=Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time.
ShinifiedAll=所有太晶洞窟异色已经生成。

TeraShiny.Any=任意
Expand Down
31 changes: 27 additions & 4 deletions TeraFinder.Plugins/Forms/ConnectionForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 42 additions & 12 deletions TeraFinder.Plugins/Forms/ConnectionForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public ConnectionForm(SAV9SV sav, string language)
toolTipOutbreakMain.SetToolTip(chkOutbreaksMain, Strings["ToolTipSyncOutbreaksMain"]);
toolTipOutbreakDLC1.SetToolTip(chkOutbreaksDLC, Strings["ToolTipSyncOutbreaksDLC1"]);
toolTipOutbreakDLC2.SetToolTip(chkOutbreaksDLC2, Strings["ToolTipSyncOutbreaksDLC2"]);
toolTipOutbreakEvent.SetToolTip(chkOutbreakEvent, Strings["ToolTipSyncOutbreaksEvent"]);
}

private void GenerateDictionary()
Expand All @@ -50,6 +51,7 @@ private void GenerateDictionary()
{ "ToolTipSyncOutbreaksMain", "Syncronize Paldea Outbreaks data from the remote device. Might require a sgnificant amount of time." },
{ "ToolTipSyncOutbreaksDLC1", "Syncronize Kitakami Outbreaks data from the remote device. Might require a sgnificant amount of time." },
{ "ToolTipSyncOutbreaksDLC2", "Syncronize Blueberry Outbreaks data from the remote device. Might require a sgnificant amount of time." },
{ "ToolTipSyncOutbreaksEvent", "Syncronize Event Outbreaks data from the remote device. Might require a sgnificant amount of time." },
};
}

Expand All @@ -71,9 +73,10 @@ public void Disconnect()
private async void btnConnect_Click(object sender, EventArgs e)
{
const int ConnectionStepsRaids = 10;
const int ConnectionStepsOutbreaksMain = 128;
const int ConnectionStepsOutbreakDLC = 100;
const int ConnectionStepsOutbreakDLC2 = 107;
const int ConnectionStepsOutbreaksMain = 57;
const int ConnectionStepsOutbreakDLC = 29;
const int ConnectionStepsOutbreakDLC2 = 36;
const int ConnectionStepsOutbreakEvent = 71;

Connected = false;
DisableConnectButton();
Expand Down Expand Up @@ -115,12 +118,15 @@ private async void btnConnect_Click(object sender, EventArgs e)
};
Settings.Default.Save();

// try
// {
try
{
MaxProgress = ConnectionStepsRaids;
if (chkOutbreaksMain.Checked) MaxProgress += ConnectionStepsOutbreaksMain;
if (chkOutbreaksDLC.Checked) MaxProgress += ConnectionStepsOutbreakDLC;
if (chkOutbreaksDLC2.Checked) MaxProgress += ConnectionStepsOutbreakDLC2;
if (chkOutbreakEvent.Checked && chkOutbreaksMain.Checked) MaxProgress += ConnectionStepsOutbreakEvent;
if (chkOutbreakEvent.Checked && chkOutbreaksDLC.Checked) MaxProgress += ConnectionStepsOutbreakEvent;
if (chkOutbreakEvent.Checked && chkOutbreaksDLC2.Checked) MaxProgress += ConnectionStepsOutbreakEvent;
CurrentProgress = 0;

await Executor.Connect(token).ConfigureAwait(false);
Expand All @@ -143,9 +149,27 @@ private async void btnConnect_Click(object sender, EventArgs e)
var raidSevenStar = SAV.Accessor.FindOrDefault(BlockDefinitions.KSevenStarRaidsCapture.Key);
raidSevenStar.ChangeData((byte[]?)await Executor.ReadBlock(BlockDefinitions.KSevenStarRaidsCapture, token).ConfigureAwait(false));
UpdateProgress(CurrentProgress++, MaxProgress);
if (chkOutbreaksMain.Checked){ await DownloadOutbreaksMainData(token).ConfigureAwait(false); await DownloadOutbreaksBCMainData(token).ConfigureAwait(false); }
if (chkOutbreaksDLC.Checked) { await DownloadOutbreaksDLCData(token).ConfigureAwait(false); await DownloadEventOutbreaksDLCData(token).ConfigureAwait(false); }
if (chkOutbreaksDLC2.Checked){ await DownloadOutbreaksDLC2Data(token).ConfigureAwait(false); await DownloadEventOutbreaksDLC2Data(token).ConfigureAwait(false); }

if (chkOutbreaksMain.Checked)
{
await DownloadOutbreaksMainData(token).ConfigureAwait(false);
if (chkOutbreakEvent.Checked)
await DownloadEventOutbreaksMainData(token).ConfigureAwait(false);
}

if (chkOutbreaksDLC.Checked)
{
await DownloadOutbreaksDLCData(token).ConfigureAwait(false);
if (chkOutbreakEvent.Checked)
await DownloadEventOutbreaksDLCData(token).ConfigureAwait(false);
}

if (chkOutbreaksDLC2.Checked)
{
await DownloadOutbreaksDLC2Data(token).ConfigureAwait(false);
if (chkOutbreakEvent.Checked)
await DownloadEventOutbreaksDLC2Data(token).ConfigureAwait(false);
}

UpdateProgress(MaxProgress, MaxProgress);
MessageBox.Show(Strings["ConnectionSuccess"]);
Expand All @@ -155,13 +179,13 @@ private async void btnConnect_Click(object sender, EventArgs e)
EnableCheckBox();
EnableGrpDevice();
SafeClose();
//}
/* catch (Exception ex)
}
catch (Exception ex)
{
Disconnect();
MessageBox.Show($"{Strings["ConnectionFailed"]}\n{Strings["ConnectionFailedAux"]}\n{ex.Message}");
return;
}*/
}
}

private async Task DownloadEventData(CancellationToken token)
Expand Down Expand Up @@ -327,7 +351,7 @@ private async Task DownloadOutbreaksMainData(CancellationToken token)
UpdateProgress(CurrentProgress++, MaxProgress);
}
}
private async Task DownloadOutbreaksBCMainData(CancellationToken token)
private async Task DownloadEventOutbreaksMainData(CancellationToken token)
{
var KMassOutbreakAmount = SAV.Accessor.FindOrDefault(BlockDefinitions.KOutbreakBCMainNumActive.Key);
var KMassOutbreakAmountData = (byte?)await Executor.ReadBlock(BlockDefinitions.KOutbreakBCMainNumActive, token).ConfigureAwait(false);
Expand Down Expand Up @@ -923,6 +947,9 @@ private void DisableCheckBox()
if (chkOutbreaksDLC2.InvokeRequired)
chkOutbreaksDLC2.Invoke(() => { chkOutbreaksDLC2.Enabled = false; });
else chkOutbreaksDLC2.Enabled = false;
if (chkOutbreakEvent.InvokeRequired)
chkOutbreakEvent.Invoke(() => { chkOutbreakEvent.Enabled = false; });
else chkOutbreakEvent.Enabled = false;
}

private void EnableCheckBox()
Expand All @@ -936,6 +963,9 @@ private void EnableCheckBox()
if (chkOutbreaksDLC2.InvokeRequired)
chkOutbreaksDLC2.Invoke(() => { chkOutbreaksDLC2.Enabled = true; });
else chkOutbreaksDLC2.Enabled = true;
if (chkOutbreakEvent.InvokeRequired)
chkOutbreakEvent.Invoke(() => { chkOutbreakEvent.Enabled = true; });
else chkOutbreakEvent.Enabled = true;
}

private void EnableDisconnectButton()
Expand Down
5 changes: 4 additions & 1 deletion TeraFinder.Plugins/Forms/ConnectionForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
<value>210, 18</value>
</metadata>
<metadata name="toolTipOutbreakDLC2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>398, 17</value>
<value>410, 21</value>
</metadata>
<metadata name="toolTipOutbreakEvent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>605, 25</value>
</metadata>
</root>

0 comments on commit c877ce0

Please sign in to comment.