public void SetPortraitId(uint portraitId)
    {
        for (int portraitIdx = 0; portraitIdx < ClientGameConstants.GetPortraitCount(); portraitIdx++)
        {
            m_portraits[portraitIdx].Visible = (portraitIdx == portraitId);
        }

        m_nameTextField.Text  = ClientGameConstants.GetDefaultNameForPicture(portraitId);
        m_genderLabel.Text    = GameConstants.GetGenderString(ClientGameConstants.GetGenderForPicture(portraitId));
        m_archetypeLabel.Text = GameConstants.GetArchetypeString(ClientGameConstants.GetArchetypeForPicture(portraitId));
    }
Exemplo n.º 2
0
    public void ShowCharacterData(CharacterData characterEntry)
    {
        for (int portraitIndex = 0; portraitIndex < ClientGameConstants.GetPortraitCount(); portraitIndex++)
        {
            m_portraits[portraitIndex].Visible = (portraitIndex == characterEntry.picture_id);
        }

        m_nameText.Text      = characterEntry.character_name;
        m_genderText.Text    = GameConstants.GetGenderString(ClientGameConstants.GetGenderForPicture((uint)characterEntry.picture_id));
        m_archetypeText.Text = GameConstants.GetArchetypeString(ClientGameConstants.GetArchetypeForPicture((uint)characterEntry.picture_id));
        m_levelText.Text     = characterEntry.power_level.ToString();
        m_gameText.Text      = characterEntry.game_name;

        m_characterDataGroup.Visible = true;
    }
Exemplo n.º 3
0
    public CharacterThumbnailWidget(
        WidgetGroup parentGroup,
        CharacterThumbnailStyle style,
        CharacterData characterData)
        : base(parentGroup, style.BackgroundWidth, style.BackgroundHeight, 0, 0)
    {
        new ImageWidget(this, style.BackgroundWidth, style.BackgroundHeight, style.Background, 0.0f, 0.0f);

        // Background for the character info
        string      portraitResource = ClientGameConstants.GetResourceNameForPicture((uint)characterData.picture_id);
        ImageWidget portrait         =
            new ImageWidget(
                this,
                style.PortraitWidth, style.PortraitHeight,
                Resources.Load <Texture>(portraitResource),
                5, 5);

        // Character name
        LabelWidget nameLabel =
            new LabelWidget(
                this,
                style.LabelWidth, style.LabelHeight,
                portrait.LocalX + portrait.Width + 3, 0,
                characterData.character_name);

        // Character info
        string archetype  = GameConstants.GetArchetypeString(ClientGameConstants.GetArchetypeForPicture((uint)characterData.picture_id));
        string infoString = "Lvl " + characterData.power_level.ToString() + " " + archetype;

        new LabelWidget(
            this,
            style.LabelWidth, style.LabelHeight,
            portrait.LocalX + portrait.Width + 3,
            nameLabel.LocalY + nameLabel.Height,
            infoString);

        this.Visible = false;
    }
 public GameConstants.eArchetype GetArchetype()
 {
     return(ClientGameConstants.GetArchetypeForPicture(m_pictureId));
 }