def _defineUI(self, ui): self._uiFields = types.SimpleNamespace() element = ControlUIElement() element.id = "lhand" element.position = Vector2D(ui.center.x, ui.resolution.y - ui.iconSize.y) element.AddIcon("lhand_inactive") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.lhand = element element = ControlUIElement() element.id = "rhand" element.position = Vector2D(ui.center.x - ui.iconSize.x, ui.resolution.y - ui.iconSize.y) element.AddIcon("rhand_inactive") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.rhand = element element = ControlUIElement() element.id = "equip" element.position = Vector2D(ui.center.x - ui.iconSize.x, ui.resolution.y - ui.iconSize.y * 2) element.AddIcon("equip") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.equip = element element = ControlUIElement() element.id = "swap1" element.position = Vector2D(ui.center.x - ui.iconSize.x, ui.resolution.y - ui.iconSize.y * 2) element.AddIcon("swap1") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.swap1 = element element = ControlUIElement() element.id = "swap2" element.position = Vector2D(ui.center.x, ui.resolution.y - ui.iconSize.y * 2) element.AddIcon("swap2") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.swap2 = element element = ControlUIElement() element.id = "pocket1" element.position = Vector2D(ui.center.x + ui.iconSize.x, ui.resolution.y - ui.iconSize.y) element.AddIcon("pocket") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.pocket1 = element element = ControlUIElement() element.id = "pocket2" element.position = Vector2D(ui.center.x + ui.iconSize.x * 2, ui.resolution.y - ui.iconSize.y) element.AddIcon("pocket") element.RegisterCallback(lambda element=element: self.__uiFieldClicked(element)) ui.UpdateElement(element) self._uiFields.pocket2 = element
def position(self) -> Vector2D: return Vector2D._FromEngineVec(super().position)
def iconSize(self) -> Vector2D: return Vector2D._FromEngineVec(self._impl.iconSize)
def center(self) -> Vector2D: return Vector2D._FromEngineVec(self._impl.center)
def resolution(self) -> Vector2D: return Vector2D._FromEngineVec(self._impl.resolution)
def GetAndDropMoveOrder(self) -> Vector2D: return Vector2D._FromEngineVec(self._impl.GetAndDropMoveOrder())
def speed(self) -> Vector2D: return Vector2D._FromEngineVec(super().speed)