Ejemplo n.º 1
0
    IEnumerator WaitForProvider()
    {
        string FormatTime(int timerSeconds)
        {
            if (shuttle.Status == ShuttleStatus.DockedCentcom || shuttle.Status == ShuttleStatus.DockedStation)
            {
                return(string.Empty);
            }

            return("ETA: " + TimeSpan.FromSeconds(timerSeconds).ToString("mm\\:ss"));
        }

        while (Provider == null)
        {
            yield return(WaitFor.EndOfFrame);
        }

        console = Provider.GetComponentInChildren <CommsConsole>();

        //starting up, setting appropriate labels
        ProcessIdChange(console.IdCard);
        console.OnServerIDCardChanged.AddListener(ProcessIdChange);
        shuttle = GameManager.Instance.PrimaryEscapeShuttle;

        shuttleStatusLabel.SetValue = shuttle.Status.ToString();
        statusImage.SetComplicatedValue("shuttle_status", (int)shuttle.Status);
        shuttle.OnShuttleUpdate.AddListener(status =>
        {
            statusImage.SetComplicatedValue("shuttle_status", (int)status);
            shuttleStatusLabel.SetValue = status.ToString();
        });

        shuttleTimerLabel.SetValue = FormatTime(shuttle.CurrentTimerSeconds);
        shuttle.OnTimerUpdate.AddListener(timerSeconds => { shuttleTimerLabel.SetValue = FormatTime(timerSeconds); });

        RefreshCallButtonText();

        Logger.Log(nameof(WaitForProvider), Category.NetUI);
    }
Ejemplo n.º 2
0
    public void UpdateEntry()
    {
        if (!CustomNetworkManager.Instance._isServer)
        {
            return;
        }

        if (record == null)
        {
            return;
        }

        nameText.SetValue         = record.EntryName;
        idText.SetValue           = record.ID;
        sexText.SetValue          = record.Sex;
        ageText.SetValue          = record.Age;
        speciesText.SetValue      = record.Species;
        rankText.SetValue         = record.Rank;
        fingerprintText.SetValue  = record.Fingerprints;
        statusButtonText.SetValue = record.Status.ToString();

        var characterSettings = record.characterSettings;

        if (characterSettings != null)
        {
            torso.SetComplicatedValue("human_parts_greyscale", characterSettings.torsoSpriteIndex, characterSettings.skinTone);
            head.SetComplicatedValue("human_parts_greyscale", characterSettings.headSpriteIndex, characterSettings.skinTone);
            rightLeg.SetValue = characterSettings.skinTone;
            leftLeg.SetValue  = characterSettings.skinTone;
            rightArm.SetValue = characterSettings.skinTone;
            leftArm.SetValue  = characterSettings.skinTone;
            eyes.SetValue     = characterSettings.eyeColor;
            beard.SetComplicatedValue("human_face", characterSettings.facialHairOffset, characterSettings.facialHairColor);
            hair.SetComplicatedValue("human_face", characterSettings.hairStyleOffset, characterSettings.hairColor);

            exosuit.SetComplicatedValue("suit", GetSpriteOffset(record.jobOutfit.suit, ItemType.Suit));
            jumpsuit.SetComplicatedValue("uniform", GetSpriteOffset(record.jobOutfit.uniform, ItemType.Uniform));
            belt.SetComplicatedValue("belt", GetSpriteOffset(record.jobOutfit.belt, ItemType.Belt));
            shoes.SetComplicatedValue("feet", GetSpriteOffset(record.jobOutfit.shoes, ItemType.Shoes));
            back.SetComplicatedValue("back", GetSpriteOffset(record.jobOutfit.backpack, ItemType.Back));
            //neck.SetComplicatedValue("neck", GetSpriteOffset(record.jobOutfit.neck, ItemType.Neck)); //JobOutfits dont have neck slots yet (will need for lawyer)
            gloves.SetComplicatedValue("hands", GetSpriteOffset(record.jobOutfit.gloves, ItemType.Gloves));
            underwear.SetComplicatedValue("underwear", characterSettings.underwearOffset);
            socks.SetComplicatedValue("underwear", characterSettings.socksOffset);
        }

        securityRecordsTab.UpdateIdText(idNameText);
        UpdateCrimesList();
    }