Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCrane committed Feb 17, 2021
0 parents commit 07505b1
Show file tree
Hide file tree
Showing 41 changed files with 7,021 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.user
44 changes: 44 additions & 0 deletions LeagueTeamBoost.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17

DEFINES += CURL_STATICLIB

SOURCES += \
aboutdialog.cpp \
clickablelabel.cpp \
gameinfo.cpp \
httpsmanager.cpp \
main.cpp \
widget.cpp

HEADERS += \
aboutdialog.h \
clickablelabel.h \
gameinfo.h \
httpsmanager.h \
widget.h

FORMS += \
aboutdialog.ui \
widget.ui \
widget.ui

LIBS += -L$$PWD/libs/lib/ -llibcurl_a
PRE_TARGETDEPS += $$PWD/libs/lib/libcurl_a.lib
INCLUDEPATH += $$PWD/libs/include
DEPENDPATH += $$PWD/libs/include

VERSION = 1.0.0.0
RC_ICONS = logo.ico
QMAKE_TARGET_PRODUCT = LeagueTeamBoost
QMAKE_TARGET_COMPANY = Mario & ButterCookies
QMAKE_TARGET_DESCRIPTION = League of Legends Team Boost
QMAKE_TARGET_COPYRIGHT = Mario & ButterCookies

QMAKE_CXXFLAGS_RELEASE = -O2

RESOURCES += \
resources.qrc
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# LeagueTeamBoost

## 英雄联盟一键解锁战斗福利
利用League of legends LCU API解锁无限火力/无限乱斗模式的战斗福利。

---
## API
`/lol-champ-select/v1/team-boost/purchase`

---

## 官方文档
https://developer.riotgames.com/docs/lol

---

本工具由Mario与ButterCookies共同维护,使用Qt作为主框架,主体语言C++。
54 changes: 54 additions & 0 deletions aboutdialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"

#include <dwmapi.h>
#include <QDesktopServices>
#include <QUrl>

AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::AboutDialog)
, m_DwmWidth(0)
{
ui->setupUi(this);

/* 窗口风格 */
this->setFixedSize(this->size());
this->setWindowFlags((this->windowFlags() & ~Qt::WindowMinMaxButtonsHint) | Qt::FramelessWindowHint);

/* 窗口阴影 */
BOOL bEnable = false;
::DwmIsCompositionEnabled(&bEnable);
if (bEnable) {
m_DwmWidth = 7;
DWMNCRENDERINGPOLICY ncrp = DWMNCRP_ENABLED;
::DwmSetWindowAttribute((HWND)winId(), DWMWA_NCRENDERING_POLICY, &ncrp, sizeof(ncrp));
MARGINS margins = { -1 };
::DwmExtendFrameIntoClientArea((HWND)winId(), &margins);
}

/* 信号槽 */
connect(ui->btn_ok, &QPushButton::clicked, this, &AboutDialog::hide);
connect(ui->btn_github, &QPushButton::clicked, this, [=] () {
QDesktopServices::openUrl(QUrl("https://github.com/LeaguePrank/LeagueTeamBoost"));
});
connect(ui->btn_bilibili, &QPushButton::clicked, this, [=] () {
QDesktopServices::openUrl(QUrl("https://space.bilibili.com/248303677"));
QDesktopServices::openUrl(QUrl("https://space.bilibili.com/14671179"));
});
}

AboutDialog::~AboutDialog()
{
delete ui;
}

void AboutDialog::showEvent(QShowEvent *e)
{
Q_UNUSED(e)
int x = parentWidget()->x() + (parentWidget()->width() / 2);
int y = parentWidget()->y() + (parentWidget()->height() / 2);
x -= this->width() / 2 + m_DwmWidth; // m_DwmWidth = 7 可能是dwm的宽度?需要再研究
y -= this->height() / 2;
move(x, y);
}
28 changes: 28 additions & 0 deletions aboutdialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H

#include <QDialog>
#include <QShowEvent>

namespace Ui {
class AboutDialog;
}

class AboutDialog : public QDialog
{
Q_OBJECT

public:
explicit AboutDialog(QWidget *parent = nullptr);
~AboutDialog();

protected:
void showEvent(QShowEvent *e);

private:
Ui::AboutDialog *ui;

int m_DwmWidth;
};

#endif // ABOUTDIALOG_H
Loading

0 comments on commit 07505b1

Please sign in to comment.