public BlockingVolumeNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; if (grapheditor.showVolumeBrushes && grapheditor.showVolume_BlockingVolume) { var TShape = get3DBrushShape(); if (TShape != null) { shape = PPath.CreatePolygon(TShape); } else { shape = PPath.CreateRectangle(0, 0, 50, 50); } } else { shape = PPath.CreateRectangle(0, 0, 50, 50); } outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = actorNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, 50, 50); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = 50 / 2 - val.Width / 2; val.Y = 50 / 2 - val.Height / 2; this.AddChild(val); this.TranslateBy(x, y); }
public EverythingElseNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; // = getType(s); float w = 50; float h = 50; shape = PPath.CreateRectangle(0, 0, w, h); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = backgroundBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); this.TranslateBy(x, y); if (comment.Text != "") { s += "\n"; } comment.Text = s + comment.Text; }
public SFXNav_TurretPoint(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; // = getType(s); float w = 50; float h = 50; PPath nodeShape = PPath.CreatePolygon(diamondshape); shape = nodeShape; outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = actorNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); }
protected PathfindingNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) { try { pcc = p; g = grapheditor; index = idx; export = pcc.GetUExport(index); comment = new SText(GetComment(), commentColor, false); comment.X = 0; comment.Y = 65 - comment.Height; comment.Pickable = false; var volsArray = export.GetProperty <ArrayProperty <StructProperty> >("Volumes"); if (volsArray != null) { foreach (var volumestruct in volsArray) { Volumes.Add(new Volume(volumestruct)); } } this.AddChild(comment); this.Pickable = true; } catch (Exception e) { Debugger.Break(); } Bounds = new RectangleF(0, 0, 50, 50); SetShape(); TranslateBy(x, y); }
public SequenceEditor() { if (string.IsNullOrEmpty(ME3Directory.cookedPath)) { MessageBox.Show("This tool requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3"); this.Close(); return; } InitializeComponent(); graphEditor.BackColor = Color.FromArgb(167, 167, 167); zoomController = new ZoomController(graphEditor); if (SText.fontcollection == null) { SText.LoadFont("KismetFont.ttf"); } if (File.Exists(ME3Directory.cookedPath + @"\SequenceViews\SequenceEditorOptions.JSON")) { Dictionary <string, object> options = JsonConvert.DeserializeObject <Dictionary <string, object> >(File.ReadAllText(ME3Directory.cookedPath + @"\SequenceViews\SequenceEditorOptions.JSON")); if (options.ContainsKey("AutoSave")) { autoSaveViewToolStripMenuItem.Checked = (bool)options["AutoSave"]; } if (options.ContainsKey("OutputNumbers")) { showOutputNumbersToolStripMenuItem.Checked = (bool)options["OutputNumbers"]; } if (options.ContainsKey("GlobalSeqRefView")) { useGlobalSequenceRefSavesToolStripMenuItem.Checked = (bool)options["GlobalSeqRefView"]; } SObj.OutputNumbers = showOutputNumbersToolStripMenuItem.Checked; } }
public SplinePoint0Node(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; StructProperty splineInfo = export.GetProperty <StructProperty>("SplineInfo"); if (splineInfo != null) { ArrayProperty <StructProperty> pointsProp = splineInfo.GetProp <ArrayProperty <StructProperty> >("Points"); StructProperty point0 = pointsProp[0]; StructProperty point1 = pointsProp[1]; a = PathfindingEditor.GetVector2(point0.GetProp <StructProperty>("OutVal")); tan1 = PathfindingEditor.GetVector2(point0.GetProp <StructProperty>("LeaveTangent")); tan2 = PathfindingEditor.GetVector2(point1.GetProp <StructProperty>("ArriveTangent")); d = PathfindingEditor.GetVector2(point1.GetProp <StructProperty>("OutVal")); // = getType(s); float w = 25; float h = 25; shape = PPath.CreateEllipse(0, 0, w, h); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = pathfindingNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(export.Index + "\nSpline Start"); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); } }
private void InfoCardInit() { Transform info = transform.Find("Info/Content"); info.Find("CardNameText").GetComponent <TextMeshPro>().text = unit.unitName; info.Find("CardText").GetComponent <TextMeshPro>().text = SText.Format(unit.cardText); }
public SplinePoint1Node(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; // = getType(s); float w = 20; float h = 20; shape = PPath.CreateEllipse(0, 0, w, h); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = pathfindingNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(export.Index + "\nSpline End"); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); }
public SFXNav_LadderNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; // = getType(s); float w = 50; float h = 50; BoolProperty bTopNode = export.GetProperty <BoolProperty>("bTopNode"); PointF[] shapetouse = laddertopshape; if (bTopNode == null || bTopNode.Value == false) { shapetouse = ladderbottomshape; } shape = PPath.CreatePolygon(shapetouse); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = pathfindingNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); }
public InterpGroup(int idx, PCCObject pccobj) : base() { index = idx; pcc = pccobj; title = new SText(""); if (pcc.Exports[index].ClassName == "InterpGroupDirector") { GroupName = "DirGroup"; } listEntry = PPath.CreateRectangle(0, 0, Timeline.ListWidth, Timeline.TrackHeight); listEntry.Brush = GroupBrush; listEntry.Pen = null; PPath p = PPath.CreatePolygon(7, 5, 12, 10, 7, 15); p.Brush = Brushes.Black; listEntry.AddChild(p); listEntry.AddChild(PPath.CreateLine(0, listEntry.Bounds.Bottom, Timeline.ListWidth, listEntry.Bounds.Bottom)); colorAccent = new PNode(); colorAccent.Brush = null; colorAccent.Bounds = new RectangleF(Timeline.ListWidth - 10, 0, 10, listEntry.Bounds.Bottom); listEntry.AddChild(colorAccent); title.TranslateBy(20, 3); listEntry.AddChild(title); listEntry.MouseDown += listEntry_MouseDown; collapsed = true; InterpTracks = new List <InterpTrack>(); LoadData(); }
public SplineActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { var splprop = export.GetProperty <ArrayProperty <StructProperty> >("Connections"); if (splprop != null) { foreach (var prop in splprop) { var spcomp = prop.GetProp <ObjectProperty>("SplineComponent"); var cmpidx = spcomp?.Value ?? 0; var cntcomp = prop.GetProp <ObjectProperty>("ConnectTo"); pcc.TryGetUExport(cntcomp?.Value ?? 0, out ExportEntry cnctn); if (spcomp != null && cmpidx > 0) { var component = pcc.GetUExport(cmpidx); var spline = new Spline(component, grapheditor, cnctn); Splines.Add(spline); spline.Pickable = false; g.nodeLayer.AddChild(spline); } connections.Add(cnctn); } } Vector3 tangent = CommonStructs.GetVector3(export, "SplineActorTangent", new Vector3(300f, 0f, 0f)); //(float controlPointX, float controlPointY, _) = tangent; (float controlPointX, float controlPointY, float controlPointZ) = ActorUtils.GetLocalToWorld(export).TransformNormal(tangent); LeaveTangentControlNode = new SplinePointControlNode(this, controlPointX, controlPointY, controlPointZ, UpdateMode.LeaveTangent); ArriveTangentControlNode = new SplinePointControlNode(this, -controlPointX, -controlPointY, controlPointZ, UpdateMode.ArriveTangent); AddChild(LeaveTangentControlNode); AddChild(ArriveTangentControlNode); shape = PPath.CreatePolygon(edgeShape); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = splineNodeBrush; shape.Pickable = false; AddChild(shape); float w = shape.Width; float h = shape.Height; Bounds = new RectangleF(0, 0, w, h); SText val = new SText(idx.ToString()) { Pickable = false, TextAlignment = StringAlignment.Center }; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; AddChild(val); SetOffset(x, y); }
public void SetShape(bool polygon) { if (shape != null) { RemoveChild(shape); } bool addVal = val == null; if (val == null) { val = new SText(index.ToString()) { Pickable = false, TextAlignment = StringAlignment.Center }; } ShowAsPolygon = polygon; outlinePen = new Pen(GetDefaultShapeColor()); //Can't put this in a class variable becuase it doesn't seem to work for some reason. if (polygon) { PointF[] polygonShape = get3DBrushShape(); int calculatedHeight = get3DBrushHeight(); if (polygonShape != null) { shape = PPath.CreatePolygon(polygonShape); var AveragePoint = GetAveragePoint(polygonShape); val.X = AveragePoint.X - val.Width / 2; val.Y = AveragePoint.Y - val.Height / 2; if (calculatedHeight >= 0) { SText brushText = new SText($"Brush total height: {calculatedHeight}"); brushText.X = AveragePoint.X - brushText.Width / 2; brushText.Y = AveragePoint.Y + 20 - brushText.Height / 2; brushText.Pickable = false; brushText.TextAlignment = StringAlignment.Center; shape.AddChild(brushText); } shape.Pen = Selected ? selectedPen : outlinePen; shape.Brush = actorNodeBrush; shape.Pickable = false; } else { SetDefaultShape(); } } else { SetDefaultShape(); } AddChild(0, shape); if (addVal) { AddChild(val); } }
public string SendText(SText model) { return(string.Format(@"<xml> <ToUserName><![CDATA[{0}]]></ToUserName> <FromUserName><![CDATA[{1}]]></FromUserName> <CreateTime>{2}</CreateTime> <MsgType><![CDATA[{3}]]></MsgType> <Content><![CDATA[{4}]]></Content> </xml>", model.ToUserName, model.FromUserName, model.CreateTime, model.MsgType, model.Content)); }
public BioTriggerVolume(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; float w = 50; float h = 50; if (grapheditor.showVolumeBrushes && grapheditor.showVolume_BioTriggerVolume) { var brushShape = get3DBrushShape(); if (brushShape != null) { shape = PPath.CreatePolygon(brushShape); } else { shape = PPath.CreatePolygon(TShape); } } else { shape = PPath.CreatePolygon(TShape); } outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = actorNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); /*if (comment != null) * { * NameProperty tagProp = export.GetProperty<NameProperty>("Tag"); * if (tagProp != null) * { * string name = tagProp.Value; * if (name != export.ObjectName) * { * comment.Text = name; * } * } * }*/ }
//已经关注的用户扫描二维码参数 public void DoSubCode(Dictionary <string, string> model) { SText mT = new SText(); mT.Content = ReadXml.Menu(); mT.FromUserName = ReadXml.ReadModel("ToUserName", model); mT.ToUserName = ReadXml.ReadModel("FromUserName", model); mT.MsgType = "text"; mT.CreateTime = long.Parse(ReadXml.ReadModel("CreateTime", model)); ReadXml.ResponseToEnd(DALWei.SendText(mT)); }
public InterpEditor() { SText.LoadFont(); InitializeComponent(); timeline.Scrollbar = vScrollBar1; timeline.GroupList.ScrollbarH = hScrollBar1; timeline.GroupList.tree1 = treeView1; timeline.GroupList.tree2 = treeView2; objects = new List <int>(); }
// Create SText public static SText AddText(GameObject gameObject) { SText txt = UGUITools.AddChild <SText>(gameObject); txt.textStyle = textStyle; txt.text = "New Text"; txt.color = Color.black; txt.raycastTarget = false; txt.rectTransform.sizeDelta = new Vector2(120, 200); UGUITools.ResetGameObject(txt.gameObject); return(txt); }
protected ActorNode(int idx, IMEPackage p) { pcc = p; index = idx; export = pcc.getExport(index); comment = new SText(GetComment(), commentColor, false); comment.X = 0; comment.Y = 0 - comment.Height; comment.Pickable = false; this.AddChild(comment); this.Pickable = true; }
public InterpEditor() { if (SText.fontcollection == null) { SText.LoadFont("KismetFont.ttf"); } InitializeComponent(); timeline.Scrollbar = vScrollBar1; timeline.GroupList.ScrollbarH = hScrollBar1; timeline.GroupList.tree1 = treeView1; timeline.GroupList.tree2 = treeView2; BitConverter.IsLittleEndian = true; objects = new List <int>(); }
protected SplineNode(int idx, IMEPackage p, PathingGraphEditor grapheditor) { Tag = new ArrayList(); //outbound reachspec edges. pcc = p; g = grapheditor; index = idx; export = pcc.getExport(index); comment = new SText(GetComment(), commentColor, false); comment.X = 0; comment.Y = 52 + comment.Height; comment.Pickable = false; this.AddChild(comment); this.Pickable = true; }
public void SetShape() { if (shape != null) { RemoveChild(shape); } bool addVal = val == null; if (val == null) { val = new SText(index.ToString()); if (Properties.Settings.Default.PathfindingEditorShowNodeSizes) { StructProperty maxPathSize = export.GetProperty <StructProperty>("MaxPathSize"); if (maxPathSize != null) { float height = maxPathSize.GetProp <FloatProperty>("Height"); float radius = maxPathSize.GetProp <FloatProperty>("Radius"); if (radius >= 135) { val.Text += "\nBS"; } else if (radius >= 90) { val.Text += "\nMB"; } else { val.Text += "\nM"; } } } val.Pickable = false; val.TextAlignment = StringAlignment.Center; } outlinePen = new Pen(GetDefaultShapeColor()); //Pen's can't be static and used in more than one place at a time. shape = GetDefaultShape(); shape.Pen = Selected ? selectedPen : outlinePen; shape.Brush = pathfindingNodeBrush; shape.Pickable = false; val.X = 50f / 2 - val.Width / 2; val.Y = 50f / 2 - val.Height / 2; AddChild(0, shape); if (addVal) { AddChild(val); } }
protected SplineNode(int idx, IMEPackage p) { pcc = p; index = idx; if (idx >= 0) { export = pcc.GetUExport(index); comment = new SText(GetComment(), commentColor, false); } comment.X = 0; comment.Y = 0 - comment.Height; comment.Pickable = false; this.AddChild(comment); this.Pickable = true; }
public SFXObjectiveSpawnPoint(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; string commentText = comment.Text + "\nSpawnLocation: "; var spawnLocation = export.GetProperty <EnumProperty>("SpawnLocation"); if (spawnLocation == null) { commentText += "Table"; } else { commentText += spawnLocation.Value; } commentText += "\n"; var spawnTagsProp = export.GetProperty <ArrayProperty <StrProperty> >("SupportedSpawnTags"); if (spawnTagsProp != null) { foreach (string str in spawnTagsProp) { commentText += str + "\n"; } } // = getType(s); float w = 50; float h = 50; shape = PPath.CreatePolygon(triangleshape); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = pathfindingNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; comment.Text = commentText; this.AddChild(val); this.TranslateBy(x, y); }
protected ActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor, bool drawAsPolygon = false, bool drawRotationLine = false, bool drawAsCylinder = false) { pcc = p; g = grapheditor; index = idx; export = pcc.GetUExport(index); comment = new SText(GetComment(), commentColor, false) { X = 0 }; comment.Y = 52 + comment.Height; comment.Pickable = false; if (drawRotationLine) { float theta = 0; if (export.GetProperty <StructProperty>("Rotation") is StructProperty rotation) { theta = rotation.GetProp <IntProperty>("Yaw").Value.UnrealRotationUnitsToDegrees(); } float circleX1 = (float)(25 + 20 * Math.Cos((theta + 5) * Math.PI / 180)); float circleY1 = (float)(25 + 20 * Math.Sin((theta + 5) * Math.PI / 180)); float circleX2 = (float)(25 + 20 * Math.Cos((theta - 5) * Math.PI / 180)); float circleY2 = (float)(25 + 20 * Math.Sin((theta - 5) * Math.PI / 180)); float circleTipX = (float)(25 + 25 * Math.Cos(theta * Math.PI / 180)); float circleTipY = (float)(25 + 25 * Math.Sin(theta * Math.PI / 180)); PPath directionShape = PPath.CreatePolygon(new[] { new PointF(25, 25), new PointF(circleX1, circleY1), new PointF(circleTipX, circleTipY), new PointF(circleX2, circleY2) }); directionShape.Pen = Pens.BlanchedAlmond; directionShape.Brush = directionBrush; directionShape.Pickable = false; AddChild(directionShape); } this.AddChild(comment); this.Pickable = true; Bounds = new RectangleF(0, 0, 50, 50); SetShape(drawAsPolygon, drawAsCylinder); if (drawAsPolygon && export.GetProperty <StructProperty>("PrePivot") is StructProperty pivotvector) { x = x - pivotvector.Properties.GetProp <FloatProperty>("X"); y = y - pivotvector.Properties.GetProp <FloatProperty>("Y"); } TranslateBy(x, y); }
public DlgStart(int idx, float x, float y, ME3BioConversation bc, DialogVis dialogvis) : base(idx, x, y, bc, dialogvis) { outlinePen = new Pen(Color.Black); GetOutputLinks(); SText title = new SText("Start: " + index, titleBrush); title.TextAlignment = StringAlignment.Center; title.X = 5; title.Y = 3; title.Pickable = false; box = PPath.CreateRectangle(0, 0, title.Width + 10, title.Height + 5); box.Pen = outlinePen; box.Brush = nodeBrush; box.AddChild(title); this.AddChild(box); this.TranslateBy(x, y); }
private void GenerateConstraintCard(Constraint constraint) { RectTransform constraintCard = Instantiate(constraintInfoPrototype, transform); constraintCard.transform.position = constraintInfoPrototype.transform.position; constraintCard.transform.position -= Vector3.up * (constraintCard.rect.height) * constraintInfos.Count; constraintCard.gameObject.SetActive(true); constraintInfos.Add(constraintCard); // Set Letter TextMeshProUGUI constraintLetter = constraintCard.transform.Find("ConstraintLetter").GetComponent <TextMeshProUGUI>(); constraintLetter.text = SText.Format($"{constraint.letter}"); // Set Text TextMeshProUGUI constraintText = constraintCard.transform.Find("ConstraintText").GetComponent <TextMeshProUGUI>(); constraintText.text = SText.Format($"{constraint.GetDescription()}"); }
/// <summary> /// 文本消息处理 /// </summary> /// <param name="rtxt"></param> /// <returns></returns> public string TextHandle(RText rtxt) { var stxt = new SText(); var resutl = string.Empty; switch (rtxt.Content) { case "111": stxt.Content = "嘻嘻"; stxt.CreateTime = MySharpUtility.GetTimeSpan(); stxt.FromUserName = rtxt.ToUserName; stxt.ToUserName = rtxt.FromUserName; resutl = XmlHelper.GetXML <SText>(stxt); break; default: break; } //new XmlSerializer(typeof(SText)).Serialize(; return(resutl); }
public SFXAmmoContainer(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; // = getType(s); float w = 50; float h = 50; shape = PPath.CreatePolygon(ammoShape); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = actorNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); this.TranslateBy(x, y); var bRespawns = export.GetProperty <BoolProperty>("bRespawns"); var respawnTime = export.GetProperty <IntProperty>("RespawnTime"); string commentText = "Respawns: "; commentText += bRespawns != null?bRespawns.Value.ToString() : "False"; if (respawnTime != null) { commentText += "\nRespawn time: " + respawnTime.Value + "s"; } else if (bRespawns != null && bRespawns.Value == true) { commentText += "\nRespawn time: 20s"; } comment.Text = commentText; }
//--------------------------------------------------------------------------------- #region 接收普通消息 //接收到文本消息 处理 public void DoText(Dictionary <string, string> model) { SText mT = new SText(); string text = ReadXml.ReadModel("Content", model).Trim(); mT.FromUserName = ReadXml.ReadModel("ToUserName", model); mT.ToUserName = ReadXml.ReadModel("FromUserName", model); mT.CreateTime = long.Parse(ReadXml.ReadModel("CreateTime", model)); if (text == "?" || text == "?" || text == "帮助") { mT.Content = mT.Content = ReadXml.Menu(); mT.MsgType = "text"; ReadXml.ResponseToEnd(DALWei.SendText(mT)); } else { SNews mN = new SNews(); mN.FromUserName = ReadXml.ReadModel("ToUserName", model); mN.ToUserName = ReadXml.ReadModel("FromUserName", model); mN.CreateTime = long.Parse(ReadXml.ReadModel("CreateTime", model)); mN.MsgType = "news"; // 以下为文章内容, 实际使用时,此处应该是一个跟数据库交互的方法,查询出文章 //文章条数, 文章内容等 都应该由数据库查询出来的数据决定 这里测试,就模拟几条 mN.ArticleCount = 5; List <ArticlesModel> listNews = new List <ArticlesModel>(); for (int i = 0; i < 5; i++) { ArticlesModel ma = new ArticlesModel(); ma.Title = "这是第" + (i + 1).ToString() + "篇文章"; ma.Description = "-描述-" + i.ToString() + "-描述-"; ma.PicUrl = "http://image6.tuku.cn/pic/wallpaper/dongwu/taipingniaogaoqingbizhi/s00" + (i + 1).ToString() + ".jpg"; ma.Url = "http://www.cnblogs.com/mochen/"; listNews.Add(ma); } mN.Articles = listNews; ReadXml.ResponseToEnd(DALWei.SendNews(mN)); } }
public SMAC_ActorNode(int idx, float x, float y, IMEPackage p, PathingGraphEditor grapheditor) : base(idx, p, grapheditor) { string s = export.ObjectName; // = getType(s); float w = 50; float h = 50; shape = PPath.CreatePolygon(SShape); outlinePen = new Pen(color); shape.Pen = outlinePen; shape.Brush = actorNodeBrush; shape.Pickable = false; this.AddChild(shape); this.Bounds = new RectangleF(0, 0, w, h); val = new SText(idx.ToString()); val.Pickable = false; val.TextAlignment = StringAlignment.Center; val.X = w / 2 - val.Width / 2; val.Y = h / 2 - val.Height / 2; this.AddChild(val); var props = export.GetProperties(); this.TranslateBy(x, y); ObjectProperty sm = export.GetProperty <ObjectProperty>("StaticMesh"); if (sm != null) { IEntry meshexp = pcc.getEntry(sm.Value); string text = comment.Text; if (text != "") { text += "\n"; } comment.Text = text + meshexp.ObjectName; } }