Advertisement
mrFitzpatrick

minecraftItemMaker

Aug 1st, 2019
1,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. from guizero import App, Text, PushButton, Combo, TextBox, ButtonGroup
  2.  
  3. app = App(title="Crafter v1.0", width=400)
  4.  
  5. def make_item():
  6.     adjective = bgp_adjectives.value
  7.     material = bgp_material.value
  8.     item = bgp_item.value
  9.     item_name = adjective + " " + material + " " + item
  10.     lbl_output.value = "You were gifted a " + item_name + "!"
  11.     if material == "Wooden":
  12.         app.bg = "Brown"
  13.     elif material == "Stone":
  14.         app.bg = "Grey"
  15.     elif material == "Iron":
  16.         app.bg = "Silver"
  17.     elif material == "Gold":
  18.         app.bg = "Gold"
  19.     else:
  20.         app.bg = "Lightblue"
  21.    
  22. lbl_adjective = Text(app, text="Choose an adjective")
  23. bgp_adjectives = Combo(app, options=["Normal","Enchanted","Poisoned","Damaged"])
  24.  
  25. lbl_material = Text(app, text="Now choose a material")
  26. bgp_material = ButtonGroup(app, options=["Wooden","Stone","Iron","Gold","Diamond"])
  27.  
  28. lbl_item = Text(app, text="Finally, choose an item")
  29. bgp_item = ButtonGroup(app, options=["Sword","Axe","Bow","Pickaxe","Shovel"])
  30.  
  31. btn_generate_name = PushButton(app, text="Reveal my new item", command=make_item)
  32. lbl_output = Text(app, text="Your new item will appear here!")
  33.                  
  34. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement