Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.07 KB | None | 0 0
  1.     def trading_screen(**kwargs):
  2.         global city_index
  3.         global arms_license
  4.         global furs_license
  5.         global oil_license
  6.         global wine_license
  7.         global tradecheck
  8.         j = city_index
  9.  
  10.         ui.hbox(yanchor=-0.28)
  11.        
  12.         ui.vbox()  
  13.         ui.textbutton("Buy beer at  %.2f " % bprices[0][j] , clicked=delta_beer)
  14.         ui.textbutton("Buy cloth at  %.1f " % bprices[1][j] , clicked=delta_cloth)
  15.         ui.textbutton("Buy fish at  %.2f " % bprices[2][j] , clicked=delta_fish)
  16.         ui.textbutton("Buy grain at  %.2f " % bprices[3][j] , clicked=delta_grain)
  17.         ui.textbutton("Buy hemp at  %.2f " % bprices[4][j] , clicked=delta_hemp)
  18.         ui.textbutton("Buy wool at  %.2f " % bprices[5][j] , clicked=delta_wool)
  19.         ui.textbutton("Buy iron goods at  %.1f " % bprices[6][j] , clicked=delta_goods)
  20.         ui.textbutton("Buy ore at  %.2f " % bprices[7][j] , clicked=delta_ore)
  21.         ui.textbutton("Buy salt at  %.2f " % bprices[8][j] , clicked=delta_salt)
  22.         if arms_license:
  23.             ui.textbutton("Buy arms at  %.1f " % bprices[9][j] , clicked=delta_arms)
  24.         if furs_license:    
  25.             ui.textbutton("Buy furs at  %.1f " % bprices[10][j] , clicked=delta_furs)
  26.         if oil_license:    
  27.             ui.textbutton("Buy oil at  %.1f " % bprices[11][j], clicked=delta_oil)
  28.         if wine_license:
  29.             ui.textbutton("Buy wine at  %.1f " % bprices[12][j] , clicked=delta_wine)
  30.         ui.close()   #closes the buy vbox.
  31.                
  32.         ui.vbox() #inventory
  33.         ui.textbutton("%s" % qbeer)
  34.         ui.textbutton("%s" % qcloth)
  35.         ui.textbutton("%s" % qfish)
  36.         ui.textbutton("%s" % qgrain)
  37.         ui.textbutton("%s" % qhemp)
  38.         ui.textbutton("%s" % qwool)
  39.         ui.textbutton("%s" % qgoods)
  40.         ui.textbutton("%s" % qore)
  41.         ui.textbutton("%s" % qsalt)
  42.         if arms_license:
  43.             ui.textbutton("%s" % qarms)
  44.         if furs_license:
  45.             ui.textbutton("%s" % qfurs)
  46.         if oil_license:
  47.             ui.textbutton("%s" % qoil)
  48.         if wine_license:
  49.             ui.textbutton("%s" % qwine)        
  50.         ui.close() #closes the inventory list
  51.        
  52.         ui.vbox()   #Sell buttons
  53.         ui.textbutton("Sell beer at  %.2f " % sprices[0][j] , clicked=n_delta_beer)
  54.         ui.textbutton("Sell cloth at  %.1f " % sprices[1][j] , clicked=n_delta_cloth)
  55.         ui.textbutton("Sell fish at  %.2f " % sprices[2][j] , clicked=n_delta_fish)
  56.         ui.textbutton("Sell grain at  %.2f " % sprices[3][j] , clicked=n_delta_grain)
  57.         ui.textbutton("Sell hemp at  %.2f " % sprices[4][j] , clicked=n_delta_hemp)
  58.         ui.textbutton("Sell wool at  %.2f " % sprices[5][j] , clicked=n_delta_wool)
  59.         ui.textbutton("Sell iron goods at  %.1f " % sprices[6][j] , clicked=n_delta_goods)
  60.         ui.textbutton("Sell ore at  %.2f " % sprices[7][j] , clicked=n_delta_ore)
  61.         ui.textbutton("Sell salt at  %.2f " % sprices[8][j] , clicked=n_delta_salt)
  62.         if arms_license:
  63.             ui.textbutton("Sell arms at  %.1f " % sprices[9][j] , clicked=n_delta_arms)
  64.         if furs_license:    
  65.             ui.textbutton("Sell furs at  %.1f " % sprices[10][j] , clicked=n_delta_furs)
  66.         if oil_license:    
  67.             ui.textbutton("Sell oil at  %.1f " % sprices[11][j], clicked=n_delta_oil)
  68.         if wine_license:
  69.             ui.textbutton("Sell wine at  %.1f " % sprices[12][j] , clicked=n_delta_wine)
  70.         ui.close() #Closes selling column.
  71.              
  72.         ui.vbox() #denominations and inventory
  73.         ui.text("Quantity is %s" % delta)
  74.         ui.textbutton("Quantity = 1", clicked=select_delta1)
  75.         ui.textbutton("Quantity = 5", clicked=select_delta5)
  76.         ui.textbutton("Quantity = 10", clicked=select_delta10)
  77.         ui.textbutton("Quantity = 25", clicked=select_delta25)
  78.         ui.textbutton("Return", clicked=tradechk)
  79.         ui.close() #closes the denom list
  80.                        
  81.         ui.close() #closes the grid.
  82.     renpy.define_screen("trading", trading_screen, modal='True', tag='main')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement