This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HenryZeng
committed
May 1, 2020
1 parent
43cd603
commit a28cfbb
Showing
19 changed files
with
3,466 additions
and
3,157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"Name": "白金(语音)", | ||
"Description": "来自明日方舟-白金(语音) ,60fps" | ||
"Description": "来自明日方舟-白金(语音) ,60fps", | ||
"cover":"preview.png", | ||
"Script":"run.json" | ||
} |
13 changes: 0 additions & 13 deletions
13
Data/白金_站立_互动 - 语音/config/ArkDesktop.LayeredWindowManager.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"usualy_play":"common", | ||
"play":{ | ||
"common":{ | ||
"path":["resources","I"], | ||
"turns":{ | ||
"front":"F (", | ||
"first":"1", | ||
"last":"121", | ||
"end":").png", | ||
"fps": 60 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
path = Workpath = os.path.dirname(os.path.abspath(__file__)) | ||
# 工程根目录 | ||
|
||
next_ = None | ||
if os.name == 'nt': | ||
next_ = '\\' | ||
else: | ||
next_ = '/' | ||
# 针对 Linux 和 windows 的不同,更改路径中的 反斜杠(\) 或 斜杠(/) | ||
|
||
def dir_mix(*dirs): | ||
mix = '' | ||
for i in dirs: | ||
mix += i+next_ | ||
return mix[:-1] | ||
# 路径拼合函数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
from PyQt5.QtWidgets import * | ||
from PyQt5.QtCore import * | ||
from PyQt5.QtGui import * | ||
import sys | ||
from PyQt5.QtCore import Qt | ||
from PyQt5.QtWidgets import QWidget, QApplication | ||
from PyQt5.QtGui import QPixmap, QPainter, QBitmap, QCursor | ||
import PyQt5.QtCore as QtCore | ||
|
||
|
||
class PixWindow(QWidget): # 不规则窗体 | ||
def __init__(self, parent=None): | ||
super().__init__(parent) | ||
class MyLabel(QLabel): | ||
def __init__(self, *args, **kw): | ||
super().__init__(*args, **kw) | ||
self.setContextMenuPolicy(Qt.CustomContextMenu) | ||
self.customContextMenuRequested.connect(self.rightMenuShow) # 开放右键策略 | ||
|
||
self.pix = QBitmap('x.png') # 蒙版 | ||
self.resize(self.pix.size()) | ||
self.setMask(self.pix) | ||
def rightMenuShow(self, pos): # 添加右键菜单 | ||
menu = QMenu(self) | ||
menu.addAction(QAction('动作1', menu)) | ||
menu.addAction(QAction('动作2', menu)) | ||
menu.addAction(QAction('动作3', menu)) | ||
menu.triggered.connect(self.menuSlot) | ||
menu.exec_(QCursor.pos()) | ||
|
||
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # 设置无边框和置顶窗口样式 | ||
def menuSlot(self, act): | ||
print(act.text()) | ||
|
||
def paintEvent(self, QPaintEvent): # 绘制窗口 | ||
paint = QPainter(self) | ||
paint.drawPixmap(0, 0, self.pix.width(), self.pix.height(), QPixmap('C:\\Users\\28799\\Desktop\\白金_站立_互动 - 语音\\resources\\R\\F (1).png')) | ||
|
||
class Demo(QWidget): | ||
def __init__(self, *args, **kw): | ||
super().__init__(*args, **kw) | ||
label = MyLabel('右击这里', self) | ||
label.setGeometry(0, 0, 60, 30) | ||
|
||
self.resize(100, 100) | ||
self.show() | ||
|
||
|
||
if __name__ == '__main__': | ||
app = QApplication(sys.argv) | ||
win = PixWindow() | ||
win.show() | ||
ecs = Demo() | ||
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from PyQt5 import QtCore, QtGui, QtWidgets | ||
from PyQt5.QtCore import pyqtSignal | ||
import sys,time | ||
import os | ||
import sys,time,os,json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from .imports import * | ||
from UI.graphics import Ui_Form as graphics_window | ||
from Environment import path, dir_mix | ||
|
||
|
||
class Special_Label(QtWidgets.QLabel): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
def mousePressEvent(self, e): ##重载一下鼠标点击事件 | ||
print("you clicked the label") | ||
|
||
def mouseReleaseEvent(self, QMouseEvent): | ||
print('you have release the mouse') | ||
|
||
|
||
class PlayBoard(QtCore.QThread): | ||
# 创建了一个子线程,用来渲染动画 | ||
play = pyqtSignal(str) | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
def run(self): | ||
dirs = 'E:\\Codes\\独立项目\\Cardinal\\Data\\白金_站立_互动 - 语音\\resources\\R\\' | ||
while True: | ||
for i in range(1, 122): | ||
front = 'F (' | ||
end = ').png' | ||
name = front + str(i) + end | ||
print(name) | ||
print(dir_mix(dirs[:-1], name)) | ||
time.sleep(1 / 64) | ||
self.play.emit(dir_mix(dirs[:-1], name)) | ||
|
||
|
||
class window_graphics(QtWidgets.QMainWindow, graphics_window): | ||
def __init__(self, config, root): | ||
super().__init__() | ||
self.config = config | ||
self.root = root | ||
# 保存传入的初始化数据 | ||
with open(dir_mix(root,config['Script']),'r',encoding='utf-8') as f: | ||
print(json.loads(f.read())) | ||
self.setupUi(self) | ||
self.setWindowFlags(QtCore.Qt.FramelessWindowHint) # 去掉窗口标题栏和按钮 | ||
self.setAttribute(QtCore.Qt.WA_TranslucentBackground) # 设置窗口背景透明 | ||
|
||
self.label = QtWidgets.QLabel(self) | ||
self.label.setObjectName("label") | ||
width = 711 | ||
height = 496 | ||
self.resize(width, height) | ||
|
||
self.label.setGeometry(0, 0, width, height) | ||
|
||
def show(self) -> None: | ||
super().show() | ||
self.PlayBoard = PlayBoard() | ||
self.PlayBoard.play.connect(self.graph) | ||
self.PlayBoard.start() | ||
|
||
def graph(self, paths): | ||
print(paths) | ||
pixmap = QtGui.QPixmap(paths).scaled(self.label.width(), self.label.height()) | ||
self.label.setPixmap(pixmap) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
from .imports import * | ||
from UI.Loading import Ui_Form as Loading_window | ||
|
||
|
||
class wait(QtCore.QThread): | ||
# 创建了一个子线程,用来防止等待带来的界面卡死 | ||
comm = pyqtSignal() | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
def run(self): | ||
time.sleep(5) | ||
# 等待5秒 | ||
self.comm.emit() | ||
|
||
class window_loading(QtWidgets.QMainWindow,Loading_window): | ||
|
||
class window_loading(QtWidgets.QMainWindow, Loading_window): | ||
def __init__(self): | ||
super().__init__() | ||
self.setWindowFlags(QtCore.Qt.FramelessWindowHint) | ||
self.setupUi(self) | ||
|
||
def show(self) -> None: | ||
super().show() | ||
self.waits = wait() | ||
self.waits.comm.connect(self.run) | ||
self.waits.start() | ||
# 执行QThread子线程,进行等待,等待结束后回调run(self)函数 | ||
|
||
def run(self): | ||
pass |
Oops, something went wrong.