diff --git a/static/js/shop/count_resources.js b/static/js/shop/count_resources.js index c56eaeff..c343f8ca 100644 --- a/static/js/shop/count_resources.js +++ b/static/js/shop/count_resources.js @@ -64,9 +64,9 @@ export function CountResources(data, index) { return result; } -export function FillResources(data) { +export function FillResources(data, disabled) { return data.map((element, index) => { - element.counted_resources = CountResources(data, index); + element.counted_resources = disabled ? [] : CountResources(data, index); return element; }) } diff --git a/static/js/shop/shop_store.js b/static/js/shop/shop_store.js index 2b9d48db..08370aa7 100644 --- a/static/js/shop/shop_store.js +++ b/static/js/shop/shop_store.js @@ -343,8 +343,9 @@ const useCart = ((set, get) => ({ if (crate_id === crate.id) { //console.log("--- CHECK ALERTS ---") let itemsCopy = Array.from(crate.items); - itemsCopy = FillResources(itemsCopy); - itemsCopy = TriggerWarnings(itemsCopy); + const disabled = !!get().crateParams(crate.crate_mode).warnings_disabled; + itemsCopy = FillResources(itemsCopy, disabled); + itemsCopy = TriggerWarnings(itemsCopy, disabled); const [crate_warnings, occupied] = TriggerCrateWarnings(crate); return { ...crate, diff --git a/static/js/shop/warnings.js b/static/js/shop/warnings.js index 4c71424c..4ec7e74a 100644 --- a/static/js/shop/warnings.js +++ b/static/js/shop/warnings.js @@ -97,10 +97,10 @@ const Types = { } } -export function TriggerWarnings(data) { +export function TriggerWarnings(data, disabled) { return data.map((element, index) => { if (!element.warnings) return element; - element.show_warnings = element.warnings + element.show_warnings = disabled ? [] :element.warnings .map((warning, _) => { if (!!Types[warning]) return Types[warning].trigger(data, index, element.counted_resources) ? {trigger: undefined, name: warning, ...Types[warning]} : null; diff --git a/static/js/shop_data.js b/static/js/shop_data.js index e1a96aec..3375987d 100644 --- a/static/js/shop_data.js +++ b/static/js/shop_data.js @@ -28,9 +28,10 @@ const shop_data = { }, no_crate: { id: 'no_crate', - name: 'Standalone cards', + name: 'Spare cards', price: 0, - hp: -1 + hp: -1, + warnings_disabled: true } }, crateModeOrder: [ diff --git a/webpack.config.js b/webpack.config.js index 662f46ef..550b70aa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -21,11 +21,11 @@ module.exports = { debug: false, directives: { render_count: false, - options_log: true + options_log: false }, params: { ENV: process.env.NODE_ENV, - disable_card_highlight: true + disable_card_highlight: false }, verbose: false, } @@ -37,8 +37,8 @@ module.exports = { resolve: { extensions: ['.tsx', '.ts', '.js', '.jsx'], }, - //devtool: "inline-source-map", - //mode: "development" - devtool: false, - mode: "production" + devtool: "inline-source-map", + mode: "development" + //devtool: false, + //mode: "production" };