Exemplo n.º 1
0
        /// <summary>Updates the origin building display using the specified building ID. If 0 value is specified,
        /// hides the origin building panel.</summary>
        /// <param name="buildingId">The ID of the building to show as origin.</param>
        /// <param name="instanceIndex">The game instance object's index value.</param>
        protected void UpdateOriginFromBuilding(ushort buildingId, uint instanceIndex)
        {
            if (buildingId == 0)
            {
                SetCustomPanelVisibility(OriginPanel, false);
                return;
            }

            SetCustomPanelVisibility(OriginPanel, true);
            OriginButton.text           = GetBuildingName(buildingId, instanceIndex, out bool isObservable);
            OriginButton.isEnabled      = isObservable;
            OriginButton.objectUserData = buildingId;
            UIComponentTools.ShortenTextToFitParent(OriginButton);
        }
Exemplo n.º 2
0
        /// <summary>Updates the parked car display using the specified citizen instance ID. If 0 value is specified,
        /// hides the parked car panel.</summary>
        /// <param name="citizenId">The citizen ID to search the parked car for.</param>
        protected void UpdateCar(uint citizenId)
        {
            if (citizenId == 0)
            {
                SetCustomPanelVisibility(carPanel, false);
                return;
            }

            ushort parkedCarId = GetParkedVehicle(citizenId);

            if (parkedCarId == 0)
            {
                SetCustomPanelVisibility(carPanel, false);
            }
            else
            {
                SetCustomPanelVisibility(carPanel, true);
                carButton.text           = GetVehicleName(parkedCarId);
                carButton.objectUserData = parkedCarId;
                UIComponentTools.ShortenTextToFitParent(carButton);
            }
        }
Exemplo n.º 3
0
        /// <summary>Updates the origin building display using the specified citizen instance ID. If 0 value is specified,
        /// hides the origin building panel.</summary>
        /// <param name="instanceId">The citizen instance ID to search the origin building for.</param>
        protected void UpdateOrigin(ushort instanceId)
        {
            if (instanceId == 0)
            {
                UpdateVisibility(false);
                return;
            }

            ushort originBuildingId = GetSourceBuilding(instanceId);

            if (originBuildingId == 0)
            {
                UpdateVisibility(false);
            }
            else
            {
                UpdateVisibility(true);
                originButton.text           = GetBuildingName(originBuildingId);
                originButton.objectUserData = originBuildingId;
                UIComponentTools.ShortenTextToFitParent(originButton);
            }
        }