示例#1
0
 public void AppendTextBox(string value)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <string>(AppendTextBox), new object[] { value });
         return;
     }
     Message_Box.AppendText("\r\n" + value);
 }
 //First checks that all required fields are filled
 //Validates Dates and User, see RequestValitation method
 //If these checks pass, clean the error message.
 //Then cast the user from the combobox into a user object and removes all commas (,) from the text
 //Then create a UserFreeRequest with dates, message and username
 //Then saves user and clears messagebox.
 private void SendRequest_Click(object sender, RoutedEventArgs e)
 {
     if (Start_Date.SelectedDate.HasValue && End_Date.SelectedDate.HasValue && SelectUserComboBox.SelectedItem != null)
     {
         if (RequestValitation(Start_Date.SelectedDate.Value, End_Date.SelectedDate.Value, SelectUserComboBox.SelectedItem.ToString()))
         {
             ErrorMessage.Content = "";
             User            user          = SelectUserComboBox.SelectedItem as User;
             string          message       = Message_Box.Text.Replace(",", "");
             UserFreeRequest ResultRequest = new UserFreeRequest(Start_Date.SelectedDate.Value, End_Date.SelectedDate.Value, message, user.UserName);
             ResultRequest.SaveUserRequest();
             Message_Box.Clear();
         }
         else
         {
             ErrorMessage.Content = "The selected start date is after the end date";
         }
     }
 }
示例#3
0
        private void SetSprites()
        {
            BattlerOffset = new Vector2(this.OffscreenOffset, 0);

            // Platform
            Platform       = new Battle_Platform(false);
            Platform.loc_1 = new Vector2((BATTLER_X - 123) + 127 - 87, 88);
            Platform.loc_2 = new Vector2((BATTLER_X - 123) + 127, 88);

            int    terrainTag  = this.Unit.terrain_id();
            string terrainName = Global.data_terrains[terrainTag].PlatformName;

            string platformName;

            if (Global.game_system.preparations)
            {
                platformName = @"Graphics/Battlebacks/" + "Floor" + "-Melee"; //@Debug
            }
            else if (Global.content_exists(@"Graphics/Battlebacks/" + terrainName + "-Melee"))
            {
                platformName = @"Graphics/Battlebacks/" + terrainName + "-Melee";
            }
            else
            {
                platformName = @"Graphics/Battlebacks/" + "Plains" + "-Melee";
            }
            Platform.platform_1 = Global.Content.Load <Texture2D>(platformName);
            Platform.platform_2 = Platform.platform_1;

            // Text Box
            Message            = new Message_Box(88, 144, 224, 2, false, "White");
            Message.text_speed = Constants.Message_Speeds.Max;
            Message.silence();
            Message.block_skip();
            Message.stereoscopic = Config.REEL_TEXT_BOX_DEPTH;

            TextBg              = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Class_Reel_Window"));
            TextBg.loc          = new Vector2(80, 144);
            TextBg.stereoscopic = Config.REEL_TEXT_BOX_DEPTH;

            // Name
            Name         = new TextSprite();
            Name.loc     = new Vector2(128, 8);
            Name.visible = false;
            Name.SetFont(Config.REEL_FONT, Global.Content);
            Name.stereoscopic  = Config.REEL_CLASS_NAME_DEPTH;
            NameBg             = new TextSprite();
            NameBg.loc         = new Vector2(128, 8);
            NameBg.draw_offset = new Vector2(2, 2);
            NameBg.visible     = false;
            NameBg.SetFont(Config.REEL_FONT, Global.Content);
            NameBg.tint         = new Color(0, 0, 0, 255);
            NameBg.stereoscopic = Config.REEL_CLASS_NAME_SHADOW_DEPTH;

            if (Global.game_system.preparations && !Global.game_state.battle_active)
            {
                // Background
                Background         = new Menu_Background();
                Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Preparation_Background");
                (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
                (Background as Menu_Background).tile = new Vector2(1, 2);
                Background.stereoscopic = Config.PREP_BG_DEPTH;
            }
        }