*removed buggy focus system completely (it was never working correct)

*added support to control screen pointer with gc pad or classic controller. you are always able to control as long as the corresponding wii control does not point to the screen (e.g. wiimote 1 not pointing to screen -> gcpad/classic controller 1 can control pointer 1). a speed factor is added to the gui option. need feedback about a proper default value, currently 15% (only tested gc pad on dolphin-emu)
*fix reinit of cheatcount on download of new file
*moved installation window to be on top of main window
*added game installation cancel
*added nand extract cancel
*added back extract of save feature for a real nand channels
*added auto position of progress window messages in vertical direction depending of how many are used at the same time
This commit is contained in:
strtoul 2011-12-28 16:27:30 +00:00
parent 16cf771891
commit a66a30a771
64 changed files with 602 additions and 475 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>2.3 r1138</version>
<release_date>201112280949</release_date>
<version>2.3 r1139</version>
<release_date>201112281612</release_date>
<!-- // remove this line to enable arguments
<arguments>
<arg>--ios=250</arg>

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: David Jelinek (djelinek@hotmail.com) e->e,r->r,u->u, c->c \n"
"Language-Team: r1056 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n"
@ -945,6 +945,9 @@ msgstr "Vložte Wii disk"
msgid "Install"
msgstr "Instalace"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Verze: %s"
msgid "Video Mode"
msgstr "Video mód"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Cesta k WDM soborum"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Fox888[dk]\n"
"Language-Team: [dk]\n"
@ -945,6 +945,9 @@ msgstr "Indsæt en Wii-DVD!"
msgid "Install"
msgstr "Installér"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Installer mappe"
@ -1698,6 +1701,9 @@ msgstr ""
msgid "Video Mode"
msgstr "Video-mode"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Sti til WDM filer"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2011-06-30 14:22+0100\n"
"Last-Translator: glowy\n"
"Language-Team: tj_cool, glowy\n"
@ -945,6 +945,9 @@ msgstr "Voer een Wii disk in!"
msgid "Install"
msgstr "Installeer"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Installeer mappen"
@ -1698,6 +1701,9 @@ msgstr "Versie: %s"
msgid "Video Mode"
msgstr ""
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Locatie WDM bestanden"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -945,6 +945,9 @@ msgstr ""
msgid "Install"
msgstr ""
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr ""
msgid "Video Mode"
msgstr ""
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: c64rmx\n"
"Language-Team: \n"
@ -945,6 +945,9 @@ msgstr "Aseta Wii-levy!"
msgid "Install"
msgstr "Asenna"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Versio: %s"
msgid "Video Mode"
msgstr "Videotila"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Cyan\n"
"Language-Team: Badablek, Amour, ikya, Cyan & Kin8\n"
@ -945,6 +945,9 @@ msgstr "Insérez un disque Wii !"
msgid "Install"
msgstr "Installer"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Dossiers d'installation"
@ -1698,6 +1701,9 @@ msgstr ""
msgid "Video Mode"
msgstr "Mode vidéo"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Dossier fichiers WDM"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2010-07-03 17:35-0800\n"
"Last-Translator: TheRealVisitor\n"
"Language-Team: Bertilax, Snoozer, wishmasterf, ZEN.13, TheRealVisitor\n"
@ -945,6 +945,9 @@ msgstr "Eine Wii Disk einlegen!"
msgid "Install"
msgstr "Installieren"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Installationsart"
@ -1698,6 +1701,9 @@ msgstr "Version: %s"
msgid "Video Mode"
msgstr "Videomodus"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "WDM Dateien"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-12-29 11:05+0100\n"
"Last-Translator: Springdale\n"
"Language-Team: Tusk, Springdale\n"
@ -945,6 +945,9 @@ msgstr "Helyezz be Wii lemezt!"
msgid "Install"
msgstr "Telepítés"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Verzió: %s"
msgid "Video Mode"
msgstr "Videó Mód"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2011-09-11 12:19+0100\n"
"Last-Translator: xFede\n"
"Language-Team: Cambo\n"
@ -945,6 +945,9 @@ msgstr "Inserisci un disco per Wii!"
msgid "Install"
msgstr "Installa"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Seleziona Subcartella"
@ -1698,6 +1701,9 @@ msgstr "Versione: %s"
msgid "Video Mode"
msgstr "Modalità Video"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Percorso dei file WDM"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: hosigumayuugi\n"
"Language-Team: hosigumayuugi\n"
@ -945,6 +945,9 @@ msgstr "Wiiディスクを入れて下さい!"
msgid "Install"
msgstr "インストール"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "インストールフォルダ"
@ -1698,6 +1701,9 @@ msgstr "バージョン: %s"
msgid "Video Mode"
msgstr "映像の出力方法"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "WDMファイル"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nextos@korea.com\n"
"Language-Team: \n"
@ -945,6 +945,9 @@ msgstr "Wii 디스크를 넣으세요!"
msgid "Install"
msgstr "설치"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "버전: %s"
msgid "Video Mode"
msgstr "비디오 모드"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: raschi\n"
"Language-Team: raschi\n"
@ -945,6 +945,9 @@ msgstr "Sett inn en Wii plate!"
msgid "Install"
msgstr "Installér"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Installer mapper"
@ -1698,6 +1701,9 @@ msgstr "Versjon: %s"
msgid "Video Mode"
msgstr "Video modus"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "WDM sti"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: ziom666 (zadania_prog@vp.pl)\n"
"Language-Team: \n"
@ -945,6 +945,9 @@ msgstr "Wloz plyte Wii!"
msgid "Install"
msgstr "Zainstaluj"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Wersja: %s"
msgid "Video Mode"
msgstr "Tryb video"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-23 18:52+0200\n"
"Last-Translator: aniemotion\n"
"Language-Team: boto12, aniemotion\n"
@ -945,6 +945,9 @@ msgstr "Insira um Disco do Wii!"
msgid "Install"
msgstr "Instalar"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Versão: %s"
msgid "Video Mode"
msgstr "Modo de Vídeo"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2011-11-03 11:00+0000\n"
"Last-Translator: pplucky <pplucky@gmail.com>\n"
"Language-Team: Sky8000, pplucky\n"
@ -945,6 +945,9 @@ msgstr "Insira um Disco da Wii!"
msgid "Install"
msgstr "Instalar"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Instalar Directórios"
@ -1698,6 +1701,9 @@ msgstr "Versão: %s"
msgid "Video Mode"
msgstr "Modo de Vídeo"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Cam. Ficheiros WDM"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nikolai_ca\n"
"Language-Team: Kir, alendit, nikolai_ca\n"
@ -945,6 +945,9 @@ msgstr "Вставьте диск Wii!"
msgid "Install"
msgstr "Установка"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Версия: %s"
msgid "Video Mode"
msgstr "Видео режим"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: knife.hu kavid emul8ion\n"
"Language-Team: kavid\n"
@ -945,6 +945,9 @@ msgstr "插入 Wii 光盘!"
msgid "Install"
msgstr "安装"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "版本: %s"
msgid "Video Mode"
msgstr "视频制式"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "WDM文件路径"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2011-07-25 16:40+0200\n"
"Last-Translator: Galen/xFede\n"
"Language-Team: Penn, SirPalax, hvy109\n"
@ -945,6 +945,9 @@ msgstr "¡Inserta un Disco Wii!"
msgid "Install"
msgstr "Instalar"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "Instalar Directorios"
@ -1698,6 +1701,9 @@ msgstr "Versión: %s"
msgid "Video Mode"
msgstr "Modo Vídeo"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "Rutas Archivos WDM"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2010-01-19 17:39+0200\n"
"Last-Translator: Katsurou\n"
"Language-Team: Katsurou, pirateX\n"
@ -945,6 +945,9 @@ msgstr "Sätt i en Wii-skiva!"
msgid "Install"
msgstr "Installera"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr ""
msgid "Video Mode"
msgstr "Video-läge"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2010-02-15 21:00+0800\n"
"Last-Translator: Jane.H\n"
"Language-Team: kyogc, Miller, Mika Li, Jane.H\n"
@ -945,6 +945,9 @@ msgstr "插入 Wii 光碟!"
msgid "Install"
msgstr "安裝"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr "安裝目錄"
@ -1698,6 +1701,9 @@ msgstr "版本: %s"
msgid "Video Mode"
msgstr "視訊格式"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr "WDM檔案路徑"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Nitro_subzero \n"
"Language-Team: Nitro_subzero\n"
@ -945,6 +945,9 @@ msgstr "ใส่แผ่น Wii !"
msgid "Install"
msgstr "ติดตั้ง"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "เวอร์ชั่น: %s"
msgid "Video Mode"
msgstr "โหมดการแสดงผลภาพ"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-28 10:29+0100\n"
"POT-Creation-Date: 2011-12-28 16:35+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: omercigingelini\n"
"Language-Team: omercigingelini\n"
@ -945,6 +945,9 @@ msgstr "Bir Wii Diski Takın!"
msgid "Install"
msgstr "Kur"
msgid "Install Canceled"
msgstr ""
msgid "Install Directories"
msgstr ""
@ -1698,6 +1701,9 @@ msgstr "Vesiyon: %s"
msgid "Video Mode"
msgstr "Video Modu"
msgid "Virtual Pointer Speed"
msgstr ""
msgid "WDM Files Path"
msgstr ""

142
source/Controls/WiiPointer.cpp Executable file
View File

@ -0,0 +1,142 @@
/****************************************************************************
* Copyright (C) 2011 Dimok
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "WiiPointer.h"
#include "settings/CSettings.h"
#include "themes/Resources.h"
#include "utils/tools.h"
#include "video.h"
#include "input.h"
WiiPointer::WiiPointer(const char *pntrImg)
: posX(screenwidth/2), posY(screenheight/2),
angle(0.0f), lastActivity(301)
{
pointerImg = Resources::GetImageData(pntrImg);
}
WiiPointer::~WiiPointer()
{
delete pointerImg;
}
void WiiPointer::SetImage(const char *pntrImg)
{
GuiImageData * newPointer = Resources::GetImageData(pntrImg);
if(!newPointer)
return;
// let's save us the work with mutex here
GuiImageData * temp2 = pointerImg;
pointerImg = newPointer;
delete temp2;
}
void WiiPointer::Draw(GuiTrigger *t)
{
if(t && pointerImg)
{
if(t->wpad.ir.valid)
{
lastActivity = 0;
posX = t->wpad.ir.x;
posY = t->wpad.ir.y;
angle = t->wpad.ir.angle;
}
else
{
angle = 0.0f;
// GC PAD
// x-axis
if(t->pad.stickX < -PADCAL)
{
posX += (t->pad.stickX + PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
else if(t->pad.stickX > PADCAL)
{
posX += (t->pad.stickX - PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
// y-axis
if(t->pad.stickY < -PADCAL)
{
posY -= (t->pad.stickY + PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
else if(t->pad.stickY > PADCAL)
{
posY -= (t->pad.stickY - PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
int wpadX = 0;
int wpadY = 0;
// don't use it, if it's a nunchuck
if(t->wpad.exp.type != WPAD_EXP_NUNCHUK)
{
wpadX = t->WPAD_Stick(0, 0);
wpadY = t->WPAD_Stick(0, 1);
}
// Wii Extensions
// x-axis
if(wpadX < -PADCAL)
{
posX += (wpadX + PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
else if(wpadX > PADCAL)
{
posX += (wpadX - PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
// y-axis
if(wpadY < -PADCAL)
{
posY -= (wpadY + PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
else if(wpadY > PADCAL)
{
posY -= (wpadY - PADCAL) * Settings.PointerSpeed;
lastActivity = 0;
}
if(t->pad.btns_h || t->wpad.btns_h)
lastActivity = 0;
posX = LIMIT(posX, -50.0f, screenwidth+50.0f);
posY = LIMIT(posY, -50.0f, screenheight+50.0f);
if(lastActivity < 300) { // (5s on 60Hz and 6s on 50Hz)
t->wpad.ir.valid = 1;
t->wpad.ir.x = posX;
t->wpad.ir.y = posY;
}
}
if(t->wpad.ir.valid)
Menu_DrawImg(posX - pointerImg->GetWidth()/2,
posY - pointerImg->GetHeight()/2,
9900.0f, pointerImg->GetWidth(), pointerImg->GetHeight(),
pointerImg->GetImage(), angle,
Settings.widescreen ? Settings.WSFactor : 1.f, 1.f, 255, 0, 0, 0, 0, 0, 0, 0, 0);
}
++lastActivity;
}

37
source/Controls/WiiPointer.h Executable file
View File

@ -0,0 +1,37 @@
/****************************************************************************
* Copyright (C) 2011 Dimok
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef WIIPOINTER_H_
#define WIIPOINTER_H_
#include "GUI/gui.h"
#include "utils/timer.h"
class WiiPointer
{
public:
WiiPointer(const char *pntrImg);
virtual ~WiiPointer();
void SetImage(const char *pntrImg);
void Draw(GuiTrigger *t);
u32 getLastActivCounter(void) { return lastActivity; }
private:
float posX, posY, angle;
u32 lastActivity;
GuiImageData * pointerImg;
};
#endif /* WIIPOINTER_H_ */

View File

@ -79,7 +79,7 @@ enum
enum
{
TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY, TRIGGER_BUTTON_ONLY_IN_FOCUS
TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY
};
enum
@ -142,11 +142,6 @@ class GuiTrigger
//!\param wiibtns Wii controller trigger button(s) - classic controller buttons are considered separately
//!\param gcbtns GameCube controller trigger button(s)
void SetButtonOnlyTrigger(s32 ch, u32 wiibtns, u16 gcbtns);
//!Sets a button-only trigger. Requires: trigger button is pressed and parent window of element is in focus
//!\param ch Controller channel number
//!\param wiibtns Wii controller trigger button(s) - classic controller buttons are considered separately
//!\param gcbtns GameCube controller trigger button(s)
void SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns);
//!Get X/Y value from Wii Joystick (classic, nunchuk) input
//!\param right Controller stick (left = 0, right = 1)
//!\param axis Controller stick axis (x-axis = 0, y-axis = 1)
@ -165,7 +160,7 @@ class GuiTrigger
//!\return true if selection should be moved down, false otherwise
bool Down();
u8 type; //!< trigger type (TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY, TRIGGER_BUTTON_ONLY_IN_FOCUS)
u8 type; //!< trigger type (TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY)
s32 chan; //!< Trigger controller channel (0-3, -1 for all)
WPADData wpad; //!< Wii controller trigger data
PADData pad; //!< GameCube controller trigger data
@ -344,15 +339,9 @@ class GuiElement
//!Sets a function to called after after Update()
//!Callback function can be used to response to changes in the state of the element, and/or update the element's attributes
void SetUpdateCallback(UpdateCallback u);
//!Checks whether the element is in focus
//!\return true if element is in focus, false otherwise
int IsFocused() { return focus; }
//!Sets the element's visibility
//!\param v Visibility (true = visible)
virtual void SetVisible(bool v);
//!Sets the element's focus
//!\param f Focus (true = in focus)
virtual void SetFocus(int f);
//!Sets the element's state
//!\param s State (STATE_DEFAULT, STATE_SELECTED, STATE_CLICKED, STATE_DISABLED)
//!\param c Controller channel (0-3, -1 = none)
@ -384,8 +373,6 @@ class GuiElement
//int position2; //! B Scrollbariable
bool visible; //!< Visibility of the element. If false, Draw() is skipped
int focus; //!< Element focus (-1 = focus disabled, 0 = not focused, 1 = focused)
int dontsetfocus; //!<If 0 games dont set the focus
int width; //!< Element width
int height; //!< Element height
int xoffset; //!< Element X offset
@ -482,19 +469,6 @@ class GuiWindow: public GuiElement
//!Gets the index of the GuiElement inside the window that is currently selected
//!\return index of selected GuiElement
int GetSelected();
//!Sets the window focus
//!\param f Focus
void SetFocus(int f);
//!Change the focus to the specified element
//!This is intended for the primary GuiWindow only
//!\param e GuiElement that should have focus
void ChangeFocus(GuiElement * e);
//!Changes window focus to the next focusable window or element
//!If no element is in focus, changes focus to the first available element
//!If B or 1 button is pressed, changes focus to the next available element
//!This is intended for the primary GuiWindow only
//!\param t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD
void ToggleFocus(GuiTrigger * t);
//!Moves the selected element to the element to the left or right
//!\param d Direction to move (-1 = left, 1 = right)
void MoveSelectionHor(int d);

View File

@ -470,11 +470,6 @@ void GuiButton::Update(GuiTrigger * t)
this->SetState(STATE_CLICKED, t->chan);
if (soundClick) soundClick->Play();
}
else if (trigger[i]->type == TRIGGER_BUTTON_ONLY_IN_FOCUS && parentElement->IsFocused())
{
this->SetState(STATE_CLICKED, t->chan);
if (soundClick) soundClick->Play();
}
}
}
}

View File

@ -42,7 +42,6 @@ GuiElement::GuiElement()
clickable = false;
holdable = false;
visible = true;
focus = -1; // cannot be focused
updateCB = NULL;
yoffsetDyn = 0;
xoffsetDyn = 0;
@ -327,12 +326,6 @@ bool GuiElement::IsHoldable()
else return holdable;
}
void GuiElement::SetFocus(int f)
{
LOCK( this );
focus = f;
}
void GuiElement::SetTrigger(GuiTrigger * t)
{
LOCK( this );

View File

@ -24,7 +24,6 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
selectedItem = 0;
selectable = true;
triggerdisabled = false; // trigger disable
focus = 0; // allow focus
trigA = new GuiTrigger;
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
@ -92,18 +91,6 @@ GuiFileBrowser::~GuiFileBrowser()
}
}
void GuiFileBrowser::SetFocus(int f)
{
LOCK( this );
focus = f;
for (int i = 0; i < FILEBROWSERSIZE; i++)
fileList[i]->ResetState();
if (f == 1)
fileList[selectedItem]->SetState(STATE_SELECTED);
}
void GuiFileBrowser::DisableTriggerUpdate(bool set)
{
LOCK( this );

View File

@ -12,7 +12,6 @@ class GuiFileBrowser: public GuiElement, public sigslot::has_slots<>
virtual ~GuiFileBrowser();
void DisableTriggerUpdate(bool set);
void ResetState();
void SetFocus(int f);
void Draw();
void UpdateList();
void Update(GuiTrigger * t);

View File

@ -56,7 +56,6 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, int offset
listOffset = (gameList.size() < 11) ? LIMIT(offset, 0, MAX(0, gameList.size()-1)) : LIMIT(offset, 0, MAX(0, gameList.size()-1))-2;
selectable = true;
selectedItem = -1;
focus = 1; // allow focus
clickedItem = -1;
speed = 0;
@ -208,8 +207,6 @@ void GuiGameCarousel::SetFocus(int f)
LOCK( this );
if (!gameList.size()) return;
focus = f;
for (int i = 0; i < pagesize; i++)
game[i]->ResetState();
@ -283,8 +280,9 @@ void GuiGameCarousel::Draw()
}
//!Draw tooltip after the Images to have it on top
if (focus && Settings.tooltips == ON) for (int i = 0; i < pagesize; i++)
game[i]->DrawTooltip();
if (Settings.tooltips == ON)
for (int i = 0; i < pagesize; i++)
game[i]->DrawTooltip();
this->UpdateEffects();
}
@ -332,7 +330,7 @@ void GuiGameCarousel::Update(GuiTrigger * t)
if (selectedItem_old >= 0) game[selectedItem_old]->SetEffect(EFFECT_SCALE, -1, 100);
}
// navigation
if (focus && gameList.size() > 6)
if (gameList.size() > 6)
{
int newspeed = 0;

View File

@ -210,7 +210,6 @@ GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, int offset) :
theme_posY = thInt("20 - game grid layout pos y");
selectable = true;
focus = 1; // allow focus
trigA = new GuiTrigger;
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
@ -304,8 +303,6 @@ void GuiGameGrid::SetFocus(int f)
{
LOCK( this );
focus = f;
for (u32 i = 0; i < game.size(); i++)
game[i]->ResetState();
@ -422,7 +419,7 @@ void GuiGameGrid::Draw()
btnRowUp->Draw();
btnRowDown->Draw();
if (focus && Settings.tooltips == ON)
if (Settings.tooltips == ON)
for (int i = 0; i < pagesize; i++)
game[i]->DrawTooltip();
@ -469,7 +466,7 @@ void GuiGameGrid::Update(GuiTrigger * t)
}
// navigation
if (focus && gameList.size() >= (pagesize - 2 * rows) && goLeft == 0 && goRight == 0)
if (gameList.size() >= (pagesize - 2 * rows) && goLeft == 0 && goRight == 0)
{
// Left/Right Navigation

View File

@ -37,7 +37,6 @@ GuiGameList::GuiGameList(int w, int h, int offset)
selectable = true;
listOffset = LIMIT(offset, 0, MAX(0, gameList.size()-pagesize));
selectedItem = 0;
focus = 1; // allow focus
trigA = new GuiTrigger;
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
@ -134,8 +133,6 @@ void GuiGameList::SetFocus(int f)
LOCK( this );
if (!gameList.size()) return;
focus = f;
for (int i = 0; i < pagesize; ++i)
game[i]->ResetState();

View File

@ -31,7 +31,6 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int minimum, int lang)
int mode = lang;
textVisible = true;
selectable = true;
focus = 0; // allow focus
alignmentHor = ALIGN_CENTRE;
alignmentVert = ALIGN_MIDDLE;
kbtextmaxlen = max > sizeof(kbtextstr) ? sizeof(kbtextstr) : max; // limit max up to sizeof(kbtextstr)
@ -601,18 +600,4 @@ void GuiKeyboard::Update(GuiTrigger * t)
}
}
} while (update);
this->ToggleFocus(t);
if (focus) // only send actions to this window if it's in focus
{
// pad/joystick navigation
if (t->Right())
this->MoveSelectionHor(1);
else if (t->Left())
this->MoveSelectionHor(-1);
else if (t->Down())
this->MoveSelectionVert(1);
else if (t->Up()) this->MoveSelectionVert(-1);
}
}

View File

@ -22,7 +22,6 @@ GuiNumpad::GuiNumpad(char * t, u32 max)
width = 400;
height = 370;
selectable = true;
focus = 0; // allow focus
alignmentHor = ALIGN_CENTRE;
alignmentVert = ALIGN_MIDDLE;
kbtextmaxlen = max > sizeof(kbtextstr) ? sizeof(kbtextstr) : max; // limit max up to sizeof(kbtextstr)
@ -178,18 +177,4 @@ void GuiNumpad::Update(GuiTrigger * t)
}
kbText->SetPosition(0, 53);
this->ToggleFocus(t);
if (focus) // only send actions to this window if it's in focus
{
// pad/joystick navigation
if (t->Right())
this->MoveSelectionHor(1);
else if (t->Left())
this->MoveSelectionHor(-1);
else if (t->Down())
this->MoveSelectionVert(1);
else if (t->Up()) this->MoveSelectionVert(-1);
}
}

View File

@ -32,7 +32,6 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l, const char * cu
selectable = true;
selectedItem = 0;
oldSelectedItem = -1;
focus = 1; // allow focus
coL2 = 50;
listOffset = 0;

View File

@ -67,19 +67,6 @@ void GuiTrigger::SetButtonOnlyTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
pad.btns_d = gcbtns;
}
/**
* Sets a button trigger. Requires:
* - Trigger button is pressed
* - Parent window is in focus
*/
void GuiTrigger::SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
{
type = TRIGGER_BUTTON_ONLY_IN_FOCUS;
chan = ch;
wpad.btns_d = wiibtns;
pad.btns_d = gcbtns;
}
/****************************************************************************
* WPAD_Stick
*
@ -88,8 +75,6 @@ void GuiTrigger::SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
s8 GuiTrigger::WPAD_Stick(u8 right, int axis)
{
#ifdef HW_RVL
float mag = 0.0;
float ang = 0.0;
@ -97,45 +82,46 @@ s8 GuiTrigger::WPAD_Stick(u8 right, int axis)
{
case WPAD_EXP_NUNCHUK:
case WPAD_EXP_GUITARHERO3:
if ( right == 0 )
{
mag = wpad.exp.nunchuk.js.mag;
ang = wpad.exp.nunchuk.js.ang;
if ( right == 0 )
{
mag = wpad.exp.nunchuk.js.mag;
ang = wpad.exp.nunchuk.js.ang;
}
break;
}
break;
case WPAD_EXP_CLASSIC:
if ( right == 0 )
{
mag = wpad.exp.classic.ljs.mag;
ang = wpad.exp.classic.ljs.ang;
if ( right == 0 )
{
mag = wpad.exp.classic.ljs.mag;
ang = wpad.exp.classic.ljs.ang;
}
else
{
mag = wpad.exp.classic.rjs.mag;
ang = wpad.exp.classic.rjs.ang;
}
break;
}
else
{
mag = wpad.exp.classic.rjs.mag;
ang = wpad.exp.classic.rjs.ang;
}
break;
default:
break;
break;
}
/* calculate x/y value (angle need to be converted into radian) */
if ( mag > 1.0 ) mag = 1.0;
else if ( mag < -1.0 ) mag = -1.0;
double val;
if ( mag > 1.0 )
mag = 1.0;
else if ( mag < -1.0 )
mag = -1.0;
float val;
if ( axis == 0 ) // x-axis
val = mag * sin( ( PI * ang ) / 180.0f );
val = (float) (mag * sin( (PI * ang) / 180.0f ));
else // y-axis
val = mag * cos( ( PI * ang ) / 180.0f );
val = (float) (mag * cos( (PI * ang) / 180.0f ));
return ( s8 )( val * 128.0f );
#else
return 0;
#endif
}
bool GuiTrigger::Left()
@ -144,23 +130,20 @@ bool GuiTrigger::Left()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_LEFT;
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h)
& PAD_BUTTON_LEFT) || pad.stickX < -PADCAL || WPAD_Stick(0, 0) < -PADCAL)
if ( ((wpad.btns_d | wpad.btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_LEFT)
|| (wpad.exp.type == WPAD_EXP_NUNCHUK && WPAD_Stick(0, 0) < -PADCAL))
{
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_LEFT))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
}
else if (scrollDelay == 0)
else if (--scrollDelay <= 0)
{
scrollDelay = SCROLL_LOOP_DELAY;
return true;
}
else
{
if (scrollDelay > 0) scrollDelay--;
}
}
return false;
}
@ -171,23 +154,20 @@ bool GuiTrigger::Right()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_RIGHT;
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h)
& PAD_BUTTON_RIGHT) || pad.stickX > PADCAL || WPAD_Stick(0, 0) > PADCAL)
if ( ((wpad.btns_d | wpad.btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_RIGHT)
|| (wpad.exp.type == WPAD_EXP_NUNCHUK && WPAD_Stick(0, 0) > PADCAL))
{
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_RIGHT))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
}
else if (scrollDelay == 0)
else if (--scrollDelay <= 0)
{
scrollDelay = SCROLL_LOOP_DELAY;
return true;
}
else
{
if (scrollDelay > 0) scrollDelay--;
}
}
return false;
}
@ -198,23 +178,20 @@ bool GuiTrigger::Up()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_UP;
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP)
|| pad.stickY > PADCAL || WPAD_Stick(0, 1) > PADCAL)
if ( ((wpad.btns_d | wpad.btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP)
|| (wpad.exp.type == WPAD_EXP_NUNCHUK && WPAD_Stick(0, 1) > PADCAL))
{
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_UP))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
}
else if (scrollDelay == 0)
else if (--scrollDelay <= 0)
{
scrollDelay = SCROLL_LOOP_DELAY;
return true;
}
else
{
if (scrollDelay > 0) scrollDelay--;
}
}
return false;
}
@ -225,23 +202,20 @@ bool GuiTrigger::Down()
if(wpad.exp.type == WPAD_EXP_CLASSIC)
wiibtn = WPAD_CLASSIC_BUTTON_DOWN;
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h)
& PAD_BUTTON_DOWN) || pad.stickY < -PADCAL || WPAD_Stick(0, 1) < -PADCAL)
if ( ((wpad.btns_d | wpad.btns_h) & wiibtn)
|| ((pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN)
|| (wpad.exp.type == WPAD_EXP_NUNCHUK && WPAD_Stick(0, 1) < -PADCAL))
{
if ((wpad.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_DOWN))
{
scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay.
return true;
}
else if (scrollDelay == 0)
else if (--scrollDelay <= 0)
{
scrollDelay = SCROLL_LOOP_DELAY;
return true;
}
else
{
if (scrollDelay > 0) scrollDelay--;
}
}
return false;
}

View File

@ -16,7 +16,6 @@ GuiWindow::GuiWindow()
height = 0;
forceDim = false;
allowDim = true;
focus = 0; // allow focus
}
GuiWindow::GuiWindow(int w, int h)
@ -25,7 +24,6 @@ GuiWindow::GuiWindow(int w, int h)
height = h;
forceDim = false;
allowDim = true;
focus = 0; // allow focus
}
GuiWindow::~GuiWindow()
@ -172,113 +170,6 @@ void GuiWindow::SetVisible(bool v)
}
}
void GuiWindow::SetFocus(int f)
{
LOCK( this );
focus = f;
if (f == 1)
this->MoveSelectionVert(1);
else this->ResetState();
}
void GuiWindow::ChangeFocus(GuiElement* e)
{
LOCK( this );
if (parentElement) return; // this is only intended for the main window
for (u8 i = 0; i < _elements.size(); i++)
{
if (e == _elements.at(i))
_elements.at(i)->SetFocus(1);
else if (_elements.at(i)->IsFocused() == 1) _elements.at(i)->SetFocus(0);
}
}
void GuiWindow::ToggleFocus(GuiTrigger * t)
{
LOCK( this );
if (parentElement) return; // this is only intended for the main window
int found = -1;
int newfocus = -1;
u8 i;
// look for currently in focus element
for (i = 0; i < _elements.size(); i++)
{
try
{
if (_elements.at(i)->IsFocused() == 1)
{
found = i;
break;
}
}
catch (const std::exception& e)
{
}
}
// element with focus not found, try to give focus
if (found == -1)
{
for (i = 0; i < _elements.size(); i++)
{
try
{
if (_elements.at(i)->IsFocused() == 0 && _elements.at(i)->GetState() != STATE_DISABLED) // focus is possible (but not set)
{
_elements.at(i)->SetFocus(1); // give this element focus
break;
}
}
catch (const std::exception& e)
{
}
}
}
// change focus
else if ((t->wpad.btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_PLUS)) || (t->pad.btns_d & PAD_BUTTON_B))
{
for (i = found; i < _elements.size(); i++)
{
try
{
if (_elements.at(i)->IsFocused() == 0 && _elements.at(i)->GetState() != STATE_DISABLED) // focus is possible (but not set)
{
newfocus = i;
_elements.at(i)->SetFocus(1); // give this element focus
_elements.at(found)->SetFocus(0); // disable focus on other element
break;
}
}
catch (const std::exception& e)
{
}
}
if (newfocus == -1)
{
for (i = 0; i < found; i++)
{
try
{
if (_elements.at(i)->IsFocused() == 0 && _elements.at(i)->GetState() != STATE_DISABLED) // focus is possible (but not set)
{
_elements.at(i)->SetFocus(1); // give this element focus
_elements.at(found)->SetFocus(0); // disable focus on other element
break;
}
}
catch (const std::exception& e)
{
}
}
}
}
}
int GuiWindow::GetSelected()
{
// find selected element
@ -434,19 +325,5 @@ void GuiWindow::Update(GuiTrigger * t)
}
}
this->ToggleFocus(t);
if (focus) // only send actions to this window if it's in focus
{
// pad/joystick navigation
if (t->Right())
this->MoveSelectionHor(1);
else if (t->Left())
this->MoveSelectionHor(-1);
else if (t->Down())
this->MoveSelectionVert(1);
else if (t->Up()) this->MoveSelectionVert(-1);
}
if (updateCB) updateCB(this);
}

View File

@ -99,7 +99,6 @@ int CheatMenu(const char * gameID)
w.Append(&createBtn);
w.Append(&chtBrowser);
mainWindow->SetState(STATE_DISABLED);
mainWindow->ChangeFocus(&w);
mainWindow->Append(&w);
ResumeGui();
@ -169,7 +168,7 @@ int CheatMenu(const char * gameID)
{
w.Remove(&chtBrowser);
cheatslst.ClearList();
cntcheats = c.getCnt();
for (int i = 0; i < cntcheats; i++)
{
cheatslst.SetValue(i, "%s", c.getCheatName(i).c_str());

View File

@ -59,39 +59,55 @@ void UpdatePads()
}
}
/****************************************************************************
* ScreensaverTime
***************************************************************************/
static inline u32 ScreensaverTime(int setting)
{
switch (setting)
{
case 0:
return 0xFFFFFF;
case 1:
return 180;
case 2:
return 300;
case 3:
return 600;
case 4:
return 1200;
case 5:
return 1800;
case 6:
return 3600;
default:
break;
}
return 0xFFFFFF;
}
/****************************************************************************
* SetWPADTimeout
***************************************************************************/
void SetWPADTimeout()
{
switch (Settings.screensaver)
{
case 0:
WPAD_SetIdleTimeout(0xFFFFFF);
break;
case 1:
WPAD_SetIdleTimeout(180);
break;
case 2:
WPAD_SetIdleTimeout(300);
break;
case 3:
WPAD_SetIdleTimeout(600);
break;
case 4:
WPAD_SetIdleTimeout(1200);
break;
case 5:
WPAD_SetIdleTimeout(1800);
break;
case 6:
WPAD_SetIdleTimeout(3600);
break;
default:
break;
}
WPAD_SetIdleTimeout(ScreensaverTime(Settings.screensaver));
}
/****************************************************************************
* ControlActivityTimeOut
***************************************************************************/
bool ControlActivityTimeout(void)
{
u32 minTime = 0xFFFFFF;
for(int i = 0; i < 3; ++i)
if(pointer[i]->getLastActivCounter() < minTime)
minTime = pointer[i]->getLastActivCounter();
// not very accurate but it's not required here
return (minTime/60 > ScreensaverTime(Settings.screensaver));
}
/****************************************************************************
* SetupPads
*

View File

@ -22,5 +22,6 @@ void UpdatePads();
void ShutoffRumble();
void DoRumble(int i);
void SetWPADTimeout();
bool ControlActivityTimeout(void);
#endif

View File

@ -386,10 +386,12 @@ static void free_block(wbfs_t *p, int bl)
p->freeblks[i] = wbfs_htonl( v | 1 << j );
}
int install_abort_signal = 0;
s32 wbfs_add_disc(wbfs_t*p, read_wiidisc_callback_t read_src_wii_disc, void *callback_data,
progress_callback_t spinner, partition_selector_t sel, int copy_1_1)
{
int i, discn;
int i, discn, ret;
u32 tot, cur;
u32 wii_sec_per_wbfs_sect = 1 << (p->wbfs_sec_sz_s - p->wii_sec_sz_s);
wiidisc_t *d = 0;
@ -457,6 +459,8 @@ s32 wbfs_add_disc(wbfs_t*p, read_wiidisc_callback_t read_src_wii_disc, void *cal
}
tot = num_wbfs_sect_to_copy * wii_sec_per_wbfs_sect;
}
install_abort_signal = 0;
/*
// num of hd sectors to copy could be specified directly
if (copy_1_1 > 1) {
@ -464,7 +468,6 @@ s32 wbfs_add_disc(wbfs_t*p, read_wiidisc_callback_t read_src_wii_disc, void *cal
num_wbfs_sect_to_copy = copy_1_1 / hd_sec_per_wii_sec / wii_sec_per_wbfs_sect;
tot = num_wbfs_sect_to_copy * wii_sec_per_wbfs_sect;
}*/
int ret = 0;
if (spinner) spinner(0, tot);
for (i = 0; i < num_wbfs_sect_to_copy; i++)
{
@ -505,9 +508,23 @@ s32 wbfs_add_disc(wbfs_t*p, read_wiidisc_callback_t read_src_wii_disc, void *cal
if (spinner) spinner(cur, tot);
}
}
if (ret) break;
if (install_abort_signal)
break;
info->wlba_table[i] = wbfs_htons( bl );
}
if(install_abort_signal)
{
int n;
for(n = 0; n < i; n++)
{
u32 iwlba = wbfs_ntohs(info->wlba_table[n]);
if (iwlba)
free_block(p,iwlba);
}
wbfs_memset(info,0,p->disc_info_sz);
p->head->disc_table[discn] = 0;
}
// write disc info
int disc_info_sz_lba = p->disc_info_sz >> p->hd_sec_sz_s;
p->write_hdsector(p->callback_data, p->part_lba + 1 + discn * disc_info_sz_lba, disc_info_sz_lba, info);

View File

@ -40,7 +40,7 @@
/*** Variables that are also used extern ***/
GuiWindow * mainWindow = NULL;
GuiImageData * pointer[4] = { NULL, NULL, NULL, NULL };
WiiPointer * pointer[4] = { NULL, NULL, NULL, NULL };
GuiImage * bgImg = NULL;
GuiImageData * background = NULL;
GuiBGM * bgMusic = NULL;
@ -103,28 +103,22 @@ static void * UpdateGUI(void *arg)
continue;
}
mainWindow->Draw();
if (Settings.tooltips && Theme::ShowTooltips && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip();
for (i = 3; i >= 0; i--)
{
if (userInput[i].wpad.ir.valid)
{
Menu_DrawImg(userInput[i].wpad.ir.x - pointer[i]->GetWidth()/2,
userInput[i].wpad.ir.y - pointer[i]->GetHeight()/2,
9900.0f, pointer[i]->GetWidth(), pointer[i]->GetHeight(),
pointer[i]->GetImage(), userInput[i].wpad.ir.angle,
Settings.widescreen ? Settings.WSFactor : 1.f, 1.f, 255, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
Menu_Render();
UpdatePads();
mainWindow->Draw();
if (Settings.tooltips && Theme::ShowTooltips && mainWindow->GetState() != STATE_DISABLED)
mainWindow->DrawTooltip();
// Pointer modifies wpad data struct for easy implementation of "virtual pointer" with PAD-Sticks
// That is why it has to be called right before updating other gui elements with the triggers
for (i = 3; i >= 0; i--)
pointer[i]->Draw(&userInput[i]);
for (i = 0; i < 4; i++)
mainWindow->Update(&userInput[i]);
Menu_Render();
if (bgMusic) bgMusic->UpdateState();
}
@ -185,10 +179,10 @@ int MainMenu(int menu)
btnSoundClick2 = new GuiSound(Resources::GetFile("button_click2.wav"), Resources::GetFileSize("button_click2.wav"), Settings.sfxvolume);
btnSoundOver = new GuiSound(Resources::GetFile("button_over.wav"), Resources::GetFileSize("button_over.wav"), Settings.sfxvolume);
pointer[0] = Resources::GetImageData("player1_point.png");
pointer[1] = Resources::GetImageData("player2_point.png");
pointer[2] = Resources::GetImageData("player3_point.png");
pointer[3] = Resources::GetImageData("player4_point.png");
pointer[0] = new WiiPointer("player1_point.png");
pointer[1] = new WiiPointer("player2_point.png");
pointer[2] = new WiiPointer("player3_point.png");
pointer[3] = new WiiPointer("player4_point.png");
mainWindow = new GuiWindow(screenwidth, screenheight);
@ -212,9 +206,6 @@ int MainMenu(int menu)
switch (currentMenu)
{
case MENU_INSTALL:
currentMenu = MenuInstall();
break;
case MENU_SETTINGS:
currentMenu = GlobalSettings::Execute();
break;

View File

@ -11,6 +11,7 @@
#include <ogcsys.h>
#include "GUI/gui.h"
#include "Controls/WiiPointer.h"
#include "settings/CSettings.h"
#include "main.h"
@ -25,7 +26,6 @@ enum
MENU_NONE,
MENU_SETTINGS,
MENU_DISCLIST,
MENU_INSTALL,
MENU_GAME_SETTINGS,
MENU_HOMEBREWBROWSE,
BOOTHOMEBREW,
@ -36,7 +36,7 @@ enum
void ResumeGui();
void HaltGui();
extern GuiImageData *pointer[4];
extern WiiPointer *pointer[4];
extern GuiImageData *background;
extern GuiImage *bgImg;
extern GuiWindow *mainWindow;

View File

@ -42,7 +42,6 @@ extern u8 mountMethod;
extern bool updateavailable;
extern struct discHdr *dvdheader;
static bool WiiMoteInitiated = false;
static bool Exiting = false;
GameBrowseMenu::GameBrowseMenu()
@ -287,7 +286,7 @@ GameBrowseMenu::GameBrowseMenu()
dvdBtnImg->SetWidescreen(Settings.widescreen);
dvdBtnImg_g = new GuiImage(imgdvd_gray);
dvdBtnImg_g->SetWidescreen(Settings.widescreen);
dvdBtn = new GuiButton(dvdBtnImg_g, dvdBtnImg_g, ALIGN_LEFT, ALIGN_TOP, 0, 0,
dvdBtn = new GuiButton(dvdBtnImg_g, 0, ALIGN_LEFT, ALIGN_TOP, 0, 0,
trigA, btnSoundOver, btnSoundClick2, 1, dvdBtnTT, 15, 52, 1, 3);
dvdBtn->SetSelectable(false);
@ -845,6 +844,7 @@ int GameBrowseMenu::MainLoop()
int choice = WindowPrompt(tr( "Install a game" ), 0, tr( "Yes" ), tr( "No" ));
if (choice == 1)
{
this->SetState(STATE_DISABLED);
if(!(Settings.LoaderMode & MODE_WIIGAMES) && (gameList.GameCount() == 0))
{
if(WBFS_ReInit(WBFS_DEVICE_USB) < 0)
@ -858,11 +858,13 @@ int GameBrowseMenu::MainLoop()
ThreadedTask::Instance()->AddCallback(&HDDSizeCallback);
ThreadedTask::Instance()->Execute();
}
return MENU_INSTALL;
return MenuInstall();
}
}
else
return MENU_INSTALL;
return MenuInstall();
this->SetState(STATE_DEFAULT);
}
installBtn->ResetState();
}
@ -1205,14 +1207,6 @@ int GameBrowseMenu::MainLoop()
OpenClickedGame();
}
if (!IsWpadConnected())
{
if(Settings.screensaver != 0 && WiiMoteInitiated)
WindowScreensaver();
}
else if(!WiiMoteInitiated)
WiiMoteInitiated = true;
return returnMenu;
}
@ -1238,7 +1232,7 @@ void GameBrowseMenu::CheckDiscSlotUpdate()
return;
}
returnMenu = MENU_INSTALL;
returnMenu = MenuInstall();
}
else if (choice == 2)
dvdBtn->SetState(STATE_CLICKED);
@ -1300,6 +1294,11 @@ void GameBrowseMenu::UpdateClock()
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
}
clockTime->SetText(theTime);
if (Settings.screensaver != 0 && ControlActivityTimeout())
{
WindowScreensaver();
}
}
void GameBrowseMenu::UpdateGameInfoText(const u8 * gameId)

View File

@ -7,7 +7,8 @@
#include "prompts/ProgressWindow.h"
#include "themes/CTheme.h"
u64 gamesize = 0;
extern int install_abort_signal;
float gamesize = 0.0f;
/****************************************************************************
* MenuInstall
@ -43,7 +44,7 @@ int MenuInstall()
choice = WindowPrompt(tr( "Not a Wii Disc" ), tr( "Insert a Wii Disc!" ), tr( "OK" ), tr( "Back" ));
if (choice == 1)
return MENU_INSTALL;
return MenuInstall();
else
return MENU_DISCLIST;
}
@ -61,7 +62,7 @@ int MenuInstall()
f32 freespace, used;
WBFS_DiskSpace(&used, &freespace);
gamesize = WBFS_EstimeGameSize();
gamesize = (float) WBFS_EstimeGameSize();
char gametxt[50];
@ -83,10 +84,16 @@ int MenuInstall()
else
{
StartProgress(gametxt, name, 0, true, true);
ProgressCancelEnable(true);
ret = WBFS_AddGame();
ProgressCancelEnable(false);
ProgressStop();
wiilight(0);
if (ret != 0)
if (install_abort_signal)
{
WindowPrompt(tr( "Install Canceled" ), 0, tr( "OK" ));
}
else if (ret != 0)
{
WindowPrompt(tr( "Install Error!" ), 0, tr( "Back" ));
}
@ -111,7 +118,7 @@ int MenuInstall()
//Turn off the WiiLight
wiilight(0);
gamesize = 0;
gamesize = 0.0f;
return MENU_DISCLIST;
}

View File

@ -554,6 +554,9 @@ bool PatchReturnTo( void *Address, int Size, u32 id )
returnToPatched = 1;
}
if(returnToPatched)
gprintf("Return to %08X patched with old method.\n", (u32) title);
return returnToPatched;
}
@ -575,6 +578,9 @@ int PatchNewReturnTo(int es_fd, u64 title)
if(es_fd >= 0)
result = IOS_Ioctlv(es_fd, 0xA1, 1, 0, vector);
if(result >= 0)
gprintf("Return to %08X patched with d2x method.\n", (u32) title);
return result;
}
@ -604,6 +610,9 @@ int BlockIOSReload(int es_fd, u8 gameIOS)
if(es_fd >= 0)
result = IOS_Ioctlv(es_fd, 0xA0, inlen, 0, vector);
if(result >= 0)
gprintf("Block IOS Reload patched with d2x method.\n");
return (result >= 0);
}

View File

@ -220,7 +220,6 @@ int CheckboxPrompt::Show(const char *title, const char *msg,
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(Window);
mainWindow->ChangeFocus(Window);
int choice = -2;

View File

@ -21,6 +21,9 @@
#include "themes/CTheme.h"
#include "utils/timer.h"
extern float gamesize;
extern int install_abort_signal;
/*** Variables used only in this file ***/
static lwp_t progressthread = LWP_THREAD_NULL;
static mutex_t ProgressMutex = LWP_MUTEX_NULL;
@ -209,8 +212,6 @@ static void UpdateProgressValues(GuiImage *progressbarImg, GuiText *prTxt, GuiTe
if(!changed)
return;
extern u64 gamesize;
LWP_MutexLock(ProgressMutex);
changed = false;
changedMessages = false;
@ -218,10 +219,13 @@ static void UpdateProgressValues(GuiImage *progressbarImg, GuiText *prTxt, GuiTe
s64 total = progressTotal;
u32 speed = 0;
if(gamesize > 0)
if(gamesize > 0.0f)
{
done = (s64) ((double) done / (double) total * (double) gamesize);
done = (s64) ((float) done / (float) total * gamesize);
total = (s64) gamesize;
if(progressCanceled)
install_abort_signal = 1;
}
//Calculate speed in KB/s
@ -286,6 +290,13 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
usleep(500000); // wait to see if progress flag changes soon
if (!showProgress) return;
int PosY;
//if(msg2 != 0)
// PosY = 40;
//else
PosY = 20;
GuiWindow promptWindow(472, 320);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
@ -310,29 +321,26 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
progressbarOutlineImg.SetWidescreen(Settings.widescreen);
}
progressbarOutlineImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
progressbarOutlineImg.SetPosition(35, 40);
progressbarOutlineImg.SetPosition(35, PosY);
GuiImageData progressbarEmpty(Resources::GetFile("progressbar_empty.png"), Resources::GetFileSize("button_dialogue_box.png"));
GuiImage progressbarEmptyImg(&progressbarEmpty);
progressbarEmptyImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
progressbarEmptyImg.SetPosition(35, 40);
progressbarEmptyImg.SetPosition(35, PosY);
progressbarEmptyImg.SetTileHorizontal(100);
GuiImageData progressbar(Resources::GetFile("progressbar.png"), Resources::GetFileSize("progressbar.png"));
GuiImage progressbarImg(&progressbar);
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
progressbarImg.SetPosition(35, 40);
progressbarImg.SetPosition(35, PosY);
GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0, 60);
titleTxt.SetPosition(0, 50);
GuiText msg1Txt(msg1, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
msg1Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
if (msg2)
msg1Txt.SetPosition(0, 100);
else
msg1Txt.SetPosition(0, 120);
msg1Txt.SetPosition(0, 90);
msg1Txt.SetMaxWidth(430, DOTTED);
GuiText msg2Txt(msg2, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
@ -342,31 +350,31 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
GuiText prsTxt("%", 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
prsTxt.SetPosition(-178, 40);
prsTxt.SetPosition(-178, PosY);
GuiText timeTxt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
GuiText timeTxt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
timeTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
timeTxt.SetPosition(280, -50);
GuiText sizeTxt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
GuiText sizeTxt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
sizeTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
sizeTxt.SetPosition(50, -50);
GuiText speedTxt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
GuiText speedTxt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
speedTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
speedTxt.SetPosition(50, -74);
GuiText prTxt((char*) NULL, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
prTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
prTxt.SetPosition(210, 40);
prTxt.SetPosition(210, PosY);
if ((Settings.wsprompt) && (Settings.widescreen)) /////////////adjust for widescreen
{
progressbarOutlineImg.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
progressbarOutlineImg.SetPosition(0, 40);
progressbarEmptyImg.SetPosition(80, 40);
progressbarOutlineImg.SetPosition(0, PosY);
progressbarEmptyImg.SetPosition(80, PosY);
progressbarEmptyImg.SetTileHorizontal(78);
progressbarImg.SetPosition(80, 40);
progressbarImg.SetPosition(80, PosY);
msg1Txt.SetMaxWidth(380, DOTTED);
msg2Txt.SetMaxWidth(380, DOTTED);
@ -380,15 +388,20 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
GuiText cancelTxt(tr( "Cancel" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows button text color"));
GuiImage cancelImg(&btnOutline);
const float cancelScale = 0.8f;
cancelImg.SetScale(cancelScale);
cancelTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
cancelTxt.SetPosition(cancelImg.GetWidth()/2*cancelScale-cancelTxt.GetTextWidth()/2, 0);
if (Settings.wsprompt)
{
cancelTxt.SetWidescreen(Settings.widescreen);
cancelImg.SetWidescreen(Settings.widescreen);
}
GuiButton cancelBtn(&cancelImg, &cancelImg, 2, 4, 0, -45, &trigA, btnSoundOver, btnSoundClick2, 1);
GuiButton cancelBtn(&cancelImg, &cancelImg, ALIGN_LEFT, ALIGN_MIDDLE, 0, 0, &trigA, btnSoundOver, btnSoundClick2, 1);
cancelBtn.SetLabel(&cancelTxt);
cancelBtn.SetState(STATE_SELECTED);
cancelBtn.SetPosition(dialogBoxImg.GetWidth()/2-cancelImg.GetWidth()/2*cancelScale, PosY + 45);
promptWindow.Append(&dialogBoxImg);
promptWindow.Append(&progressbarEmptyImg);
@ -406,17 +419,12 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
promptWindow.Append(&speedTxt);
}
if(CancelEnabled)
{
promptWindow.Append(&cancelBtn);
if(showSize)
cancelBtn.SetPosition(90, -45);
}
HaltGui();
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while (promptWindow.GetEffect() > 0) usleep(100);
@ -432,10 +440,23 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
if (changed)
{
if (changedMessages) titleTxt.SetText(progressTitle);
if (changedMessages) msg1Txt.SetText(progressMsg1);
if (changedMessages) msg2Txt.SetText(progressMsg2);
if (changedMessages)
{
titleTxt.SetText(progressTitle);
msg1Txt.SetText(progressMsg1);
msg2Txt.SetText(progressMsg2);
if(progressMsg1[0] != '\0' && progressMsg2[0] == '\0') {
msg1Txt.SetPosition(0, 120);
}
else if(progressMsg2[0] != '\0' && progressMsg1[0] == '\0') {
msg2Txt.SetPosition(0, 120);
}
else {
msg1Txt.SetPosition(0, 90);
msg2Txt.SetPosition(0, 125);
}
}
UpdateProgressValues(&progressbarImg, &prTxt, &timeTxt, &speedTxt, &sizeTxt);
}

View File

@ -86,7 +86,6 @@ int OnScreenNumpad(char * var, u32 maxlen)
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&numpad);
mainWindow->ChangeFocus(&numpad);
ResumeGui();
while (save == -1)
@ -160,7 +159,6 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min, bool hide)
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&keyboard);
mainWindow->ChangeFocus(&keyboard);
ResumeGui();
while (save == -1)
@ -449,16 +447,6 @@ void WindowCredits()
***************************************************************************/
int WindowScreensaver()
{
//! 2 Seconds delay in case the wiimote shutdown was pressed
time_t start = time(0);
while(time(0)-start < 2)
{
usleep(100);
if(shutdown)
return 0;
}
gprintf("WindowScreenSaver()\n");
bool exit = false;
@ -491,11 +479,9 @@ int WindowScreensaver()
if (reset)
Sys_Reboot();
if (IsWpadConnected())
{
exit = true;
if(!ControlActivityTimeout())
break;
}
/* Set random position */
GXlogoImg.SetPosition((rand() % 345), (rand() % 305));
@ -540,7 +526,6 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(Window);
mainWindow->ChangeFocus(Window);
ResumeGui();
while (choice == -1)
@ -761,7 +746,6 @@ int WindowExitPrompt()
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while (choice == -1)
@ -843,7 +827,6 @@ int WindowExitPrompt()
HaltGui();
mainWindow->SetState(STATE_DISABLED);
promptWindow.SetState(STATE_DEFAULT);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
btn2.ResetState();
}
@ -864,7 +847,6 @@ int WindowExitPrompt()
HaltGui();
mainWindow->SetState(STATE_DISABLED);
promptWindow.SetState(STATE_DEFAULT);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
btn3.ResetState();
}
@ -1016,7 +998,6 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
if (IsDeviceWait)
@ -1103,7 +1084,6 @@ int FormatingPartition(const char *title, int part_num)
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
VIDEO_WaitVSync();
@ -1201,7 +1181,6 @@ bool NetworkInitPrompt()
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while (!IsNetworkInit())

View File

@ -837,7 +837,6 @@ static int InternalShowGameInfo(char *ID)
//mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&gameinfoWindow);
if(boxCov) mainWindow->Append(boxCov);
mainWindow->ChangeFocus(&gameinfoWindow);
ResumeGui();
while (choice == -1)

View File

@ -139,6 +139,7 @@ void CSettings::SetDefault()
LoaderMode = MODE_WIIGAMES;
SearchMode = SEARCH_BEGINNING;
GameAspectRatio = ASPECT_SYSTEM_DEFAULT;
PointerSpeed = 0.15f;
}
bool CSettings::Load()
@ -314,6 +315,7 @@ bool CSettings::Save()
fprintf(file, "LoaderMode = %d\n", LoaderMode);
fprintf(file, "SearchMode = %d\n", SearchMode);
fprintf(file, "GameAspectRatio = %d\n", GameAspectRatio);
fprintf(file, "PointerSpeed = %g\n", PointerSpeed);
fclose(file);
return true;
@ -650,6 +652,11 @@ bool CSettings::SetSetting(char *name, char *value)
FontScaleFactor = atof(value);
return true;
}
else if (strcmp(name, "PointerSpeed") == 0)
{
PointerSpeed = atof(value);
return true;
}
else if (strcmp(name, "ParentalBlocks") == 0)
{
ParentalBlocks = strtoul(value, 0, 16);

View File

@ -122,6 +122,7 @@ class CSettings
u32 ParentalBlocks;
f32 WSFactor;
f32 FontScaleFactor;
f32 PointerSpeed;
short Wiinnertag;
short SelectedGame;
short GameListOffset;

View File

@ -280,10 +280,6 @@ int MenuLanguageSelect()
snprintf(Settings.languagefiles_path, sizeof(Settings.languagefiles_path), entered);
WindowPrompt(tr("Languagepath changed."), 0, tr("OK"));
}
if ( Dir.GetFilecount() > 0 )
{
optionBrowser4.SetFocus( 1 );
}
pathBtn.ResetState();
}
@ -312,7 +308,6 @@ int MenuLanguageSelect()
returnhere = 2;
break;
}
optionBrowser4.SetFocus( 1 );
}
}

View File

@ -123,6 +123,7 @@ GuiSettingsMenu::GuiSettingsMenu()
Options->SetName(Idx++, "%s", tr( "HOME Menu" ));
Options->SetName(Idx++, "%s", tr( "Use System Font" ));
Options->SetName(Idx++, "%s", tr( "Search Mode" ));
Options->SetName(Idx++, "%s", tr( "Virtual Pointer Speed" ));
SetOptionValues();
}
@ -193,6 +194,9 @@ void GuiSettingsMenu::SetOptionValues()
//! Settings: Search Mode
Options->SetValue(Idx++, "%s", tr( searchModeText[Settings.SearchMode] ));
//! Settings: Virtual Pointer Speed
Options->SetValue(Idx++, "%g", Settings.PointerSpeed);
}
int GuiSettingsMenu::GetMenuInternal()
@ -375,6 +379,25 @@ int GuiSettingsMenu::GetMenuInternal()
if (++Settings.SearchMode >= SEARCH_MAX_CHOICE) Settings.SearchMode = 0;
}
//! Settings: Virtual Pointer Speed
else if (ret == ++Idx)
{
char entrie[20];
snprintf(entrie, sizeof(entrie), "%g", Settings.PointerSpeed);
int ret = OnScreenKeyboard(entrie, sizeof(entrie), 0);
if(ret)
{
for(u32 i = 0; i < sizeof(entrie); ++i)
{
if(entrie[i] == ',')
entrie[i] = '.';
}
Settings.PointerSpeed = atof(entrie);
}
}
SetOptionValues();
return MENU_NONE;

View File

@ -70,7 +70,7 @@ void GameSettingsMenu::SetupMainButtons()
SetMainButton(pos++, tr( "Game Load" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Ocarina" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Categories" ), MainButtonImgData, MainButtonImgOverData);
if(DiscHeader->type == TYPE_GAME_WII)
if(DiscHeader->type == TYPE_GAME_WII || DiscHeader->type == TYPE_GAME_NANDCHAN)
{
SetMainButton(pos++, tr( "Extract Save to EmuNand" ), MainButtonImgData, MainButtonImgOverData);
}
@ -136,7 +136,7 @@ void GameSettingsMenu::CreateSettingsMenu(int menuNr)
}
//! Extract Save to EmuNand
else if((DiscHeader->type == TYPE_GAME_WII) && menuNr == Idx++)
else if((DiscHeader->type == TYPE_GAME_WII || DiscHeader->type == TYPE_GAME_NANDCHAN) && menuNr == Idx++)
{
int choice = WindowPrompt(tr( "Do you want to extract the save game?" ), tr("The save game will be extracted to your emu nand path."), tr( "Yes" ), tr( "Cancel" ));
if (choice == 1)
@ -146,6 +146,7 @@ void GameSettingsMenu::CreateSettingsMenu(int menuNr)
snprintf(nandPath, sizeof(nandPath), "/title/00010000/%02x%02x%02x%02x", DiscHeader->id[0], DiscHeader->id[1], DiscHeader->id[2], DiscHeader->id[3]);
snprintf(filePath, sizeof(filePath), "%s%s", Settings.NandEmuPath, nandPath);
ProgressCancelEnable(true);
StartProgress(tr("Extracting file:"), 0, 0, true, false);
int ret = NandTitle::ExtractDir(nandPath, filePath);
@ -156,6 +157,7 @@ void GameSettingsMenu::CreateSettingsMenu(int menuNr)
ret = NandTitle::ExtractDir(nandPath, filePath);
}
ProgressStop();
ProgressCancelEnable(false);
if(ret < 0)
WindowPrompt(tr("Error:"), tr("Failed to extract all files. Savegame might not exist."), tr("OK"));

View File

@ -60,8 +60,7 @@ void Theme::Reload()
{
char image[50];
snprintf(image, sizeof(image), "player%i_point.png", i+1);
delete pointer[i];
pointer[i] = Resources::GetImageData(image);
pointer[i]->SetImage(image);
}
delete btnSoundClick;
delete btnSoundClick2;

View File

@ -370,7 +370,6 @@ void ThemeDownloader::MainButtonClicked(int button)
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while (!leave)
@ -396,7 +395,6 @@ void ThemeDownloader::MainButtonClicked(int button)
}
mainWindow->SetState(STATE_DISABLED);
promptWindow.SetState(STATE_DEFAULT);
mainWindow->ChangeFocus(&promptWindow);
downloadBtn.ResetState();
}

View File

@ -393,7 +393,6 @@ void ThemeMenu::MainButtonClicked(int button)
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
while (!leave)
@ -420,7 +419,6 @@ void ThemeMenu::MainButtonClicked(int button)
}
mainWindow->SetState(STATE_DISABLED);
promptWindow.SetState(STATE_DEFAULT);
mainWindow->ChangeFocus(&promptWindow);
applyBtn.ResetState();
}

View File

@ -75,6 +75,9 @@ int Playlog_Update(const char * ID, const u16 * title)
if(!ID || !title)
return -1;
//If not started from SystemMenu, create playlog
Playlog_Create();
s32 fd = -1, res = -1;
u32 sum = 0;
u8 i;

View File

@ -37,6 +37,7 @@ using namespace std;
static const char wbfs_fat_dir[] = "/wbfs";
static const char invalid_path[] = "/\\:|<>?*\"'";
extern u32 hdd_sector_size[2];
extern int install_abort_signal;
Wbfs_Fat::Wbfs_Fat(u32 lba, u32 size, u32 part, u32 port) :
Wbfs(lba, size, part, port), fat_hdr_list(NULL), fat_hdr_count(0)
@ -176,6 +177,8 @@ s32 Wbfs_Fat::AddGame(void)
wbfs_trim(part);
ClosePart(part);
if(install_abort_signal)
RemoveGame(header.id);
if (ret < 0) return ret;
return 0;

View File

@ -4,8 +4,6 @@
#include "settings/GameTitles.h"
#include "menu/menus.h"
extern GuiImageData * pointer[4];
void rockout(int gameSelected, int f)
{
static bool rockoutSet = false;
@ -16,23 +14,19 @@ void rockout(int gameSelected, int f)
|| strcasestr(GameTitles.GetTitle(gameList[gameSelected]), "band") || strcasestr(GameTitles.GetTitle(gameList[gameSelected]),
"rock")))
{
for (int i = 0; i < 4; i++)
delete pointer[i];
pointer[0] = Resources::GetImageData("rplayer1_point.png");
pointer[1] = Resources::GetImageData("rplayer2_point.png");
pointer[2] = Resources::GetImageData("rplayer3_point.png");
pointer[3] = Resources::GetImageData("rplayer4_point.png");
pointer[0]->SetImage("rplayer1_point.png");
pointer[1]->SetImage("rplayer2_point.png");
pointer[2]->SetImage("rplayer3_point.png");
pointer[3]->SetImage("rplayer4_point.png");
rockoutSet = true;
}
else if(rockoutSet)
{
for (int i = 0; i < 4; i++)
delete pointer[i];
pointer[0] = Resources::GetImageData("player1_point.png");
pointer[1] = Resources::GetImageData("player2_point.png");
pointer[2] = Resources::GetImageData("player3_point.png");
pointer[3] = Resources::GetImageData("player4_point.png");
pointer[0]->SetImage("player1_point.png");
pointer[1]->SetImage("player2_point.png");
pointer[2]->SetImage("player3_point.png");
pointer[3]->SetImage("player4_point.png");
rockoutSet = false;
}

View File

@ -72,8 +72,6 @@ s32 NandTitle::Get()
}
ISFS_Deinitialize();
//If not started from SystemMenu, create playlog while we got nand access.
Playlog_Create();
return 1;
}

View File

@ -215,7 +215,6 @@ s32 Wad_Install(FILE *fp)
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
//sleep(1);
@ -496,7 +495,6 @@ s32 Wad_Uninstall(FILE *fp)
HaltGui();
mainWindow->SetState(STATE_DISABLED);
mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow);
ResumeGui();
//sleep(3);