Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix compatibility with ppb 0.12.0 #8

Draft
wants to merge 2 commits into
base: canon
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions ppb_mutant/__init__.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
* TONES_ALL: Valid tone values for all morphs
"""
import ppb
from ppb.flags import DoNotRender
import weakref
import logging
import functools
@@ -227,7 +226,7 @@ def __call__(self, shortcode):
return e


class MutantSprite(ppb.BaseSprite):
class MutantSprite(ppb.Sprite):
"""
Deprecated
"""
@@ -243,8 +242,8 @@ def __init_subclass__(cls, **kwargs):

@property
def image(self):
if self.emoji is DoNotRender:
return DoNotRender
if self.emoji is None:
return None
else:
emoji = self.emoji.rsplit('/', 1)[-1]
if self._image is None or (
@@ -283,7 +282,7 @@ class SelectScene(ppb.BaseScene):
#: Hoof hands have incomplete emoji coverage, so games may choose to opt-out of it.
include_hoof = True

class Sprite(ppb.BaseSprite):
class Sprite(ppb.Sprite):
"""
The sprite to use in the menu
"""
8 changes: 4 additions & 4 deletions ppb_mutant/index.py
Original file line number Diff line number Diff line change
@@ -22,10 +22,10 @@ def on_update(self, event, signal):
self.spinner.rotation += self.rotation_rate * event.time_delta


class Region(ppb.BaseSprite):
class Region(ppb.Sprite):
@staticmethod
def get_vector(other):
if isinstance(other, ppb.BaseSprite):
if isinstance(other, ppb.Sprite):
return other.position
else:
return other
@@ -39,7 +39,7 @@ def contains(self, other):
)


class EmojiSprite(Region, ppb.BaseSprite):
class EmojiSprite(Region, ppb.Sprite):
def __init__(self, *p, **kw):
super().__init__(*p, **kw)

@@ -48,7 +48,7 @@ def on_button_pressed(self, mouse, signal):
print(self.image.shortcode)


class OpenMenuSprite(Region, ppb.BaseSprite):
class OpenMenuSprite(Region, ppb.Sprite):
image = Emoji('color_modifier')

def on_button_pressed(self, mouse, signal):