Represents a Sim that can be drawn and animated. Abstraction on top of Vitaboy's AvatarBase to hold information such as whether this Sim has a house, is a child and so on.
示例#1
0
        public CASScreen(ScreenManager Manager, SpriteBatch SBatch)
            : base(Manager, "CAS", SBatch, 
            new Vector2(0, 0), 
            new Vector2(GlobalSettings.Default.ScreenWidth, GlobalSettings.Default.ScreenHeight),
            GlobalSettings.Default.StartupPath + "\\" + "gamedata\\uiscripts\\personselectionedit.uis")
        {
            m_BackgroundImg = (UIImage)m_Walker.Elements["\"BackgroundImage\""];

            m_CancelBtn = (UIButton)m_Walker.Elements["\"CancelButton\""];
            m_AcceptBtn = (UIButton)m_Walker.Elements["\"AcceptButton\""];
            m_DescriptionScrollUpBtn = (UIButton)m_Walker.Elements["\"DescriptionScrollUpButton\""];
            m_DescriptionScrollDownBtn = (UIButton)m_Walker.Elements["\"DescriptionScrollDownButton\""];

            m_ExitBtn = (UIButton)m_Walker.Elements["\"ExitButton\""];
            m_ExitBtn.OnButtonClicked += M_ExitBtn_OnButtonClicked;

            m_FemaleBtn = (UIButton)m_Walker.Elements["\"FemaleButton\""];
            m_FemaleBtn.OnButtonClicked += M_FemaleBtn_OnButtonClicked;

            m_MaleBtn = (UIButton)m_Walker.Elements["\"MaleButton\""];
            m_MaleBtn.OnButtonClicked += M_MaleBtn_OnButtonClicked;

            m_SkinLightBtn = (UIButton)m_Walker.Elements["\"SkinLightButton\""];
            m_SkinLightBtn.OnButtonClicked += M_SkinLightBtn_OnButtonClicked;

            m_SkinMediumBtn = (UIButton)m_Walker.Elements["\"SkinMediumButton\""];
            m_SkinMediumBtn.OnButtonClicked += M_SkinMediumBtn_OnButtonClicked;

            m_SkinDarkBtn = (UIButton)m_Walker.Elements["\"SkinDarkButton\""];
            m_SkinDarkBtn.OnButtonClicked += M_SkinDarkBtn_OnButtonClicked;

            m_HeadSkinBrowser = new UIHeadBrowser(this, m_Walker.Controls["\"HeadSkinBrowser\""], 1, AvatarSex.Female);
            m_HeadSkinBrowser.OnButtonClicked += M_HeadSkinBrowser_OnButtonClicked;
            m_BodySkinBrowser = new UIBodyBrowser(this, m_Walker.Controls["\"BodySkinBrowser\""], 1, AvatarSex.Female);
            m_BodySkinBrowser.OnButtonClicked += M_BodySkinBrowser_OnButtonClicked;

            AdultAvatar Avatar = new AdultAvatar(Manager.Device);
            Avatar.ChangeOutfit(FileManager.GetOutfit((ulong)FileIDs.OutfitsFileIDs.fab001_sl__pjs4), Vitaboy.SkinType.Medium);
            Avatar.SetHead(FileManager.GetOutfit((ulong)FileIDs.OutfitsFileIDs.fah002_mom), (Vitaboy.SkinType)m_CurrentSkinType);
            Avatar.ShouldRotate = true;

            m_Avatar = new Sim(Manager.Device, Avatar);
            m_Avatar.Camera.Origin = new Vector2(175, 100);
            m_Avatar.Camera.Zoom = 0.7f;

            m_VitaboyScreen = new VitaboyScreen(Manager, new Vector2(0, 0),
                new Vector2(GlobalSettings.Default.ScreenWidth, GlobalSettings.Default.ScreenHeight));
            m_VitaboyScreen.AddSim(m_Avatar);

            m_ExitDialog = new ExitDialog(this, new Vector2(250, 250), m_Walker,
                GlobalSettings.Default.StartupPath + "\\" + "gamedata\\uiscripts\\exitdialog.uis");
            m_ExitDialog.Visible = false;

            Manager.AddScreen(m_VitaboyScreen);
        }
示例#2
0
        /// <summary>
        /// Adds an avatar to this instance of SASScreen.
        /// </summary>
        /// <param name="Avatar">An instance of AdultAvatar. 
        /// Assumed to already have a head and outfit.</param>
        /// <param name="ID">ID from 1 - 3, indicates which "box" this avatar will be rendered in.</param>
        public void AddAvatar(AdultAvatar Avatar, int ID)
        {
            switch(ID)
            {
                case 1:
                    if (m_Avatars.Count != 0)
                        m_Avatars[0] = new Sim(Manager.Device, Avatar);
                    else
                        m_Avatars.Add(new Sim(Manager.Device, Avatar));

                    m_Avatars[0].ShouldRotate = true;
                    m_Avatars[0].Camera.Origin = new Vector2(175, 100);
                    m_Avatars[0].Camera.Zoom = 0.7f;
                    break;
            }
        }
 /// <summary>
 /// Removes an instance of Sim from this instance of VitaboyScreen.
 /// </summary>
 /// <param name="S">The instance of Sim to remove.</param>
 public void RemoveSim(Sim S)
 {
     m_Avatars.Remove(S);
 }
 /// <summary>
 /// Adds an instance of Sin to this instance of VitaboyScreen so it can
 /// be drawn and updated.
 /// </summary>
 /// <param name="S">The instance to add.</param>
 public void AddSim(Sim S)
 {
     m_Avatars.Add(S);
 }