Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
weeeBox committed Dec 20, 2016
1 parent 169c4f6 commit 7efb905
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Project/Assets/LunarPlugin/Editor/UI/CAboutWindow.cs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ protected override void CreateUI()

View buttonsView = new View();

Button twitterButton = new Button("Follow @LunarPlugin", delegate(Button button) {
CButton twitterButton = new CButton("Follow @LunarPlugin", delegate(CButton button) {
Application.OpenURL("https://twitter.com/intent/follow?screen_name=LunarPlugin&user_id=2939274198");
});
twitterButton.Width = contentView.Width;
buttonsView.AddSubview(twitterButton);

Button facebookButton = new Button("Facebook Page", delegate(Button button) {
CButton facebookButton = new CButton("Facebook Page", delegate(CButton button) {
Application.OpenURL("https://www.facebook.com/LunarPlugin");
});
facebookButton.Width = contentView.Width;
buttonsView.AddSubview(facebookButton);

Button emailButton = new Button("Send Email", delegate(Button button) {
CButton emailButton = new CButton("Send Email", delegate(CButton button) {
Application.OpenURL("mailto:lunar.plugin@gmail.com?subject=Lunar%20plugin%20feedback&body=Hey%20Alex%2C%0A%0AI%27ve%20just%20checked%20the%20Lunar%20plugin.%20Nice%20job%2C%20man%21%20Still%2C%20there%27s%20some%20stuff%20I%20don%27t%20really%20like.%20For%20example%2C%20...%0A%0AFix%20it%2C%20you%20son%20of%20a%20bitch%2C%20or%20go%20to%20Hell%21%0A%0ASincerely%2C%0A%0AYour%20Lunar%20Plugin%20User");
});
emailButton.Width = contentView.Width;
Expand Down
6 changes: 3 additions & 3 deletions Project/Assets/LunarPlugin/Editor/UI/CBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

namespace LunarEditor
{
class Box : View
class CBox : View
{
public Box(float width, float height)
public CBox(float width, float height)
: this(width, height, GUI.skin.box)
{
}

public Box(float width, float height, GUIStyle style)
public CBox(float width, float height, GUIStyle style)
: base(width, height)
{
this.Style = style;
Expand Down
8 changes: 4 additions & 4 deletions Project/Assets/LunarPlugin/Editor/UI/CButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

namespace LunarEditor
{
delegate void ButtonDelegate(Button button);
delegate void CButtonDelegate(CButton button);

class Button : CAbstractButton
class CButton : CAbstractButton
{
public Button(string title, ButtonDelegate buttonDelegate)
public CButton(string title, CButtonDelegate buttonDelegate)
: base(title)
{
ButtonDelegate = buttonDelegate;
Expand All @@ -47,7 +47,7 @@ public override void OnGUI()

#region Properties

public ButtonDelegate ButtonDelegate { get; private set; }
public CButtonDelegate ButtonDelegate { get; private set; }

#endregion
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ private void CreateUI()
ToolBar toolbar = new ToolBar(this.Width);
toolbar.Width = this.Width;

toolbar.AddButton("Clear", delegate(Button button)
toolbar.AddButton("Clear", delegate(CButton button)
{
Terminal.Clear();
});

// copy to clipboard
toolbar.AddButton("Copy", delegate(Button button)
toolbar.AddButton("Copy", delegate(CButton button)
{
string text = GetText();
CEditor.CopyToClipboard(text);
});

// save to file
toolbar.AddButton("Save", delegate(Button button)
toolbar.AddButton("Save", delegate(CButton button)
{
string title = "Console log";
string directory = CFileUtils.DataPath;
Expand Down
6 changes: 3 additions & 3 deletions Project/Assets/LunarPlugin/Editor/UI/CToolBar.cs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override void OnGUI()
GUILayout.EndHorizontal();
}

public ToolBarButton AddButton(string title, ButtonDelegate buttonDelegate)
public ToolBarButton AddButton(string title, CButtonDelegate buttonDelegate)
{
ToolBarButton button = new ToolBarButton(title, buttonDelegate);
AddSubview(button);
Expand Down Expand Up @@ -95,9 +95,9 @@ public void AddFlexibleSpace()
}
}

class ToolBarButton : Button
class ToolBarButton : CButton
{
public ToolBarButton(string title, ButtonDelegate buttonDelegate)
public ToolBarButton(string title, CButtonDelegate buttonDelegate)
: base(title, buttonDelegate)
{
Width = SharedStyles.MeasureWidth(SharedStyles.toolbarButton, title);
Expand Down

0 comments on commit 7efb905

Please sign in to comment.