mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-18 16:01:58 +01:00
*Fixed some Themeprompts problems thx to julienstephan
*Added new effects (EFFECT_PULSE, EFFECT_GOROUND and EFFECT_ROCK_VERTICLE)
This commit is contained in:
parent
516baef59f
commit
899502b766
@ -45,6 +45,8 @@ Doyouwanttoretryfor30secs = R
|
||||
Downloadingfile = Téléchargement du fichier :
|
||||
DownloadBoxartimage = Télécharger les jaquettes ?
|
||||
Downloadfinished = Téléchargement terminé
|
||||
Defaultgamesettings = Réinitialiser les paramètres du jeu
|
||||
Defaultsettings = Réinitialiser les paramètres par défaut
|
||||
Error = Erreur !
|
||||
hour = Heures
|
||||
Homemenu = Menu HOME
|
||||
@ -120,6 +122,7 @@ OFF = D
|
||||
OfficialSite = Site Officiel
|
||||
ok = OK
|
||||
ON = Activé
|
||||
OnlyInstall = Jeu installé seulement
|
||||
Parentalcontrol = Contrôle parental
|
||||
Partition = Partition
|
||||
Password = Mot de passe
|
||||
@ -177,6 +180,7 @@ Waiting = En attente...
|
||||
WaitingforUSBDevice = Attente d'un périphérique USB
|
||||
WidescreenFix = 16:9
|
||||
WiiMenu = Menu Wii
|
||||
Wiilight = Illumination Wii
|
||||
WrongPassword = Mot de passe incorrect
|
||||
Yes = Oui
|
||||
YoudonthavecIOS = cIOS222 non installé
|
||||
|
@ -116,6 +116,9 @@ typedef struct _paddata {
|
||||
#define EFFECT_FADE 64
|
||||
#define EFFECT_SCALE 128
|
||||
#define EFFECT_COLOR_TRANSITION 256
|
||||
#define EFFECT_PULSE 512
|
||||
#define EFFECT_ROCK_VERTICLE 1024
|
||||
#define EFFECT_GOROUND 2048
|
||||
|
||||
//!Sound conversion and playback. A wrapper for other sound libraries - ASND, libmad, ltremor, etc
|
||||
class GuiSound
|
||||
@ -337,6 +340,8 @@ class GuiElement
|
||||
void SetEffectOnOver(int e, int a, int t=0);
|
||||
//!Shortcut to SetEffectOnOver(EFFECT_SCALE, 4, 110)
|
||||
void SetEffectGrow();
|
||||
//!Stops the current element effect
|
||||
void StopEffect();
|
||||
//!Gets the current element effects
|
||||
//!\return element effects
|
||||
int GetEffect();
|
||||
@ -403,6 +408,9 @@ class GuiElement
|
||||
int xmax; //!< Element's max X offset allowed
|
||||
int xoffsetDyn; //!< Element X offset, dynamic (added to xoffset value for animation effects)
|
||||
int yoffsetDyn; //!< Element Y offset, dynamic (added to yoffset value for animation effects)
|
||||
f32 degree; //!< Degree for flying stuff
|
||||
f32 yoffsetDynFloat; //!< Integer sucks float is need by some parts
|
||||
int changervar; //!< Changervariable for some stuff
|
||||
int alpha; //!< Element alpha value (0-255)
|
||||
f32 scale; //!< Element scale (1 = 100%)
|
||||
int alphaDyn; //!< Element alpha, dynamic (multiplied by alpha value for blending/fading effects)
|
||||
|
@ -44,6 +44,7 @@ GuiElement::GuiElement()
|
||||
updateCB = NULL;
|
||||
yoffsetDyn = 0;
|
||||
xoffsetDyn = 0;
|
||||
yoffsetDynFloat = 0;
|
||||
alphaDyn = -1;
|
||||
scaleDyn = 1;
|
||||
effects = 0;
|
||||
@ -52,6 +53,8 @@ GuiElement::GuiElement()
|
||||
effectsOver = 0;
|
||||
effectAmountOver = 0;
|
||||
effectTargetOver = 0;
|
||||
degree = 0;
|
||||
changervar = 0;
|
||||
|
||||
// default alignment - align to top left
|
||||
alignmentVert = ALIGN_TOP;
|
||||
@ -89,7 +92,7 @@ int GuiElement::GetLeft()
|
||||
pLeft = parentElement->GetLeft();
|
||||
}
|
||||
|
||||
if(effects & (EFFECT_SLIDE_IN | EFFECT_SLIDE_OUT))
|
||||
if(effects & (EFFECT_SLIDE_IN | EFFECT_SLIDE_OUT | EFFECT_GOROUND | EFFECT_ROCK_VERTICLE))
|
||||
pLeft += xoffsetDyn;
|
||||
|
||||
switch(alignmentHor)
|
||||
@ -124,7 +127,7 @@ int GuiElement::GetTop()
|
||||
pTop = parentElement->GetTop();
|
||||
}
|
||||
|
||||
if(effects & (EFFECT_SLIDE_IN | EFFECT_SLIDE_OUT))
|
||||
if(effects & (EFFECT_SLIDE_IN | EFFECT_SLIDE_OUT | EFFECT_GOROUND | EFFECT_ROCK_VERTICLE))
|
||||
pTop += yoffsetDyn;
|
||||
|
||||
switch(alignmentVert)
|
||||
@ -424,6 +427,7 @@ void GuiElement::SetEffect(int eff, int amount, int target)
|
||||
else if(eff & EFFECT_SLIDE_RIGHT)
|
||||
xoffsetDyn = screenwidth;
|
||||
}
|
||||
|
||||
if(eff & EFFECT_FADE && amount > 0)
|
||||
{
|
||||
alphaDyn = 0;
|
||||
@ -431,6 +435,14 @@ void GuiElement::SetEffect(int eff, int amount, int target)
|
||||
else if(eff & EFFECT_FADE && amount < 0)
|
||||
{
|
||||
alphaDyn = alpha;
|
||||
|
||||
} else if(eff & EFFECT_GOROUND) {
|
||||
xoffsetDyn = 0;
|
||||
yoffsetDyn = -200;
|
||||
} else if(eff & EFFECT_ROCK_VERTICLE) {
|
||||
changervar = 0;
|
||||
yoffsetDyn = 0;
|
||||
yoffsetDynFloat = 0.0;
|
||||
}
|
||||
|
||||
effects |= eff;
|
||||
@ -451,10 +463,26 @@ void GuiElement::SetEffectGrow()
|
||||
SetEffectOnOver(EFFECT_SCALE, 4, 110);
|
||||
}
|
||||
|
||||
void GuiElement::StopEffect()
|
||||
{
|
||||
xoffsetDyn = 0;
|
||||
yoffsetDyn = 0;
|
||||
effects = 0;
|
||||
effectsOver = 0;
|
||||
effectAmount = 0;
|
||||
effectAmountOver = 0;
|
||||
effectTarget = 0;
|
||||
effectTargetOver = 0;
|
||||
scaleDyn = 1;
|
||||
degree = 0;
|
||||
changervar = 0;
|
||||
}
|
||||
|
||||
void GuiElement::UpdateEffects()
|
||||
{
|
||||
LOCK(this);
|
||||
if(effects & (EFFECT_SLIDE_IN | EFFECT_SLIDE_OUT))
|
||||
|
||||
if(effects & (EFFECT_SLIDE_IN | EFFECT_SLIDE_OUT | EFFECT_GOROUND))
|
||||
{
|
||||
if(effects & EFFECT_SLIDE_IN)
|
||||
{
|
||||
@ -531,6 +559,42 @@ void GuiElement::UpdateEffects()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(effects & EFFECT_GOROUND) {
|
||||
|
||||
if(degree < 2*PI) { //here we can let it cicle less/more than 2*PI which is 360°
|
||||
int Radius = 200; //this needs to be moved to a global variable
|
||||
degree += 0.08; //this defines the flying speed
|
||||
|
||||
xoffsetDyn = (int)(Radius*cos(degree-PI/2)); //here we can make the startdegree different
|
||||
yoffsetDyn = (int)(Radius*sin(degree-PI/2)); //(by changing the radian degree of cos/sin
|
||||
|
||||
} else {
|
||||
xoffsetDyn = 0;
|
||||
yoffsetDyn += 0.08*100;
|
||||
if(yoffsetDyn >= 0) {
|
||||
effects = 0;
|
||||
degree = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(effects & EFFECT_ROCK_VERTICLE) {
|
||||
//move up to 10pixel above 0
|
||||
if(changervar == 0 && yoffsetDynFloat < 11.0) {
|
||||
yoffsetDynFloat += (effectAmount*0.01);
|
||||
} else if(yoffsetDynFloat > 10.0) {
|
||||
changervar = 1;
|
||||
}
|
||||
//move down till 10pixel under 0
|
||||
if(changervar == 1 && yoffsetDynFloat > -11.0) {
|
||||
yoffsetDynFloat -= (effectAmount*0.01);
|
||||
} else if(yoffsetDynFloat < -10.0) {
|
||||
changervar = 0;
|
||||
}
|
||||
yoffsetDyn = (int)(yoffsetDynFloat);
|
||||
}
|
||||
|
||||
if(effects & EFFECT_FADE)
|
||||
{
|
||||
alphaDyn += effectAmount;
|
||||
@ -557,6 +621,21 @@ void GuiElement::UpdateEffects()
|
||||
effects = 0; // shut off effect
|
||||
}
|
||||
}
|
||||
if(effects & EFFECT_PULSE)
|
||||
{
|
||||
int percent = 10; //go down from target by this
|
||||
|
||||
if((scaleDyn <= (effectTarget*0.01)) && (!changervar)) {
|
||||
scaleDyn += (effectAmount*0.001);
|
||||
} else if(scaleDyn > (effectTarget*0.01)) {
|
||||
changervar = 1;
|
||||
}
|
||||
if((scaleDyn >= ((effectTarget-percent)*0.01)) && (changervar)) {
|
||||
scaleDyn -= (effectAmount*0.001);
|
||||
} else if(scaleDyn < ((effectTarget-percent)*0.01)) {
|
||||
changervar = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GuiElement::Update(GuiTrigger * t)
|
||||
|
@ -1612,6 +1612,8 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
|
||||
mainWindow->ChangeFocus(&promptWindow);
|
||||
ResumeGui();
|
||||
|
||||
SDCard_deInit();
|
||||
|
||||
if(IsDeviceWait) {
|
||||
while(i >= 0)
|
||||
{
|
||||
@ -5405,18 +5407,16 @@ static int MenuCheck()
|
||||
ret2 = WBFS_Init(WBFS_DEVICE_USB);
|
||||
if (ret2 < 0)
|
||||
{
|
||||
//shutdown SD
|
||||
SDCard_deInit();
|
||||
//initialize WiiMote for Prompt
|
||||
Wpad_Init();
|
||||
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
|
||||
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
|
||||
|
||||
ret2 = WindowPrompt(LANGUAGE.NoUSBDevicefound,
|
||||
LANGUAGE.Doyouwanttoretryfor30secs,
|
||||
"cIOS249", "cIOS222",
|
||||
LANGUAGE.BacktoWiiMenu, 0);
|
||||
|
||||
//shutdown SD
|
||||
SDCard_deInit();
|
||||
if(ret2 == 1) {
|
||||
Settings.cios = ios249;
|
||||
} else if(ret2 == 2) {
|
||||
@ -5429,6 +5429,7 @@ static int MenuCheck()
|
||||
WPAD_Disconnect(0);
|
||||
WPAD_Shutdown();
|
||||
|
||||
SDCard_Init();
|
||||
ret2 = DiscWait(LANGUAGE.NoUSBDevice, LANGUAGE.WaitingforUSBDevice, 0, 0, 1);
|
||||
PAD_Init();
|
||||
Wpad_Init();
|
||||
@ -5437,7 +5438,9 @@ static int MenuCheck()
|
||||
SDCard_Init();
|
||||
}
|
||||
if (ret2 < 0) {
|
||||
SDCard_Init();
|
||||
WindowPrompt (LANGUAGE.Error,LANGUAGE.USBDevicenotfound, LANGUAGE.ok, 0,0,0);
|
||||
SDCard_deInit();
|
||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||
} else {
|
||||
PAD_Init();
|
||||
@ -5449,17 +5452,20 @@ static int MenuCheck()
|
||||
|
||||
ret2 = Disc_Init();
|
||||
if (ret2 < 0) {
|
||||
SDCard_Init();
|
||||
WindowPrompt (LANGUAGE.Error,LANGUAGE.CouldnotinitializeDIPmodule,LANGUAGE.ok, 0,0,0);
|
||||
SDCard_deInit();
|
||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||
}
|
||||
|
||||
ret2 = WBFS_Open();
|
||||
if (ret2 < 0) {
|
||||
|
||||
SDCard_Init();
|
||||
choice = WindowPrompt(LANGUAGE.NoWBFSpartitionfound,
|
||||
LANGUAGE.Youneedtoformatapartition,
|
||||
LANGUAGE.Format,
|
||||
LANGUAGE.Return,0,0);
|
||||
SDCard_deInit();
|
||||
if(choice == 0)
|
||||
{
|
||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||
@ -5469,8 +5475,9 @@ static int MenuCheck()
|
||||
u32 sector_size;
|
||||
ret2 = Partition_GetEntries(partitions, §or_size);
|
||||
if (ret2 < 0) {
|
||||
|
||||
SDCard_Init();
|
||||
WindowPrompt (LANGUAGE.Nopartitionsfound,0, LANGUAGE.Restart, 0,0,0);
|
||||
SDCard_deInit();
|
||||
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user