Skip to content

Commit cf534fb

Browse files
committed
BXT: Trade Corner Webpage Updates
- Changes card warnings to use ! instead of a warning sign emoji - PKRS (Cured) now properly displays on cards according to the in-game Crystal parameters.
1 parent 39375c6 commit cf534fb

12 files changed

Lines changed: 41 additions & 9 deletions

File tree

web/classes/PokemonUtil.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,17 @@ public function unpackPokemon($region, $data) {
146146
"name" => $this->getItemName($pkm["item"])
147147
];
148148

149-
if ($pkm["pokerus"] == 0) {
150-
$pkm["pokerus"] = null;
151-
} else {
149+
$pokerus_byte = $pkm["pokerus"];
150+
$pokerus_strain = ($pokerus_byte >> 4) & 0xF;
151+
$pokerus_days = $pokerus_byte & 0xF;
152+
153+
if ($pokerus_days != 0 || $pokerus_strain != 0) {
152154
$pkm["pokerus"] = [
153-
"strain" => $pkm["pokerus"] >> 4,
154-
"days" => $pkm["pokerus"] & 0xF,
155-
"cured" => $pkm["pokerus"] & 0xF == 0,
155+
"days" => $pokerus_days,
156+
"cured" => $pokerus_days == 0,
156157
];
158+
} else {
159+
$pkm["pokerus"] = null;
157160
}
158161

159162
foreach(range(1,4) as $i) {
@@ -378,4 +381,4 @@ public function fakePokemon($species) {
378381
self::MNY, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', // F0-FF
379382
];
380383
}
381-
?>
384+
?>

web/htdocs/css/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,10 @@ header.navbar #localeDropdownMenu .dropdown-item {
945945

946946
.crystal-trade .offer-pokerus-line .offer-pokerus-cured {
947947
color: #000;
948+
display: block;
949+
width: 100%;
950+
line-height: 13px;
951+
text-align: center;
948952
}
949953

950954
.crystal-trade .offer-pokerus-line .offer-pokerus-infected {

web/locales/de.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pokemon:
1212
item: ITEM
1313
trainer: OT
1414
wanted: GESUCHT
15+
pokerus:
16+
cured: "POK\u00C9RUS (GEHEILT)"
17+
infected: "POK\u00C9RUS (INFIZIERT)"
1518
trade-warning-all-disabled: "⚠️ Dieser Nutzer hat internationale Tausche deaktiviert."
1619
trade-warning-only-own-game: "⚠️ Dieser Nutzer hat nur Tausche mit %game_id% aktiviert."
1720
trade-warning-no-japanese: "⚠️ Dieser Nutzer hat Tausche mit nicht-europäischen Sprachen deaktiviert."

web/locales/es.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ pokemon:
1313
item: OBJETOS
1414
trainer: EO
1515
wanted: SE BUSCA
16+
pokerus:
17+
cured: "POK\u00C9RUS (CURADO)"
18+
infected: "POK\u00C9RUS (INFECTADO)"
1619
trade-warning-all-disabled: "⚠️ Este usuario ha desactivado los intercambios internacionales."
1720
trade-warning-only-own-game: "⚠️ Este usuario solo ha habilitado intercambios con %game_id%."
1821
trade-warning-no-japanese: "⚠️ Este usuario ha desactivado los intercambios con idiomas no europeos."

web/locales/it.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pokemon:
1212
item: STRUM.
1313
trainer: AO
1414
wanted: CHIESTO
15+
pokerus:
16+
cured: "POK\u00C9RUS (GUARITO)"
17+
infected: "POK\u00C9RUS (INFETTO)"
1518
trade-warning-all-disabled: "⚠️ Questo utente ha disattivato gli scambi internazionali."
1619
trade-warning-only-own-game: "⚠️ Questo utente ha abilitato gli scambi solo con %game_id%."
1720
trade-warning-no-japanese: "⚠️ Questo utente ha disattivato gli scambi con lingue non europee."

web/locales/ja.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ locale:
99
pokemon:
1010
shiny: 光る
1111
level: :L
12+
pokerus:
13+
cured: "\u30DD\u30B1\u30EB\u30B9 (\u6CBB\u7652)"
14+
infected: "\u30DD\u30B1\u30EB\u30B9 (\u611F\u67D3)"
1215
trade-warning-all-disabled: "⚠️ このユーザーは国際交換を無効にしています"
1316
trade-warning-only-own-game: "⚠️ このユーザーは%game_id%との交換のみを有効にしています"
1417
trade-warning-no-japanese: "⚠️ このユーザーは非ヨーロッパ言語との交換を無効にしています"

web/locales/locales/de.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pokemon:
1212
item: ITEM
1313
trainer: OT
1414
wanted: GESUCHT
15+
pokerus:
16+
cured: "POK\u00C9RUS (GEHEILT)"
17+
infected: "POK\u00C9RUS (INFIZIERT)"
1518
trade-warning-all-disabled: "⚠️ Dieser Nutzer hat internationale Tausche deaktiviert."
1619
trade-warning-only-own-game: "⚠️ Dieser Nutzer hat nur Tausche mit %game_id% aktiviert."
1720
trade-warning-no-japanese: "⚠️ Dieser Nutzer hat Tausche mit nicht-europäischen Sprachen deaktiviert."

web/locales/locales/es.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ pokemon:
1313
item: OBJETOS
1414
trainer: EO
1515
wanted: SE BUSCA
16+
pokerus:
17+
cured: "POK\u00C9RUS (CURADO)"
18+
infected: "POK\u00C9RUS (INFECTADO)"
1619
trade-warning-all-disabled: "⚠️ Este usuario ha desactivado los intercambios internacionales."
1720
trade-warning-only-own-game: "⚠️ Este usuario solo ha habilitado intercambios con %game_id%."
1821
trade-warning-no-japanese: "⚠️ Este usuario ha desactivado los intercambios con idiomas no europeos."

web/locales/locales/it.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pokemon:
1212
item: STRUM.
1313
trainer: AO
1414
wanted: CHIESTO
15+
pokerus:
16+
cured: "POK\u00C9RUS (GUARITO)"
17+
infected: "POK\u00C9RUS (INFETTO)"
1518
trade-warning-all-disabled: "⚠️ Questo utente ha disattivato gli scambi internazionali."
1619
trade-warning-only-own-game: "⚠️ Questo utente ha abilitato gli scambi solo con %game_id%."
1720
trade-warning-no-japanese: "⚠️ Questo utente ha disattivato gli scambi con lingue non europee."

web/locales/locales/ja.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ locale:
99
pokemon:
1010
shiny: 光る
1111
level: :L
12+
pokerus:
13+
cured: "\u30DD\u30B1\u30EB\u30B9 (\u6CBB\u7652)"
14+
infected: "\u30DD\u30B1\u30EB\u30B9 (\u611F\u67D3)"
1215
trade-warning-all-disabled: "⚠️ このユーザーは国際交換を無効にしています"
1316
trade-warning-only-own-game: "⚠️ このユーザーは%game_id%との交換のみを有効にしています"
1417
trade-warning-no-japanese: "⚠️ このユーザーは非ヨーロッパ言語との交換を無効にしています"

0 commit comments

Comments
 (0)