Skip to content

Commit

Permalink
removed idm button
Browse files Browse the repository at this point in the history
  • Loading branch information
amir1387aht committed Aug 3, 2024
1 parent 714840f commit 6abef34
Show file tree
Hide file tree
Showing 31 changed files with 205 additions and 135 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/Unity Downloader/v17/.suo
Binary file not shown.
86 changes: 86 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Contributing to Unity Downloader

Thank you for your interest in contributing to Unity Downloader! We welcome contributions from the community to help make this project better. Please take a moment to review this guide to make the contribution process easy and effective for everyone involved.

## How Can I Contribute?

### Reporting Bugs

If you encounter a bug or an issue with Unity Downloader, please report it by opening an issue on GitHub. When reporting a bug, please include:

- A clear and descriptive title.
- A detailed description of the problem.
- Steps to reproduce the issue.
- Any relevant screenshots or logs.
- Information about your environment (e.g., OS version, Unity version).

### Suggesting Enhancements

We welcome suggestions for new features or improvements. To suggest an enhancement, please open an issue on GitHub and include:

- A clear and descriptive title.
- A detailed description of the enhancement.
- Rationale for why the enhancement would be useful.
- Any relevant examples or mockups.

### Submitting Pull Requests

If you want to contribute code, follow these steps:

1. **Fork the repository:**

Click the "Fork" button at the top right corner of the GitHub repository page.

2. **Clone your fork:**

```bash
git clone https://github.com/amir1387aht/Unity-Downloader.git
cd Unity-Downloader
```

3. **Create a new branch:**

```bash
git checkout -b feature/your-feature-name
```

4. **Make your changes:**

Make the necessary changes in your local repository.

5. **Commit your changes:**

```bash
git add .
git commit -m "Description of your changes"
```

6. **Push your changes to your fork:**

```bash
git push origin feature/your-feature-name
```

7. **Open a Pull Request:**

Go to the original repository and click on the "New Pull Request" button. Make sure to provide a clear and descriptive title and description for your pull request.

### Code Style

Please follow these guidelines to maintain consistency in the codebase:

- Use meaningful variable and function names.
- Write comments to explain complex code and logic.
- Format your code properly and consistently.

### Testing

If applicable, please write tests for your changes. Ensure that all tests pass before submitting your pull request.

## License

By contributing to Unity Downloader, you agree that your contributions will be licensed under the [MIT License](LICENSE).

---

Thank you for contributing to Unity Downloader! Your support and involvement are greatly appreciated.
84 changes: 83 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,84 @@
# Unity Downloader
the best tool to download unity modules without worring about internet connection and download stop

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Unity Downloader is a C# Windows Forms application designed to simplify and enhance the Unity editor experience. This application automatically identifies the installed version of the Unity editor and provides options for downloading compatible tools and assets. Unlike Unity Hub, Unity Downloader supports chunk-based, parallel downloads, allowing for pause and resume functionality, ensuring that your downloads can continue from where they left off if your internet connection is interrupted.

## Features

- **Automatic Detection:** Identifies installed Unity editor versions.
- **Download Management:** Displays available tools and assets for the detected Unity version.
- **Chunk-Based Downloads:** Utilizes the [Downloader package by Bezzad](https://github.com/bezzad/Downloader) for efficient, reliable downloads.
- **Pause and Resume:** Supports resuming downloads after an interruption, preventing the need to restart from the beginning.
- **Automatic Installation:** Automatically installs downloaded tools and assets, simplifying the setup process.
- **Proxy and DNS Support:** Allows configuring proxy settings and custom DNS for enhanced download flexibility and speed.

## Screenshots

![Main Screen](screenshots/main_screen.png)
Main Screen

![Download Screen](screenshots/download_screen.png)
Download Screen

## Installation

1. **Clone the repository:**

```bash
git clone https://github.com/amir1387aht/Unity-Downloader.git
```

2. **Open the project:**

Open the project in Visual Studio.

3. **Build the project:**

Build the solution to compile the application.

4. **Run the application:**

Run the application from Visual Studio or the executable file in the `bin` directory.

## Usage

1. **Launch Unity Downloader:**

Open the application. It will automatically detect installed Unity editor versions.

3. **Configure Proxy/DNS (Optional):**

If needed, configure your proxy settings or custom DNS for optimized downloads.

2. **Select Tools/Assets:**

Browse through the available tools and assets compatible with your Unity version.

3. **Download:**

Select the items you want to download. The app will use chunk-based, parallel downloading to ensure efficient and reliable downloads.

4. **Install:**

After downloading, Unity Downloader will automatically install the tools and assets, making them ready for use in your projects.

## Dependencies

- [Downloader package by Bezzad](https://github.com/bezzad/Downloader)

## Contributing

We welcome contributions! Please read our [contributing guidelines](CONTRIBUTING.md) for more details.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Disclaimer

Unity Downloader is an independent project and is not affiliated with or endorsed by Unity Technologies. Use this application at your own risk. While we strive to provide a reliable tool, we are not responsible for any issues that may arise from using this application, including but not limited to data loss or corruption, download failures, or compatibility problems.

## Contact

For any questions or issues, please open an issue on GitHub or contact the maintainer at [[email protected]] or on telegram at [@Do3p3iri].
76 changes: 0 additions & 76 deletions Unity Downloader/AppDownloadForm.Designer.cs

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

36 changes: 13 additions & 23 deletions Unity Downloader/AppDownloadForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum ActionButtonEnum { Pause, Resume, Retry }

private FileStream downloadFileStream;

private string tempDownloadDirectoryName = "unity_downloader";
private string tempDownloadPath = "";

private const int timeToUpdateUI = 170, timeToSaveProgress = 5000; // MiliSeconds

Expand All @@ -45,7 +45,9 @@ public AppDownloadForm(Form lastForm, UnityReleaseModule module)
LastForm = lastForm;
CurrentModule = module;

tempDownloadDirectoryName = Path.Combine(Path.GetTempPath(), tempDownloadDirectoryName);
tempDownloadPath = Path.Combine(Path.GetTempPath(), "unity_downloader", MainForm.SelectedEditor);

if (!Directory.Exists(tempDownloadPath)) Directory.CreateDirectory(tempDownloadPath);

InitializeComponent();

Expand Down Expand Up @@ -84,7 +86,6 @@ public AppDownloadForm(Form lastForm, UnityReleaseModule module)
downloader.DownloadFileCompleted += OnDownloadFileCompleted;

SetActionButtonType(ActionButtonEnum.Pause);
SetChoosePanelVisibility(true);

ActionButton.Enabled = false;
DownloadProgressBar.Value = 0;
Expand All @@ -95,9 +96,12 @@ public AppDownloadForm(Form lastForm, UnityReleaseModule module)
TimeLeftLabel.Text = "Time Left : Calculating...";

ShowPendingText(CurrentModule.SubModules);
ChangeFormSizeToMinimum();

InitializeProgressBars();

SetupForm();

StartDownload();
}

private void InitializeProgressBars()
Expand All @@ -106,7 +110,7 @@ private void InitializeProgressBars()
{
progressBars[i] = new CustomProgressBar
{
Location = new Point((i * 52) + 81, 15),
Location = new Point((i * 52) + 7, 15),
Size = new Size(55, 15),
ForeColor = Color.Blue,
Anchor = AnchorStyles.Top
Expand All @@ -129,9 +133,9 @@ private async void StartDownload()
try
{
// Set file paths
CurrentFilePath = Path.Combine(tempDownloadDirectoryName, $"{CurrentModule.Name}.{CurrentModule.Type.ToLower()}");
ProgressFilePath = Path.Combine(tempDownloadDirectoryName, $"{CurrentModule.Name}.{CurrentModule.Type.ToLower()}.json.tmp");
LogsFilePath = Path.Combine(tempDownloadDirectoryName, $"{CurrentModule.Name}.{CurrentModule.Type.ToLower()}.log");
CurrentFilePath = Path.Combine(tempDownloadPath, $"{CurrentModule.Name}.{CurrentModule.Type.ToLower()}");
ProgressFilePath = Path.Combine(tempDownloadPath, $"{CurrentModule.Name}.{CurrentModule.Type.ToLower()}.json.tmp");
LogsFilePath = Path.Combine(tempDownloadPath, $"{CurrentModule.Name}.{CurrentModule.Type.ToLower()}.log");

// Show Logs Path
AddLog($"Logs file can be found in \"{LogsFilePath}\"");
Expand Down Expand Up @@ -222,17 +226,6 @@ private void InvokeFunction(Action action)
else action();
}

private void IDMButton_Click(object sender, EventArgs e)
{
Close();
}

private void InAppButton_Click(object sender, EventArgs e)
{
ClearChooseAction();
StartDownload();
}

private void OnDownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
SaveProgress();
Expand Down Expand Up @@ -389,17 +382,14 @@ private void ShowPendingText(List<SubModule> subModules)
PendingLabel.Text = "Pending : " + string.Join(", ", subModules.Select(x => x.Name));
}

private void ClearChooseAction()
private void SetupForm()
{
ChangeFormSizeToMaximum();
SetFormLocationCenterOfParent();
SetChoosePanelVisibility(false);
}

private void ChangeFormSizeToMinimum() => Size = new Size(LastForm.Width, 380);
private void ChangeFormSizeToMaximum() => Size = new Size(LastForm.Width, LastForm.Height - 1);
private void SetFormLocationCenterOfParent() => Location = new Point(LastForm.Width / 2 - LastForm.Width / 2 + LastForm.Location.X, LastForm.Height / 2 - LastForm.Height / 2 + LastForm.Location.Y);
private void SetChoosePanelVisibility(bool v) => ChoosePanel.Visible = v;

private void ActionButton_Click(object sender, EventArgs e)
{
Expand Down
Loading

0 comments on commit 6abef34

Please sign in to comment.