Skip to content

Commit

Permalink
Merge pull request #765 from plural/update-hardcoded-stuff
Browse files Browse the repository at this point in the history
Updated hardcoded cycle and pack names.
  • Loading branch information
plural authored Aug 6, 2023
2 parents 32c012f + ab506e2 commit 45c32f2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AppBundle/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function displayAction(
$standard_legal = "available";

// Startup legality is currently hard-coded since the DB doesn't know anything about it.
$startupCycles = ['system-gateway' => true, 'system-update-2021' => true, 'borealis' => true]; // Hardcoded Startup Codes
$startupCycles = ['system-gateway' => true, 'system-update-2021' => true, 'borealis' => true, 'liberation' => true]; // Hardcoded Startup Codes
$startup_legal = false;

$rotated_count = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Service/CardsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ public function get_search_rows(array $conditions, string $sortorder, string $lo
$condition[0] = strtolower($condition[0]);
if ($condition[0] == "startup") {
// Add the valid cycles for startup and add them to the WHERE clause for the query.
$cycles = ['system-gateway', 'system-update-2021', 'borealis']; // Hardcoded Startup Codes
$cycles = ['system-gateway', 'system-update-2021', 'borealis', 'liberation']; // Hardcoded Startup Codes
$placeholders = array();
foreach($cycles as $cycle) {
array_push($placeholders, "?$i");
Expand Down
4 changes: 4 additions & 0 deletions web/js/deck.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ function create_collection_tab(initialPackSelection) {
startup_cycles['system-gateway'] = 1;
startup_cycles['system-update-2021'] = 1;
startup_cycles['borealis'] = 1;
startup_cycles['liberation'] = 1;
let startup_packs = Array(); // Hardcoded Startup Codes
startup_packs['sg'] = 1;
startup_packs['su21'] = 1;
startup_packs['msbp'] = 1;
startup_packs['ms'] = 1;
startup_packs['ph'] = 1;
startup_packs['tai'] = 1;
event.preventDefault();
$('#pack_code').find(':checkbox').each(function() {
$(this).prop('checked', Boolean(startup_cycles[$(this).prop('name')] || startup_packs[$(this).prop('name')]));
Expand All @@ -232,6 +234,7 @@ function create_collection_tab(initialPackSelection) {
startup_cycles['system-update-2021'] = 1;
startup_cycles['ashes'] = 1;
startup_cycles['borealis'] = 1;
startup_cycles['liberation'] = 1;
let startup_packs = Array(); // Hardcoded Startup Codes
startup_packs['sg'] = 1;
startup_packs['su21'] = 1;
Expand All @@ -241,6 +244,7 @@ function create_collection_tab(initialPackSelection) {
startup_packs['msbp'] = 1;
startup_packs['ms'] = 1;
startup_packs['ph'] = 1;
startup_packs['tai'] = 1;
event.preventDefault();
$('#pack_code').find(':checkbox').each(function() {
$(this).prop('checked', Boolean(startup_cycles[$(this).prop('name')] || startup_packs[$(this).prop('name')]));
Expand Down
2 changes: 1 addition & 1 deletion web/js/initbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $(function() {
let visible = true;
// Startup
if (format === 'startup') {
visible = ['sg', 'su21', 'msbp', 'ms', 'ph'].some(p => $(this).hasClass('pack-' + p)); // Hardcoded Startup Codes
visible = ['sg', 'su21', 'msbp', 'ms', 'ph', 'tai'].some(p => $(this).hasClass('pack-' + p)); // Hardcoded Startup Codes
}
// Standard
else if (format === 'standard') {
Expand Down
2 changes: 2 additions & 0 deletions web/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ $(document).on('data.app', function() {
startup_cycles['system-gateway'] = 1;
startup_cycles['system-update-2021'] = 1;
startup_cycles['borealis'] = 1;
startup_cycles['liberation'] = 1;
var nsg_cycles = Array(); // Hardcoded NSG Codes
nsg_cycles['system-gateway'] = 1;
nsg_cycles['system-update-2021'] = 1;
nsg_cycles['ashes'] = 1;
nsg_cycles['borealis'] = 1;
nsg_cycles['liberation'] = 1;
var rotated_packs = Array();
var startup_packs = Array();
var nsg_packs = Array();
Expand Down

0 comments on commit 45c32f2

Please sign in to comment.