diff --git a/src/branding/fancy/branding.desc b/src/branding/fancy/branding.desc deleted file mode 100644 index 8aae1b0b7..000000000 --- a/src/branding/fancy/branding.desc +++ /dev/null @@ -1,32 +0,0 @@ ---- -componentName: fancy - -welcomeStyleCalamares: false - -strings: - productName: Fancy GNU/Linux - shortProductName: Fancy - version: 2018.3 LTS - shortVersion: 2018.3 - versionedName: Fancy GNU/Linux 2018.3 LTS "Terrible Tubas" - shortVersionedName: Fancy 2018.3 - bootloaderEntryName: Fancy - productUrl: https://calamares.io/ - supportUrl: https://github.com/calamares/calamares/issues - knownIssuesUrl: https://calamares.io/about/ - releaseNotesUrl: https://calamares.io/about/ - -welcomeExpandingLogo: true - -images: - productLogo: "squid.png" - productIcon: "squid.png" - productWelcome: "languages.png" - -slideshow: "show.qml" - -style: - sidebarBackground: "#392F34" - sidebarText: "#eFFFFF" - sidebarTextSelect: "#392F34" - sidebarTextHighlight: "#c35400" diff --git a/src/branding/fancy/go-next.svgz b/src/branding/fancy/go-next.svgz deleted file mode 100644 index c6dc7d0f4..000000000 Binary files a/src/branding/fancy/go-next.svgz and /dev/null differ diff --git a/src/branding/fancy/go-previous.svgz b/src/branding/fancy/go-previous.svgz deleted file mode 100644 index 971b1d989..000000000 Binary files a/src/branding/fancy/go-previous.svgz and /dev/null differ diff --git a/src/branding/fancy/lang/calamares-fancy_en.ts b/src/branding/fancy/lang/calamares-fancy_en.ts deleted file mode 100644 index 945bfb532..000000000 --- a/src/branding/fancy/lang/calamares-fancy_en.ts +++ /dev/null @@ -1,42 +0,0 @@ - - - - - show - - - - This is a customizable QML slideshow. - - - - - - Welcome to Fancy GNU/Linux. - - - - - - This is example branding for your GNU/Linux distribution. Long texts in the slideshow are translated and word-wrapped appropriately. Calamares is a distribution-independent installer framework. - - - - - - This is a third Slide element. - - - - - This is a fourth Slide element. - - - - - - Slide number five - - - - diff --git a/src/branding/fancy/lang/calamares-fancy_nl.ts b/src/branding/fancy/lang/calamares-fancy_nl.ts deleted file mode 100644 index 088f9c0f8..000000000 --- a/src/branding/fancy/lang/calamares-fancy_nl.ts +++ /dev/null @@ -1,42 +0,0 @@ - - - - - show - - - - This is a customizable QML slideshow. - Dit is een zelf-aan-te-passen QML presentatie. - - - - - Welcome to Fancy GNU/Linux. - Welkom bij Fancy GNU/Linux. - - - - - This is example branding for your GNU/Linux distribution. Long texts in the slideshow are translated and word-wrapped appropriately. Calamares is a distribution-independent installer framework. - Dit is voorbeeld merk-materiaal voor uw GNU/Linux distributie. Lange teksten in de presentatie kunnen automatisch worden ge-layout. Calamares is een distributie-onafhankelijke installatie raamwerk. - - - - - This is a third Slide element. - Dit is de derde slide. - - - - This is a fourth Slide element. - - - - - - Slide number five - Slide nummer vijf - - - diff --git a/src/branding/fancy/languages.png b/src/branding/fancy/languages.png deleted file mode 100644 index 53316526b..000000000 Binary files a/src/branding/fancy/languages.png and /dev/null differ diff --git a/src/branding/fancy/show.qml b/src/branding/fancy/show.qml deleted file mode 100644 index 399434420..000000000 --- a/src/branding/fancy/show.qml +++ /dev/null @@ -1,112 +0,0 @@ -/* === This file is part of Calamares - === - * - * Copyright 2015, Teo Mrnjavac - * Copyright 2018, Adriaan de Groot - * - * Calamares is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calamares is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calamares. If not, see . - */ - -import QtQuick 2.5; -import calamares.slideshow 1.0; - -Presentation -{ - id: presentation - - mouseNavigation: false /* Only the fwd/back buttons */ - loopSlides: false - - BackButton { - width: 60 - height: 60 - source: "go-previous.svgz" - } - - ForwardButton { - width: 60 - height: 60 - source: "go-next.svgz" - } - - SlideCounter {} - - Slide { - /* This first slide ignores the "normal" slide layout and places - * an image and text by itself. The anchors need to be connected - * to place the items properly. - */ - Image { - id: background1 // Must be unique - source: "squid.png" - width: 200; height: 200 - fillMode: Image.PreserveAspectFit - anchors.centerIn: parent - } - Text { - anchors.horizontalCenter: background1.horizontalCenter - anchors.top: background1.bottom - text: qsTr("This is a customizable QML slideshow.") - wrapMode: Text.WordWrap - width: presentation.width - horizontalAlignment: Text.Center - } - } - - Slide { - /* Make this one narrower to prevent overlap of wide text with nav buttons */ - width: parent.width * 0.9 - 120 - x: parent.width * 0.05 + 60 - /* For just a slide with text, things can be simplified using properties */ - title: qsTr("Welcome to Fancy GNU/Linux.") - centeredText: qsTr("This is example branding for your GNU/Linux distribution. " + - "Long texts in the slideshow are translated and word-wrapped appropriately. " + - "Calamares is a distribution-independent installer framework. ") - } - - Slide { - centeredText: qsTr("This is a third Slide element.") - } - - Slide { - /* Note that these overlap because both are centered. The z-order puts the background - * in back. While you can use the properties of the Slide, it's not easy to get at - * the anchors of the items. - */ - Image { - id: background4 - source: "squid4.png" - width: 200; height: 200 - fillMode: Image.PreserveAspectFit - anchors.centerIn: parent - z: -1 - } - centeredText: qsTr("This is a fourth Slide element.") - } - - Slide { - title: qsTr("Slide number five") - writeInText: qsTr("This is example branding for your GNU/Linux distribution. " + - "Long texts in the slideshow are translated and word-wrapped appropriately. " + - "Calamares is a distribution-independent installer framework. ") - } - - Slide { - title: qsTr("Slide number five") - content: [ - qsTr("Welcome to Fancy GNU/Linux."), - qsTr("This is a customizable QML slideshow."), - qsTr("This is a third Slide element.") - ] - } -} diff --git a/src/branding/fancy/squid.png b/src/branding/fancy/squid.png deleted file mode 100644 index 452e4450c..000000000 Binary files a/src/branding/fancy/squid.png and /dev/null differ diff --git a/src/branding/fancy/squid2.png b/src/branding/fancy/squid2.png deleted file mode 100644 index 305153444..000000000 Binary files a/src/branding/fancy/squid2.png and /dev/null differ diff --git a/src/branding/fancy/squid3.png b/src/branding/fancy/squid3.png deleted file mode 100644 index 8cc9551ec..000000000 Binary files a/src/branding/fancy/squid3.png and /dev/null differ diff --git a/src/branding/fancy/squid4.png b/src/branding/fancy/squid4.png deleted file mode 100644 index c20d90f55..000000000 Binary files a/src/branding/fancy/squid4.png and /dev/null differ diff --git a/src/branding/samegame/Block.qml b/src/branding/samegame/Block.qml deleted file mode 100644 index 81bdd67ea..000000000 --- a/src/branding/samegame/Block.qml +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Item { - id: block - - property int type: 0 - - Image { - id: img - - anchors.fill: parent - source: { - if (type == 0) - return "redStone.png"; - else if (type == 1) - return "blueStone.png"; - else - return "greenStone.png"; - } - } -} -//![0] diff --git a/src/branding/samegame/Button.qml b/src/branding/samegame/Button.qml deleted file mode 100644 index 77921772d..000000000 --- a/src/branding/samegame/Button.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: container - - property string text: "Button" - - signal clicked - - width: buttonLabel.width + 20; height: buttonLabel.height + 5 - border { width: 1; color: Qt.darker(activePalette.button) } - antialiasing: true - radius: 8 - - // color the button with a gradient - gradient: Gradient { - GradientStop { - position: 0.0 - color: { - if (mouseArea.pressed) - return activePalette.dark - else - return activePalette.light - } - } - GradientStop { position: 1.0; color: activePalette.button } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: container.clicked(); - } - - Text { - id: buttonLabel - anchors.centerIn: container - color: activePalette.buttonText - text: container.text - } -} diff --git a/src/branding/samegame/Dialog.qml b/src/branding/samegame/Dialog.qml deleted file mode 100644 index 94e708f9c..000000000 --- a/src/branding/samegame/Dialog.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Rectangle { - id: container - - function show(text) { - dialogText.text = text; - container.opacity = 1; - } - - function hide() { - container.opacity = 0; - } - - width: dialogText.width + 20 - height: dialogText.height + 20 - opacity: 0 - - Text { - id: dialogText - anchors.centerIn: parent - text: "" - } - - MouseArea { - anchors.fill: parent - onClicked: hide(); - } -} -//![0] diff --git a/src/branding/samegame/background.jpg b/src/branding/samegame/background.jpg deleted file mode 100644 index 903d395c8..000000000 Binary files a/src/branding/samegame/background.jpg and /dev/null differ diff --git a/src/branding/samegame/blueStar.png b/src/branding/samegame/blueStar.png deleted file mode 100644 index 213bb4bf6..000000000 Binary files a/src/branding/samegame/blueStar.png and /dev/null differ diff --git a/src/branding/samegame/blueStone.png b/src/branding/samegame/blueStone.png deleted file mode 100644 index 20e43c75b..000000000 Binary files a/src/branding/samegame/blueStone.png and /dev/null differ diff --git a/src/branding/samegame/branding.desc b/src/branding/samegame/branding.desc deleted file mode 100644 index b280e3df3..000000000 --- a/src/branding/samegame/branding.desc +++ /dev/null @@ -1,76 +0,0 @@ ---- -componentName: samegame - -# This selects between different welcome texts. When false, uses -# the traditional "Welcome to the %1 installer.", and when true, -# uses "Welcome to the Calamares installer for %1." This allows -# to distinguish this installer from other installers for the -# same distribution. -welcomeStyleCalamares: false - -# These are strings shown to the user in the user interface. -# There is no provision for translating them -- since they -# are names, the string is included as-is. -# -# The four Url strings are the Urls used by the buttons in -# the welcome screen, and are not shown to the user. Clicking -# on the "Support" button, for instance, opens the link supportUrl. -# If a Url is empty, the corresponding button is not shown. -# -# bootloaderEntryName is how this installation / distro is named -# in the boot loader (e.g. in the GRUB menu). -strings: - productName: Generic GNU/Linux - shortProductName: Generic - version: 2018.1 LTS - shortVersion: 2018.1 - versionedName: Generic GNU/Linux 2018.1 LTS "Tasseled Tambourine" - shortVersionedName: Generic 2018.1 - bootloaderEntryName: Generic - productUrl: https://calamares.io/ - supportUrl: https://github.com/calamares/calamares/issues - knownIssuesUrl: https://calamares.io/about/ - releaseNotesUrl: https://calamares.io/about/ - -# Should the welcome image (productWelcome, below) be scaled -# up beyond its natural size? If false, the image does not grow -# with the window but remains the same size throughout (this -# may have surprising effects on HiDPI monitors). -welcomeExpandingLogo: true - -# These images are loaded from the branding module directory. -# -# productIcon is used as the window icon, and will (usually) be used -# by the window manager to represent the application. This image -# should be square, and may be displayed by the window manager -# as small as 16x16 (but possibly larger). -# productLogo is used as the logo at the top of the left-hand column -# which shows the steps to be taken. The image should be square, -# and is displayed at 80x80 pixels (also on HiDPI). -# productWelcome is shown on the welcome page of the application in -# the middle of the window, below the welcome text. It can be -# any size and proportion, and will be scaled to fit inside -# the window. Use `welcomeExpandingLogo` to make it non-scaled. -# Recommended size is 320x150. -images: - productLogo: "squidball.png" - productIcon: "squidball.png" - productWelcome: "languages.png" - -# The slideshow is displayed during execution steps (e.g. when the -# installer is actually writing to disk and doing other slow things). -slideshow: "samegame.qml" - -# Colors for text and background components. -# -# - sidebarBackground is the background of the sidebar -# - sidebarText is the (foreground) text color -# - sidebarTextHighlight sets the background of the selected (current) step. -# Optional, and defaults to the application palette. -# - sidebarSelect is the text color of the selected step. -# -style: - sidebarBackground: "#292F34" - sidebarText: "#FFFFFF" - sidebarTextSelect: "#292F34" - sidebarTextHighlight: "#D35400" diff --git a/src/branding/samegame/greenStar.png b/src/branding/samegame/greenStar.png deleted file mode 100644 index 38429749b..000000000 Binary files a/src/branding/samegame/greenStar.png and /dev/null differ diff --git a/src/branding/samegame/greenStone.png b/src/branding/samegame/greenStone.png deleted file mode 100644 index b568a1900..000000000 Binary files a/src/branding/samegame/greenStone.png and /dev/null differ diff --git a/src/branding/samegame/languages.png b/src/branding/samegame/languages.png deleted file mode 100644 index 53316526b..000000000 Binary files a/src/branding/samegame/languages.png and /dev/null differ diff --git a/src/branding/samegame/redStar.png b/src/branding/samegame/redStar.png deleted file mode 100644 index 5cdf45c4c..000000000 Binary files a/src/branding/samegame/redStar.png and /dev/null differ diff --git a/src/branding/samegame/redStone.png b/src/branding/samegame/redStone.png deleted file mode 100644 index 36b09a268..000000000 Binary files a/src/branding/samegame/redStone.png and /dev/null differ diff --git a/src/branding/samegame/samegame.js b/src/branding/samegame/samegame.js deleted file mode 100644 index 01edc5bd4..000000000 --- a/src/branding/samegame/samegame.js +++ /dev/null @@ -1,174 +0,0 @@ -/* This script file handles the game logic */ -var maxColumn = 10; -var maxRow = 15; -var maxIndex = maxColumn * maxRow; -var board = new Array(maxIndex); -var component; - -//Index function used instead of a 2D array -function index(column, row) { - return column + (row * maxColumn); -} - -function startNewGame() { - //Calculate board size - maxColumn = Math.floor(gameCanvas.width / gameCanvas.blockSize); - maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize); - maxIndex = maxRow * maxColumn; - - //Close dialogs - dialog.hide(); - - //Initialize Board - board = new Array(maxIndex); - gameCanvas.score = 0; - for (var column = 0; column < maxColumn; column++) { - for (var row = 0; row < maxRow; row++) { - board[index(column, row)] = null; - createBlock(column, row); - } - } -} - -function createBlock(column, row) { - if (component == null) - component = Qt.createComponent("Block.qml"); - - // Note that if Block.qml was not a local file, component.status would be - // Loading and we should wait for the component's statusChanged() signal to - // know when the file is downloaded and ready before calling createObject(). - if (component.status == Component.Ready) { - var dynamicObject = component.createObject(gameCanvas); - if (dynamicObject == null) { - console.log("error creating block"); - console.log(component.errorString()); - return false; - } - dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.x = column * gameCanvas.blockSize; - dynamicObject.y = row * gameCanvas.blockSize; - dynamicObject.width = gameCanvas.blockSize; - dynamicObject.height = gameCanvas.blockSize; - board[index(column, row)] = dynamicObject; - } else { - console.log("error loading block component"); - console.log(component.errorString()); - return false; - } - return true; -} - -var fillFound; //Set after a floodFill call to the number of blocks found -var floodBoard; //Set to 1 if the floodFill reaches off that node - -//![1] -function handleClick(xPos, yPos) { - var column = Math.floor(xPos / gameCanvas.blockSize); - var row = Math.floor(yPos / gameCanvas.blockSize); - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if (board[index(column, row)] == null) - return; - //If it's a valid block, remove it and all connected (does nothing if it's not connected) - floodFill(column, row, -1); - if (fillFound <= 0) - return; - gameCanvas.score += (fillFound - 1) * (fillFound - 1); - shuffleDown(); - victoryCheck(); -} -//![1] - -function floodFill(column, row, type) { - if (board[index(column, row)] == null) - return; - var first = false; - if (type == -1) { - first = true; - type = board[index(column, row)].type; - - //Flood fill initialization - fillFound = 0; - floodBoard = new Array(maxIndex); - } - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type)) - return; - floodBoard[index(column, row)] = 1; - floodFill(column + 1, row, type); - floodFill(column - 1, row, type); - floodFill(column, row + 1, type); - floodFill(column, row - 1, type); - if (first == true && fillFound == 0) - return; //Can't remove single blocks - board[index(column, row)].opacity = 0; - board[index(column, row)] = null; - fillFound += 1; -} - -function shuffleDown() { - //Fall down - for (var column = 0; column < maxColumn; column++) { - var fallDist = 0; - for (var row = maxRow - 1; row >= 0; row--) { - if (board[index(column, row)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - var obj = board[index(column, row)]; - obj.y += fallDist * gameCanvas.blockSize; - board[index(column, row + fallDist)] = obj; - board[index(column, row)] = null; - } - } - } - } - //Fall to the left - var fallDist = 0; - for (var column = 0; column < maxColumn; column++) { - if (board[index(column, maxRow - 1)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - for (var row = 0; row < maxRow; row++) { - var obj = board[index(column, row)]; - if (obj == null) - continue; - obj.x -= fallDist * gameCanvas.blockSize; - board[index(column - fallDist, row)] = obj; - board[index(column, row)] = null; - } - } - } - } -} - -//![2] -function victoryCheck() { - //Award bonus points if no blocks left - var deservesBonus = true; - for (var column = maxColumn - 1; column >= 0; column--) - if (board[index(column, maxRow - 1)] != null) - deservesBonus = false; - if (deservesBonus) - gameCanvas.score += 500; - - //Check whether game has finished - if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) - dialog.show("Game Over. Your score is " + gameCanvas.score); -} -//![2] - -//only floods up and right, to see if it can find adjacent same-typed blocks -function floodMoveCheck(column, row, type) { - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return false; - if (board[index(column, row)] == null) - return false; - var myType = board[index(column, row)].type; - if (type == myType) - return true; - return floodMoveCheck(column + 1, row, myType) || floodMoveCheck(column, row - 1, board[index(column, row)].type); -} - diff --git a/src/branding/samegame/samegame.qml b/src/branding/samegame/samegame.qml deleted file mode 100644 index 73ef74d1e..000000000 --- a/src/branding/samegame/samegame.qml +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 -import "samegame.js" as SameGame - -Rectangle { - id: screen - - width: 490; height: 720 - - SystemPalette { id: activePalette } - - Item { - width: parent.width - anchors { top: parent.top; bottom: toolBar.top } - - Image { - id: background - anchors.fill: parent - source: "background.jpg" - fillMode: Image.PreserveAspectCrop - } - -//![1] - Item { - id: gameCanvas - - property int score: 0 - property int blockSize: 40 - - width: parent.width - (parent.width % blockSize) - height: parent.height - (parent.height % blockSize) - anchors.centerIn: parent - - MouseArea { - anchors.fill: parent - onClicked: SameGame.handleClick(mouse.x, mouse.y) - } - } -//![1] - } - -//![2] - Dialog { - id: dialog - anchors.centerIn: parent - z: 100 - } -//![2] - - Rectangle { - id: toolBar - width: parent.width; height: 30 - color: activePalette.window - anchors.bottom: screen.bottom - - Button { - anchors { left: parent.left; verticalCenter: parent.verticalCenter } - text: "New Game" - onClicked: SameGame.startNewGame() - } - } -} -//![0] diff --git a/src/branding/samegame/squidball.png b/src/branding/samegame/squidball.png deleted file mode 100644 index b7934e8ee..000000000 Binary files a/src/branding/samegame/squidball.png and /dev/null differ diff --git a/src/branding/samegame/star.png b/src/branding/samegame/star.png deleted file mode 100644 index defbde53c..000000000 Binary files a/src/branding/samegame/star.png and /dev/null differ diff --git a/src/branding/samegame/yellowStone.png b/src/branding/samegame/yellowStone.png deleted file mode 100644 index b1ce76212..000000000 Binary files a/src/branding/samegame/yellowStone.png and /dev/null differ