MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / AddKey

Method AddKey

engine/Poseidon/UI/DisplayUI.cpp:654–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652 _keys[action].Add(key);
653 _collisions[action].Add(collision);
654}
655
656inline PackedColor ModAlpha(PackedColor color, float alpha)
657{
658 int a = toInt(alpha * color.A8());
659 saturate(a, 0, 255);
660 return PackedColorRGB(color, a);
661}
662
663void CKeys::DrawItem(Vector3Par position, Vector3Par down, int i, float alpha)
664{
665 float y1c = 0;
666 float y2c = 1;
667 if (i < _topString)
668 {
669 y1c = _topString - i;
670 }
671 if (i > _topString + _rows - 1)
672 {
673 y2c = _topString + _rows - i;
674 }
675
676 Vector3 normal = _down.CrossProduct(_right).Normalized();
677
678 Vector3 rightSB = _right;
679 if (GetSize() > _rows)
680 {
681 rightSB = (1.0 - _sb3DWidth) * _right;
682 }
683 float rightSBSize = rightSB.Size();
684 Vector3 border = 0.02 * _right;
685
686 bool selected = i == GetCurSel() && IsEnabled();
687 PackedColor color = ModAlpha(GetFtColor(i), alpha);
688 PackedColor selColor = color;
689 if (selected && _showSelected)
690 {
691 PackedColor selBgColor = ModAlpha(_selBgColor, alpha);
692 switch (_mode)
693 {
694 case -1:
695 GEngine->Draw3D(position, down, 0.4 * rightSB, ClipAll, selBgColor, DisableSun, nullptr, 0, y1c, 1,
696 y2c);

Callers 1

OnSimulateMethod · 0.80

Calls 3

SizeMethod · 0.45
DeleteMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected