Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
EndangeredNayla committed Aug 26, 2024
1 parent bf7439b commit 3d5bb3b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion codes/marioParty1.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def getBlockWeights(one, two, three, four, five, six):
81040918 2A02
8104091A 00{five}
8104091C 1040
8104091E 000D
8104091E 0012
81040920 2402
81040922 00{six}
'''
Expand Down
5 changes: 0 additions & 5 deletions codes/marioParty7.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,5 @@ def initialCoinsMod7(hex, hexDec):
return f'''
MP7 - Gain {hexDec} Coins at the Start of the Game
02196D12 0000{hex}
<<<<<<< HEAD
02151DEA 0000{hex}
'''
=======
02151DEB 0000{hex}
'''
>>>>>>> b5de1aa02ec72ef5e18bebec4176e73cbb01f859
13 changes: 6 additions & 7 deletions events/marioParty1_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import pyperclip


def itemsEvent_mp1(plus, minus, speed, slow, warp):
if not all([plus.get(), minus.get(), speed.get(), slow.get(), warp.get()]):
def itemsEvent_mp1(plus, minus, speed, slow, warp, stock):
if not all([plus.get(), minus.get(), speed.get(), slow.get(), warp.get(), stock.get()]):
createDialog("Error", "error", "Please fill out all the boxes.", None)
return

Expand All @@ -22,14 +22,12 @@ def itemsEvent_mp1(plus, minus, speed, slow, warp):
speedWeight = float(speed.get())
slowWeight = float(slow.get())
warpWeight = float(warp.get())
stockWeight = float(stock.get())
except ValueError:
createDialog("Error", "error", "Please enter valid integers.", None)
return

# Calculate total weight
total_weight = plusWeight + minusWeight + speedWeight + slowWeight + warpWeight

all_dice_weight = 255 - total_weight
total_weight = plusWeight + minusWeight + speedWeight + slowWeight + warpWeight + stockWeight

# Normalize weights to ensure they sum to 100%
if total_weight > 0:
Expand All @@ -38,6 +36,7 @@ def itemsEvent_mp1(plus, minus, speed, slow, warp):
speedWeight = (speedWeight / total_weight) * 100
slowWeight = (slowWeight / total_weight) * 100
warpWeight = (warpWeight / total_weight) * 100
stockWeight = (stockWeight / total_weight) * 100

# Define cumulative weights
cumulative_weights = [
Expand All @@ -46,7 +45,7 @@ def itemsEvent_mp1(plus, minus, speed, slow, warp):
plusWeight + minusWeight + speedWeight,
plusWeight + minusWeight + speedWeight + slowWeight,
plusWeight + minusWeight + speedWeight + slowWeight + warpWeight,
all_dice_weight
plusWeight + minusWeight + speedWeight + slowWeight + warpWeight + stockWeight,
]

# Scale cumulative weights and ensure they do not exceed 255
Expand Down
12 changes: 9 additions & 3 deletions frames/marioParty1_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,16 @@ def create_entry(tab, row, icon_path, label_text, color, placeholder):
warp1 = ctk.CTkEntry(master=tabview.tab("Block Weights"), width=48, font=("Arial", 16, "bold"))
warp1.grid(row=5, column=3)

warningLabel = ctk.CTkLabel(master=tabview.tab("Block Weights"), text="These are weights. Closer to 100 means more likely\nto show instead of a dice.", font=("Arial", 16, "bold"))
warningLabel.place(x=5, y=280)
icon = create_image_icon(tabview.tab("Block Weights"), "assets/icons/diceBlock.png", 6, 1)
label = ctk.CTkLabel(master=tabview.tab("Block Weights"), text=" Weight: ", font=("Arial", 16))
label.grid(row=6, column=2)
stock1 = ctk.CTkEntry(master=tabview.tab("Block Weights"), width=48, font=("Arial", 16, "bold"))
stock1.grid(row=6, column=3)

warningLabel = ctk.CTkLabel(master=tabview.tab("Block Weights"), text="These are weights. These are the\nodds of dice showing.", font=("Arial", 16, "bold"))
warningLabel.place(x=5, y=330)

parseButtonTwo = ctk.CTkButton(master=tabview.tab("Block Weights"), command=lambda: itemsEvent_mp1(plus, minus, speed, slow, warp1), text="Generate Codes")
parseButtonTwo = ctk.CTkButton(master=tabview.tab("Block Weights"), command=lambda: itemsEvent_mp1(plus, minus, speed, slow, warp1, stock1), text="Generate Codes")
parseButtonTwo.place(x=10, y=800)

return frame

0 comments on commit 3d5bb3b

Please sign in to comment.