Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/menu.js
Show First 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | for (let resCode of resCodes) | ||||
++r; | ++r; | ||||
if (hidden) | if (hidden) | ||||
continue; | continue; | ||||
button.enabled = controlsPlayer(g_ViewedPlayer); | button.enabled = controlsPlayer(g_ViewedPlayer); | ||||
button.tooltip = formatTributeTooltip(i, resCode, 100); | button.tooltip = formatTributeTooltip(i, resCode, 100); | ||||
button.onPress = (function(i, resCode, button) { | button.onPress = (function(i, resCode, button) { | ||||
// Shift+click to send 500, shift+click+click to send 1000, etc. | // Shift+click to send 500, shift+click+click to send 1000, etc. | ||||
// See INPUT_MASSTRIBUTING in input.js | // See "MASSTRIBUTING" in input.js | ||||
let multiplier = 1; | let multiplier = 1; | ||||
return function() { | return function() { | ||||
let isBatchTrainPressed = Engine.HotkeyIsPressed("session.masstribute"); | let isBatchTrainPressed = Engine.HotkeyIsPressed("session.masstribute"); | ||||
if (isBatchTrainPressed) | if (isBatchTrainPressed) | ||||
{ | { | ||||
inputState = INPUT_MASSTRIBUTING; | g_InputEvents.SwitchToNextState("MASSTRIBUTING"); | ||||
multiplier += multiplier == 1 ? 4 : 5; | multiplier += multiplier == 1 ? 4 : 5; | ||||
} | } | ||||
let amounts = {}; | let amounts = {}; | ||||
for (let res of resCodes) | for (let res of resCodes) | ||||
amounts[res] = 0; | amounts[res] = 0; | ||||
amounts[resCode] = 100 * multiplier; | amounts[resCode] = 100 * multiplier; | ||||
▲ Show 20 Lines • Show All 750 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator