Skip to content

Commit

Permalink
Merge branch 'master' into wip-translator
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Feb 24, 2024
2 parents c82e5bb + 6b6a444 commit e5fc9af
Show file tree
Hide file tree
Showing 10 changed files with 158 additions and 50 deletions.
5 changes: 3 additions & 2 deletions Editor/common_features/crashhandler.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<string>Crash</string>
</property>
<property name="windowIcon">
<iconset resource="../_resources/editor.qrc">
<normaloff>:/toolbar/dock/bookmarks.png</normaloff>:/toolbar/dock/bookmarks.png</iconset>
<iconset resource="../_resources/toolbar/toolbar.qrc">
<normaloff>:/toolbar/dock/bug.png</normaloff>:/toolbar/dock/bug.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1000,0" columnminimumwidth="160,0,0">
<item row="1" column="0" colspan="3">
Expand Down Expand Up @@ -149,6 +149,7 @@
</tabstops>
<resources>
<include location="../_resources/editor.qrc"/>
<include location="../_resources/toolbar/toolbar.qrc"/>
</resources>
<connections/>
</ui>
36 changes: 18 additions & 18 deletions Editor/common_features/json_settings_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,24 @@ void JsonSettingsWidget::SetupStack::setValue(const QString &propertyId, const Q
o = o[t].toObject();
}

switch(value.type())
switch(value.Q_QVariantType())
{
case QVariant::Rect:
case Q_QVariantTypeEnum::Rect:
o[top] = rectToArray(value);
break;
case QVariant::RectF:
case Q_QVariantTypeEnum::RectF:
o[top] = rectfToArray(value);
break;
case QVariant::Point:
case Q_QVariantTypeEnum::Point:
o[top] = pointToArray(value);
break;
case QVariant::PointF:
case Q_QVariantTypeEnum::PointF:
o[top] = pointfToArray(value);
break;
case QVariant::Size:
case Q_QVariantTypeEnum::Size:
o[top] = sizeToArray(value);
break;
case QVariant::SizeF:
case Q_QVariantTypeEnum::SizeF:
o[top] = sizefToArray(value);
break;
default:
Expand Down Expand Up @@ -514,39 +514,39 @@ QVariant JsonSettingsWidget::retrieve_property(const JsonSettingsWidget::SetupSt
return defaultValue;
}

switch(defaultValue.type())
switch(defaultValue.Q_QVariantType())
{
case QVariant::Size:
case Q_QVariantTypeEnum::Size:
{
QJsonObject sz = o[prop].toObject();
out = QSize(sz["w"].toInt(), sz["h"].toInt());
break;
}
case QVariant::SizeF:
case Q_QVariantTypeEnum::SizeF:
{
QJsonObject sz = o[prop].toObject();
out = QSizeF(sz["w"].toDouble(), sz["h"].toDouble());
break;
}
case QVariant::Point:
case Q_QVariantTypeEnum::Point:
{
QJsonObject sz = o[prop].toObject();
out = QPoint(sz["x"].toInt(), sz["y"].toInt());
break;
}
case QVariant::PointF:
case Q_QVariantTypeEnum::PointF:
{
QJsonObject sz = o[prop].toObject();
out = QPointF(sz["x"].toDouble(), sz["y"].toDouble());
break;
}
case QVariant::Rect:
case Q_QVariantTypeEnum::Rect:
{
QJsonObject sz = o[prop].toObject();
out = QRect(sz["x"].toInt(), sz["y"].toInt(), sz["w"].toInt(), sz["h"].toInt());
break;
}
case QVariant::RectF:
case Q_QVariantTypeEnum::RectF:
{
QJsonObject sz = o[prop].toObject();
out = QRectF(sz["x"].toDouble(), sz["y"].toDouble(), sz["w"].toDouble(), sz["h"].toDouble());
Expand Down Expand Up @@ -642,13 +642,13 @@ static QColor colorFromHexValue(QString color)

if(color.size() >= 6)
{
newRgba.setRed(color.midRef(0, 2).toInt(nullptr, 16));
newRgba.setGreen(color.midRef(2, 2).toInt(nullptr, 16));
newRgba.setBlue(color.midRef(4, 2).toInt(nullptr, 16));
newRgba.setRed(Q_QStringRef(color, 0, 2).toInt(nullptr, 16));
newRgba.setGreen(Q_QStringRef(color, 2, 2).toInt(nullptr, 16));
newRgba.setBlue(Q_QStringRef(color, 4, 2).toInt(nullptr, 16));
}

if(color.size() == 8)
newRgba.setAlpha(color.midRef(6, 2).toInt(nullptr, 16));
newRgba.setAlpha(Q_QStringRef(color, 6, 2).toInt(nullptr, 16));
else
newRgba.setAlpha(255);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <editing/_scenes/level/lvl_scene.h>
#include <editing/_scenes/level/items/item_playerpoint.h>
#include "itemsearcher.h"
#include <pge_qt_compat.h>


HistoryElementReplacePlayerPoint::HistoryElementReplacePlayerPoint(PlayerPoint plr, QVariant oldPos, QObject *parent) :
Expand Down Expand Up @@ -70,7 +71,7 @@ void HistoryElementReplacePlayerPoint::historyRemovePlayerPoint(const PlayerPoin

if(!m_oldPos.isNull())
{
if(m_oldPos.type() == QVariant::List)
if(m_oldPos.Q_QVariantType() == Q_QVariantTypeEnum::List)
{
QList<QVariant> mData = m_oldPos.toList();
if(mData.size() == 5)
Expand Down
8 changes: 4 additions & 4 deletions Editor/main_window/dock/lvl_events_box.ui
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../../_resources/editor.qrc">
<normaloff>:/images/copy_16x16.png</normaloff>:/images/copy_16x16.png</iconset>
<iconset resource="../../_resources/dock/dock.qrc">
<normaloff>:/dock/copy_16x16.png</normaloff>:/dock/copy_16x16.png</iconset>
</property>
<property name="shortcut">
<string notr="true"/>
Expand Down Expand Up @@ -183,7 +183,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-300</y>
<y>0</y>
<width>269</width>
<height>2316</height>
</rect>
Expand Down Expand Up @@ -1588,7 +1588,7 @@
</customwidget>
</customwidgets>
<resources>
<include location="../../_resources/editor.qrc"/>
<include location="../../_resources/dock/dock.qrc"/>
</resources>
<connections>
<connection>
Expand Down
11 changes: 6 additions & 5 deletions Editor/main_window/dock/lvl_warp_props.ui
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="windowIcon">
<iconset resource="../../_resources/editor.qrc">
<iconset resource="../../_resources/toolbar/toolbar.qrc">
<normaloff>:/toolbar/dock/doors.png</normaloff>:/toolbar/dock/doors.png</iconset>
</property>
<property name="styleSheet">
Expand Down Expand Up @@ -55,7 +55,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-199</y>
<y>0</y>
<width>325</width>
<height>947</height>
</rect>
Expand Down Expand Up @@ -403,8 +403,8 @@ Every warp point pair requires a warp entry.</string>
<string notr="true">Duplicate</string>
</property>
<property name="icon">
<iconset resource="../../_resources/editor.qrc">
<normaloff>:/images/copy_16x16.png</normaloff>:/images/copy_16x16.png</iconset>
<iconset resource="../../_resources/dock/dock.qrc">
<normaloff>:/dock/copy_16x16.png</normaloff>:/dock/copy_16x16.png</iconset>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1135,7 +1135,8 @@ If this flag is enabled, you can only place a warp exit.</string>
</customwidget>
</customwidgets>
<resources>
<include location="../../_resources/editor.qrc"/>
<include location="../../_resources/dock/dock.qrc"/>
<include location="../../_resources/toolbar/toolbar.qrc"/>
</resources>
<connections>
<connection>
Expand Down
10 changes: 6 additions & 4 deletions Editor/tools/tilesets/tileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@

#include <common_features/graphics_funcs.h>
#include <common_features/items.h>
#include <pge_qt_compat.h>

#include "tileset.h"


tileset::tileset(DataConfig *conf, int type, QWidget *parent, int baseSize, int rows, int cols, QGraphicsScene *scene) :
QWidget(parent)
{
Expand Down Expand Up @@ -125,10 +127,10 @@ void tileset::dragLeaveEvent(QDragLeaveEvent *event)
void tileset::dragMoveEvent(QDragMoveEvent *event)
{
if(event->mimeData()->hasFormat(getMimeType())
&& findPiece(targetSquare(event->pos())) == -1)
&& findPiece(targetSquare(event->Q_EventPos())) == -1)
{

highlightedRect = targetSquare(event->pos());
highlightedRect = targetSquare(event->Q_EventPos());
event->setDropAction(Qt::MoveAction);
event->accept();
}
Expand All @@ -144,12 +146,12 @@ void tileset::dragMoveEvent(QDragMoveEvent *event)
void tileset::dropEvent(QDropEvent *event)
{
if(event->mimeData()->hasFormat(getMimeType())
&& findPiece(targetSquare(event->pos())) == -1)
&& findPiece(targetSquare(event->Q_EventPos())) == -1)
{

QByteArray pieceData = event->mimeData()->data(getMimeType());
QDataStream stream(&pieceData, QIODevice::ReadOnly);
QRect square = targetSquare(event->pos());
QRect square = targetSquare(event->Q_EventPos());
int objID;
stream >> objID;

Expand Down
26 changes: 13 additions & 13 deletions PlayableCalibrator/calibration_main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<height>34</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_4" columnstretch="10000,0,0,0,0,0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="10000,0,0,0,0">
<property name="leftMargin">
<number>0</number>
</property>
Expand Down Expand Up @@ -120,7 +120,7 @@
<string>Reset scroll</string>
</property>
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/reset_pos.png</normaloff>:/images/reset_pos.png</iconset>
</property>
<property name="popupMode">
Expand Down Expand Up @@ -184,7 +184,7 @@
<string>Save config</string>
</property>
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/save.png</normaloff>:/images/save.png</iconset>
</property>
<addaction name="actionSaveSameDir"/>
Expand Down Expand Up @@ -375,8 +375,8 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="features">
<set>QDockWidget::AllDockWidgetFeatures</set>
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Settings</string>
Expand Down Expand Up @@ -685,6 +685,9 @@
</widget>
</widget>
<widget class="QDockWidget" name="dockScrolling">
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Scrolling</string>
</property>
Expand Down Expand Up @@ -785,7 +788,7 @@ Right button - move grab offset if visible.</string>
<string>Reset scroll</string>
</property>
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/reset_pos.png</normaloff>:/images/reset_pos.png</iconset>
</property>
</widget>
Expand Down Expand Up @@ -824,7 +827,7 @@ Right button - Move the right-bottom crop edges.</string>
</widget>
<action name="actionOpen">
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/open.png</normaloff>:/images/open.png</iconset>
</property>
<property name="text">
Expand All @@ -847,7 +850,7 @@ Right button - Move the right-bottom crop edges.</string>
</action>
<action name="actionCopy_settings">
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/edit_copy.png</normaloff>:/images/edit_copy.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -929,7 +932,7 @@ Right button - Move the right-bottom crop edges.</string>
</action>
<action name="actionSaveMenu">
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/save.png</normaloff>:/images/save.png</iconset>
</property>
<property name="text">
Expand All @@ -941,7 +944,7 @@ Right button - Move the right-bottom crop edges.</string>
</action>
<action name="actionResetScroll">
<property name="icon">
<iconset resource="../Editor/_resources/editor.qrc">
<iconset resource="_resources/images.qrc">
<normaloff>:/images/reset_pos.png</normaloff>:/images/reset_pos.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -1032,9 +1035,6 @@ Right button - Move the right-bottom crop edges.</string>
<tabstop>mountRiding</tabstop>
</tabstops>
<resources>
<include location="../Editor/_resources/editor.qrc"/>
<include location="_resources/images.qrc"/>
<include location="../Editor/_resources/editor.qrc"/>
<include location="_resources/images.qrc"/>
</resources>
<connections/>
Expand Down
Loading

0 comments on commit e5fc9af

Please sign in to comment.