mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Fix for drag end touch fro mobule, update contributing, update input examples to make better for mobile (move up)
This commit is contained in:
parent
4e71fee9ba
commit
8155d649ab
127
CONTRIBUTING
127
CONTRIBUTING
@ -1,67 +1,116 @@
|
|||||||
# Contribution Guidelines
|
# Contributing to Druid
|
||||||
|
|
||||||
Hello, Defolder! Thanks for your interest in contributing to the **Druid** project. It's a massive project that has been around for a long time, and it's still growing. This project has a lot of places where you can help!
|
Thank you for your interest in contributing to **Druid**! We welcome contributions of all sizes - even small fixes make a big difference.
|
||||||
|
|
||||||
Finally, there are set of instructions that will help you to contribute to the project.
|
## Table of Contents
|
||||||
|
- [How to Report Issues](#how-to-report-issues)
|
||||||
|
- [Small Fixes](#small-fixes)
|
||||||
|
- [Larger Contributions](#larger-contributions)
|
||||||
|
- [Documentation Updates](#documentation-updates)
|
||||||
|
- [Adding or Updating Examples](#adding-or-updating-examples)
|
||||||
|
- [Unit Tests](#unit-tests)
|
||||||
|
|
||||||
Thanks for your help!
|
## How to Report Issues
|
||||||
|
|
||||||
## Issue Reporting
|
Found a bug? Please report it to our [issue tracker](https://github.com/druid-js/druid/issues) with:
|
||||||
|
- A clear description of the problem
|
||||||
|
- Steps to reproduce the issue
|
||||||
|
- Expected vs. actual behavior
|
||||||
|
- Your environment (Defold version, OS, etc.)
|
||||||
|
|
||||||
If you find any bugs, please report them to the [issue tracker](https://github.com/druid-js/druid/issues).
|
## Small Fixes
|
||||||
|
|
||||||
## Pull Requests
|
**We highly encourage small improvements!** For bug fixes, typo corrections, or minor improvements, you can create a pull request directly to the `master` or `develop` branch.
|
||||||
|
|
||||||
Any pull requests are welcome!
|
When making these contributions, you **must**:
|
||||||
|
|
||||||
Please, open PR against the `develop` branch. Very nice to have an issue, which this PR fixes.
|
1. Update the patch version number in both:
|
||||||
|
- `README.md` file (in the dependency section)
|
||||||
|
- `game.project` file (in the project section)
|
||||||
|
2. Add your changes to `wiki/changelog.md`
|
||||||
|
3. These steps are required to properly tag a new release
|
||||||
|
|
||||||
You fix should contains only changes, which are related to the issue. Also please keep the code style the same!
|
**Example of version updates:**
|
||||||
|
|
||||||
❤️ Thanks ❤️
|
For README.md:
|
||||||
|
```
|
||||||
|
# Before
|
||||||
|
https://github.com/Insality/druid/archive/refs/tags/1.1.0.zip
|
||||||
|
|
||||||
## Update Documentation
|
# After (patch version increased)
|
||||||
|
https://github.com/Insality/druid/archive/refs/tags/1.1.1.zip
|
||||||
|
```
|
||||||
|
|
||||||
If you see any mistakes in the documentation, you can update it by yourself with the following steps:
|
For game.project:
|
||||||
|
```
|
||||||
|
# Before
|
||||||
|
[project]
|
||||||
|
title = Druid
|
||||||
|
version = 1.1.0
|
||||||
|
|
||||||
- Fork Druid repository
|
# After (patch version increased)
|
||||||
- Create a new branch for your changes
|
[project]
|
||||||
- Make your changes and commit them
|
title = Druid
|
||||||
- Push your changes to your fork
|
version = 1.1.1
|
||||||
- Create a pull request to the Druid repository `develop` branch
|
```
|
||||||
|
|
||||||
|
## Larger Contributions
|
||||||
|
|
||||||
## Add or Update Examples
|
For new features, major improvements, or complex fixes:
|
||||||
|
|
||||||
Examples contains a GUI scene, a Druid widget for this GUI. This GUI is included to the `examples.gui` and the information about examples are added in `examples_list.lua` file
|
1. Fork the repository
|
||||||
|
2. Create a branch from `develop`
|
||||||
|
3. Make your changes
|
||||||
|
4. Ensure code follows project style guidelines
|
||||||
|
5. Test your changes thoroughly
|
||||||
|
6. Submit a pull request to the `develop` branch
|
||||||
|
7. Include references to any related issues (e.g., "Fixes #123")
|
||||||
|
|
||||||
You can add new examples or update existing ones.
|
Please keep changes focused on addressing specific issues or features, and maintain the existing code style.
|
||||||
|
|
||||||
To add new example, you need to create a new folder in the `examples` directory.
|
## Documentation Updates
|
||||||
|
|
||||||
On your repo fork:
|
To improve documentation:
|
||||||
|
|
||||||
- Create a gui file with the example inside `/example/examples` directory
|
1. Fork the repository
|
||||||
- Add the example info to the `examples_list.lua` file.
|
2. Create a branch for your changes
|
||||||
- Add this GUI template to the `/example/druid.gui` file
|
3. Update the relevant documentation files
|
||||||
- GUI should be placed inside relative example parent, e.g. `root -> container_center -> examples -> widgets`
|
4. Submit a pull request to the `master` or `develop` branch
|
||||||
- Test the example by running the game
|
|
||||||
- Create a pull request to the `develop` branch
|
|
||||||
|
|
||||||
|
Clear, accurate documentation helps everyone, so documentation improvements are always appreciated!
|
||||||
|
|
||||||
## Add or Update Unit Tests
|
## Adding or Updating Examples
|
||||||
|
|
||||||
The unit tests was updated to cover more Druid's source code. So now I have more examples how to run and check some parts of the code.
|
Examples are vital for helping users understand how to use Druid. Each example should include:
|
||||||
|
|
||||||
In case you face issue and want to reproduce it, you also can starts from the unit tests:
|
1. A GUI scene with a Druid widget
|
||||||
|
2. Information about the example in `examples_list.lua`
|
||||||
|
|
||||||
All tests placed in the `/test/tests` directory.
|
To add a new example:
|
||||||
|
|
||||||
To run tests you need to set the bootstrap collection to `/test/test.collection` and run it.
|
1. Create a new GUI file in the `/example/examples` directory
|
||||||
|
2. Add the example information to `examples_list.lua`
|
||||||
|
3. Include your GUI template in `/example/druid.gui`
|
||||||
|
- Place it inside the proper hierarchy: `root -> container_center -> examples -> widgets`
|
||||||
|
4. Test your example by running the game
|
||||||
|
5. Submit a pull request to the `develop` branch
|
||||||
|
|
||||||
So the flow will be the similar:
|
## Unit Tests
|
||||||
|
|
||||||
- Create a new branch for your changes
|
Unit tests help ensure Druid works correctly. If you're facing an issue, unit tests can be a good starting point to understand or reproduce it.
|
||||||
- Make your changes and commit them
|
|
||||||
- Push your changes to your fork
|
All tests are located in the `/test/tests` directory.
|
||||||
- Create a pull request to the Druid repository `develop` branch
|
|
||||||
|
To run tests:
|
||||||
|
1. Set the bootstrap collection to `/test/test.collection`
|
||||||
|
2. Run the project
|
||||||
|
|
||||||
|
To submit new or updated tests:
|
||||||
|
1. Create a branch for your changes
|
||||||
|
2. Add or modify tests
|
||||||
|
3. Verify your tests pass
|
||||||
|
4. Submit a pull request to the `develop` branch
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Thank you for contributing to making Druid better for everyone! ❤️
|
||||||
|
@ -223,7 +223,7 @@ Special thanks to all the contributors who have helped make **Druid** better!
|
|||||||
<img src="https://contributors-img.web.app/image?repo=insality/druid"/>
|
<img src="https://contributors-img.web.app/image?repo=insality/druid"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
Read the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
|
Read the [CONTRIBUTING](CONTRIBUTING) file for more information.
|
||||||
|
|
||||||
|
|
||||||
## ❤️ Support project ❤️
|
## ❤️ Support project ❤️
|
||||||
|
@ -162,7 +162,7 @@ function M:on_input(action_id, action)
|
|||||||
if touch.released and self.is_touch then
|
if touch.released and self.is_touch then
|
||||||
if action.touch then
|
if action.touch then
|
||||||
-- Mobile
|
-- Mobile
|
||||||
self:_on_touch_release(action_id, action)
|
self:_on_touch_release(action_id, action, touch)
|
||||||
else
|
else
|
||||||
-- PC
|
-- PC
|
||||||
self:_end_touch(touch)
|
self:_end_touch(touch)
|
||||||
@ -321,7 +321,8 @@ end
|
|||||||
---touches exists to switch to another touch.
|
---touches exists to switch to another touch.
|
||||||
---@param action_id hash Action id from on_input
|
---@param action_id hash Action id from on_input
|
||||||
---@param action table Action from on_input
|
---@param action table Action from on_input
|
||||||
function M:_on_touch_release(action_id, action)
|
---@param touch table Touch action
|
||||||
|
function M:_on_touch_release(action_id, action, touch)
|
||||||
if #action.touch >= 2 then
|
if #action.touch >= 2 then
|
||||||
-- Find next unpressed touch
|
-- Find next unpressed touch
|
||||||
local next_touch
|
local next_touch
|
||||||
@ -337,10 +338,10 @@ function M:_on_touch_release(action_id, action)
|
|||||||
self.y = next_touch.y
|
self.y = next_touch.y
|
||||||
self.touch_id = next_touch.id
|
self.touch_id = next_touch.id
|
||||||
else
|
else
|
||||||
self:_end_touch()
|
self:_end_touch(touch)
|
||||||
end
|
end
|
||||||
elseif #action.touch == 1 then
|
elseif #action.touch == 1 then
|
||||||
self:_end_touch()
|
self:_end_touch(touch)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@ nodes {
|
|||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
|
position {
|
||||||
|
y: 301.0
|
||||||
|
}
|
||||||
type: TYPE_TEMPLATE
|
type: TYPE_TEMPLATE
|
||||||
id: "input"
|
id: "input"
|
||||||
parent: "root"
|
parent: "root"
|
||||||
@ -29,7 +32,7 @@ nodes {
|
|||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
y: -150.0
|
y: 151.0
|
||||||
}
|
}
|
||||||
type: TYPE_TEMPLATE
|
type: TYPE_TEMPLATE
|
||||||
id: "input_2"
|
id: "input_2"
|
||||||
|
@ -9,6 +9,9 @@ nodes {
|
|||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
|
position {
|
||||||
|
y: 249.0
|
||||||
|
}
|
||||||
type: TYPE_TEMPLATE
|
type: TYPE_TEMPLATE
|
||||||
id: "input"
|
id: "input"
|
||||||
parent: "root"
|
parent: "root"
|
||||||
|
@ -13,6 +13,9 @@ nodes {
|
|||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
|
position {
|
||||||
|
y: 309.0
|
||||||
|
}
|
||||||
type: TYPE_TEMPLATE
|
type: TYPE_TEMPLATE
|
||||||
id: "rich_input"
|
id: "rich_input"
|
||||||
parent: "root"
|
parent: "root"
|
||||||
@ -57,7 +60,7 @@ nodes {
|
|||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
y: -150.0
|
y: 159.0
|
||||||
}
|
}
|
||||||
type: TYPE_TEMPLATE
|
type: TYPE_TEMPLATE
|
||||||
id: "rich_input_2"
|
id: "rich_input_2"
|
||||||
|
@ -681,3 +681,8 @@ And all my other supporters! Very appreciated!
|
|||||||
Please support me if you like this project! It will help me keep engaged to update **Druid** and make it even better!
|
Please support me if you like this project! It will help me keep engaged to update **Druid** and make it even better!
|
||||||
|
|
||||||
[](https://github.com/sponsors/insality) [](https://ko-fi.com/insality) [](https://www.buymeacoffee.com/insality)
|
[](https://github.com/sponsors/insality) [](https://ko-fi.com/insality) [](https://www.buymeacoffee.com/insality)
|
||||||
|
|
||||||
|
|
||||||
|
### Druid 1.1.X
|
||||||
|
|
||||||
|
- {Place for the community changelogs}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user