└── addons └── build-and-deploy ├── Build.gd ├── Build_and_Deploy.tscn ├── Deploy.gd ├── Dock Script.gd ├── Export Example.png ├── Game Name Example.png ├── Old_Build_Menu.tscn ├── Presets Example.png ├── QuickDeploy.gd ├── build-and-deploy.gd ├── directory example.png ├── export all example.png └── plugin.cfg /addons/build-and-deploy/Build.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends Control 3 | 4 | 5 | var build_presets = { 6 | "directory": "", 7 | "game": "", 8 | "channels": { 9 | "Windows": false, 10 | "Linux": false, 11 | "Mac": false, 12 | "HTML5": false 13 | }, 14 | "async mode": true 15 | } 16 | 17 | func _ready(): 18 | print("executable path: ", OS.get_executable_path()) 19 | 20 | func _on_BuildDialog_dir_selected(dir): 21 | print("Selected directory: ", dir) 22 | $VBoxContainer/BuildDir.text = dir 23 | 24 | 25 | func _on_SelectDir_pressed(): 26 | $FileDialog.popup() 27 | 28 | 29 | func _on_FileDialog_dir_selected(dir): 30 | print("Selected directory: ", dir) 31 | $VBoxContainer/BuildDir.text = dir 32 | 33 | 34 | func update_presets(): 35 | build_presets["directory"] = $VBoxContainer/BuildDir.text 36 | build_presets["game"] = $VBoxContainer/Game.text 37 | build_presets["channels"]["Windows"] = $VBoxContainer/Windows.is_pressed() 38 | build_presets["channels"]["Linux"] = $VBoxContainer/Linux.is_pressed() 39 | build_presets["channels"]["Mac"] = $VBoxContainer/Mac.is_pressed() 40 | build_presets["channels"]["HTML5"] = $VBoxContainer/HTML5.is_pressed() 41 | build_presets["async mode"] = $VBoxContainer/Async.is_pressed() 42 | print("build presets updated with: ", build_presets) 43 | 44 | 45 | func build_prject(game: String, channel: String, async_mode:= false): 46 | var output = [] 47 | var array = ["--export", str(channel), str(game)] 48 | var args = PackedStringArray(array) 49 | if async_mode: 50 | var thread = Thread.new() 51 | thread.start(func(): OS.execute(OS.get_executable_path(), args, output)) 52 | else: 53 | OS.execute(OS.get_executable_path(), args, output) 54 | 55 | 56 | func _on_Build_pressed(): 57 | update_presets() 58 | if build_presets["channels"]["Windows"] == true: 59 | build_prject( 60 | build_presets["game"], 61 | "Windows Desktop", 62 | build_presets["async mode"] 63 | ) 64 | 65 | if build_presets["channels"]["Linux"] == true: 66 | build_prject( 67 | build_presets["game"], 68 | "Linux/X11", 69 | build_presets["async mode"] 70 | ) 71 | 72 | if build_presets["channels"]["Mac"] == true: 73 | build_prject( 74 | build_presets["game"], 75 | "Mac OSX", 76 | build_presets["async mode"] 77 | ) 78 | 79 | if build_presets["channels"]["HTML5"] == true: 80 | build_prject( 81 | build_presets["game"], 82 | "HTML5", 83 | build_presets["async mode"] 84 | ) 85 | 86 | 87 | -------------------------------------------------------------------------------- /addons/build-and-deploy/Build_and_Deploy.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=9 format=3 uid="uid://h48nmfijyob"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://bygwg6dirmcp0" path="res://addons/build-and-deploy/directory example.png" id="1"] 4 | [ext_resource type="Script" path="res://addons/build-and-deploy/Deploy.gd" id="2"] 5 | [ext_resource type="Script" path="res://addons/build-and-deploy/Dock Script.gd" id="3"] 6 | [ext_resource type="Texture2D" uid="uid://dysguigdeok" path="res://addons/build-and-deploy/Export Example.png" id="4"] 7 | [ext_resource type="Texture2D" uid="uid://bj7uv06tim2ec" path="res://addons/build-and-deploy/Presets Example.png" id="5"] 8 | [ext_resource type="Texture2D" uid="uid://cdp112tvwvkr0" path="res://addons/build-and-deploy/export all example.png" id="6"] 9 | [ext_resource type="Texture2D" uid="uid://b4cxblhj5jwb2" path="res://addons/build-and-deploy/Game Name Example.png" id="7"] 10 | [ext_resource type="Script" path="res://addons/build-and-deploy/QuickDeploy.gd" id="8"] 11 | 12 | [node name="ItchDeploy" type="Control"] 13 | layout_mode = 3 14 | anchors_preset = 15 15 | anchor_right = 1.0 16 | anchor_bottom = 1.0 17 | script = ExtResource("3") 18 | 19 | [node name="TabBox" type="TabContainer" parent="."] 20 | layout_mode = 0 21 | anchor_right = 1.0 22 | anchor_bottom = 1.0 23 | 24 | [node name="About" type="Control" parent="TabBox"] 25 | layout_mode = 2 26 | 27 | [node name="ScrollContainer" type="ScrollContainer" parent="TabBox/About"] 28 | layout_mode = 0 29 | anchor_right = 1.0 30 | anchor_bottom = 1.0 31 | 32 | [node name="VBoxContainer" type="VBoxContainer" parent="TabBox/About/ScrollContainer"] 33 | layout_mode = 2 34 | size_flags_horizontal = 3 35 | size_flags_vertical = 3 36 | 37 | [node name="Label" type="Label" parent="TabBox/About/ScrollContainer/VBoxContainer"] 38 | layout_mode = 2 39 | text = "Building is no longer supported as part of this plugin. 40 | This is because it was unstable and the engine's built in export menu already has the ability to build for all platforms with one click, and it is much more performant. 41 | If you would like to mess around with the old build menu, it is the file named Old_Build_Menu.tscn 42 | have fun :) 43 | 44 | Setup: 45 | to use the itch deploy you must create an empty file (the name of this file is not important) then fill the file as shown (the names of the these files are important)" 46 | autowrap_mode = 3 47 | 48 | [node name="TextureRect" type="TextureRect" parent="TabBox/About/ScrollContainer/VBoxContainer"] 49 | layout_mode = 2 50 | texture = ExtResource("1") 51 | stretch_mode = 5 52 | 53 | [node name="Label2" type="Label" parent="TabBox/About/ScrollContainer/VBoxContainer"] 54 | layout_mode = 2 55 | text = "Once you have finished creating these folders you can go to the export menu and set up the exports. 56 | You must put the exports in the proper files (windows in the windows file you made, linux in the linux file etc)" 57 | autowrap_mode = 3 58 | 59 | [node name="TextureRect2" type="TextureRect" parent="TabBox/About/ScrollContainer/VBoxContainer"] 60 | layout_mode = 2 61 | size_flags_horizontal = 3 62 | texture = ExtResource("4") 63 | stretch_mode = 5 64 | 65 | [node name="Label3" type="Label" parent="TabBox/About/ScrollContainer/VBoxContainer"] 66 | layout_mode = 2 67 | text = "Once you are done the presets should look like this:" 68 | autowrap_mode = 3 69 | 70 | [node name="TextureRect3" type="TextureRect" parent="TabBox/About/ScrollContainer/VBoxContainer"] 71 | layout_mode = 2 72 | size_flags_horizontal = 3 73 | texture = ExtResource("5") 74 | stretch_mode = 5 75 | 76 | [node name="Label4" type="Label" parent="TabBox/About/ScrollContainer/VBoxContainer"] 77 | layout_mode = 2 78 | text = "And you should have the ability to Export All (sometines the button isn't clickable, if that happens just select another preset and it should become selectable)" 79 | autowrap_mode = 3 80 | 81 | [node name="TextureRect4" type="TextureRect" parent="TabBox/About/ScrollContainer/VBoxContainer"] 82 | layout_mode = 2 83 | size_flags_horizontal = 3 84 | texture = ExtResource("6") 85 | stretch_mode = 5 86 | 87 | [node name="Label5" type="Label" parent="TabBox/About/ScrollContainer/VBoxContainer"] 88 | layout_mode = 2 89 | text = "now you may actually make use of this plugin! 90 | Once you have clicked Export All and finished exporting your project you can go to the deploy tab and fill in all of the needed info. 91 | -click the login to butler button and login into butler (if you haven't already) 92 | -put your username where it asks for it 93 | for your game name: 94 | Don't put you game's name!!! 95 | instead put your game's link like shown:" 96 | autowrap_mode = 3 97 | 98 | [node name="TextureRect5" type="TextureRect" parent="TabBox/About/ScrollContainer/VBoxContainer"] 99 | layout_mode = 2 100 | size_flags_horizontal = 3 101 | texture = ExtResource("7") 102 | stretch_mode = 5 103 | 104 | [node name="Label6" type="Label" parent="TabBox/About/ScrollContainer/VBoxContainer"] 105 | layout_mode = 2 106 | text = "in this example I would put: 107 | virtual-spitfire-exhibit 108 | *note that I only kept what came after the itch.io/ 109 | 110 | -now click the path to directory buton and select the folder that you created in the begining (the one that contains windows, linux, mac, html5 if you forgot) 111 | -select which channels you want to upload to 112 | -click save presets (optional) 113 | -click deploy to Itch 114 | 115 | now you just need to wait for everything to upload, the editor should freeze until its done (unless you turned off pause mode) 116 | 117 | once the editor unfreezes (unless you turned off pause mode) your builds should be live! 118 | *the first push to Itch will take much longer than patches because the entire engine needs to be uploaded in the first build* 119 | 120 | I hope this walkthrough helped!" 121 | autowrap_mode = 3 122 | 123 | [node name="Deploy" type="Control" parent="TabBox"] 124 | visible = false 125 | layout_mode = 2 126 | script = ExtResource("2") 127 | 128 | [node name="ScrollContainer" type="ScrollContainer" parent="TabBox/Deploy"] 129 | layout_mode = 0 130 | anchor_right = 1.0 131 | anchor_bottom = 1.0 132 | 133 | [node name="VBoxContainer" type="VBoxContainer" parent="TabBox/Deploy/ScrollContainer"] 134 | layout_mode = 2 135 | size_flags_horizontal = 3 136 | size_flags_vertical = 3 137 | 138 | [node name="Login" type="Button" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 139 | layout_mode = 2 140 | text = "Login to Butler" 141 | 142 | [node name="Logout" type="Button" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 143 | layout_mode = 2 144 | text = "Logout From Butler" 145 | 146 | [node name="User" type="LineEdit" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 147 | layout_mode = 2 148 | placeholder_text = "Itch Username" 149 | 150 | [node name="Game" type="LineEdit" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 151 | layout_mode = 2 152 | placeholder_text = "Itch Game" 153 | 154 | [node name="SelectDir" type="Button" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 155 | layout_mode = 2 156 | text = "Click to select a directory" 157 | 158 | [node name="BuildDir" type="LineEdit" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 159 | layout_mode = 2 160 | placeholder_text = "Path To Build Folder" 161 | 162 | [node name="ChannelsLabel" type="Label" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 163 | layout_mode = 2 164 | text = "Select which channels you would like to push to" 165 | 166 | [node name="Windows" type="CheckBox" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 167 | layout_mode = 2 168 | text = "Windows" 169 | 170 | [node name="Linux" type="CheckBox" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 171 | layout_mode = 2 172 | text = "Linux" 173 | 174 | [node name="Mac" type="CheckBox" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 175 | layout_mode = 2 176 | text = "Mac" 177 | 178 | [node name="HTML5" type="CheckBox" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 179 | layout_mode = 2 180 | text = "HTML5" 181 | 182 | [node name="Async" type="CheckBox" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 183 | layout_mode = 2 184 | text = "Pause Mode" 185 | 186 | [node name="SavePresets" type="Button" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 187 | layout_mode = 2 188 | text = "Save Presets" 189 | 190 | [node name="ItchPush" type="Button" parent="TabBox/Deploy/ScrollContainer/VBoxContainer"] 191 | layout_mode = 2 192 | text = "Push to Itch" 193 | 194 | [node name="QuickDeploy" type="Control" parent="TabBox"] 195 | visible = false 196 | layout_mode = 2 197 | script = ExtResource("8") 198 | 199 | [node name="ScrollContainer" type="ScrollContainer" parent="TabBox/QuickDeploy"] 200 | layout_mode = 0 201 | anchor_right = 1.0 202 | anchor_bottom = 1.0 203 | 204 | [node name="VBoxContainer" type="VBoxContainer" parent="TabBox/QuickDeploy/ScrollContainer"] 205 | layout_mode = 2 206 | size_flags_horizontal = 3 207 | size_flags_vertical = 3 208 | 209 | [node name="AboutQuickDP" type="Label" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 210 | layout_mode = 2 211 | text = "This menu will let you manually select any folder of your choice and deploy it to Itch under any channel 212 | This is intended for power users of this plugin and to make deploying this plugin to Itch easier for me-[@uberfig] ;)" 213 | autowrap_mode = 3 214 | 215 | [node name="Login" type="Button" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 216 | layout_mode = 2 217 | text = "Login to Butler" 218 | 219 | [node name="Logout" type="Button" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 220 | layout_mode = 2 221 | text = "Logout From Butler" 222 | 223 | [node name="User" type="LineEdit" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 224 | layout_mode = 2 225 | placeholder_text = "Itch Username" 226 | 227 | [node name="Game" type="LineEdit" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 228 | layout_mode = 2 229 | placeholder_text = "Itch Game" 230 | 231 | [node name="QuickSelectDir" type="Button" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 232 | layout_mode = 2 233 | text = "Click to select a directory" 234 | 235 | [node name="BuildDir" type="LineEdit" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 236 | layout_mode = 2 237 | placeholder_text = "Path To Folder" 238 | 239 | [node name="ChannelsLabel" type="Label" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 240 | layout_mode = 2 241 | text = "fill in what channel you would like to build to:" 242 | 243 | [node name="Channel" type="LineEdit" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 244 | layout_mode = 2 245 | placeholder_text = "Channel" 246 | 247 | [node name="Async" type="CheckBox" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 248 | layout_mode = 2 249 | text = "Pause Mode" 250 | 251 | [node name="SavePresets" type="Button" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 252 | layout_mode = 2 253 | text = "Save Presets" 254 | 255 | [node name="ItchPush" type="Button" parent="TabBox/QuickDeploy/ScrollContainer/VBoxContainer"] 256 | layout_mode = 2 257 | text = "Push to Itch" 258 | 259 | [node name="Settings" type="Control" parent="TabBox"] 260 | visible = false 261 | layout_mode = 2 262 | 263 | [node name="ScrollContainer" type="ScrollContainer" parent="TabBox/Settings"] 264 | layout_mode = 0 265 | anchor_right = 1.0 266 | anchor_bottom = 1.0 267 | 268 | [node name="VBoxContainer" type="VBoxContainer" parent="TabBox/Settings/ScrollContainer"] 269 | layout_mode = 2 270 | size_flags_horizontal = 3 271 | size_flags_vertical = 3 272 | 273 | [node name="Butler off path" type="Label" parent="TabBox/Settings/ScrollContainer/VBoxContainer"] 274 | layout_mode = 2 275 | text = "This menu will let you use Butler off path" 276 | 277 | [node name="offPathToggle" type="CheckButton" parent="TabBox/Settings/ScrollContainer/VBoxContainer"] 278 | layout_mode = 2 279 | text = "Use Butler Off Path" 280 | 281 | [node name="SelectPath" type="Button" parent="TabBox/Settings/ScrollContainer/VBoxContainer"] 282 | visible = false 283 | layout_mode = 2 284 | text = "Click To Select Path" 285 | 286 | [node name="ButPath" type="LineEdit" parent="TabBox/Settings/ScrollContainer/VBoxContainer"] 287 | visible = false 288 | layout_mode = 2 289 | placeholder_text = "Path To Butler Executable" 290 | 291 | [node name="SaveSett" type="Button" parent="TabBox/Settings/ScrollContainer/VBoxContainer"] 292 | layout_mode = 2 293 | text = "Save" 294 | 295 | [node name="FileDialog" type="FileDialog" parent="."] 296 | mode = 2 297 | dialog_text = "Select a Directory to Deploy From (use the same Directory you are building into)" 298 | access = 2 299 | 300 | [node name="QuickFile" type="FileDialog" parent="."] 301 | mode = 2 302 | dialog_text = "Select a Directory to Deploy From (use the same Directory you are building into)" 303 | access = 2 304 | 305 | [node name="ButlerPath" type="FileDialog" parent="."] 306 | dialog_text = "Select your Butler Executable" 307 | access = 2 308 | 309 | [connection signal="pressed" from="TabBox/Deploy/ScrollContainer/VBoxContainer/Login" to="TabBox/Deploy" method="_on_Login_pressed"] 310 | [connection signal="pressed" from="TabBox/Deploy/ScrollContainer/VBoxContainer/Logout" to="TabBox/Deploy" method="_on_Logout_pressed"] 311 | [connection signal="pressed" from="TabBox/Deploy/ScrollContainer/VBoxContainer/SelectDir" to="." method="_on_SelectDir_pressed"] 312 | [connection signal="pressed" from="TabBox/Deploy/ScrollContainer/VBoxContainer/SavePresets" to="." method="_on_SavePresets_pressed"] 313 | [connection signal="pressed" from="TabBox/Deploy/ScrollContainer/VBoxContainer/ItchPush" to="TabBox/Deploy" method="_on_ItchPush_pressed"] 314 | [connection signal="pressed" from="TabBox/QuickDeploy/ScrollContainer/VBoxContainer/Login" to="TabBox/Deploy" method="_on_Login_pressed"] 315 | [connection signal="pressed" from="TabBox/QuickDeploy/ScrollContainer/VBoxContainer/Logout" to="TabBox/Deploy" method="_on_Logout_pressed"] 316 | [connection signal="pressed" from="TabBox/QuickDeploy/ScrollContainer/VBoxContainer/QuickSelectDir" to="." method="_on_QuickSelectDir_pressed"] 317 | [connection signal="pressed" from="TabBox/QuickDeploy/ScrollContainer/VBoxContainer/SavePresets" to="." method="_on_SavePresets_pressed"] 318 | [connection signal="pressed" from="TabBox/QuickDeploy/ScrollContainer/VBoxContainer/ItchPush" to="TabBox/QuickDeploy" method="_on_ItchPush_pressed"] 319 | [connection signal="toggled" from="TabBox/Settings/ScrollContainer/VBoxContainer/offPathToggle" to="." method="_on_offPathToggle_toggled"] 320 | [connection signal="pressed" from="TabBox/Settings/ScrollContainer/VBoxContainer/SelectPath" to="." method="_on_SelectPath_pressed"] 321 | [connection signal="pressed" from="TabBox/Settings/ScrollContainer/VBoxContainer/SaveSett" to="." method="_on_SaveSett_pressed"] 322 | [connection signal="dir_selected" from="FileDialog" to="." method="_on_FileDialog_dir_selected"] 323 | [connection signal="dir_selected" from="QuickFile" to="." method="_on_QuickFile_dir_selected"] 324 | [connection signal="file_selected" from="ButlerPath" to="." method="_on_ButlerPath_file_selected"] 325 | -------------------------------------------------------------------------------- /addons/build-and-deploy/Deploy.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends Control 3 | 4 | var butler_path = "butler" 5 | 6 | var presets_dict: Dictionary = { 7 | "is logged in": false, 8 | "directory": "", 9 | "user": "", 10 | "game": "", 11 | "channels": { 12 | "Windows": false, 13 | "Linux": false, 14 | "Mac": false, 15 | "HTML5": false 16 | }, 17 | "async mode": true 18 | } 19 | 20 | 21 | func butler_login(): 22 | var output = [] 23 | var array = ["login"] 24 | var args = PackedStringArray(array) 25 | OS.execute(butler_path, args, output) 26 | 27 | 28 | func butler_logout(): 29 | var output = [] 30 | var array = ["logout"] 31 | var args = PackedStringArray(array) 32 | OS.execute(butler_path, args, output) 33 | 34 | 35 | func butler_push(directory: String, user: String, game: String, channel: String, async_mode:= false): 36 | #channel is the slot the game is uploaded to, for example windows-beta 37 | var output = [] 38 | var array = ["push", str(directory), str(user, "/", game, ":", channel)] 39 | var args = PackedStringArray(array) 40 | if async_mode: 41 | var thread = Thread.new() 42 | thread.start(func(): OS.execute(butler_path, args, output)) 43 | else: 44 | OS.execute(butler_path, args, output) 45 | 46 | 47 | func _on_Login_pressed(): 48 | butler_login() 49 | 50 | 51 | func _on_Logout_pressed(): 52 | butler_logout() 53 | 54 | 55 | func update_presets(): 56 | presets_dict["directory"] = $ScrollContainer/VBoxContainer/BuildDir.text 57 | presets_dict["user"] = $ScrollContainer/VBoxContainer/User.text 58 | presets_dict["game"] = $ScrollContainer/VBoxContainer/Game.text 59 | presets_dict["channels"]["Windows"] = $ScrollContainer/VBoxContainer/Windows.is_pressed() 60 | presets_dict["channels"]["Linux"] = $ScrollContainer/VBoxContainer/Linux.is_pressed() 61 | presets_dict["channels"]["Mac"] = $ScrollContainer/VBoxContainer/Mac.is_pressed() 62 | presets_dict["channels"]["HTML5"] = $ScrollContainer/VBoxContainer/HTML5.is_pressed() 63 | presets_dict["async mode"] = $ScrollContainer/VBoxContainer/Async.is_pressed() 64 | print("presets updated with: ", presets_dict) 65 | 66 | 67 | func _on_ItchPush_pressed(): 68 | update_presets() 69 | print("started deploy with presets: ", presets_dict) 70 | 71 | if presets_dict["channels"]["Windows"] == true: 72 | butler_push( 73 | str(presets_dict["directory"], "/windows"), 74 | presets_dict["user"], 75 | presets_dict["game"], 76 | "windows", 77 | presets_dict["async mode"] 78 | ) 79 | 80 | if presets_dict["channels"]["Linux"] == true: 81 | butler_push( 82 | str(presets_dict["directory"], "/linux"), 83 | presets_dict["user"], 84 | presets_dict["game"], 85 | "linux-universal", 86 | presets_dict["async mode"] 87 | ) 88 | 89 | if presets_dict["channels"]["Mac"] == true: 90 | butler_push( 91 | str(presets_dict["directory"], "/mac"), 92 | presets_dict["user"], 93 | presets_dict["game"], 94 | "osx-universal", 95 | presets_dict["async mode"] 96 | ) 97 | 98 | if presets_dict["channels"]["HTML5"] == true: 99 | butler_push( 100 | str(presets_dict["directory"], "/html5"), 101 | presets_dict["user"], 102 | presets_dict["game"], 103 | "html5", 104 | presets_dict["async mode"] 105 | ) 106 | 107 | -------------------------------------------------------------------------------- /addons/build-and-deploy/Dock Script.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends Control 3 | 4 | var settings = { 5 | "off_path": false, 6 | "butler_path": "butler" 7 | } 8 | 9 | 10 | var plugin_persistant_data = "res://addons/build-and-deploy/persistant.save" 11 | 12 | 13 | var persistant_dict = { 14 | "Deploy": {}, 15 | "QuickDeploy": {}, 16 | "Settings": {} 17 | } 18 | 19 | 20 | #var blank_presets_dict: Dictionary = { 21 | # "is logged in": false, 22 | # "directory": "", 23 | # "user": "", 24 | # "game": "", 25 | # "channels": { 26 | # "Windows": false, 27 | # "Linux": false, 28 | # "Mac": false, 29 | # "HTML5": false 30 | # }, 31 | # "async mode": true 32 | #} 33 | 34 | 35 | func save_build_presets(): 36 | $TabBox/Deploy.update_presets() 37 | $TabBox/QuickDeploy.update_presets() 38 | # $Build.update_presets() 39 | print("saving deploy presets with: ", $TabBox/Deploy.presets_dict) 40 | persistant_dict["Deploy"] = $TabBox/Deploy.presets_dict 41 | persistant_dict["QuickDeploy"] = $TabBox/QuickDeploy.presets_dict 42 | persistant_dict["Settings"] = settings 43 | print("settings:", settings) 44 | # persistant_dict["Build"] = $Build.build_presets 45 | var file = FileAccess.open(plugin_persistant_data, FileAccess.WRITE) 46 | file.store_var(persistant_dict, true) 47 | file.close() 48 | 49 | 50 | func load_build_presets(): 51 | if FileAccess.file_exists(plugin_persistant_data): 52 | var file = FileAccess.open(plugin_persistant_data, FileAccess.READ) 53 | persistant_dict = Dictionary(file.get_var()) 54 | # $Build.build_presets = persistant_dict["Build"] 55 | $TabBox/Deploy.presets_dict = persistant_dict["Deploy"] 56 | $TabBox/QuickDeploy.presets_dict = persistant_dict["QuickDeploy"] 57 | if persistant_dict.has("Settings"): 58 | settings = persistant_dict["Settings"] 59 | file.close() 60 | update_ui() 61 | else: 62 | persistant_dict["Settings"] = settings 63 | persistant_dict["Deploy"] = $TabBox/Deploy.presets_dict 64 | persistant_dict["QuickDeploy"] = $TabBox/QuickDeploy.presets_dict 65 | var file = FileAccess.open(plugin_persistant_data, FileAccess.WRITE) 66 | file.store_var(persistant_dict, true) 67 | file.close() 68 | 69 | 70 | func update_ui(): 71 | var deploy_presets = $TabBox/Deploy.presets_dict 72 | print("updating ui with: ", deploy_presets) 73 | $TabBox/Deploy/ScrollContainer/VBoxContainer/User.text = deploy_presets["user"] 74 | $TabBox/Deploy/ScrollContainer/VBoxContainer/Game.text = deploy_presets["game"] 75 | $TabBox/Deploy/ScrollContainer/VBoxContainer/BuildDir.text = deploy_presets["directory"] 76 | $TabBox/Deploy/ScrollContainer/VBoxContainer/Windows.set_pressed(deploy_presets["channels"]["Windows"]) 77 | $TabBox/Deploy/ScrollContainer/VBoxContainer/Linux.set_pressed(deploy_presets["channels"]["Linux"]) 78 | $TabBox/Deploy/ScrollContainer/VBoxContainer/Mac.set_pressed(deploy_presets["channels"]["Mac"]) 79 | $TabBox/Deploy/ScrollContainer/VBoxContainer/HTML5.set_pressed(deploy_presets["channels"]["HTML5"]) 80 | $TabBox/Deploy/ScrollContainer/VBoxContainer/Async.set_pressed(deploy_presets["async mode"]) 81 | 82 | var Quickdeploy_presets = $TabBox/QuickDeploy.presets_dict 83 | print("updating ui with: ", deploy_presets) 84 | $TabBox/QuickDeploy/ScrollContainer/VBoxContainer/User.text = Quickdeploy_presets["user"] 85 | $TabBox/QuickDeploy/ScrollContainer/VBoxContainer/Game.text = Quickdeploy_presets["game"] 86 | $TabBox/QuickDeploy/ScrollContainer/VBoxContainer/BuildDir.text = Quickdeploy_presets["directory"] 87 | $TabBox/QuickDeploy/ScrollContainer/VBoxContainer/Channel.text = Quickdeploy_presets["channel"] 88 | $TabBox/QuickDeploy/ScrollContainer/VBoxContainer/Async.set_pressed(Quickdeploy_presets["async mode"]) 89 | 90 | show_hide_butler(settings["off_path"]) 91 | $TabBox/Settings/ScrollContainer/VBoxContainer/ButPath.text = settings["butler_path"] 92 | $TabBox/Settings/ScrollContainer/VBoxContainer/offPathToggle.set_pressed(settings["off_path"]) 93 | 94 | # var Build_presets = $Build.build_presets 95 | # print("updating ui with: ", Build_presets) 96 | # $Build/VBoxContainer/Game.text = Build_presets["game"] 97 | # $Build/VBoxContainer/BuildDir.text = Build_presets["directory"] 98 | # $Build/VBoxContainer/Windows.set_pressed(Build_presets["channels"]["Windows"]) 99 | # $Build/VBoxContainer/Linux.set_pressed(Build_presets["channels"]["Linux"]) 100 | # $Build/VBoxContainer/Mac.set_pressed(Build_presets["channels"]["Mac"]) 101 | # $Build/VBoxContainer/HTML5.set_pressed(Build_presets["channels"]["HTML5"]) 102 | # $Build/VBoxContainer/Async.set_pressed(Build_presets["async mode"]) 103 | 104 | 105 | func _ready(): 106 | load_build_presets() 107 | 108 | 109 | func _on_SavePresets_pressed(): 110 | save_build_presets() 111 | 112 | 113 | func _on_SelectDir_pressed(): 114 | $FileDialog.popup() 115 | 116 | 117 | func _on_FileDialog_dir_selected(dir): 118 | print("Selected directory: ", dir) 119 | $TabBox/Deploy/ScrollContainer/VBoxContainer/BuildDir.text = dir 120 | 121 | 122 | func _on_QuickSelectDir_pressed(): 123 | $QuickFile.popup() 124 | 125 | 126 | func _on_QuickFile_dir_selected(dir): 127 | print("Selected directory: ", dir) 128 | $TabBox/QuickDeploy/ScrollContainer/VBoxContainer/BuildDir.text = dir 129 | 130 | 131 | func _on_offPathToggle_toggled(button_pressed): 132 | settings["off_path"] = button_pressed 133 | show_hide_butler(button_pressed) 134 | 135 | 136 | 137 | func show_hide_butler(toggle): 138 | if toggle: 139 | $TabBox/Settings/ScrollContainer/VBoxContainer/SelectPath.show() 140 | $TabBox/Settings/ScrollContainer/VBoxContainer/ButPath.show() 141 | else: 142 | $TabBox/Settings/ScrollContainer/VBoxContainer/SelectPath.hide() 143 | $TabBox/Settings/ScrollContainer/VBoxContainer/ButPath.hide() 144 | 145 | 146 | func _on_SelectPath_pressed(): 147 | $ButlerPath.popup() 148 | 149 | 150 | func _on_ButlerPath_file_selected(path): 151 | settings["butler_path"] = path 152 | $TabBox/Settings/ScrollContainer/VBoxContainer/ButPath.text = settings["butler_path"] 153 | 154 | 155 | func _on_SaveSett_pressed(): 156 | settings["off_path"] = $TabBox/Settings/ScrollContainer/VBoxContainer/offPathToggle.is_pressed() 157 | settings["butler_path"] = $TabBox/Settings/ScrollContainer/VBoxContainer/ButPath.text 158 | $TabBox/Deploy.butler_path = settings["butler_path"] 159 | $TabBox/QuickDeploy.butler_path = settings["butler_path"] 160 | save_build_presets() 161 | -------------------------------------------------------------------------------- /addons/build-and-deploy/Export Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uberfig/godot-build-and-deploy-plugin/f8b6d9a9019e1d31bf04538025209aecef5c6f2d/addons/build-and-deploy/Export Example.png -------------------------------------------------------------------------------- /addons/build-and-deploy/Game Name Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uberfig/godot-build-and-deploy-plugin/f8b6d9a9019e1d31bf04538025209aecef5c6f2d/addons/build-and-deploy/Game Name Example.png -------------------------------------------------------------------------------- /addons/build-and-deploy/Old_Build_Menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://addons/build-and-deploy/Build.gd" type="Script" id=1] 4 | 5 | [node name="Build" type="Control"] 6 | anchor_right = 1.0 7 | anchor_bottom = 1.0 8 | margin_left = 4.0 9 | margin_top = 32.0 10 | margin_right = -4.0 11 | margin_bottom = -4.0 12 | script = ExtResource( 1 ) 13 | 14 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 15 | anchor_right = 1.0 16 | anchor_bottom = 1.0 17 | __meta__ = { 18 | "_edit_use_anchors_": false 19 | } 20 | 21 | [node name="ChannelsLabel" type="Label" parent="VBoxContainer"] 22 | margin_right = 1016.0 23 | margin_bottom = 14.0 24 | text = "Select which platforms you would like to build for, and fill in your project's name" 25 | autowrap = true 26 | 27 | [node name="Label" type="Label" parent="VBoxContainer"] 28 | margin_top = 18.0 29 | margin_right = 1016.0 30 | margin_bottom = 32.0 31 | text = "Please Note: you will need to configure the EDITOR's export presets in the EDITOR's export menu" 32 | autowrap = true 33 | 34 | [node name="Game" type="LineEdit" parent="VBoxContainer"] 35 | margin_top = 36.0 36 | margin_right = 1016.0 37 | margin_bottom = 60.0 38 | hint_tooltip = "If you already have the name of your game set in the export menu you can skip this step" 39 | placeholder_text = "Game Name" 40 | 41 | [node name="Windows" type="CheckBox" parent="VBoxContainer"] 42 | margin_top = 64.0 43 | margin_right = 1016.0 44 | margin_bottom = 88.0 45 | text = "Windows" 46 | 47 | [node name="Linux" type="CheckBox" parent="VBoxContainer"] 48 | margin_top = 92.0 49 | margin_right = 1016.0 50 | margin_bottom = 116.0 51 | text = "Linux" 52 | 53 | [node name="Mac" type="CheckBox" parent="VBoxContainer"] 54 | margin_top = 120.0 55 | margin_right = 1016.0 56 | margin_bottom = 144.0 57 | text = "Mac" 58 | 59 | [node name="HTML5" type="CheckBox" parent="VBoxContainer"] 60 | margin_top = 148.0 61 | margin_right = 1016.0 62 | margin_bottom = 172.0 63 | text = "HTML5" 64 | 65 | [node name="Async" type="CheckBox" parent="VBoxContainer"] 66 | margin_top = 176.0 67 | margin_right = 1016.0 68 | margin_bottom = 200.0 69 | hint_tooltip = "when in pause mode (recommended) the editor will pause it's process until the build is finished (you will not be able to interact with the editor until butler is done)" 70 | pressed = true 71 | text = "Pause Mode" 72 | 73 | [node name="SavePresets" type="Button" parent="VBoxContainer"] 74 | margin_top = 204.0 75 | margin_right = 1016.0 76 | margin_bottom = 224.0 77 | hint_tooltip = "save currently selected presets to persistant storage" 78 | text = "Save Presets" 79 | align = 0 80 | 81 | [node name="Build" type="Button" parent="VBoxContainer"] 82 | margin_top = 228.0 83 | margin_right = 1016.0 84 | margin_bottom = 248.0 85 | text = "Build" 86 | align = 0 87 | __meta__ = { 88 | "_edit_use_anchors_": false 89 | } 90 | 91 | [node name="SelectDir" type="Button" parent="VBoxContainer"] 92 | visible = false 93 | margin_top = 210.0 94 | margin_right = 1016.0 95 | margin_bottom = 230.0 96 | text = "Click to select a directory" 97 | align = 0 98 | 99 | [node name="BuildDir" type="LineEdit" parent="VBoxContainer"] 100 | visible = false 101 | margin_top = 210.0 102 | margin_right = 1016.0 103 | margin_bottom = 234.0 104 | placeholder_text = "Path To Build Folder" 105 | 106 | [node name="FileDialog" type="FileDialog" parent="."] 107 | margin_right = 315.0 108 | margin_bottom = 131.5 109 | rect_min_size = Vector2( 250, 87.5 ) 110 | window_title = "Open a Directory" 111 | resizable = true 112 | dialog_text = "Select a Directory to Build into" 113 | mode = 2 114 | access = 2 115 | current_dir = "/Users/aidan_v7p35uv/Documents/figroot/godot-build-and-deploy-plugin" 116 | current_path = "/Users/aidan_v7p35uv/Documents/figroot/godot-build-and-deploy-plugin/" 117 | 118 | [connection signal="pressed" from="VBoxContainer/Build" to="." method="_on_Build_pressed"] 119 | [connection signal="pressed" from="VBoxContainer/SelectDir" to="." method="_on_SelectDir_pressed"] 120 | [connection signal="dir_selected" from="FileDialog" to="." method="_on_FileDialog_dir_selected"] 121 | -------------------------------------------------------------------------------- /addons/build-and-deploy/Presets Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uberfig/godot-build-and-deploy-plugin/f8b6d9a9019e1d31bf04538025209aecef5c6f2d/addons/build-and-deploy/Presets Example.png -------------------------------------------------------------------------------- /addons/build-and-deploy/QuickDeploy.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends Control 3 | 4 | var butler_path = "butler" 5 | 6 | 7 | var presets_dict: Dictionary = { 8 | "is logged in": false, 9 | "directory": "", 10 | "user": "", 11 | "game": "", 12 | "channel": "", 13 | "async mode": true 14 | } 15 | 16 | 17 | func butler_login(): 18 | var output = [] 19 | var array = ["login"] 20 | var args = PackedStringArray(array) 21 | OS.execute(butler_path, args, output) 22 | 23 | 24 | func butler_logout(): 25 | var output = [] 26 | var array = ["logout"] 27 | var args = PackedStringArray(array) 28 | OS.execute(butler_path, args, output) 29 | 30 | 31 | func butler_push(directory: String, user: String, game: String, channel: String, async_mode:= false): 32 | #channel is the slot the game is uploaded to, for example windows-beta 33 | 34 | var output = [] 35 | var array = ["push", str(directory), str(user, "/", game, ":", channel)] 36 | var args = PackedStringArray(array) 37 | if async_mode: 38 | var thread = Thread.new() 39 | thread.start(func(): OS.execute(butler_path, args, output)) 40 | else: 41 | OS.execute(butler_path, args, output) 42 | 43 | 44 | func _on_Login_pressed(): 45 | butler_login() 46 | 47 | 48 | func _on_Logout_pressed(): 49 | butler_logout() 50 | 51 | 52 | func update_presets(): 53 | presets_dict["directory"] = $ScrollContainer/VBoxContainer/BuildDir.text 54 | presets_dict["user"] = $ScrollContainer/VBoxContainer/User.text 55 | presets_dict["game"] = $ScrollContainer/VBoxContainer/Game.text 56 | presets_dict["channel"] = $ScrollContainer/VBoxContainer/Channel.text 57 | presets_dict["async mode"] = $ScrollContainer/VBoxContainer/Async.is_pressed() 58 | print("presets updated with: ", presets_dict) 59 | 60 | 61 | func _on_ItchPush_pressed(): 62 | update_presets() 63 | print("started deploy with presets: ", presets_dict) 64 | 65 | butler_push( 66 | presets_dict["directory"], 67 | presets_dict["user"], 68 | presets_dict["game"], 69 | presets_dict["channel"], 70 | presets_dict["async mode"] 71 | ) 72 | 73 | print("finished deploy") 74 | 75 | -------------------------------------------------------------------------------- /addons/build-and-deploy/build-and-deploy.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends EditorPlugin 3 | 4 | 5 | # A class member to hold the dock during the plugin life cycle. 6 | var dock 7 | 8 | 9 | func _enter_tree(): 10 | # Initialization of the plugin goes here. 11 | # Load the dock scene and instance it. 12 | dock = preload("res://addons/build-and-deploy/Build_and_Deploy.tscn").instantiate() 13 | 14 | # Add the loaded scene to the docks. 15 | add_control_to_dock(DOCK_SLOT_RIGHT_UL, dock) 16 | # Note that LEFT_UL means the left of the editor, upper-left dock. 17 | 18 | 19 | func _exit_tree(): 20 | # Clean-up of the plugin goes here. 21 | # Remove the dock. 22 | remove_control_from_docks(dock) 23 | # Erase the control from the memory. 24 | dock.free() 25 | -------------------------------------------------------------------------------- /addons/build-and-deploy/directory example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uberfig/godot-build-and-deploy-plugin/f8b6d9a9019e1d31bf04538025209aecef5c6f2d/addons/build-and-deploy/directory example.png -------------------------------------------------------------------------------- /addons/build-and-deploy/export all example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uberfig/godot-build-and-deploy-plugin/f8b6d9a9019e1d31bf04538025209aecef5c6f2d/addons/build-and-deploy/export all example.png -------------------------------------------------------------------------------- /addons/build-and-deploy/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="One Click Build and Deploy" 4 | description="this plugin allows you to build your project and deploy it to Itch with one click" 5 | author="Aidan Gifford" 6 | version="1.5" 7 | script="build-and-deploy.gd" 8 | --------------------------------------------------------------------------------