mirror of
https://github.com/bdnugget/runekit.git
synced 2026-11-07 09:07:30 +00:00
Add support for overlayImage
This commit is contained in:
1 parent
2d36573285
commit
a13b8dd2d8
5 files changed
+32
-6
No files matched your search
@@ -35,13 +35,14 @@ Alt1-compatible toolbox for RuneScape 3, for Linux and macOS.
|
||||
| **DgKey** | | |
|
||||
| - Show map | ✅ | ? |
|
||||
| - Track key | ✅ | ? |
|
||||
| - Select player location | ❌ | ? |
|
||||
| - Select player location | 3 | ? |
|
||||
| **[ArchMatCounter](https://zerogwafa.github.io/ArchMatCounter/appconfig.json)** | ? | ? |
|
||||
| **Bank price checker** | ✅ | ? |
|
||||
| **Meg answers** | 2 | ? |
|
||||
|
||||
- 1: Only keyboard activity count as active
|
||||
- 2: Works but the alt+1 keybind count as selecting option 1
|
||||
- 3: Works but you have to alt+tab to game window
|
||||
|
||||
## Installation setup
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
- [x] alt1.overLayText
|
||||
- [x] alt1.overLayTextEx
|
||||
- [x] alt1.overLayLine
|
||||
- [ ] alt1.overLayImage
|
||||
- [x] alt1.overLayImage
|
||||
- [x] alt1.overLayClearGroup
|
||||
- [x] alt1.overLaySetGroup
|
||||
- [x] alt1.overLayFreezeGroup
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
},
|
||||
|
||||
setTitleBarText(text) {
|
||||
|
||||
|
||||
},
|
||||
|
||||
overLayRect(color, x, y, w, h, time, lineWidth) {
|
||||
@@ -247,8 +247,10 @@
|
||||
return true;
|
||||
},
|
||||
overLayImage(x, y, imgstr, imgwidth, time) {
|
||||
console.trace('overLayImage');
|
||||
return false;
|
||||
channel.then(function(chan){
|
||||
chan.objects.alt1.overlayImage(drawCallId++, x, y, imgstr, imgwidth, time);
|
||||
});
|
||||
return true;
|
||||
},
|
||||
overLayClearGroup(group) {
|
||||
channel.then(function(chan){
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import base64
|
||||
import json
|
||||
import logging
|
||||
import secrets
|
||||
@@ -272,6 +273,16 @@ class Alt1Api(QObject):
|
||||
call_id, "overlay_line", color, width, x1, y1, x2, y2, timeout
|
||||
)
|
||||
|
||||
@Slot(int, int, int, str, int, int)
|
||||
def overlayImage(self, call_id, x, y, img_str, img_width, timeout):
|
||||
if not self.app.has_permission("overlay"):
|
||||
raise ApiPermissionDeniedException("overlay")
|
||||
|
||||
img_bytes = base64.b64decode(img_str)
|
||||
self._overlay.enqueue(
|
||||
call_id, "overlay_image", img_bytes, x, y, img_width, timeout
|
||||
)
|
||||
|
||||
@Slot(int, str, int, int, int, int, int, str, bool, bool)
|
||||
def overlayTextEx(
|
||||
self, call_id, message, color, size, x, y, timeout, font_name, centered, shadow
|
||||
|
||||
@@ -4,7 +4,7 @@ import logging
|
||||
from typing import List, Dict, Tuple, Optional, TYPE_CHECKING
|
||||
|
||||
from PySide2.QtCore import QObject, QTimer, Qt
|
||||
from PySide2.QtGui import QFont, QPen
|
||||
from PySide2.QtGui import QFont, QPen, QImage, QPixmap
|
||||
from PySide2.QtWidgets import (
|
||||
QGraphicsItem,
|
||||
QGraphicsDropShadowEffect,
|
||||
@@ -12,6 +12,7 @@ from PySide2.QtWidgets import (
|
||||
QGraphicsRectItem,
|
||||
QGraphicsItemGroup,
|
||||
QGraphicsLineItem,
|
||||
QGraphicsPixmapItem,
|
||||
)
|
||||
|
||||
from .utils import decode_color
|
||||
@@ -243,6 +244,17 @@ class OverlayApi(QObject):
|
||||
|
||||
self._finalize_gfx(gfx, timeout)
|
||||
|
||||
@ensure_overlay
|
||||
def overlay_image(self, img: bytes, x: int, y: int, width: int, timeout: int):
|
||||
height = len(img) / width / 4
|
||||
|
||||
img = QImage(img, width, height, QImage.Format_ARGB32)
|
||||
|
||||
gfx = QGraphicsPixmapItem(QPixmap.fromImage(img))
|
||||
gfx.setPos(x, y)
|
||||
|
||||
self._finalize_gfx(gfx, timeout)
|
||||
|
||||
@ensure_overlay
|
||||
def overlay_set_group_z(self, name: str, z_index: int):
|
||||
for item in self.groups.get(name, []):
|
||||
|
||||
Reference in new issue
Block a user