// 吹き出しを生成
    void CreateBalloon(BalloonType type)
    {
        Vector3 balloonPoint = new Vector3(0, BALLOON_OFFSET_X, 0);
        string  balloonPath  = "";

        switch (type)
        {
        case BalloonType.Numbers:
            balloonPath = PATH + this.myOrder;
            this.sePlayer.SendMessage("Play", SE.SE_10);
            break;

        case BalloonType.Angry:
            balloonPath = PATH + BalloonType.Angry.ToString();
            break;

        case BalloonType.Hit:
            balloonPath = PATH + BalloonType.Hit.ToString();
            break;
        }

        GameObject balloonPrefab = Resources.Load(balloonPath) as GameObject;

        this.orderBalloon = Instantiate(balloonPrefab, transform.position + balloonPoint, Quaternion.identity) as GameObject;
        this.orderBalloon.transform.parent = gameObject.transform;
    }
    // 吹き出しを生成
    void CreateBalloon(BalloonType type)
    {
        Vector3 balloonPoint = new Vector3(0, BALLOON_OFFSET_X, 0);
        string balloonPath = "";

        switch (type)
        {
            case BalloonType.Numbers:
                balloonPath = PATH + this.myOrder;
                this.sePlayer.SendMessage("Play", SE.SE_10);
                break;

            case BalloonType.Angry:
                balloonPath = PATH + BalloonType.Angry.ToString();
                break;

            case BalloonType.Hit:
                balloonPath = PATH + BalloonType.Hit.ToString();
                break;
        }

        GameObject balloonPrefab = Resources.Load(balloonPath) as GameObject;
        this.orderBalloon = Instantiate(balloonPrefab, transform.position + balloonPoint, Quaternion.identity) as GameObject;
        this.orderBalloon.transform.parent = gameObject.transform;
    }
Пример #3
0
    public static Color GetColorByBalloonType(BalloonType type)
    {
        Color tempCol = new Color();

        switch (type)
        {
        case BalloonType.Red:
            tempCol = Color.red;
            break;

        case BalloonType.Yellow:
            tempCol = Color.yellow;
            break;

        case BalloonType.Lime:
            tempCol = Color.HSVToRGB(0.12f, 1, 1);
            break;

        case BalloonType.Green:
            tempCol = Color.green;
            break;

        case BalloonType.Pink:
            tempCol = Color.HSVToRGB(0.9f, 0.45f, 1);
            break;

        case BalloonType.Orange:
            tempCol = Color.HSVToRGB(0.38f, 1, 1);
            break;
        }
        return(tempCol);
    }
        /// <summary>
        /// Initializes a new instance of the <see cref="Balloon" /> class.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="caption">The caption.</param>
        /// <param name="balloonType">Type of the balloon.</param>
        /// <param name="maxHeight">The maximum height.</param>
        public Balloon(Control control, string caption, BalloonType balloonType, double maxHeight = 0)
        {
            InitializeComponent();
            this.control = control;

            Application.Current.MainWindow.Closing         += this.OwnerClosing;
            Application.Current.MainWindow.LocationChanged += this.MainWindowLocationChanged;

            LinearGradientBrush brush;

            if (balloonType == BalloonType.Help)
            {
                this.imageType.Source = Properties.Resources.help.ToBitmapImage();
                brush = this.FindResource("HelpGradient") as LinearGradientBrush;
            }
            else
            {
                this.imageType.Source = Properties.Resources.Information.ToBitmapImage();
                brush = this.FindResource("InfoGradient") as LinearGradientBrush;
            }

            this.borderBalloon.SetValue(Control.BackgroundProperty, brush);

            if (maxHeight > 0)
            {
                this.scrollViewerCaption.Height = maxHeight;
            }

            this.textBlockCaption.Text = caption;
            this.CalcPosition();
        }
Пример #5
0
    public void Initialization(BalloonType balloonType)
    {
        var childBlock = A.Dummy <IBlock>();
        var sut        = new BalloonNode(balloonType, childBlock);

        sut.BallonType.Should().Be(balloonType);
        sut.ChildBlock.Should().Be(childBlock);
    }
Пример #6
0
        public ActionResult DeleteConfirmed(int id)
        {
            BalloonType balloonType = db.BalloonTypes.Find(id);

            db.BalloonTypes.Remove(balloonType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #7
0
    public void Initialization(BalloonType balloonType)
    {
        var sut = new BalloonTextNode(textSource, balloonType, null);

        sut.TextSource.Should().Be(textSource);
        sut.BalloonType.Should().Be(balloonType);
        sut.ChoiceNode.Should().BeNull();
    }
Пример #8
0
    public void Initialization(BalloonType balloonType, bool isProtagonist, string description)
    {
        var sut = new BalloonCloseEvent(balloonType, isProtagonist);

        sut.BalloonType.Should().Be(balloonType);
        sut.IsProtagonist.Should().Be(isProtagonist);
        sut.ToString().Should().Be(description);
    }
Пример #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Balloon" /> class.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="caption">The caption.</param>
        /// <param name="balloonType">Type of the balloon.</param>
        /// <param name="maxHeight">The maximum height.</param>
        /// <param name="autoWidth">if set to <c>true</c> [automatic width].</param>
        /// <param name="placeInCenter">if set to <c>true</c> [place in center].</param>
        /// <param name="showCloseButton">if set to <c>true</c> [show close button].</param>
        public Balloon(Control control, string caption, BalloonType balloonType, double maxHeight = 0, bool autoWidth = false, bool placeInCenter = true, bool showCloseButton = true)
        {
            InitializeComponent();
            this.control         = control;
            this.placeInCenter   = placeInCenter;
            this.ShowCloseButton = showCloseButton;

            if (placeInCenter)
            {
                Application.Current.MainWindow.LocationChanged += this.MainWindowLocationChanged;
                control.LayoutUpdated += this.MainWindowLocationChanged;
            }

            if (showCloseButton)
            {
                this.imageClose.Visibility = Visibility.Visible;
            }
            else
            {
                this.imageClose.Visibility = Visibility.Collapsed;
            }

            Application.Current.MainWindow.Closing += this.OwnerClosing;
            LinearGradientBrush brush;

            if (balloonType == BalloonType.Help)
            {
                this.imageType.Source = Properties.Resources.help.ToBitmapImage();
                brush = this.FindResource("HelpGradient") as LinearGradientBrush;
            }
            else if (balloonType == BalloonType.Information)
            {
                this.imageType.Source = Properties.Resources.Information.ToBitmapImage();
                brush = this.FindResource("InfoGradient") as LinearGradientBrush;
            }
            else
            {
                this.imageType.Source = Properties.Resources.Warning.ToBitmapImage();
                brush = this.FindResource("WarningGradient") as LinearGradientBrush;
            }

            this.borderBalloon.SetValue(Control.BackgroundProperty, brush);

            if (autoWidth)
            {
                this.SizeToContent = SizeToContent.WidthAndHeight;
                this.textBlockCaption.TextWrapping = TextWrapping.NoWrap;
            }

            this.textBlockCaption.Text = caption;

            if (maxHeight > 0)
            {
                this.scrollViewerCaption.MaxHeight = maxHeight;
            }

            this.CalcPosition();
        }
Пример #10
0
 public BalloonContentUpdateMessage(string balloonID, BalloonType type, string label, string content, string url, string imageURL)
     : base(MessageType.BalloonContentUpdate, Tag, balloonID)
 {
     m_type = type;
     m_label = label;
     m_content = content;
     m_url = url;
     m_imageUrl = imageURL;
 }
Пример #11
0
    public void Initialization(string text, BalloonType balloonType, bool isProtagonist, string description)
    {
        var sut = new BalloonTextEvent(text, balloonType, isProtagonist, null);

        sut.Text.Should().Be(text);
        sut.BalloonType.Should().Be(balloonType);
        sut.IsProtagonist.Should().Be(isProtagonist);
        sut.ToString().Should().Be(description);
        sut.Choice.Should().BeNull();
    }
Пример #12
0
 public ActionResult Edit([Bind(Include = "TypeID,IsMylar,IsLatex")] BalloonType balloonType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(balloonType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(balloonType));
 }
Пример #13
0
        public ActionResult Create([Bind(Include = "TypeID,IsMylar,IsLatex")] BalloonType balloonType)
        {
            if (ModelState.IsValid)
            {
                db.BalloonTypes.Add(balloonType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(balloonType));
        }
Пример #14
0
    public static string ProtagSymbol(BalloonType balloonType, bool isProtagonist)
    {
        switch (balloonType)
        {
        case BalloonType.Speech:
        case BalloonType.Thought:
            return(ProtagSymbol(isProtagonist));

        default:
            return(string.Empty);
        }
    }
Пример #15
0
        // GET: BalloonTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BalloonType balloonType = db.BalloonTypes.Find(id);

            if (balloonType == null)
            {
                return(HttpNotFound());
            }
            return(View(balloonType));
        }
Пример #16
0
    public async Task OnLeaveAsyncShouldRaiseEvent(BalloonType balloonType, bool isProtagonist)
    {
        var tester = new Tester(balloonType, isProtagonist);
        var sut    = tester.BalloonNode;

        await sut.LeaveAsync(tester.Context);

        tester.Invoker.ShouldContainSingle <IBalloonCloseEvent>(
            i => i.Should().BeEquivalentTo(new
        {
            BalloonType   = balloonType,
            IsProtagonist = isProtagonist
        })
            );
    }
        // Use this for initialization
        void Awake()
        {
            balloonType      = BalloonType.NONE;
            currentCoroutine = null;

            StartCoroutine(MainCoroutine());                     // 메인 코루틴을 실행 시킨다.

            stateMachine = new StateMachine <Stage1Enemy>(this); // 스테이트 머신 생성

            if (ModelData != null)
            {
                // 캐릭터의 얼굴 애니메이션을 위한 morph 세팅, morph는 에셋을 구입하여 사용
                megaMorph = (MegaMorph)ModelData.GetComponent <MegaMorph>();
                SetMorph(1);
            }
        }
Пример #18
0
        public Tester(BalloonType balloonType, bool isProtagonist)
        {
            var state = A.Dummy <INavigationState>();

            state.PersonName      = "alpha";
            state.ProtagonistName = isProtagonist ? "alpha" : "beta";

            var context = A.Fake <INavigationContext>(i => i.Strict());

            A.CallTo(() => context.State).Returns(state);

            var childBlock = A.Dummy <IBlock>();

            BalloonNode = new BalloonNode(balloonType, childBlock);
            Context     = context;
            Invoker     = new TestInvoker(context);
        }
Пример #19
0
 public void ShowBalloon(BalloonType baloonType, string title, string message, int timeout)
 {
     switch (baloonType) {
         case BalloonType.Error:
             notifyIcon1.ShowBalloonTip(timeout, title, message, ToolTipIcon.Error);
             break;
         case BalloonType.Exclamation:
             notifyIcon1.ShowBalloonTip(timeout, title, message, ToolTipIcon.Warning);
             break;
         case BalloonType.Information:
             notifyIcon1.ShowBalloonTip(timeout, title, message, ToolTipIcon.Info);
             break;
         default:
             notifyIcon1.ShowBalloonTip(timeout, title, message, ToolTipIcon.None);
             break;
     }
 }
Пример #20
0
    private void Start()
    {
        rb2d = GetComponent <Rigidbody2D>();

        int randomType = Random.Range(0, 3);

        balloonType = (BalloonType)randomType;

        GetComponent <SpriteRenderer>().sprite = sprites[randomType];

        float moveSpeed = baseSpeed;

        if (balloonType == BalloonType.Blue)
        {
            moveSpeed *= 2;
        }

        rb2d.velocity = new Vector2(0.0f, moveSpeed);
    }
Пример #21
0
    /// <summary>
    /// Set balloon type/color/airLimit/size.
    /// Use this only when spawn this.
    /// </summary>
    /// <param name="type"></param>
    public void InitializeBalloon(BalloonType type, Player newOwner)
    {
        Owner             = newOwner;
        PresentBallonType = type;
        airLimit          = (float)type;
        originCol         = GetColorByBalloonType(type);
        GetComponentInChildren <MeshRenderer>().
        material.SetColor("_Color", originCol);
        float sizeDelta = ((float)type -
                           (float)(BalloonType)System.Enum.GetValues(typeof(BalloonType)).GetValue(0));

        transform.localScale = transform.localScale * initialScaleRatio
                               + sizeDelta * scalePerAirDelta * Vector3.one;
        initialScale = transform.localScale;
        initialQuat  = transform.rotation;
        scalePerStep = (initialScale / initialScaleRatio -
                        initialScale) / maxScaleStep;
        GetComponent <Rigidbody>().detectCollisions = false;
        inflateSFX = GetComponent <AudioSource>();
    }
Пример #22
0
    void Start()
    {
        Instance = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();

        rb2d = GetComponent <Rigidbody2D>();

        int randomType = Random.Range(0, 4);

        balloonType = (BalloonType)randomType;

        GetComponent <SpriteRenderer>().sprite = ballons[randomType];

        float moveSpeed = Random.Range(0, 4);

        if (balloonType == BalloonType.Blue)
        {
            moveSpeed = 10;
        }

        rb2d.velocity = new Vector2(0.0f, moveSpeed);
    }
Пример #23
0
    public async Task OnEnterAsyncShouldRaiseEvent(BalloonType balloonType, bool isProtagonist)
    {
        state.PersonName      = "alpha";
        state.ProtagonistName = isProtagonist ? "alpha" : "beta";

        var sut     = new BalloonTextNode(textSource, balloonType, null);
        var invoker = new TestInvoker(context);

        var ret = await sut.EnterAsync(context);

        ret.Should().BeNull();

        invoker.ShouldContainSingle <IBalloonTextEvent>(
            i => i.Should().BeEquivalentTo(new
        {
            Text          = balloonText,
            BalloonType   = balloonType,
            IsProtagonist = isProtagonist,
            Choice        = (IChoice)null
        })
            );
    }
Пример #24
0
 public BalloonNode(BalloonType ballonType, IBlock childBlock)
 => (BallonType, ChildBlock) = (ballonType, childBlock);
Пример #25
0
        /// <summary>
        /// modifyNotifyIcon
        /// </summary>
        /// <returns>true on success</returns>
        private bool modifyNotifyIcon(int flags, string tip, string infoTitle, string info, BalloonType balloonType)
        {
            NOTIFYICONDATA data = getNOTIFYICONDATA(icon.Handle, flags, tip, infoTitle, info, balloonType);

            return(Shell_NotifyIcon(NIM_MODIFY, ref data));
        }
Пример #26
0
        /// <summary>
        /// getNOTIFYICONDATA
        /// </summary>
        private NOTIFYICONDATA getNOTIFYICONDATA(IntPtr iconHwnd, int flags, string tip, string infoTitle, string info, BalloonType balloonType)
        {
            NOTIFYICONDATA data = new NOTIFYICONDATA();

            data.cbSize             = Marshal.SizeOf(data);
            data.hwnd               = messageLoopHandle;
            data.uID                = uID;
            data.uFlags             = flags;
            data.uCallbackMessage   = WM_NOTIFY_TRAY;
            data.hIcon              = iconHwnd;
            data.uTimeoutAndVersion = 10 * 1000;
            data.dwInfoFlags        = balloonType;

            data.szTip       = tip;
            data.szInfoTitle = infoTitle;
            data.szInfo      = info;

            return(data);
        }
Пример #27
0
 /// <summary>
 /// Displays a balloon ToolTip for the notification icon.
 /// </summary>
 /// <param name="InfoTitle">The title for the balloon ToolTip.</param>
 /// <param name="Info">The text for the balloon ToolTip.</param>
 /// <param name="BalloonType">A flag to add an icon to a balloon ToolTip.</param>
 public void DisplayBalloonTooltip(string InfoTitle, string Info, BalloonType BalloonType)
 {
     modifyNotifyIcon(NIF_ICON | NIF_INFO, text, InfoTitle, Info, BalloonType);
 }
Пример #28
0
 public BalloonCloseEvent(BalloonType ballonType, bool isProtagonist)
 => (BalloonType, IsProtagonist) = (ballonType, isProtagonist);
Пример #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Balloon"/> class.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="balloonType">Type of the balloon.</param>
 /// <param name="placeInCenter">if set to <c>true</c> [place in center].</param>
 public Balloon(Control control, string caption, BalloonType balloonType, bool placeInCenter)
     : this(control, caption, balloonType, 0, false, placeInCenter)
 {
 }
Пример #30
0
    /// <summary>
    /// Initializes different balloon types with different rewards and visualizations.
    /// </summary>
    /// <param name="type">Type of Balloon</param>
    public void InitializeBalloon(BalloonType type)
    {
        myBaloonType = type;

        AssignPoints();
    }
Пример #31
0
 public void ProtagSymbol1(BalloonType balloonType, bool isProtagonist, string expected)
 {
     Helper.ProtagSymbol(balloonType, isProtagonist).Should().Be(expected);
 }
Пример #32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Balloon"/> class.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="title">The title.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="balloonType">Type of the balloon.</param>
 /// <param name="placeInCenter">if set to <c>true</c> [place in center].</param>
 /// <param name="showCloseButton">if set to <c>true</c> [show close button].</param>
 public Balloon(Control control, string title, string caption, BalloonType balloonType, bool placeInCenter, bool showCloseButton)
     : this(control, caption, balloonType, 0, 0, false, placeInCenter, showCloseButton, title)
 {
 }
Пример #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Balloon" /> class.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="title">The title.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="balloonType">Type of the balloon.</param>
 public Balloon(Control control, string title, string caption, BalloonType balloonType)
     : this(control, caption, balloonType, 0, 0, false, true, true, title)
 {
 }
Пример #34
0
 public void ShowBalloon(BalloonType baloonType, string title, string message, int timeout)
 {
 }
Пример #35
0
 public void ShowBalloon(BalloonType baloonType, string title, string message, int timeout)
 {
     ((StatusForm) Program.Engine.UploadNotificationSystem).Invoke(
         new Action(() => Program.Core.ShowBalloon(baloonType, title, message, timeout)));
 }