Merge branch 'master' of git://github.com/kangaderoo/fpdb-kangaderoo
Conflicts: run_fpdb.py
This commit is contained in:
+13
-8
@@ -358,21 +358,24 @@ class Aux_Seats(Aux_Window):
|
||||
except AttributeError:
|
||||
return
|
||||
loc = self.config.get_aux_locations(self.params['name'], int(self.hud.max))
|
||||
width = self.hud.table.width
|
||||
height = self.hud.table.height
|
||||
|
||||
for i in (range(1, self.hud.max + 1) + ['common']):
|
||||
if i == 'common':
|
||||
(x, y) = self.params['layout'][self.hud.max].common
|
||||
else:
|
||||
(x, y) = loc[adj[i]]
|
||||
self.positions[i] = self.card_positions(x, self.hud.table.x, y, self.hud.table.y)
|
||||
self.positions[i] = self.card_positions((x * width) / 1000, self.hud.table.x, (y * height) /1000, self.hud.table.y)
|
||||
self.m_windows[i].move(self.positions[i][0], self.positions[i][1])
|
||||
|
||||
|
||||
def create(self):
|
||||
self.adj = self.hud.adj_seats(0, self.config) # move adj_seats to aux and get rid of it in Hud.py
|
||||
loc = self.config.get_aux_locations(self.params['name'], int(self.hud.max))
|
||||
|
||||
self.m_windows = {} # windows to put the card images in
|
||||
|
||||
width = self.hud.table.width
|
||||
height = self.hud.table.height
|
||||
for i in (range(1, self.hud.max + 1) + ['common']):
|
||||
if i == 'common':
|
||||
(x, y) = self.params['layout'][self.hud.max].common
|
||||
@@ -384,7 +387,7 @@ class Aux_Seats(Aux_Window):
|
||||
self.m_windows[i].set_transient_for(self.hud.main_window)
|
||||
self.m_windows[i].set_focus_on_map(False)
|
||||
self.m_windows[i].connect("configure_event", self.configure_event_cb, i)
|
||||
self.positions[i] = self.card_positions(x, self.hud.table.x, y, self.hud.table.y)
|
||||
self.positions[i] = self.card_positions((x * width) / 1000, self.hud.table.x, (y * height) /1000, self.hud.table.y)
|
||||
self.m_windows[i].move(self.positions[i][0], self.positions[i][1])
|
||||
if self.params.has_key('opacity'):
|
||||
self.m_windows[i].set_opacity(float(self.params['opacity']))
|
||||
@@ -426,11 +429,13 @@ class Aux_Seats(Aux_Window):
|
||||
"""Save new layout back to the aux element in the config file."""
|
||||
new_locs = {}
|
||||
# print "adj =", self.adj
|
||||
witdh = self.hud.table.width
|
||||
height = self.hud.table.height
|
||||
for (i, pos) in self.positions.iteritems():
|
||||
if i != 'common':
|
||||
new_locs[self.adj[int(i)]] = (pos[0] - self.hud.table.x, pos[1] - self.hud.table.y)
|
||||
else:
|
||||
new_locs[i] = (pos[0] - self.hud.table.x, pos[1] - self.hud.table.y)
|
||||
if i != 'common':
|
||||
new_locs[self.adj[int(i)]] = ((pos[0] - self.hud.table.x) * 1000 / witdh, (pos[1] - self.hud.table.y) * 1000 / height)
|
||||
else:
|
||||
new_locs[i] = ((pos[0] - self.hud.table.x) * 1000 / witdh, (pos[1] - self.hud.table.y) * 1000 / height)
|
||||
self.config.edit_aux_layout(self.params['name'], self.hud.max, locations = new_locs)
|
||||
|
||||
def configure_event_cb(self, widget, event, i, *args):
|
||||
|
||||
Reference in New Issue
Block a user