diff --git a/PictureDialog.cpp b/PictureDialog.cpp index 1432f62..0868b7c 100755 --- a/PictureDialog.cpp +++ b/PictureDialog.cpp @@ -82,12 +82,15 @@ PictureDialog::PictureDialog(ProfileDatabase *profileDB, CrewDatabase *crewDB, Q smpic = 0; // Avatar area - avatarPreviewImage = QImage(); avatarAreaPicture = QImage(":/img/avatararea.png"); avatarLocX = 145; avatarLocY = 66; avatarSize = 470; + // Overlay area + renderOverlayPicture(); + overlayenabled = 1; + // Export menu exportMenu = new QMenu(this); jpegExportAction = exportMenu->addAction(tr("Export as &JPG picture..."), this, SLOT(exportSnapmaticPicture())); @@ -211,7 +214,7 @@ bool PictureDialog::eventFilter(QObject *obj, QEvent *ev) ui->cmdExport->click(); returnValue = true; break; - case Qt::Key_A: + case Qt::Key_1: if (previewmode) { previewmode = false; @@ -223,6 +226,18 @@ bool PictureDialog::eventFilter(QObject *obj, QEvent *ev) renderPicture(); } break; + case Qt::Key_2: + if (overlayenabled) + { + overlayenabled = false; + if (!previewmode) renderPicture(); + } + else + { + overlayenabled = true; + if (!previewmode) renderPicture(); + } + break; #if QT_VERSION >= 0x050300 case Qt::Key_Exit: ui->cmdClose->click(); @@ -270,6 +285,61 @@ void PictureDialog::dialogPreviousPictureRequested() emit previousPictureRequested(); } +void PictureDialog::renderOverlayPicture() +{ + // Generating Overlay Preview + QRect preferedRect = QRect(0, 0, 200, 160); + QString overlayText = tr("Key 1 - Avatar Preview Mode\nKey 2 - Toggle Overlay\nArrow Keys - Navigate"); + QPixmap overlayPixmap(1, 1); + overlayPixmap.fill(Qt::transparent); + + QPainter overlayPainter(&overlayPixmap); + QFont overlayPainterFont; + overlayPainterFont.setPixelSize(12); + overlayPainter.setFont(overlayPainterFont); + QRect overlaySpace = overlayPainter.boundingRect(preferedRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextDontClip | Qt::TextWordWrap, overlayText); + overlayPainter.end(); + + int hOverlay = Qt::AlignTop; + if (overlaySpace.height() < 74) + { + hOverlay = Qt::AlignVCenter; + preferedRect.setHeight(71); + overlaySpace.setHeight(80); + } + else + { + overlaySpace.setHeight(overlaySpace.height() + 6); + } + + overlayPixmap = overlayPixmap.scaled(overlaySpace.size()); + overlayPainter.begin(&overlayPixmap); + overlayPainter.setPen(QColor::fromRgb(255, 255, 255, 255)); + overlayPainter.setFont(overlayPainterFont); + overlayPainter.drawText(preferedRect, Qt::AlignLeft | hOverlay | Qt::TextDontClip | Qt::TextWordWrap, overlayText); + overlayPainter.end(); + + if (overlaySpace.width() < 194) + { + overlaySpace.setWidth(200); + } + else + { + overlaySpace.setWidth(overlaySpace.width() + 6); + } + + QPixmap overlayBorderImage(overlaySpace.width(), overlaySpace.height()); + overlayBorderImage.fill(QColor(15, 15, 15, 162)); + + QPixmap overlayTempPixmap(overlaySpace.size()); + overlayTempPixmap.fill(Qt::transparent); + QPainter overlayTempPainter(&overlayTempPixmap); + overlayTempPainter.drawPixmap(0, 0, overlayBorderImage); + overlayTempPainter.drawPixmap(3, 3, overlayPixmap); + overlayTempPainter.end(); + overlayTempImage = overlayTempPixmap.toImage(); +} + void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, QString picturePath, bool readOk, bool _indexed, int _index) { snapmaticPicture = QImage(); @@ -285,16 +355,6 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, QString pictu if (picture->isPicOk()) { snapmaticPicture = picture->getPicture(); - - // Generating Avatar Preview - QPixmap finalPixmap(960, 536); - QPainter snapPainter(&finalPixmap); - snapPainter.drawImage(0, 0, snapmaticPicture); - snapPainter.drawImage(0, 0, avatarAreaPicture); - snapPainter.setPen(QColor::fromRgb(255, 255, 255, 255)); - snapPainter.drawStaticText(3, 3, tr("Avatar Preview Mode
Press A for Default View")); - avatarPreviewImage = finalPixmap.toImage(); - renderPicture(); ui->cmdExport->setEnabled(true); } @@ -385,11 +445,35 @@ void PictureDialog::renderPicture() { if (!previewmode) { - ui->labPicture->setPixmap(QPixmap::fromImage(snapmaticPicture)); + if (overlayenabled) + { + QPixmap overlayAreaPixmap(960, 536); + overlayAreaPixmap.fill(Qt::transparent); + QPainter overlayAreaPainter(&overlayAreaPixmap); + overlayAreaPainter.drawImage(0, 0, snapmaticPicture); + overlayAreaPainter.drawImage(3, 3, overlayTempImage); + overlayAreaPainter.end(); + ui->labPicture->setPixmap(overlayAreaPixmap); + } + else + { + ui->labPicture->setPixmap(QPixmap::fromImage(snapmaticPicture)); + } } else { - ui->labPicture->setPixmap(QPixmap::fromImage(avatarPreviewImage)); + // Generating Avatar Preview + QPixmap avatarPixmap(960, 536); + QPainter snapPainter(&avatarPixmap); + QFont snapPainterFont; + snapPainterFont.setPixelSize(12); + snapPainter.drawImage(0, 0, snapmaticPicture); + snapPainter.drawImage(0, 0, avatarAreaPicture); + snapPainter.setPen(QColor::fromRgb(255, 255, 255, 255)); + snapPainter.setFont(snapPainterFont); + snapPainter.drawText(QRect(3, 3, 140, 60), Qt::AlignLeft | Qt::TextWordWrap, tr("Avatar Preview Mode\nPress 1 for Default View")); + snapPainter.end(); + ui->labPicture->setPixmap(avatarPixmap); } } diff --git a/PictureDialog.h b/PictureDialog.h index 21e9d3e..c16f3c7 100755 --- a/PictureDialog.h +++ b/PictureDialog.h @@ -65,6 +65,7 @@ private slots: void exportCustomContextMenuRequestedPrivate(const QPoint &pos, bool fullscreen); void nextPictureRequestedSlot(); void previousPictureRequestedSlot(); + void renderOverlayPicture(); void renderPicture(); signals: @@ -86,9 +87,9 @@ private: QWidget *fullscreenWidget; QAction *jpegExportAction; QAction *pgtaExportAction; - QImage avatarPreviewImage; QImage avatarAreaPicture; QImage snapmaticPicture; + QImage overlayTempImage; QString jsonDrawString; QString windowTitleStr; QStringList plyrsList; @@ -101,6 +102,7 @@ private: QString locX; QString locY; QString locZ; + bool overlayenabled; bool rqfullscreen; bool navienabled; bool previewmode; diff --git a/res/gta5sync_de.qm b/res/gta5sync_de.qm index 9d54012..9e85a0e 100755 Binary files a/res/gta5sync_de.qm and b/res/gta5sync_de.qm differ diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index faab4c1..c1ff875 100755 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -110,7 +110,7 @@ Pictures and Savegames Snapmatic Bilder und Spielständen - + A project for viewing and sync Grand Theft Auto V Snapmatic<br/> Pictures and Savegames Ein Projekt zum ansehen und synchronisieren von<br/> @@ -383,26 +383,26 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen %1 (%2 wenn verfügbar) [sys] - + System System like PC System System - + %1 (%2 if available) System like PC System = %1, System Language like Deutsch = %2 %1 (%2 wenn verfügbar) - + %1 %1 %1 - + The new Custom Folder will initialize after you restart %1. Der eigene Ordner wird initialisiert sobald du %1 neugestartet hast. @@ -411,20 +411,20 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen Der eigene Ordner initialisiert sobald du %1 neugestartet hast. - + The language change will take effect after you restart %1. Die Änderung der Sprache nimmt Effekt sobald du %1 neugestartet hast. - + No Profile No Profile, as default Kein Profil - - + + Profile: %1 Profil: %1 @@ -521,46 +521,87 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen Schließen - + Export as &JPG picture... Exportiere als &JPG Bild... - + Export as &GTA Snapmatic... Exportiere als &GTA Snapmatic... - - + + Key 1 - Avatar Preview Mode +Key 2 - Toggle Overlay +Arrow Keys - Navigate + Taste 1 - Avatar Vorschaumodus +Taste 2 - Overlay umschalten +Pfeiltasten - Navigieren + + + + Snapmatic Picture Viewer Snapmatic Bildansicht - - + + Failed at %1 Fehlgeschlagen bei %1 - - Avatar Preview Mode<br>Press A for Default View - Avatar Vorschaumodus<br>Drücke A für Standardansicht + + Avatar Preview Mode +Press 1 for Default View + Avatar Vorschaumodus +Drücke 1 für Standardmodus - - + 1 - Avatar Preview Mode +2 - Toggle Overlay +Arrow Keys - Navigate + // L is for Left and R is for Right, Left Arrow Right Arrow + 1 - Avatar Vorschaumodus +2 - Overlay umschalten +Pfeiltasten - Navigieren + + + 1 - Avatar Preview Mode +2 - Toggle Overlay +L Arrow - Back +R Arrow - Next + L is for Left and R is for Right, Left Arrow Right Arrow + 1 - Avatar Vorschaumodus +2 - Overlay umschalten +L Pfeil - Zurück +R Pfeil - Weiter + + + Avatar Preview Mode +Press A for Default View + Avatar Vorschaumodus +Drücke A für Standardansicht + + + Avatar Preview Mode<br>Press A for Default View + Avatar Vorschaumodus<br>Drücke A für Standardansicht + + + + No player Keine Spieler - - + + No crew Keine Crew - + Unknown Location Unbekannter Standort @@ -732,52 +773,52 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen Lade... - + Import... Importieren... - - - - - - - - - - - - + + + + + + + + + + + + Import Importieren - + All profile files (SGTA* PGTA*) Alle Profildateien (SGTA* PGTA*) - + Savegames files (SGTA*) Spielstanddateien (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic Bilder (PGTA*) - + All files (**) Alle Dateien (**) - + Import failed with... %1 @@ -786,35 +827,35 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen %1 - + Failed to read Snapmatic picture Fehler beim Lesen vom Snapmatic Bild - + Failed to read Savegame file Fehler beim Lesen von Spielstanddatei - + Can't import %1 because of not valid file format Kann %1 nicht importieren weil das Dateiformat nicht gültig ist - + Failed to import the Snapmatic picture, the picture is already in the game Fehlgeschlagen beim Importieren vom Snapmatic Bild, dieses Bild ist bereits im Spiel - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Exportiere Snapmatic Bilder%2<br><br>JPG Bilder machen es möglich sie mit ein Bildansicht Programm zu öffnen<br>Das GTA Snapmatic Format macht es möglich sie wieder ins Game zu importieren<br><br>Exportieren als: - - + + No valid file is selected Keine gültige Datei wurde ausgewählt @@ -825,40 +866,40 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen Aktivierte Bilder: %1 von %2 - + Failed to import the Snapmatic picture, file not begin with PGTA Fehlgeschlagen beim Importieren vom Snapmatic Bild, Datei beginnt nicht mit PGTA - + Failed to import the Snapmatic picture, can't copy the file into profile Fehlgeschlagen beim Importieren vom Snapmatic Bild, kann Snapmatic Bild nicht ins Profil kopieren - + Failed to import the Savegame, can't copy the file into profile Fehlgeschlagen beim Importieren vom Spielstand, kann Spielstanddatei nicht ins Profil kopieren - + Failed to import the Savegame, no Savegame slot is left Fehlgeschlagen beim Importieren vom Spielstand, kein Spielstandslot mehr frei - - + + JPG pictures and GTA Snapmatic JPG Bilder und GTA Snapmatic - - + + JPG pictures only Nur JPG Bilder - - + + GTA Snapmatic only Nur GTA Snapmatic @@ -877,25 +918,25 @@ Das GTA Snapmatic Format macht es möglich sie wieder ins Game zu importieren Exportieren als: - - + + No Snapmatic pictures or Savegames files are selected Keine Snapmatic Bilder oder Spielstände ausgewählt - - - + + + Remove selected Auswahl löschen - + You really want remove the selected Snapmatic picutres and Savegame files? Möchtest du wirklich die ausgewählten Snapmatic Bilder und Spielstanddateien löschen? - + Failed at remove the complete selected Snapmatic pictures and/or Savegame files Fehlgeschlagen beim kompletten entfernen der ausgewählten Snapmatic Bilder und/oder der Spielstanddateien @@ -916,10 +957,10 @@ Exportieren als: Fehlgeschlagenen beim Import vom Spielstand weil kein Spielstandslot mehr übrig ist - - - - + + + + Export selected Auswahl exportieren @@ -940,12 +981,12 @@ Exportieren als: Wie sollen wir mit den Snapmatic Bilder umgehen? - + Export selected... Auswahl exportieren... - + Initializing export... Initialisiere Export... @@ -954,7 +995,7 @@ Exportieren als: Initialisierung... - + Export failed with... %1 @@ -1277,36 +1318,36 @@ Exportieren als: SnapmaticEditor - + Snapmatic Properties Snapmatic Eigenschaften - + Snapmatic Type Snapmatic Typ - - + + Editor Editor - - + + Selfie Selbstporträt - + Regular Typisch - - + + Mugshot Fahndungsfoto @@ -1315,37 +1356,37 @@ Exportieren als: Eigenes - + Director Director - + Meme Meme - + Extras Extras - + Qualify as Avatar automatically at apply Beim Übernehmen als Avatar qualifizieren - + Qualify as Avatar allows you to use this Snapmatic as a Social Club profile picture Das Qualifizieren als Avatar erlaubt dir dieses Snapmatic als Social Club Profilbild zu nutzen - + &Apply &Übernehmen - + &Cancel Abbre&chen @@ -1824,7 +1865,7 @@ Exportieren als: - + Select GTA V Folder... diff --git a/res/gta5sync_fr.ts b/res/gta5sync_fr.ts index b176550..aa9099e 100644 --- a/res/gta5sync_fr.ts +++ b/res/gta5sync_fr.ts @@ -74,7 +74,7 @@ Pictures and Savegames et les fichiers de sauvegarde de Grand Theft Auto V - + A project for viewing and sync Grand Theft Auto V Snapmatic<br/> Pictures and Savegames Un outil pour gérer et synchroniser les photos Snapmatic<br/> @@ -306,44 +306,44 @@ et les fichiers de sauvegarde de Grand Theft Auto V &Annuler - + %1 (%2 if available) System like PC System = %1, System Language like Deutsch = %2 %1 (%2 si disponible) - + System System like PC System Système - + %1 %1 %1 - + The new Custom Folder will initialize after you restart %1. Le répertoire personnalisé sera actif au prochain lancement de %1. - + The language change will take effect after you restart %1. Le changement de langue sera actif au prochain lancement de %1. - + No Profile No Profile, as default Aucun profil - - + + Profile: %1 Profil : %1 @@ -434,46 +434,58 @@ et les fichiers de sauvegarde de Grand Theft Auto V Fichier invalide - + Export as &JPG picture... Exporter comme image &JPG... - + Export as &GTA Snapmatic... Exporter comme &GTA Snapmatic... - - + + Key 1 - Avatar Preview Mode +Key 2 - Toggle Overlay +Arrow Keys - Navigate + + + + + Snapmatic Picture Viewer Visionneuse de photo Snapmatic - - + + Failed at %1 Echec de %1 - - Avatar Preview Mode<br>Press A for Default View - Aperçu avatar<br>Appuyer sur A pour la vue par défaut + + Avatar Preview Mode +Press 1 for Default View + - - + Avatar Preview Mode<br>Press A for Default View + Aperçu avatar<br>Appuyer sur A pour la vue par défaut + + + + No player Aucun joueur - - + + No crew Aucun crew - + Unknown Location Emplacement inconnu @@ -566,52 +578,52 @@ et les fichiers de sauvegarde de Grand Theft Auto V Chargement... - + Import... Importer... - - - - - - - - - - - - + + + + + + + + + + + + Import Importer - + All profile files (SGTA* PGTA*) Fichiers de profil GTA (SGTA* PGTA*) - + Savegames files (SGTA*) Fichiers de sauvegarde GTA (SGTA*) - + Snapmatic pictures (PGTA*) Photos Snapmatic (PGTA*) - + All files (**) Tous les fichiers (**) - + Import failed with... %1 @@ -620,97 +632,97 @@ et les fichiers de sauvegarde de Grand Theft Auto V %1 - - + + No valid file is selected Fichier invalide - + Failed to read Snapmatic picture Impossible d'ouvrir la photo Snapmatic - + Failed to read Savegame file Impossible de lire le fichier de sauvegarde - + Can't import %1 because of not valid file format Impossible d'importer %1, format invalide - + Failed to import the Snapmatic picture, file not begin with PGTA Impossible d'importer la photo Snapmatic,nom de fichier incorrect (PGTA*) - + Failed to import the Snapmatic picture, the picture is already in the game Impossible d'importer la photo Snapmatic, un fichier du même nom existe déjà - + Failed to import the Snapmatic picture, can't copy the file into profile Impossible d'importer la photo Snapmatic, impossible de copier le fichier dans le profil - + Failed to import the Savegame, can't copy the file into profile Impossible d'importer la sauvegarde, impossible de copier le fichier dans le profil - + Failed to import the Savegame, no Savegame slot is left Impossible d'importer la sauvegarde, aucun emplacement libre - - - - + + + + Export selected Exporter la sélection - - + + JPG pictures and GTA Snapmatic Images JPG et GTA Snapmatic - - + + JPG pictures only Images JPG seulement - - + + GTA Snapmatic only GTA Snapmatic seulement - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Exporter les photos Snapmatic%2<br><br>Les fichiers JPG permettent d'ouvrir les photos avec une visionneuse d'images<br>Les GTA Snapmatic permettent d'importer les photos dans le jeu<br><br>Exporter comme : - + Export selected... Exporter la sélection... - + Initializing export... Initialisation de l'export... - + Export failed with... %1 @@ -719,25 +731,25 @@ et les fichiers de sauvegarde de Grand Theft Auto V %1 - - + + No Snapmatic pictures or Savegames files are selected Aucun fichier de sauvegarde ou photo Snapmatic sélectionné - - - + + + Remove selected Supprimer la sélection - + You really want remove the selected Snapmatic picutres and Savegame files? Supprimer la sélection ? - + Failed at remove the complete selected Snapmatic pictures and/or Savegame files Impossible de supprimer la sélection @@ -949,36 +961,36 @@ et les fichiers de sauvegarde de Grand Theft Auto V SnapmaticEditor - + Snapmatic Properties Propriétés Snapmatic - + Snapmatic Type Type - - + + Editor Éditeur - - + + Selfie Selfie - + Regular Normal - - + + Mugshot Mugshot @@ -987,37 +999,37 @@ et les fichiers de sauvegarde de Grand Theft Auto V Personnalisé - + Director Director - + Meme Meme - + Extras Extras - + Qualify as Avatar automatically at apply Qualifier comme Avatar - + Qualify as Avatar allows you to use this Snapmatic as a Social Club profile picture Qualifier comme Avatar permet d'utiliser cette image en tant que photo de profil sur le Social Club - + &Apply A&ppliquer - + &Cancel A&nnuler @@ -1317,7 +1329,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V - + Select GTA V Folder...