Skip to content

Commit

Permalink
同步
Browse files Browse the repository at this point in the history
  • Loading branch information
TimChen44 committed May 9, 2015
1 parent 58d58f8 commit b4a38b3
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
################################################################################
# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
################################################################################

/src/DTSDebug
/src/DTS_Addon/bin/Debug
/src/DTS_Addon/obj/Debug
/src/DTS_zh/bin/Debug
/src/KSP_zh/bin/Debug
/src/KSP_zh/obj/Debug
/src/DTS_zh/obj/Debug
25 changes: 25 additions & 0 deletions resource/GameData/DTS_zh/xSquad/Contracts.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--一条记录创建一个Config-->
<Configs>
<!--战略-->
<Config url="Squad/Contracts/Contracts/Contracts">
<Nodes>
<Node name="Base">
<Nodes>
<Node name="PART_REQUEST">
<Values>
<Value name="Title"><![CDATA[一Have a research lab at the outpost]]></Value>
</Values>
</Node>
<Node name="PART_REQUEST">
<Values>
<Value name="Title"><![CDATA[二Have a viewing cupola at the outpost]]></Value>
</Values>
</Node>
</Nodes>

</Node>

</Nodes>
</Config>
</Configs>
85 changes: 85 additions & 0 deletions src/DTS_Addon/SuperTool/xFontTool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.IO;

using System.Text;

using UnityEngine;

namespace DTS_Addon.SuperTool
{
[KSPAddon(KSPAddon.Startup.EveryScene, false)]
public class xFontTool : MonoBehaviour
{
void OnGUI()
{
//a = GUI.TextField(new Rect(50, 50, 100, 20), a);

//if (GUI.Button(new Rect(50, 75, 100, 20), "3423"))
//{
// var go = GameObject.Find("ProgressBar");
// go.transform.localScale = new Vector3(1, 5, 1);
// go.transform.position = new Vector3(go.transform.position.x, go.transform.position.y, go.transform.position.z);
//}
if (SuperTools.UIxFontTool == true)
{
xFont.XFont.IsWatch = true;
xFontWindow = GUI.Window(104, xFontWindow, CxFontWindow, "汉化监视");
}
else
{
xFont.XFont.IsWatch = false;
}

}

public List<Node> Nodes;

Rect xFontWindow = new Rect(100, 100, 400, 400);
Vector2 scrollPosition;


void CxFontWindow(int id)
{

GUI.DragWindow(new Rect(0, 0, 380, 30));

GUI.Label(new Rect(10, 20, 400, 20), xFont.XFont.FindStr);
GUI.Label(new Rect(10, 40, 400, 20), xFont.XFont.xFontStr);
GUI.Label(new Rect(10, 60, 400, 20), xFont.XFont.xTextStr);
GUI.Label(new Rect(10, 80, 400, 20), xFont.XFont.AllStr);

//开始滚动视图
scrollPosition = GUI.BeginScrollView(new Rect(5, 100, 390, 295), scrollPosition, new Rect(0, 0, 370, (xFont.XFont.sts.Length + xFont.XFont.strs.Length) * 20));

int index = 0;
GUI.Label(new Rect(0, index * 20, 370, 20), "SpriteText:" + xFont.XFont.sts.Length.ToString());
index++;
foreach (var item in xFont.XFont.sts)
{
GUI.TextField(new Rect(0, index * 20, 350, 20), item.name + ":" + item.Text);
if (GUI.Button(new Rect (350,index *20,20,20),"+"))
{
File.AppendAllText("GameData/DTS_zh/App.txt", item.Text);
}

index++;
}
GUI.Label(new Rect(0, index * 20, 370, 20), "SpriteTextRich:" + xFont.XFont.sts.Length.ToString());
index++;
foreach (var item in xFont.XFont.strs)
{
GUI.TextField(new Rect(0, index * 20, 350, 20), item.name + ":" + item.Text);
if (GUI.Button(new Rect(350, index * 20, 20, 20), "+"))
{
File.AppendAllText("GameData/DTS_zh/App.txt", item.Text);
}
index++;
}

//结束滚动视图
GUI.EndScrollView();

}
}
}

0 comments on commit b4a38b3

Please sign in to comment.