Release v1.0.8.9: Gearset persists on slot
- Do not treat slot as empty when CommandType is GearSet (CommandId 0 valid) - Use CommandType/CommandId for GearSet display; resolve icon when IconId 0 - Bump version, changelog, pluginmaster Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -116,22 +116,35 @@ namespace HSUI.Helpers
|
||||
continue;
|
||||
}
|
||||
|
||||
if (slot->IsEmpty)
|
||||
// GearSet with id 0 is valid (first gearset); the game's IsEmpty (CommandId == 0) would wrongly treat it as empty.
|
||||
bool isEmpty = slot->IsEmpty && slot->CommandType != RaptureHotbarModule.HotbarSlotType.GearSet;
|
||||
if (isEmpty)
|
||||
{
|
||||
list.Add(new SlotInfo(0, true, false, 0, 0, 0, 0, keybind, 0, 0));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Use CommandType/CommandId for GearSet so we handle gearset 0 and slots not yet synced to Apparent*.
|
||||
var slotType = slot->CommandType == RaptureHotbarModule.HotbarSlotType.GearSet
|
||||
? RaptureHotbarModule.HotbarSlotType.GearSet
|
||||
: slot->ApparentSlotType;
|
||||
uint actionId = slot->CommandType == RaptureHotbarModule.HotbarSlotType.GearSet
|
||||
? slot->CommandId
|
||||
: slot->ApparentActionId;
|
||||
|
||||
// For GearSet slots, refresh IconId from the gearset (e.g. job icon from first equipment slot).
|
||||
// Only call for already-synced GearSet slots: calling LoadIconId() on other types or before the
|
||||
// game has synced a just-dropped slot can prevent the drop from sticking.
|
||||
if (slot->ApparentSlotType == RaptureHotbarModule.HotbarSlotType.GearSet)
|
||||
if (slotType == RaptureHotbarModule.HotbarSlotType.GearSet)
|
||||
slot->LoadIconId();
|
||||
|
||||
bool usable = slot->IsSlotUsable(slot->ApparentSlotType, slot->ApparentActionId);
|
||||
bool usable = slot->IsSlotUsable(slotType, actionId);
|
||||
uint iconId = slot->IconId;
|
||||
uint actionId = slot->ApparentActionId;
|
||||
var slotType = slot->ApparentSlotType;
|
||||
// GearSet 0 or just-dropped: game may not have synced Apparent* so IconId can be 0; resolve for display.
|
||||
if (slotType == RaptureHotbarModule.HotbarSlotType.GearSet && iconId == 0)
|
||||
{
|
||||
int resolved = slot->GetIconIdForSlot(slotType, actionId);
|
||||
if (resolved > 0)
|
||||
iconId = (uint)resolved;
|
||||
}
|
||||
|
||||
(int pct, int secsLeft) = GetSlotCooldown(slot);
|
||||
(int currentCharges, int maxCharges) = GetSlotCharges(slotType, actionId);
|
||||
|
||||
Reference in New Issue
Block a user