Skip to content

Commit

Permalink
Changed folder structure & added Readme & License information
Browse files Browse the repository at this point in the history
  • Loading branch information
WispBart committed Mar 4, 2021
1 parent 4cb83d3 commit 6e3ad2b
Show file tree
Hide file tree
Showing 29 changed files with 208 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ChangeLog

##[0.6.0-preview] - 2021-03-04
* Initial Release
7 changes: 7 additions & 0 deletions CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions ButlerSettings.cs → Editor/ButlerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ public class ButlerSettings : ScriptableSingleton<ButlerSettings>
protected override SerializationMode defaultSerializationMode => SerializationMode.Text;

public SupportedBuildTarget BuildTarget = SupportedBuildTarget.WebGL;

public string GetDefaultBuildPath(SupportedBuildTarget buildTarget)
{
switch (buildTarget)
{
case SupportedBuildTarget.WebGL: return "Builds/WebGL";
default: return "Builds/latestBuild";
}
}
public string Account = "";
public string Project = "";
public bool OverrideChannel = false;
public string Channel = "";
public bool OverrideVersion = false;
public string Version = "";

public bool OverrideBuildPath;
public string BuildPath;

public string GetChannel() => OverrideChannel ? Channel : BuildTarget.ToString();
public string GetBuildPath() => OverrideBuildPath ? BuildPath : GetDefaultBuildPath(BuildTarget);

public string GetURL() => $"https://{Account}.itch.io/{Project}";
public string ToPushArgs()
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 14 additions & 10 deletions ButlerWindow2.cs → Editor/ButlerWindow2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace ButlerWindow
public class ButlerWindow2 : EditorWindow
{
public const string TITLE = "Upload to itch.io";
public readonly string ShareUXML = "Packages/com.wispfire.butlerwindow/UI/ButlerWindow_Share.uxml";
public readonly string DownloadUXML = "Packages/com.wispfire.butlerwindow/UI/ButlerWindow_Download.uxml";
public readonly string MainStyleSheet = "Packages/com.wispfire.butlerwindow/UI/ButlerWindow.uss";
public readonly string ShareUXML = "Packages/com.wispbart.butlerwindow/UI/ButlerWindow_Share.uxml";
public readonly string DownloadUXML = "Packages/com.wispbart.butlerwindow/UI/ButlerWindow_Download.uxml";
public readonly string MainStyleSheet = "Packages/com.wispbart.butlerwindow/UI/ButlerWindow.uss";

private ButlerWin64 _butler;
private ButlerSettings _settings => ButlerSettings.instance;
Expand All @@ -32,6 +32,7 @@ void OnEnable()
{
_butler = CreateInstance<ButlerWin64>();
_butler.SetConsoleMessage = SetConsoleContents;

_butler.AppendConsoleMessage = AppendConsoleMessage;
}

Expand Down Expand Up @@ -102,7 +103,14 @@ public void CreateGUI()
overrideVersion.BindProperty(settings.FindProperty("OverrideVersion"));
version.visible = overrideVersion.value;
overrideVersion.RegisterValueChangedCallback((x) => version.visible = x.newValue);
_sharePage.Q<TextField>("buildPath").BindProperty(settings.FindProperty("BuildPath"));

//buildPath
var buildPath = _sharePage.Q<TextField>("buildPath");
buildPath.BindProperty(settings.FindProperty("BuildPath"));
var overridebuildPath = _sharePage.Q<Toggle>("overrideBuildPath");
buildPath.visible = overridebuildPath.value;
overridebuildPath.RegisterValueChangedCallback((x) => buildPath.visible = x.newValue);


_devBuildToggle = _sharePage.Q<Toggle>("devBuild");
_devBuildToggle.SetValueWithoutNotify(EditorUserBuildSettings.development);
Expand All @@ -111,10 +119,6 @@ public void CreateGUI()
// Build button
var buildButton = _sharePage.Q<Button>("build");
buildButton.clicked += Build;

var newButton = new Button();
newButton.text = "I am a new button";
_sharePage.Add(newButton);

// Console
_console = _sharePage.Q<TextField>("console");
Expand Down Expand Up @@ -156,12 +160,12 @@ private void Build()
bool confirm = EditorUtility.DisplayDialog("Build WebGL Player", "This might take a while... Continue?",
"Confirm", "Cancel");
if (!confirm) return;

var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions()
{
scenes = EditorBuildSettings.scenes.Select((scene) => scene.path).ToArray(),
target = (BuildTarget) _settings.BuildTarget,
locationPathName = _settings.BuildPath,
locationPathName = _settings.GetBuildPath(),
options = EditorUserBuildSettings.development ? BuildOptions.Development : BuildOptions.None,
});
Share();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This software is covered by the MIT License. The package may download Butler when used, which may be covered by its own license.


MIT License

Copyright (c) 2021 WispBart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions LICENSE.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Butler Window for Unity
An Unity Editor Window for uploading builds to Itch.io

![itch io window](meta/itchiowindow.png)

This tool downloads & wraps [Butler](https://itch.io/docs/butler/) so you can build & upload your project to itch.io with a single button. It's ideal for rapidly sharing the latest iteration of your game, prototype or other without having to leave your Editor.

##Requirements
Butler Window was tested with Unity 2019.4 and 2020.2. Butler Window currently only builds to WebGL (by choice), so you need to have the WebGl Build module installed.

##Supported Platforms
Butler Window / Upload to itch.io currently only supports the UnityEditor on Windows, although it can be safely shared with Linux/macOS machines.

##Security
Butler Window uses Butler for authentication, so no passwords are stored by the package.
7 changes: 7 additions & 0 deletions README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion UI.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion UI/ButlerWindow_Share.uxml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
<ui:Toggle label="Override Version" name="overrideVersion" />
<ui:TextField picking-mode="Ignore" label="Version" name="version" class="channel-toggle__textfield" />
</ui:VisualElement>
<ui:TextField picking-mode="Ignore" name="buildPath" label="Build Path" />
<ui:VisualElement name="channel" class="channel-toggle">
<ui:Toggle label="Override Build Path" name="overrideBuildPath" />
<ui:TextField picking-mode="Ignore" name="buildPath" label="Build Path" class="channel-toggle__textfield" />
</ui:VisualElement>
<ui:Toggle label="Development Build" name="devBuild" />
</ui:Box>
<ui:VisualElement name="ShareButtons" class="sharebuttons" style="justify-content: flex-end;">
Expand Down
8 changes: 8 additions & 0 deletions meta.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added meta/itchiowindow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions meta/itchiowindow.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "com.wispbart.butlerwindow",
"displayName": "itch.io Window",
"version": "0.5.3-preview",
"version": "0.6.0-preview",
"unity": "2019.4",
"description": "An editor window for quickly and easily sharing your project to itch.io as a WebGL build.",
"description": "An editor window for quickly and easily sharing your project to itch.io as a WebGL build.\n\nThis tool downloads & wraps Butler so you can build & upload your project to itch.io with a single button. It's ideal for rapidly sharing the latest iteration of your game, prototype or other without having to leave your Editor.\n\nPreview versions have not been exhaustively tested.",
"dependencies": {
"com.unity.editorcoroutines": "0.1.0-preview.1"
},
Expand Down

0 comments on commit 6e3ad2b

Please sign in to comment.