Skip to content

Commit c86ae6d

Browse files
committed
Merge pull request #20 from elbryan/improvements
Slight improvements
2 parents 406aae0 + 71d76a6 commit c86ae6d

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

core/bid.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def bid(q, api, playerList, settings):
112112
for item in api.searchAuctions('player', defId=defId, max_price=bidDetails[defId]['maxBid']-subtract, start=0, page_size=50):
113113
# player safety checks for every possible bid
114114
# Let's look at last 5 minutes for now and bid on 5 players max
115-
if item['expires'] > 600 or bidon >= 5 or listed >= settings['maxPlayer'] or api.credits < settings['minCredits']:
115+
if item['expires'] > 300 or bidon >= 5 or listed >= settings['maxPlayer'] or api.credits < settings['minCredits']:
116116
break
117117

118118
# No Dups
@@ -165,6 +165,9 @@ def bid(q, api, playerList, settings):
165165
displayName = asset['Item']['CommonName'] if asset['Item']['CommonName'] else asset['Item']['LastName']
166166
card = PlayerCard(item, displayName)
167167

168+
# Update the card, regardless what will happen
169+
q.put((card, EventType.UPDATE, api.credits))
170+
168171
# Handle Expired Items
169172
if item['expires'] == -1:
170173
if (item['bidState'] == 'highest' or (item['tradeState'] == 'closed' and item['bidState'] == 'buyNow')):
@@ -221,9 +224,6 @@ def bid(q, api, playerList, settings):
221224
else:
222225
q.put('%s Bid Error: You are not allowed to bid on this trade\n' % (time.strftime('%Y-%m-%d %H:%M:%S')))
223226

224-
else:
225-
q.put((card, EventType.UPDATE, api.credits))
226-
227227
# buy now goes directly to unassigned now
228228
if binWon:
229229
for item in api.unassigned():

frames/bid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def checkQueue(self):
330330
elif msg[1] == EventType.SOLD:
331331
self.auctionStatus.update_status(msg[0], time.strftime('%Y-%m-%d %H:%M:%S'), msg[0].currentBid, tag='sold')
332332
elif msg[1] == EventType.UPDATE:
333-
self.auctionStatus.update_status(msg[0], time.strftime('%Y-%m-%d %H:%M:%S'), msg[0].currentBid)
333+
self.auctionStatus.update_status(msg[0], time.strftime('%Y-%m-%d %H:%M:%S'), msg[0].currentBid, highlight=False)
334334
self.controller.status.set_credits(msg[2])
335335
else:
336336
# Auction Results

frames/misc/auctions.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, frame):
5656
def get_view(self):
5757
return self.view
5858

59-
def update_status(self, card, timestamp, currbid, tag=''):
59+
def update_status(self, card, timestamp, currbid, tag='', highlight=True):
6060
if not card.cardid in self.cards:
6161
self.tree.insert("", 'end', card.cardid, text=card.cardname, values=(timestamp, card.startingBid,
6262
currbid, card.buyNowPrice,
@@ -69,10 +69,16 @@ def update_status(self, card, timestamp, currbid, tag=''):
6969
if tag:
7070
options['tags'] = (tag,)
7171
self.tree.item(card.cardid, text=options['text'], values=options['values'], tags=options['tags'])
72-
self.tree.see(card.cardid)
73-
self.tree.selection_set([card.cardid])
72+
73+
# Highlight the row and make sure it is visible
74+
if highlight:
75+
self.tree.see(card.cardid)
76+
self.tree.selection_set([card.cardid])
77+
78+
# Update the cards dictionary with the new entry
7479
self.cards[card.cardid] = card
7580

81+
7682
def decreaseExpires(self):
7783
for cardid in self.cards:
7884
card = self.cards[cardid]

0 commit comments

Comments
 (0)