feat: all four pattern colours, the in-game item giver again, and 18 and over

- a special animal's pattern has four colours, as its presets do: the
  pattern tab's 1 to 4 each have a colour table
- the Item Giver opens in the game again; the Item Maker's previews keep
  their own colours instead of the giver's colour box
- the drawn trading sign is gone
- sign-up, the terms and the privacy policy say 18 and over (terms
  version 2026-10-24)
- builds 92
This commit is contained in:
Burrowdev committed 2026-10-24 05:55:42 +03:00
1 parent 29c0eff454
commit 8e117ff26f
12 files changed
+152 -131

No files matched your search

+9 -14
View File
@@ -46,7 +46,7 @@ const TRADES_KEPT = 50; // per account, for its page
const MAX_WAITING_OFFERS = 50; // offers left on one account
const MAX_OFFERS_MADE = 20; // by one account, still waiting
module.exports = ({findOnline, blocks, showTrading}) => {
module.exports = ({findOnline, blocks}) => {
// TradeManager.onTradeListReceived: [username, clothingCount, (defId,
// invIdx, color)..., denItemCount, (defId, invIdx, version, approved,
// imageId, creatorDbId, creatorUuid)..., petCount, (speciesId, invIdx,
@@ -134,6 +134,10 @@ module.exports = ({findOnline, blocks, showTrading}) => {
return coming === 0 || collectionOf(account, type).length + coming - gives.filter(item => item.type === type).length <= max;
});
const endTrade = trade => {
trade.requester.trade = trade.owner.trade = null;
};
// ends the trade `session` is part of, telling the other side with `status`.
const abandon = (session, status) => {
const {trade} = session;
@@ -141,10 +145,8 @@ module.exports = ({findOnline, blocks, showTrading}) => {
return;
}
const other = trade.requester === session ? trade.owner : trade.requester;
trade.requester.trade = trade.owner.trade = null;
endTrade(trade);
other.sendXt("ti", -1, status, session.account.username, USERNAME_SHOWN);
showTrading(session);
showTrading(other);
};
// moves one entry between accounts. it gets a fresh inventory id, and
@@ -216,8 +218,6 @@ module.exports = ({findOnline, blocks, showTrading}) => {
return;
}
session.trade = owner.trade = {requester: session, owner, wantedType, wanted, offered, accepted: false, confirmed: new Set()};
showTrading(session);
showTrading(owner);
// TradeManager.displayTradeRequested: [0, requesterName, moderatedFlag,
// wantedCode, wantedInvIdx, clothingCount, denCount, petCount, ...items]
const ofType = type => offered.filter(item => item.type === type);
@@ -259,9 +259,7 @@ module.exports = ({findOnline, blocks, showTrading}) => {
return;
}
const {requester, owner, wantedType, wanted, offered} = trade;
requester.trade = owner.trade = null;
showTrading(requester);
showTrading(owner);
endTrade(trade);
// either side may have recycled or re-traded something while deciding.
const stillThere = collectionOf(owner.account, wantedType).includes(wanted)
&& offered.every(item => collectionOf(requester.account, item.type).includes(item.entry))
@@ -324,11 +322,8 @@ module.exports = ({findOnline, blocks, showTrading}) => {
},
// ["1"/"0"]: busy flag while the trade window is open; nothing to
// answer. it shows as the trading sign (lib/world.js showTrading).
tb(session, roomId, [busy]) {
session.tradeBusy = busy === "1";
showTrading(session);
},
// answer.
tb() {},
ti(session, roomId, params) {
switch (params[0]) {