Beispiel #1
0
 public virtual void UpClick(LComponent comp, float x, float y)
 {
     if (!_enabled)
     {
         return;
     }
     if (_downClick)
     {
         if (_upTouch != null)
         {
             _upTouch.On(x, y);
         }
         if (clicks != null)
         {
             for (int i = 0, size = clicks.size; i < size; i++)
             {
                 ClickListener listener = clicks.Get(i);
                 if (listener != null && listener != this)
                 {
                     listener.UpClick(comp, x, y);
                 }
             }
         }
         _downClick = false;
     }
 }
Beispiel #2
0
        public override void CreateUI(GLEx g, int x, int y, LComponent component,
                                      LTexture[] buttonImage)
        {
            if (Touch.IsUp())
            {
                FreeClick();
            }

            batch.Begin();
            batch.Draw(back, x, y, backWidth, backHeight);
            if (isClick)
            {
                if (angle < 360)
                {
                    angle += 1;
                }
                else
                {
                    angle = 1;
                }
                batch.Draw(dot, x + centerX, y + centerY, dotWidth, dotHeight,
                           angle);
            }
            batch.Draw(fore, (x + (backWidth - baseWidth) * 0.5f),
                       (y + (backHeight - baseHeight) * 0.5f), baseWidth,
                       baseHeight);
            batch.End();
        }
Beispiel #3
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
                               LTexture[] buttonImage)
 {
     if (Touch.IsUp())
     {
         FreeClick();
     }
     g.BeginBatch(BlendState.NonPremultiplied);
     g.DrawBatch(back, x, y, backWidth, backHeight);
     if (isClick)
     {
         if (angle < 360)
         {
             angle += 1;
         }
         else
         {
             angle = 1;
         }
         g.DrawBatch(dot, x + centerX, y + centerY, dotWidth, dotHeight,
                     angle);
     }
     g.DrawBatch(fore, (x + (backWidth - baseWidth) * 0.5f),
                 (y + (backHeight - baseHeight) * 0.5f), baseWidth,
                 baseHeight);
     g.EndBatch();
 }
Beispiel #4
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
         LTexture[] buttonImage)
 {
     if (Touch.IsUp())
     {
         FreeClick();
     }
     g.BeginBatch(BlendState.NonPremultiplied);
     g.DrawBatch(back, x, y, backWidth, backHeight);
     if (isClick)
     {
         if (angle < 360)
         {
             angle += 1;
         }
         else
         {
             angle = 1;
         }
         g.DrawBatch(dot, x + centerX , y + centerY , dotWidth, dotHeight,
                 angle);
     }
     g.DrawBatch(fore, (x + (backWidth - baseWidth) * 0.5f),
             (y + (backHeight - baseHeight) * 0.5f), baseWidth,
             baseHeight);
     g.EndBatch();
 }
Beispiel #5
0
 public void DownClick(LComponent comp, float x, float y)
 {
     if (comp.Tag is Screen)
     {
         ((Screen)comp.Tag).SetScreen(new MyAVGScreen());
     }
 }
Beispiel #6
0
        public override void Build()
        {
            FrameWorks.Component Component;
            #region Case

            // Left Side
            Component = new Component(2878, "LSide", this, 1, this.SubAssemblyHieght, SubAssemblyDepth);
            Component.ComponentThick     = 0.75m;
            Component.ComponentGroupType = "Case";
            this.Components.Add(Component);

            // Right Side
            Component = new Component(2878, "RSide", this, 1, this.SubAssemblyHieght, SubAssemblyDepth);
            Component.ComponentThick     = 0.75m;
            Component.ComponentGroupType = "Case";
            this.Components.Add(Component);

            // Bottom
            Component = new Component(2878, "Bottom ", this, 1, this.SubAssemblyWidth - 1.5m, SubAssemblyDepth);
            Component.ComponentThick     = 0.75m;
            Component.ComponentGroupType = "Case";
            this.Components.Add(Component);
            //Top
            Component = new Component(2878, "Top", this, 1, this.SubAssemblyWidth - 1.5m, SubAssemblyDepth);
            Component.ComponentThick     = 0.75m;
            Component.ComponentGroupType = "Case";
            this.Components.Add(Component);
            // Back
            Component = new Component(2880, "Back", this, 1, this.SubAssemblyHieght - 1.0m);
            Component.ComponentWidth     = this.SubAssemblyWidth - 1.0m;
            Component.ComponentThick     = 0.25m;
            Component.ComponentGroupType = "Case";
            this.Components.Add(Component);

            // Test
            Component = new Component(795, "Extrusion", this, 1, this.SubAssemblyHieght - 1.0m);
            Component.ComponentWidth     = this.SubAssemblyWidth - 1.0m;
            Component.ComponentThick     = 1.25m;
            Component.ComponentGroupType = "Case";
            this.Components.Add(Component);


            this.Components.Add(new Component(2893, "21-Runner", this, 1, 22.0m));

            #endregion

            #region Labor

            Component = new LComponent("Drafting", this, 1.5m, 85.0m);
            this.Components.Add(Component);
            #endregion

            foreach (FrameWorks.Component p in this.Components)
            {
                // needed to tickle the cost forcing calculation
                decimal d = p.Area;
                m_calculatedCost += p.CalculatedCost;
            }
        }
Beispiel #7
0
 public override void Add(LComponent c)
 {
     if (desktop == null)
     {
         InitDesktop();
     }
     desktop.Add(c);
 }
Beispiel #8
0
		public override void CreateUI(GLEx g, int x, int y, LComponent component,
				LTexture[] buttonImage) {
			if (visible && goalPath != null) {
				g.SetLineWidth(lineWidth);
				g.SetColor(color);
				g.Draw(goalPath);
				g.ResetLineWidth();
				g.ResetColor();
			}
		}
Beispiel #9
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
                               LTexture[] buttonImage)
 {
     if (this.visible)
     {
         g.SetAlpha(0.5f);
         g.DrawTexture(controlBase, x, y, baseWidth, baseHeight);
         g.DrawTexture(controlDot, x + centerX, y + centerY, dotWidth, dotHeight);
         g.SetAlpha(1f);
     }
 }
Beispiel #10
0
            void ClickListener.DoClick(LComponent comp)
            {
                LLKScreen s = (LLKScreen)StaticCurrentSceen;

                if (comp.GetAlpha() >= 1.0 && s.overFlag)
                {
                    s.over = null;
                    s.RemoveAll();
                    s.Stage(s.stageNo);
                    s.GetSprites().SetVisible(true);
                }
            }
Beispiel #11
0
 public void DoClick(LComponent comp)
 {
     if (!action.IsPressed())
     {
         action.Press();
         if (comp.Tag is Screen)
         {
             Screen screen = (Screen)comp.Tag;
             screen.ReplaceScreen(new MyAVGScreen(), MoveMethod.FROM_LEFT);
         }
     }
 }
Beispiel #12
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
                               LTexture[] buttonImage)
 {
     if (visible && goalPath != null)
     {
         g.SetLineWidth(lineWidth);
         g.SetColor(color);
         g.Draw(goalPath);
         g.ResetLineWidth();
         g.ResetColor();
     }
 }
Beispiel #13
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
                               LTexture[] buttonImage)
 {
     if (!visible)
     {
         return;
     }
     if (message.Length != 0)
     {
         DrawMessage(g);
     }
     flag.Draw(g);
 }
Beispiel #14
0
 public void DownClick(LComponent comp, float x, float y)
 {
     if (comp.Tag is AVGScreen)
     {
         AVGScreen screen = (AVGScreen)comp.Tag;
         // 解除锁定
         screen.SetLocked(false);
         // 触发事件
         // click();
         // 删除当前按钮
         screen.Remove(comp);
     }
 }
Beispiel #15
0
            public void DoClick(LComponent comp)
            {
                if (comp.Tag is LLKScreen)
                {
                    LMessage  message = (LMessage)comp;
                    LLKScreen screen  = (LLKScreen)comp.Tag;
                    if (!screen.init)
                    {
                        if (screen.count == 0)
                        {
                            screen.role.SetImage(screen.GetImage(12));
                            message.SetMessage(START_MES);
                        }
                        else if (message.IsComplete())
                        {
                            screen.CallEvent(new _Runnable(screen, message));
                        }
                        screen.count++;
                    }

                    if (HELP_MES.Equals(message.GetMessage(), StringComparison.InvariantCultureIgnoreCase) && message.IsComplete())
                    {
                        message.SetVisible(false);
                        screen.select = new LSelect(screen.GetImage(14), (screen
                                                                          .GetWidth() - 460) / 2,
                                                    screen.GetHeight() - 126 - 10);
                        screen.select.Tag = screen;
                        screen.select.SetFontColor(LColor.black);
                        screen.select.SetAlpha(0.8f);
                        screen.select.SetTopOffset(-5);
                        screen.select.SetMessage(new String[] { "1.刷新", "2.提示", "3.炸弹",
                                                                "4.取消" });
                        screen.select.Click = new SelectClick();
                        screen.Add(screen.select);
                        return;
                    }
                    else if ((EASY_MES.Equals(message.GetMessage(), StringComparison.InvariantCultureIgnoreCase) || message.GetMessage()
                              .StartsWith(SORRY)) &&
                             message.IsComplete())
                    {
                        screen.mes.SetVisible(false);
                        screen.role.SetVisible(false);
                        screen.helpRole.SetVisible(true);
                        if (screen.stage != null)
                        {
                            screen.stage.SetVisible(true);
                        }
                    }
                }
            }
Beispiel #16
0
        public override void CreateUI(GLEx g, int x, int y, LComponent component,
                                      LTexture[] buttonImage)
        {
            LButton button = (LButton)component;

            if (buttonImage != null)
            {
                if (!button.IsEnabled())
                {
                    g.DrawTexture(buttonImage[3], x, y);
                }
                else if (button.IsTouchPressed())
                {
                    g.DrawTexture(buttonImage[2], x, y);
                }
                else if (button.IsTouchOver())
                {
                    g.DrawTexture(buttonImage[1], x, y);
                }
                else
                {
                    if (type == 1)
                    {
                        g.DrawTexture(buttonImage[0], x, y, LColor.gray);
                    }
                    else
                    {
                        g.DrawTexture(buttonImage[0], x, y);
                    }
                }
            }
            if (text != null)
            {
                LFont old = g.GetFont();
                g.SetFont(font);
                g.SetColor(fontColor);
                g.DrawString(
                    text,
                    x + button.GetOffsetLeft()
                    + (button.GetWidth() - font.StringWidth(text)) / 2,
                    y + button.GetOffsetTop()
                    + (button.GetHeight() - font.GetLineHeight()) / 2
                    + font.GetLineHeight());
                g.SetFont(old);
                g.ResetColor();
            }
        }
Beispiel #17
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
         LTexture[] buttonImage)
 {
     LButton button = (LButton)component;
     if (buttonImage != null)
     {
         if (!button.IsEnabled())
         {
             g.DrawTexture(buttonImage[3], x, y);
         }
         else if (button.IsTouchPressed())
         {
             g.DrawTexture(buttonImage[2], x, y);
         }
         else if (button.IsTouchOver())
         {
             g.DrawTexture(buttonImage[1], x, y);
         }
         else
         {
             if (type == 1)
             {
                 g.DrawTexture(buttonImage[0], x, y, LColor.gray);
             }
             else
             {
                 g.DrawTexture(buttonImage[0], x, y);
             }
         }
     }
     if (text != null)
     {
         LFont old = g.GetFont();
         g.SetFont(font);
         g.SetColor(fontColor);
         g.DrawString(
                 text,
                 x + button.GetOffsetLeft()
                         + (button.GetWidth() - font.StringWidth(text)) / 2,
                 y + button.GetOffsetTop()
                         + (button.GetHeight() - font.GetLineHeight()) / 2
                         + font.GetLineHeight());
         g.SetFont(old);
         g.ResetColor();
     }
 }
Beispiel #18
0
 public virtual void DoClick(LComponent comp)
 {
     if (!_enabled)
     {
         return;
     }
     if (_allTouch != null)
     {
         _allTouch.On(SysTouch.GetX(), SysTouch.GetY());
     }
     if (clicks != null)
     {
         for (int i = 0, size = clicks.size; i < size; i++)
         {
             ClickListener listener = clicks.Get(i);
             if (listener != null && listener != this)
             {
                 listener.DoClick(comp);
             }
         }
     }
 }
Beispiel #19
0
    public override void CreateUI(GLEx g, int x, int y, LComponent component,
			LTexture[] buttonImage) {
     

	}
Beispiel #20
0
 public void DragClick(LComponent comp, float x, float y)
 {
 }
Beispiel #21
0
 public void UpClick(LComponent comp, float x, float y)
 {
 }
Beispiel #22
0
 public void DoClick(LComponent comp)
 {
 }
Beispiel #23
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
         LTexture[] buttonImage)
 {
     if (!visible)
     {
         return;
     }
     if (message.Length != 0)
     {
         DrawMessage(g);
     }
     flag.Draw(g);
 }
Beispiel #24
0
        public override void CreateUI(GLEx g, int x, int y, LComponent component,
				LTexture[] buttonImage) {
			if (visible) {
				g.SetAlpha(0.5f);
				g.DrawTexture(controlBase, x, y, baseWidth, baseHeight);
				g.DrawTexture(controlDot, x + centerX, y + centerY, dotWidth,
						dotHeight);
				g.SetAlpha(1f);
			}
		}
Beispiel #25
0
 public void DownClick(LComponent comp, float x, float y)
 {
 }
Beispiel #26
0
 public Bind(Object o)
 {
     if (o is Actor)
     {
         type                   = 1;
         actorObject            = (Actor)o;
         this.isBindPos         = true;
         this.isBindGetPos      = true;
         this.isBindRotation    = true;
         this.isBindGetRotation = true;
         this.isBindUpdate      = true;
         this.isBindScale       = true;
         this.isBindSize        = true;
     }
     else if (o is Shape)
     {
         type                   = 2;
         shapeObject            = (Shape)o;
         this.isBindPos         = true;
         this.isBindGetPos      = true;
         this.isBindRotation    = true;
         this.isBindGetRotation = true;
         this.isBindUpdate      = false;
         this.isBindScale       = true;
         this.isBindSize        = true;
     }
     else if (o is LComponent)
     {
         type                   = 3;
         compObject             = (LComponent)o;
         this.isBindPos         = true;
         this.isBindGetPos      = true;
         this.isBindRotation    = false;
         this.isBindGetRotation = false;
         this.isBindUpdate      = true;
         this.isBindScale       = false;
         this.isBindSize        = true;
     }
     else if (o is LObject)
     {
         type                   = 4;
         lObject                = (LObject)o;
         this.isBindPos         = true;
         this.isBindGetPos      = true;
         this.isBindRotation    = true;
         this.isBindGetRotation = true;
         this.isBindUpdate      = true;
         this.isBindScale       = false;
         this.isBindSize        = true;
     }
     else
     {
         type = 0;
         Bind.BindObject obj0 = BindClass(this.obj = o);
         this.methods           = obj0.methods;
         this.isBindPos         = obj0.bindPos;
         this.isBindGetPos      = obj0.bindGetPos;
         this.isBindRotation    = obj0.bindRotation;
         this.isBindGetRotation = obj0.bindGetRotation;
         this.isBindUpdate      = obj0.bindUpdate;
         this.isBindScale       = obj0.bindScale;
         this.isBindSize        = obj0.bindSize;
     }
 }
Beispiel #27
0
            public void DoClick(LComponent comp)
            {
                if (comp.Tag is Screen)
                {
                    LLKScreen screen = (LLKScreen)comp.Tag;
                    LSelect   select = (LSelect)comp;

                    switch (select.GetResultIndex())
                    {
                    case 0:
                        screen.mes.SetVisible(true);
                        if (screen.refreshcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.Refreshs();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY1_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 1:
                        screen.mes.SetVisible(true);
                        if (screen.tipcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.ShowNext();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY2_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 2:
                        screen.mes.SetVisible(true);
                        if (screen.bombcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.UseBomb();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY3_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 3:
                        screen.mes.SetVisible(true);
                        screen.Remove(select);
                        screen.mes.SetVisible(false);
                        screen.role.SetVisible(false);
                        screen.helpRole.SetVisible(true);
                        if (screen.stage != null)
                        {
                            screen.stage.SetVisible(true);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
Beispiel #28
0
        public override void CreateUI(GLEx g, int x, int y, LComponent component,
                LTexture[] buttonImage)
        {
            if (Touch.IsUp())
            {
                FreeClick();
            }

            batch.Begin();
            batch.Draw(back, x, y, backWidth, backHeight);
            if (isClick)
            {
                if (angle < 360)
                {
                    angle += 1;
                }
                else
                {
                    angle = 1;
                }
                batch.Draw(dot, x + centerX, y + centerY, dotWidth, dotHeight,
                        angle);
            }
            batch.Draw(fore, (x + (backWidth - baseWidth) * 0.5f),
                    (y + (backHeight - baseHeight) * 0.5f), baseWidth,
                    baseHeight);
            batch.End();
        }
Beispiel #29
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
                               LTexture[] buttonImage)
 {
 }
Beispiel #30
0
 void ClickListener.DragClick(LComponent comp, float x, float y)
 {
 }
Beispiel #31
0
 public override void Remove(LComponent comp)
 {
     desktop.Remove(comp);
 }
Beispiel #32
0
        private void AddFilesAndDirectories(string APath, XmlElement AParent, XmlElement AComponentGroup, XmlDocument ADocument, string ARelativePath)
        {
            // Add a component element (if AElement isn't one)
            XmlElement LComponent;

            if (AParent.LocalName != "Component")
            {
                LComponent = ADocument.CreateElement("Component", CWiXNamespace);
                LComponent.SetAttribute("Id", AParent.Attributes["Id"].Value + "Component");
                LComponent.SetAttribute("Guid", Guid.NewGuid().ToString("D"));
                LComponent.SetAttribute("DiskId", "1");
                AParent.AppendChild(LComponent);
                Log.LogMessage(MessageImportance.Low, "Added component ({0}).", LComponent.Attributes["Id"].Value);
            }
            else
            {
                LComponent = AParent;
            }

            // If a component group is specified, add a component ref to the component
            if (AComponentGroup != null)
            {
                var LRef = ADocument.CreateElement("ComponentRef", CWiXNamespace);
                LRef.SetAttribute("Id", LComponent.Attributes["Id"].Value);
                AComponentGroup.AppendChild(LRef);
                Log.LogMessage(MessageImportance.Low, "Added component ref ({0}) to component group element ({1}).", LRef.Attributes["Id"].Value, AComponentGroup.Attributes["Id"].Value);
            }

            // Add all files that belong directly in this path
            foreach (string LSourceFile in FSourceFiles)
            {
                if (APath == Path.GetDirectoryName(Path.GetFullPath(LSourceFile)))
                {
                    var        LFileName    = Path.GetFileName(LSourceFile);
                    XmlElement LFileElement = ADocument.CreateElement("File", CWiXNamespace);
                    LFileElement.SetAttribute("Id", FileNameToID(LFileName, LComponent.ParentNode.Attributes["Id"].Value));
                    LFileElement.SetAttribute("Name", LFileName);
                    LFileElement.SetAttribute("Source", MakePathRelative(Path.GetFullPath(ARelativePath) + "\\", Path.GetFullPath(LSourceFile)));
                    LComponent.AppendChild(LFileElement);
                    Log.LogMessage(MessageImportance.Low, "Added file element Id={0} Name={1} Source={2}.", LFileElement.Attributes["Id"].Value, LFileElement.Attributes["Name"].Value, LFileElement.Attributes["Source"].Value);
                }
            }

            // Ensure that the directory is created if no files are contained
            if (LComponent.ChildNodes.Count == 0)
            {
                LComponent.AppendChild(ADocument.CreateElement("CreateFolder", CWiXNamespace));
            }

            var LAddedSubfolders = new List <string>();

            // Add each sub-folder
            foreach (string LSourceFile in FSourceFiles)
            {
                var LSubFolderName = SubFolderName(Path.GetFullPath(LSourceFile), APath);
                if (!String.IsNullOrEmpty(LSubFolderName))
                {
                    if (!LAddedSubfolders.Contains(LSubFolderName))
                    {
                        // Add a directory element
                        var LDirectoryElement = ADocument.CreateElement("Directory", CWiXNamespace);
                        LDirectoryElement.SetAttribute("Id", FileNameToID(LSubFolderName, LComponent.ParentNode.Attributes["Id"].Value));
                        LDirectoryElement.SetAttribute("Name", LSubFolderName);
                        LComponent.ParentNode.AppendChild(LDirectoryElement);

                        // Recurse on the given sub-folder
                        AddFilesAndDirectories(Path.Combine(APath, LSubFolderName), LDirectoryElement, AComponentGroup, ADocument, ARelativePath);

                        // Indicate that the given sub-folder has been handled
                        LAddedSubfolders.Add(LSubFolderName);
                    }
                }
            }
        }