Skip to content

Commit 6a2bdde

Browse files
authored
Merge pull request #2955 from UmedMuzl/dev-copy1
Tooltip
2 parents aa276c1 + ac1845d commit 6a2bdde

File tree

7 files changed

+76
-5
lines changed

7 files changed

+76
-5
lines changed

archipelago/Options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Goal(Choice):
3737
- pearls: Find a certain number of Pearls to win. See goal_quantity option for more info.
3838
- bosses: Defeat a certain number of bosses to win. See goal_quantity option for more info.
3939
- bonuses: Complete a certain number of Bonus Barrels to win. Automatically disables auto_complete_bonus_barrels if set. See goal_quantity option for more info.
40-
- treasure_hurry: Run down the timer by collecting treasure! You win when the timer reaches 0.
40+
- treasure_hurry: Run down the timer by collecting treasure! You win when the timer reaches 0. If you beat Helm, the wincon automatically changes to beating K. Rool.
4141
- krools_challenge: K. Rool's ship does not spawn until you collect All keys, Defeat All bosses, Play all Bonus Barrels, and collect All Blueprints.
4242
- kill_the_rabbit: Kill the rabbit in Chunky's igloo in Caves. Turn it to Ash. Simple as that.
4343
"""
105 KB
Loading

randomizer/Patching/ASMPatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ def patchAssembly(ROM_COPY, spoiler):
17061706
# Fix Null Lag Boost
17071707
writeHook(ROM_COPY, 0x806CCA90, Overlay.Static, "fixNullLagBoost", offset_dict)
17081708

1709-
if settings.win_condition_spawns_ship:
1709+
if settings.win_condition_spawns_ship and not (settings.helm_hurry and settings.archipelago):
17101710
writeValue(ROM_COPY, 0x80029706, Overlay.Menu, getHiSym("k_rool_text"), offset_dict)
17111711
writeValue(ROM_COPY, 0x8002970A, Overlay.Menu, getLoSym("k_rool_text"), offset_dict)
17121712
writeFloatUpper(ROM_COPY, 0x800296D2, Overlay.Menu, 280, offset_dict)

randomizer/Patching/CosmeticColors.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,8 @@ def writeWinConImage(settings: Settings, image: Image, ROM_COPY: LocalROM):
705705
def showWinCondition(settings: Settings, ROM_COPY: LocalROM):
706706
"""Alter the image that's shown on the main menu to display the win condition."""
707707
win_con = settings.win_condition_item
708-
if win_con == WinConditionComplex.beat_krool:
709-
# Default, don't alter image
710-
return
708+
helmhurry = settings.helm_hurry and settings.archipelago
709+
711710
if win_con == WinConditionComplex.krools_challenge:
712711
images = [
713712
(0x903, 0, 1),
@@ -728,6 +727,11 @@ def showWinCondition(settings: Settings, ROM_COPY: LocalROM):
728727
output_image.paste(local_img, (pos_x, pos_y), local_img)
729728
output_image = output_image.resize((32, 32)).transpose(Image.FLIP_TOP_BOTTOM)
730729
writeWinConImage(settings, output_image, ROM_COPY)
730+
if helmhurry:
731+
output_image = Image.open(BytesIO(js.getFile("base-hack/assets/displays/treasurechest.png")))
732+
output_image = output_image.resize((32, 32))
733+
writeWinConImage(settings, output_image, ROM_COPY)
734+
return
731735
if win_con == WinConditionComplex.get_key8:
732736
output_image = Image.open(BytesIO(js.getFile("base-hack/assets/displays/key8.png")))
733737
output_image = output_image.resize((32, 32))

static/js/rando_options.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,35 @@ function update_win_con_num_access() {
15101510
}
15111511
}
15121512
}
1513+
1514+
// Update tooltip for special win conditions
1515+
const TOOLTIP_WIN_CONS = {
1516+
"krools_challenge": "Beat K. Rool and collect all Keys, Blueprints, Bosses, and Bonus Barrels",
1517+
"dk_rap_items": "Acquire all items referenced in each verse of the DK Rap:<br><br><strong>Donkey verse</strong> : Coconuts, Strong Kong<br><strong>Diddy verse</strong> : Rocketbarrel, Peanuts, Guitar<br><strong>Lanky verse</strong> : Orangstand, Baboon Balloon, Trombone<br><strong>Tiny verse</strong> : Mini Monkey, Ponytail Twirl, Climbing<br><strong>Chunky verse</strong> : Barrel Throwing<br><strong>The Fridge</strong> : Cranky, Peanuts, Pineapple, Grape, Orange Throwing, Coconuts",
1518+
"kill_the_rabbit": "Kill the rabbit in Chunky's igloo in Caves. Turn it to Ash. Simple as that."
1519+
};
1520+
1521+
const infoIcon = document.getElementById("win_condition_info_icon");
1522+
1523+
// Always dispose existing tooltip first
1524+
$(infoIcon).tooltip('dispose');
1525+
1526+
if (TOOLTIP_WIN_CONS[winConSelection.value]) {
1527+
infoIcon.setAttribute("title", TOOLTIP_WIN_CONS[winConSelection.value]);
1528+
infoIcon.setAttribute("data-bs-original-title", TOOLTIP_WIN_CONS[winConSelection.value]);
1529+
infoIcon.classList.remove("hidden");
1530+
// Initialize Bootstrap tooltip
1531+
$(infoIcon).tooltip({
1532+
trigger: 'hover',
1533+
html: true,
1534+
placement: 'right',
1535+
customClass: 'win-condition-tooltip'
1536+
});
1537+
} else {
1538+
infoIcon.setAttribute("title", "");
1539+
infoIcon.setAttribute("data-bs-original-title", "");
1540+
infoIcon.classList.add("hidden");
1541+
}
15131542
}
15141543

15151544
document

static/styles/gui.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,41 @@ td.directional_divider {
804804
min-width: 125px;
805805
}
806806

807+
#win_condition_container {
808+
position: relative;
809+
}
810+
811+
#win_condition_info_icon {
812+
display: inline-block;
813+
position: absolute;
814+
right: -48px;
815+
top: 50%;
816+
transform: translateY(-50%) scale(0.7);
817+
transform-origin: center center;
818+
}
819+
820+
#win_condition_info_icon.hidden {
821+
display: none !important;
822+
}
823+
824+
.win-condition-tooltip {
825+
opacity: 1 !important;
826+
}
827+
828+
.win-condition-tooltip .tooltip-inner {
829+
background-color: rgb(4, 130, 67, 0.95) !important;
830+
border-left: 3px solid var(--donk-green);
831+
color: #e3e3e3;
832+
text-align: left;
833+
line-height: 1.6;
834+
max-width: 500px;
835+
opacity: 1 !important;
836+
}
837+
838+
.win-condition-tooltip.bs-tooltip-right .tooltip-arrow::before {
839+
border-right-color: rgb(4, 130, 67, 0.95) !important;
840+
}
841+
807842
#fairy-container {
808843
text-align: left;
809844
display: flex;

templates/progression.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ <h2 class="title">ENDGAME OPTIONS</h2>
9393
title="Amount of the item specified to beat the game."
9494
default="1"
9595
placeholder="1"/>
96+
<span id="win_condition_info_icon" class="hidden" style="cursor: help; color: var(--donk-green);" data-toggle="tooltip" data-placement="right" data-html="true" title="">
97+
<i class="fa fa-info-circle"></i>
98+
</span>
9699
</div>
97100
<div class="form-check form-switch item-switch" style="padding-left: 0;">
98101
<label data-toggle="tooltip"

0 commit comments

Comments
 (0)