market implement
This commit is contained in:
@@ -114,7 +114,7 @@ window.sendCommand = async function() {
|
||||
}
|
||||
|
||||
payload = { building_id };
|
||||
} else {
|
||||
} else if (type === 'recruit') {
|
||||
const unit_id = document.getElementById('unit-select').value;
|
||||
const amount = parseInt(document.getElementById('recruit-amount').value) || 1;
|
||||
const uData = town.unit_data?.[unit_id];
|
||||
@@ -142,6 +142,15 @@ window.sendCommand = async function() {
|
||||
}
|
||||
|
||||
payload = { unit_id, amount };
|
||||
} else if (type === 'market_offer') {
|
||||
const offer = parseInt(document.getElementById('market-offer-amount').value) || 1000;
|
||||
const offer_type = document.getElementById('market-offer-type').value;
|
||||
const demand = parseInt(document.getElementById('market-demand-amount').value) || 1000;
|
||||
const demand_type = document.getElementById('market-demand-type').value;
|
||||
const max_delivery_time = parseInt(document.getElementById('market-max-time').value) || 1800;
|
||||
const visibility = document.getElementById('market-visibility').value;
|
||||
|
||||
payload = { offer, offer_type, demand, demand_type, max_delivery_time, visibility };
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user