Exemplo n.º 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_PResult.Elements["\"BackgroundImage\""];

            m_CancelBtn = (UIButton)m_PResult.Elements["\"CancelButton\""];
            m_AcceptBtn = (UIButton)m_PResult.Elements["\"AcceptButton\""];

            m_DescriptionScrollUpBtn = (UIButton)m_PResult.Elements["\"DescriptionScrollUpButton\""];
            m_DescriptionScrollUpBtn.OnButtonClicked += M_DescriptionScrollUpBtn_OnButtonClicked;
            m_DescriptionScrollUpBtn.Enabled          = false;
            m_DescriptionScrollDownBtn = (UIButton)m_PResult.Elements["\"DescriptionScrollDownButton\""];
            m_DescriptionScrollDownBtn.OnButtonClicked += M_DescriptionScrollDownBtn_OnButtonClicked;
            m_DescriptionScrollDownBtn.Enabled          = false;

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

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

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

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

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

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

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

            AdultAvatar Avatar = new AdultAvatar(Manager.Device, Manager.HeadShader);

            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, Manager.RenderCamera, Avatar);

            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;

            m_DescriptionTextEdit = (UITextEdit)m_PResult.Elements["\"DescriptionTextEdit\""];

            Manager.AddScreen(m_VitaboyScreen);
        }
Exemplo n.º 2
0
        public SASScreen(ScreenManager Manager, SpriteBatch SBatch) : base(Manager, "SAS", SBatch,
                                                                           new Vector2(0, 0), new Vector2(GlobalSettings.Default.ScreenWidth, GlobalSettings.Default.ScreenHeight),
                                                                           GlobalSettings.Default.StartupPath + "\\" + "gamedata\\uiscripts\\personselection.uis")
        {
            m_BackgroundImg = (UIBackgroundImage)m_PResult.Elements["\"BackgroundImage\""];

            AdultAvatar Avatar = new AdultAvatar(Manager.Device, Manager.HeadShader);

            Avatar.ChangeOutfit(FileManager.Instance.GetOutfit((ulong)FileIDs.OutfitsFileIDs.fab001_sl__pjs4), Vitaboy.SkinType.Medium);
            Avatar.SetHead(FileManager.Instance.GetOutfit((ulong)FileIDs.OutfitsFileIDs.fah002_mom), Vitaboy.SkinType.Medium);
            AddAvatar(Avatar, 1);

            VitaboyScreen VScreen = new VitaboyScreen(Manager, new Vector2(0, 0),
                                                      new Vector2(GlobalSettings.Default.ScreenWidth, GlobalSettings.Default.ScreenHeight));

            VScreen.AddSim(m_Avatars[0]);

            Manager.AddScreen(VScreen);

            TabBackgroundImg1 = m_PResult.Elements["\"TabBackgroundImage1\""].Image;
            TabBackgroundImg2 = m_PResult.Elements["\"TabBackgroundImage2\""].Image;
            TabBackgroundImg3 = m_PResult.Elements["\"TabBackgroundImage3\""].Image;

            SimCreateButtonImage = (UIImage)m_PResult.Elements["\"SimCreateButtonImage\""];
            SimSelectButtonImage = (UIImage)m_PResult.Elements["\"SimSelectButtonImage\""];

            DescriptionTabBackgroundImg1         = m_PResult.Elements["\"DescriptionTabBackgroundImage1\""].Image;
            DescriptionTabBackgroundImg1.Visible = m_Avatars.Count >= 1 ? true : false;
            DescriptionTabBackgroundImg2         = m_PResult.Elements["\"DescriptionTabBackgroundImage2\""].Image;
            DescriptionTabBackgroundImg2.Visible = m_Avatars.Count >= 2 ? true : false;
            DescriptionTabBackgroundImg3         = m_PResult.Elements["\"DescriptionTabBackgroundImage3\""].Image;
            DescriptionTabBackgroundImg3.Visible = m_Avatars.Count == 3 ? true : false;

            DescriptionTabImage1         = m_PResult.Elements["\"DescriptionTabImage1\""].Image;
            DescriptionTabImage1.Visible = m_Avatars.Count >= 1 ? true : false;
            DescriptionTabImage2         = m_PResult.Elements["\"DescriptionTabImage2\""].Image;
            DescriptionTabImage2.Visible = m_Avatars.Count >= 2 ? true : false;
            DescriptionTabImage3         = m_PResult.Elements["\"DescriptionTabImage3\""].Image;
            DescriptionTabImage3.Visible = m_Avatars.Count == 3 ? true : false;

            EnterTabImage1         = m_PResult.Elements["\"EnterTabImage1\""].Image;
            EnterTabImage1.Visible = false;
            EnterTabImage2         = m_PResult.Elements["\"EnterTabImage2\""].Image;
            EnterTabImage2.Visible = false;
            EnterTabImage3         = m_PResult.Elements["\"EnterTabImage3\""].Image;
            EnterTabImage3.Visible = false;

            EnterTabBackgroundImage1         = m_PResult.Elements["\"EnterTabBackgroundImage1\""].Image;
            EnterTabBackgroundImage1.Visible = false;
            EnterTabBackgroundImage2         = m_PResult.Elements["\"EnterTabBackgroundImage2\""].Image;
            EnterTabBackgroundImage2.Visible = false;
            EnterTabBackgroundImage3         = m_PResult.Elements["\"EnterTabBackgroundImage3\""].Image;
            EnterTabBackgroundImage3.Visible = false;

            //DefaultHouseImg = (UIImage)m_Elements["\"DefaultHouseImage\""].Image; //Not used??

            CreditsBackgroundImg = m_PResult.Controls["\"CreditsButtonBackgroundImage\""].Image;
            //CityThumbnailBusyImg = m_Controls["\"CityThumbnailBusyImage\""].Image; //Not used??

            CityButtonTemplateImage = (UIImage)m_PResult.Elements["\"CityButtonTemplateImage\""];

            m_ExitButton = (UIButton)m_PResult.Elements["\"ExitButton\""];
            m_ExitButton.OnButtonClicked += M_ExitButton_OnButtonClicked;
            m_ExitDialog = new ExitDialog(this, new Vector2(250, 250), m_Walker,
                                          GlobalSettings.Default.StartupPath + "gamedata\\uiscripts\\exitdialog.uis");
            m_ExitDialog.Visible = false;
            RegisterElement(m_ExitDialog);

            m_EnterTabBtn1 = (UIButton)m_PResult.Elements["\"EnterTabButton1\""];
            m_EnterTabBtn1.OnButtonClicked += EnterTabBtn1_OnButtonClicked;
            m_EnterTabBtn1.Enabled          = m_Avatars.Count >= 1 ? true : false;
            m_EnterTabBtn2 = (UIButton)m_PResult.Elements["\"EnterTabButton2\""];
            m_EnterTabBtn2.OnButtonClicked += EnterTabBtn2_OnButtonClicked;
            m_EnterTabBtn2.Enabled          = m_Avatars.Count >= 2 ? true : false;
            m_EnterTabBtn3 = (UIButton)m_PResult.Elements["\"EnterTabButton3\""];
            m_EnterTabBtn3.OnButtonClicked += EnterTabBtn3_OnButtonClicked;
            m_EnterTabBtn3.Enabled          = m_Avatars.Count == 3 ? true : false;

            m_DescriptionTabBtn1 = (UIButton)m_PResult.Elements["\"DescriptionTabButton1\""];
            m_DescriptionTabBtn1.OnButtonClicked += DescriptionTabBtn1_OnButtonClicked;
            m_DescriptionTabBtn1.Enabled          = m_Avatars.Count >= 1 ? true : false;
            m_DescriptionTabBtn2 = (UIButton)m_PResult.Elements["\"DescriptionTabButton2\""];
            m_DescriptionTabBtn2.OnButtonClicked += DescriptionTabBtn2_OnButtonClicked;
            m_DescriptionTabBtn2.Enabled          = m_Avatars.Count >= 2 ? true : false;
            m_DescriptionTabBtn3 = (UIButton)m_PResult.Elements["\"DescriptionTabButton3\""];
            m_DescriptionTabBtn3.OnButtonClicked += DescriptionTabBtn3_OnButtonClicked;
            m_DescriptionTabBtn3.Enabled          = m_Avatars.Count == 3 ? true : false;

            m_AvatarButton1 = (UIButton)m_PResult.Elements["\"AvatarButton1\""];
            //m_AvatarButton1.AddImage(SimCreateButtonImage);
            m_AvatarButton2 = (UIButton)m_PResult.Elements["\"AvatarButton2\""];
            UIImage SimCreateButtonImg2 = new UIImage(SimCreateButtonImage);

            m_AvatarButton2.AddImage(SimCreateButtonImg2);
            m_AvatarButton3 = (UIButton)m_PResult.Elements["\"AvatarButton3\""];
            UIImage SimCreateButtonImg3 = new UIImage(SimCreateButtonImage);

            m_AvatarButton3.AddImage(SimCreateButtonImg3);

            m_CityButton1 = (UIButton)m_PResult.Elements["\"CityButton1\""];
            m_CityButton1.AddImage(GetImage("\"CityButtonTemplateImage\"", true));
            m_CityButton1.Visible = false;
            m_CityButton2         = (UIButton)m_PResult.Elements["\"CityButton2\""];
            m_CityButton2.AddImage(GetImage("\"CityButtonTemplateImage\"", true));
            m_CityButton2.Visible = false;
            m_CityButton3         = (UIButton)m_PResult.Elements["\"CityButton3\""];
            m_CityButton3.AddImage(GetImage("\"CityButtonTemplateImage\"", true));
            m_CityButton3.Visible = false;

            m_HouseButton1 = (UIButton)m_PResult.Elements["\"HouseButton1\""];
            m_HouseButton1.AddImage(GetImage("\"HouseButtonTemplateImage\"", true));
            m_HouseButton1.Visible = false;
            m_HouseButton2         = (UIButton)m_PResult.Elements["\"HouseButton2\""];
            m_HouseButton2.AddImage(GetImage("\"HouseButtonTemplateImage\"", true));
            m_HouseButton2.Visible = false;
            m_HouseButton3         = (UIButton)m_PResult.Elements["\"HouseButton3\""];
            m_HouseButton3.AddImage(GetImage("\"HouseButtonTemplateImage\"", true));
            m_HouseButton3.Visible = false;

            m_NewAvatarButton1         = (UIButton)m_PResult.Elements["\"NewAvatarButton1\""];
            m_NewAvatarButton1.Image   = SimSelectButtonImage;
            m_NewAvatarButton1.Visible = m_Avatars.Count >= 1 ? false : true;
            m_NewAvatarButton2         = (UIButton)m_PResult.Elements["\"NewAvatarButton2\""];
            m_NewAvatarButton2.Image   = SimCreateButtonImage;
            m_NewAvatarButton2.Visible = m_Avatars.Count >= 2 ? false : true;
            m_NewAvatarButton3         = (UIButton)m_PResult.Elements["\"NewAvatarButton3\""];
            m_NewAvatarButton3.Image   = SimCreateButtonImage;
            m_NewAvatarButton3.Visible = m_Avatars.Count == 3 ? false : true;

            m_DeleteAvatarButton1         = (UIButton)m_PResult.Elements["\"DeleteAvatarButton1\""];
            m_DeleteAvatarButton1.Visible = m_Avatars.Count >= 1 ? true : false;
            m_DeleteAvatarButton2         = (UIButton)m_PResult.Elements["\"DeleteAvatarButton2\""];
            m_DeleteAvatarButton2.Visible = m_Avatars.Count >= 2 ? true : false;
            m_DeleteAvatarButton3         = (UIButton)m_PResult.Elements["\"DeleteAvatarButton3\""];
            m_DeleteAvatarButton3.Visible = m_Avatars.Count == 3 ? true : false;

            m_PersonDescriptionText1         = (UITextEdit)m_PResult.Elements["\"PersonDescriptionText1\""];
            m_PersonDescriptionText1.Visible = m_Avatars.Count >= 1 ? true : false;
            m_PersonDescriptionText2         = (UITextEdit)m_PResult.Elements["\"PersonDescriptionText2\""];
            m_PersonDescriptionText2.Visible = m_Avatars.Count >= 2 ? true : false;
            m_PersonDescriptionText3         = (UITextEdit)m_PResult.Elements["\"PersonDescriptionText3\""];
            m_PersonDescriptionText3.Visible = m_Avatars.Count == 3 ? true : false;

            m_PersonDescriptionScrollUpBtn1         = (UIButton)m_PResult.Elements["\"PersonDescriptionScrollUpButton1\""];
            m_PersonDescriptionScrollUpBtn1.Visible = m_PersonDescriptionText1.Visible ? true : false;
            m_PersonDescriptionScrollUpBtn2         = (UIButton)m_PResult.Elements["\"PersonDescriptionScrollUpButton2\""];
            m_PersonDescriptionScrollUpBtn2.Visible = m_PersonDescriptionText2.Visible ? true : false;
            m_PersonDescriptionScrollUpBtn3         = (UIButton)m_PResult.Elements["\"PersonDescriptionScrollUpButton3\""];
            m_PersonDescriptionScrollUpBtn3.Visible = m_PersonDescriptionText3.Visible ? true : false;

            m_PersonDescriptionScrollDownBtn1         = (UIButton)m_PResult.Elements["\"PersonDescriptionScrollDownButton1\""];
            m_PersonDescriptionScrollDownBtn1.Visible = m_PersonDescriptionText1.Visible ? true : false;
            m_PersonDescriptionScrollDownBtn2         = (UIButton)m_PResult.Elements["\"PersonDescriptionScrollDownButton2\""];
            m_PersonDescriptionScrollDownBtn2.Visible = m_PersonDescriptionText2.Visible ? true : false;
            m_PersonDescriptionScrollDownBtn3         = (UIButton)m_PResult.Elements["\"PersonDescriptionScrollDownButton3\""];
            m_PersonDescriptionScrollDownBtn3.Visible = m_PersonDescriptionText3.Visible ? true : false;

            m_CityNameText1         = (UILabel)m_PResult.Elements["\"CityNameText1\""];
            m_CityNameText1.Visible = false;
            m_CityNameText2         = (UILabel)m_PResult.Elements["\"CityNameText2\""];
            m_CityNameText2.Visible = false;
            m_CityNameText3         = (UILabel)m_PResult.Elements["\"CityNameText3\""];
            m_CityNameText3.Visible = false;

            //TODO: Assign captions to these if a sim has a house...
            m_HouseNameText1 = (UILabel)m_PResult.Elements["\"HouseNameText1\""];
            m_HouseNameText2 = (UILabel)m_PResult.Elements["\"HouseNameText2\""];
            m_HouseNameText3 = (UILabel)m_PResult.Elements["\"HouseNameText3\""];

            m_CreditsButton = (UIButton)m_PResult.Elements["\"CreditsButton\""];

            HitVM.PlayEvent("bkground_selectasim");

            foreach (KeyValuePair <string, UIElement> KVP in m_PResult.Elements)
            {
                RegisterElement(KVP.Value);
            }
        }
Exemplo n.º 3
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 = (UIBackgroundImage)m_PResult.Elements["\"BackgroundImage\""];

            m_CancelBtn = (UIButton)m_PResult.Elements["\"CancelButton\""];
            m_AcceptBtn = (UIButton)m_PResult.Elements["\"AcceptButton\""];

            m_DescriptionScrollUpBtn = (UIButton)m_PResult.Elements["\"DescriptionScrollUpButton\""];
            m_DescriptionScrollUpBtn.OnButtonClicked += M_DescriptionScrollUpBtn_OnButtonClicked;
            m_DescriptionScrollUpBtn.Enabled          = false;
            m_DescriptionScrollDownBtn = (UIButton)m_PResult.Elements["\"DescriptionScrollDownButton\""];
            m_DescriptionScrollDownBtn.OnButtonClicked += M_DescriptionScrollDownBtn_OnButtonClicked;
            m_DescriptionScrollDownBtn.Enabled          = false;

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

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

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

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

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

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

            m_HeadSkinBrowser = new UIHeadBrowser(this, m_PResult.Controls["\"HeadSkinBrowser\""], 1, AvatarSex.Female);
            m_HeadSkinBrowser.OnButtonClicked += M_HeadSkinBrowser_OnButtonClicked;
            m_HeadSkinBrowser.DrawOrder        = (int)DrawOrderEnum.UI;
            RegisterElement(m_HeadSkinBrowser);
            m_BodySkinBrowser = new UIBodyBrowser(this, m_PResult.Controls["\"BodySkinBrowser\""], 1, AvatarSex.Female);
            m_BodySkinBrowser.OnButtonClicked += M_BodySkinBrowser_OnButtonClicked;
            m_BodySkinBrowser.DrawOrder        = (int)DrawOrderEnum.UI;
            RegisterElement(m_BodySkinBrowser);

            AdultAvatar Avatar = new AdultAvatar(Manager.Device, Manager.HeadShader);

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

            m_Avatar = new Sim(Manager.Device, Manager.RenderCamera, Avatar);

            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;
            RegisterElement(m_ExitDialog);

            m_NameTextEdit = new TextBox(new Rectangle(22, 52, 230, 18), 64, "", Manager.Device, 9,
                                         StandardTxtColor, StandardTxtColor, 30, this, false);
            m_NameTextEdit.Name             = "NameTextEdit"; //This should be set for all UIElements that need to receive input.
            m_NameTextEdit.DrawOrder        = (int)DrawOrderEnum.UI;
            m_DescriptionTextEdit           = (UITextEdit)m_PResult.Elements["\"DescriptionTextEdit\""];
            m_DescriptionTextEdit.DrawOrder = (int)DrawOrderEnum.UI;

            KeyboardInput.Initialize(Manager, 500f, 20);

            HitVM.PlayEvent("bkground_createasim");

            Manager.AddScreen(m_VitaboyScreen);

            foreach (KeyValuePair <string, UIElement> KVP in m_PResult.Elements)
            {
                RegisterElement(KVP.Value);
            }
        }