diff --git a/Editor/Linux/Installer/ABOUT.md b/Editor/Linux/Installer/ABOUT.md new file mode 100644 index 000000000..fe84a007b --- /dev/null +++ b/Editor/Linux/Installer/ABOUT.md @@ -0,0 +1,13 @@ +# Wicked Engine Installer + +This directory holds all the source code for the Wicked Engine Editor installer. +The source code is from [this repository](https://github.com/MolassesLover/WickedEngine-Installer.git). +It is designed for package maintainers and distributors. It is fully functional, but very early +and prone to a lot of changes, it is a fairly big project. + +## Dependencies +All the dependencies are Python modules, you can install them with this command in your terminal: + +```bash +pip install pillow ttkbootstrap distro +``` diff --git a/Editor/Linux/Installer/Build.sh b/Editor/Linux/Installer/Build.sh new file mode 100644 index 000000000..d5ed937f6 --- /dev/null +++ b/Editor/Linux/Installer/Build.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +python Setup.py build_ext --inplace diff --git a/Editor/Linux/Installer/Distribution/wicked-engine.desktop b/Editor/Linux/Installer/Distribution/wicked-engine.desktop new file mode 100644 index 000000000..141fed28a --- /dev/null +++ b/Editor/Linux/Installer/Distribution/wicked-engine.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Name=Wicked Engine +Name[ja]=ウィケッドエンジン +GenericName=Game engine +GenericName[ja]=ゲームエンジン +Comment=A 3D game engine focusing on modern rendering. +Comment[nl]=Een 3D game engine gefocust op moderne weergave. +Comment[ja]=現代のレンダリングに焦点を当てた3Dゲームエンジ・ +Comment[pt]=Um engine de jogo 3D focado em renderização moderna. +Comment[pt_BR]=Um engine de jogo 3D focado em renderização moderna. +Keywords=3d;cg;modeling;animation;painting;texturing;rendering;render engine;game engine;lua; +Exec=wicked-engine +Icon=wicked +Terminal=true +Type=Application +Categories=Graphics;3DGraphics; diff --git a/Editor/Linux/Installer/Distribution/wicked-engine.sh b/Editor/Linux/Installer/Distribution/wicked-engine.sh new file mode 100755 index 000000000..f3e33479a --- /dev/null +++ b/Editor/Linux/Installer/Distribution/wicked-engine.sh @@ -0,0 +1,7 @@ +#!/usr/bin/zsh + +echo "Starting Wicked Engine" + +cd $WICKED + +./WickedEngineEditor diff --git a/Editor/Linux/Installer/Install.py b/Editor/Linux/Installer/Install.py new file mode 100644 index 000000000..b33e51ddc --- /dev/null +++ b/Editor/Linux/Installer/Install.py @@ -0,0 +1,95 @@ +#!/usr/bin/python + +#region Modules + +import os +import tkinter as Tk +from tkinter import filedialog + +import ttkbootstrap as TkBootstrap +from PIL import Image, ImageTk +from ttkbootstrap.constants import * +from ttkbootstrap.dialogs import * + +#endregion + +#region Variables + +class WickedDirectories: + wickedRootDirectory = "$WICKED" + wickedRootDirectorySelected = bool() + +#endregion + +#region Functions + +def Install(): + if(WickedDirectories.wickedRootDirectorySelected): + os.system('sudo cp ' + WickedDirectories.wickedRootDirectory + '/Editor/Linux/Installer/Distribution/wicked-engine.desktop /usr/share/applications/wicked-engine.desktop') + os.system('sudo cp ' + WickedDirectories.wickedRootDirectory + '/Editor/Linux/Installer/Distribution/wicked-engine.sh /usr/bin/wicked-engine') + os.system('sudo chmod +x ' + WickedDirectories.wickedRootDirectory + '/Editor/Linux/Installer/Distribution/wicked-engine.sh') + os.system('sudo chmod +x /usr/bin/wicked-engine') + + # Feel free to move this if in your fork it isn't the case. + print("Finished installing!") + + # The two following `if` statements are for package maintainers or distributors to edit and use! + # Please @MolassesLover on the Discord or create a GitHub issue if these statements break. + + #if(checkButton_denoiser.offvalue): + # pass + #else: + # pass + + #if(checkButton_settings.offvalue): + # pass + #else: + # pass + + else: + directoryWarning = Messagebox.ok("No Wicked Engine directory selected!", title = "Install Error") + +def SelectDirectory(): + WickedDirectories.wickedRootDirectory = filedialog.askdirectory(initialdir = "../../../", title = "Select Wicked Folder") + WickedDirectories.wickedRootDirectorySelected = True + +#endregio + +if __name__ == "__main__": + #region Tk Interface variables + + window = TkBootstrap.Window() + window.title("Wicked Engine Installer") + window.resizable(False, False) + style = TkBootstrap.Style("darkly") + + screenWidth = int(window.winfo_screenwidth()/3) + screenHeight = int(window.winfo_screenheight()/5) + + #endregion + + #region Tk Interface widgets + + button_install = TkBootstrap.Button(text = "start install", bootstyle = 'success', command = Install) + button_path = TkBootstrap.Button(text = "select source folder", bootstyle = 'default', command = SelectDirectory) + checkButton_denoiser = TkBootstrap.Checkbutton(text = "add denoising", bootstyle = 'outline-toolbutton') + checkButton_settings = TkBootstrap.Checkbutton(text = "copy settings", bootstyle = 'outline-toolbutton') + entry_path = TkBootstrap.Entry(text = "root directory", bootstyle = 'default') + label_info = TkBootstrap.Label(text = "Wicked Engine folder:") + + #endregion + + #region Window changes, widget packing/placing, etc. + + window.geometry(str(screenWidth) + 'x' + str(screenHeight)) # Needs to be strings for some reason? + + button_install.place(relx = 0.5, rely = 0.75, anchor = CENTER) + button_path.place(relx = 0.5, rely = 0.5, anchor = CENTER) + + # These two lines are up to the package maintainer to use or not! + #checkButton_denoiser.place(relx = 0.25, rely = 0.325, anchor = CENTER) + #checkButton_settings.place(relx = 0.25, rely = 0.650, anchor = CENTER) + + window.mainloop() # No changes should be applied after this. + + #endregion diff --git a/Editor/Linux/Installer/Settings/ABOUT.md b/Editor/Linux/Installer/Settings/ABOUT.md new file mode 100644 index 000000000..7527f93d0 --- /dev/null +++ b/Editor/Linux/Installer/Settings/ABOUT.md @@ -0,0 +1,42 @@ +# Settings + +A brief explanation of Wicked Engine's settings. + +## About + +This folder contains settings files optionally copied over to your Wicked +Engine installation directory. + +### Configuration + +The `config.ini` file is responsible for a few options. All changes in the +`config.ini` file must be done with [integers](https://en.wikipedia.org/wiki/Integer), +I.E whole numbers. A value of **0** is equal to **false** and a value of **1** +is equal to **true**. This means the numbers are stand-ins for the +[boolean](https://en.wikipedia.org/wiki/Boolean_data_type) data type. + +#### Variables +There's a lot of variables to change around to customise your `config.ini` file. +Here's their documentation: + +- The `enabled` variable toggles whether to enable or ignore the `config.ini`. +- The `x` and `y` +variables, which influence where your window appears when you open Wicked +Engine. +- The `w` and `h` variables control the width and height of your Wicked Engine window. +- The `fullscreen`variable controls whether your window goes full-screen when opening Wicked Engine. +- The `borderless` variable determines if your window should have borders or not. +- The `allow_hdr` variable toggles whether HDR should be used by Wicked Engine. + +### Start-up + +Wicked Engine automatically loads the `startup.lua` script if found. This script +is just like any other Wicked Engine Lua script. Rather than having set variables +for you to control, the script simply allows you do whatever you want. Have fun! + +#### Profiling +By default the `startup.lua` script contains `SetProfilerEnabled(false)`, which +sets the profiler to **false**. In order to enable the profiler on start-up, +simply change `SetProfilerEnabled(false)` to `SetProfilerEnabled(true)`! + + diff --git a/Editor/Linux/Installer/Settings/config.ini b/Editor/Linux/Installer/Settings/config.ini new file mode 100644 index 000000000..b708a40fb --- /dev/null +++ b/Editor/Linux/Installer/Settings/config.ini @@ -0,0 +1,8 @@ +enabled 1 +x 0 +y 0 +w 3840 +h 2160 +fullscreen 1 +borderless 0 +allow_hdr 1 diff --git a/Editor/Linux/Installer/Settings/startup.lua b/Editor/Linux/Installer/Settings/startup.lua new file mode 100644 index 000000000..beebdf49f --- /dev/null +++ b/Editor/Linux/Installer/Settings/startup.lua @@ -0,0 +1 @@ +SetProfilerEnabled(false) \ No newline at end of file diff --git a/Editor/Linux/Installer/Setup.py b/Editor/Linux/Installer/Setup.py new file mode 100644 index 000000000..5ee80c3b9 --- /dev/null +++ b/Editor/Linux/Installer/Setup.py @@ -0,0 +1,8 @@ +#!/usr/bin/python + +from setuptools import setup +from Cython.Build import cythonize + +setup( + ext_modules = cythonize("Install.py") +)