Giter Site home page Giter Site logo

samclane / discordmud Goto Github PK

View Code? Open in Web Editor NEW
21.0 6.0 1.0 968 KB

MUD game and server that uses discord as a player interface

License: GNU General Public License v3.0

Python 100.00%
discord python dungeon-crawler-game multi-user-dungeon mud mud-server mud-client mud-engine mud-game-server

discordmud's Introduction

Hi there ๐Ÿ‘‹

  • I'm currently looking for new work opportunities! Please feel free to drop me an email!
  • ๐Ÿ”ญ Iโ€™m currently working on ...
  • ๐ŸŒฑ Iโ€™m currently learning ...
    • Anything to do with LLMs
  • ๐Ÿ“ซ How to reach me: [email protected]
  • ๐Ÿ˜„ Pronouns: He/Him

Sawyer's github stats

discordmud's People

Contributors

samclane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kazuyabr

discordmud's Issues

WorldView doesn't resize sprites when zooming in

Pixelizes like one was zooming into a static image; however original sprite images are of higher quality than currently represented on the WorldView when zoomed in. Can be "fixed" by factoring parent zoom into squareWidth/Height functions, however this causes mouse-anchored zoom to no longer work.

The images must be resampled on zooming.

Middle Click to Pan

When working on the WorldFrame where I inherit from QGraphicsView to display a QGraphicsObject (WorldView). I have already implemented the image zoom functionality from this post, and I have tried using their implementation of pan, and have found that it works. However, I want to be able to do the pan without toggling, simply by holding down the middle mouse button and dragging from there.

I've written this code to switch between the two modes (normal and drag), and then call it on mouse(Press/Release)Events.

(in QGraphicsView)

def toggleDragMode(self):
    if self.dragMode() == QGraphicsView.ScrollHandDrag:
        self.setDragMode(QGraphicsView.NoDrag)
        self.pointerMode = PointerMode.Normal
    else:
        self.setDragMode(QGraphicsView.ScrollHandDrag)
        self.pointerMode = PointerMode.Drag

def mousePressEvent(self, event):
    if event.buttons() & Qt.MiddleButton:
        self.toggleDragMode()
    ...
    super().mousePressEvent(event)

def mouseReleaseEvent(self, event):
    if self.dragMode() == QGraphicsView.ScrollHandDrag:
        self.setDragMode(QGraphicsView.NoDrag)
        self.pointerMode = PointerMode.Normal
    super().mouseReleaseEvent(event)

(Sidenote: With the mouseReleaseEvent, I found that I couldn't use event.buttons() & Qt.MiddleButton to check if the middle button was released, so I always check and release in this case.)

However, whenever I try and middle-click and drag, no pan happens. However, I have confirmed this works correctly whenever I use the left mouse button as the binding (i.e. if event.buttons() & Qt.LeftButton: toggleDrag()). There has to be some code in QGraphicsView.mouseMoveEvent() that checks to see if the left button is held AND the cursor is in DragMode. Is there a way to change the keybinding on that deeper level?

EDIT: I just found this link and tried it by doing this (in QGraphicsView)

def __init__(*args, **kwargs):
  ...
  self.STOP_GLOBAL_SCROLLING = 1

But to no avail. Still, it's an interesting lead.


Here's the stackoverflow question

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.