Skip to content

Commit

Permalink
Implemented selection plugin (#89)
Browse files Browse the repository at this point in the history
* Bumped core dependency

* Moved back the singleton signal

* Updated python requirement

* Added selection API

* Added library

* Bumped macos minimum version
  • Loading branch information
gentlegiantJGC authored Nov 5, 2024
1 parent 0ae63e9 commit 962c39d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ requires = [
"pybind11 ~= 2.12",
"Amulet-pybind11-extensions @ git+https://github.com/Amulet-Team/Amulet-pybind11-extensions.git@4d7292f3090bb739a55f8377c8f096d134910720",
"amulet_nbt ~= 4.0a2",
"amulet_core @ git+https://github.com/Amulet-Team/Amulet-Core.git@7844bec50b93c8711ae703840b1a0e43b8283df6"
"amulet_core @ git+https://github.com/Amulet-Team/Amulet-Core.git@f1e7a3852161a19e583c78e396ea9d7fa18618ec"
]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_compile_args() -> list[str]:
compile_args.append("-std=c++20")

if sys.platform == "darwin":
compile_args.append("-mmacosx-version-min=10.13")
compile_args.append("-mmacosx-version-min=10.15")
return compile_args


Expand Down
1 change: 1 addition & 0 deletions src/builtin_plugins/amulet_team_selection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ._api import get_selection, set_selection, selection_changed
17 changes: 17 additions & 0 deletions src/builtin_plugins/amulet_team_selection/_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from amulet.selection import SelectionGroup
from amulet_editor.models.generic._singleton_signal import SingletonSignal


_selection: SelectionGroup = SelectionGroup()

_selection_changed_obj, selection_changed = SingletonSignal(SelectionGroup)


def get_selection() -> SelectionGroup:
return _selection


def set_selection(selection: SelectionGroup) -> None:
global _selection
_selection = selection
selection_changed.emit(selection)
5 changes: 3 additions & 2 deletions src/builtin_plugins/amulet_team_selection/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "1.0.0",
"name": "Amulet Selection",
"depends": {
"python": "~=3.9",
"python": "~=3.11",
"plugin": [],
"library": [
"amulet_core~=2.0a8"
"amulet_core~=2.0a8",
"amulet_editor~=1.0a0"
]
},
"locked": "true"
Expand Down

0 comments on commit 962c39d

Please sign in to comment.