Fixd UI-Updates with CarryHeavy on Clonk-Selection

Added CarryHeavy to the Contentsmenu
floating-point
Bernhard Bonigl 2012-04-13 20:24:41 +02:00
parent 0dda1f59f5
commit 0bac82bcc3
3 changed files with 12 additions and 1 deletions

View File

@ -197,6 +197,10 @@ private func PutContentsIntoMenu(object menu, object container)
if (!AddContentsMenuItem(stack[0], menu, stack))
return;
}
// TODO: find an extra-entry or something like that for this.
if(container->~IsCarryingHeavy())
AddContentsMenuItem(container->GetCarryHeavy(), menu);
}
private func AddContentsMenuItem(object symbol, object menu, array stack)

View File

@ -584,6 +584,7 @@ public func OnCrewSelection(object clonk, bool deselect)
ScheduleUpdateBackpack();
UpdateHealthTube();
UpdateBreathTube();
OnCarryHeavyChange(clonk->~GetCarryHeavy());
}
public func FxIntSearchInteractionObjectsEffect(string newname, object target)

View File

@ -431,6 +431,8 @@ protected func Ejection(object obj)
for(var c = 0; c < ContentsCount(); ++c)
{
var o = Contents(c);
if(o->~IsCarryHeavy())
continue;
if (GetItemPos(o) == nil)
{
// found it! Collect it properly
@ -520,6 +522,9 @@ public func AllowTransfer(object obj)
if (ContentsCount() >= MaxContentsCount())
return false;
if(carryheavy && obj->~IsCarryHeavy())
return false;
return true;
}
@ -546,6 +551,7 @@ public func CarryHeavy(object target)
this->~OnCarryHeavyChange(carryheavy);
// Update attach stuff
this->~OnHandFull();
//this->~UpdateAttach();
return true;
@ -558,7 +564,7 @@ private func StopCarryHeavy()
carryheavy = nil;
this->~OnCarryHeavyChange(nil);
this->~UpdateAttach();
this->~OnSlotEmpty();
}
public func GetCarryHeavy() { return carryheavy; }