diff --git a/codes/marioParty1.py b/codes/marioParty1.py index e9227a7..e84a0df 100644 --- a/codes/marioParty1.py +++ b/codes/marioParty1.py @@ -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} ''' diff --git a/codes/marioParty7.py b/codes/marioParty7.py index bffd312..21b6df4 100644 --- a/codes/marioParty7.py +++ b/codes/marioParty7.py @@ -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 diff --git a/events/marioParty1_items.py b/events/marioParty1_items.py index 2a7c913..21afada 100644 --- a/events/marioParty1_items.py +++ b/events/marioParty1_items.py @@ -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 @@ -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: @@ -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 = [ @@ -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 diff --git a/frames/marioParty1_frame.py b/frames/marioParty1_frame.py index 06c3536..dc7a4d8 100644 --- a/frames/marioParty1_frame.py +++ b/frames/marioParty1_frame.py @@ -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 \ No newline at end of file