mirror of
https://github.com/lucaspalomodevelop/Party.git
synced 2026-03-13 00:07:21 +00:00
x and y are flipped when drinking mate
This commit is contained in:
parent
c14aa08283
commit
547561a3ed
@ -28,7 +28,7 @@ class MateKiste():
|
||||
self.FlaschenBreite = flaschenAnzahl[0]
|
||||
self.FlaschenHoehe = flaschenAnzahl[1]
|
||||
|
||||
flaschenAnzahl = self.FlaschenBreite * self.FlaschenHoehe
|
||||
flaschenAnzahl = (self.FlaschenBreite * self.FlaschenHoehe)
|
||||
|
||||
self.collection.insert_one({'mateKiste': True, 'status': generate_kiste(flaschenAnzahl)})
|
||||
self.initialized = True
|
||||
@ -39,5 +39,5 @@ class MateKiste():
|
||||
|
||||
@classmethod
|
||||
def removeAt(self, x: int, y: int):
|
||||
position = y * self.FlaschenBreite + x
|
||||
self.collection.update_one({'mateKiste': True}, {'$set': {'status.' + str(position): False}})
|
||||
position = x * self.FlaschenBreite + y # for whatever reason y and x are swapped here lamoooo dont touch this
|
||||
self.collection.update_one({'mateKiste': True}, {'$set': {f'status.{str(position)}': False}})
|
||||
|
||||
@ -29,9 +29,7 @@ function getMateStatus(socket) {
|
||||
|
||||
const flascheTrinkenButton = document.createElement('button');
|
||||
flascheTrinkenButton.classList.add('flasche-trinken-button');
|
||||
flascheTrinkenButton.disabled = !flascheIstVoll;
|
||||
if (!flascheIstVoll) flascheTrinkenButton.style.backgroundColor = 'red';
|
||||
flascheTrinkenButton.style.backgroundColor = flascheIstVoll ? '#c88a35' : '#333';
|
||||
flascheTrinkenButton.style.backgroundColor = '#c88a35';
|
||||
flascheTrinkenButton.id = `flasche-trinken-button-${x}-${y}`; //TODO: remove and replace with class
|
||||
flascheTrinkenButton.onclick = () => { flascheTrinken(x, y) };
|
||||
cell.appendChild(flascheTrinkenButton);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user