PDA

View Full Version : Mini Mods - v3 Arcade - Lights Out Mode v2


Gemma
01-20-2012, 11:00 PM
What Does This Do?
Basically, when you turn lights down, the entire page darkens* and lets you play the game in the 'dark' which cuts out distractions.

*You can also change the fade background colour to match that of your forum and blank everything out except the game.

Upload the contents of the zip file to your forum root

In your v3ARCADE_PLAY template and find:

<title>{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}} - {vb:raw vboptions.arcadename} - {vb:raw game.title}</title>
{vb:raw headinclude_bottom}
</head>Underneath that add:
<style type="text/css">
#lights { /* This is the container which holds the light switch */
position:relative; /* Set the position of the light switch to relative so it can be placed above the "dimming" layer */
z-index:500; /* Set the height on the Z axis to 500 which is above the "dimmed" layer */
}

object { /* The object tag is what the swf files are held in */
outline:none; /* Set the outline of swf objects to none so when you click on it you don't get a border around the swf */
}

#fade { /* This is the "dimmed" layer which fades in when the lights go off */
display: none; /* Set the display to none which hides the layer */
background: #fff; /* Set the color to black */
position: fixed; left: 0; top: 0; /* Set the position to fixed so when the user scrolls it stays with them */
width: 100%; height: 100%; /* Set the width and height to 100% of the browser window */
opacity: .90; /* Set the layer's opacity to .90 which is 90% */
z-index:100; /* Set the height on the Z axis to 100 which is below the "light switch" layer */
}
#standout{
position:relative;
background-color:#ffffff;
z-index:1000;
}
</style>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = false;

var params = {
movie: "Lights.swf",
quality: "high",
allowScriptAccess: "always",
wmode: "transparent"
};

var attributes = false;

swfobject.embedSWF("Lights.swf", "lights", "100", "100", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
function lightsOn(){
//When you turn the lights back on fade out the "dim" layer over 500 milliseconds and then remove it
$('#fade').fadeOut(500,function() { $("#fade").remove(); });
};

function lightsOff(){
$('body').append('<div id="fade"></div>'); //When you turn the lights off add the "dimmed" layer to the page
$('#fade').fadeIn(250); //Fade in the "dim" layer over 250 milliseconds
};
</script>You can change background: #fff; /* Set the color to black */ to match the colour of your forum if you'd prefer that to black and the opacity: .90; /* Set the layer's opacity to .90 which is 90% */ to suit your needs.

Still in the v3ARCADE_PLAY template find:
<td align="center" class="blockbody" valign="top">
<!-- main -->Below that add:
<div id = "standout">Next, find:
<!-- /main -->
</td>Above that add:
</div>Search for:
</div>
</div>
<!-- /right area-->Above that add:
<div class="blockrow" align="center">
<div id="lights"></div>Save the template.

Thanks goes to C.Birch for pointing out and providing a fix that some people were experiencing where upon pressing the lights out button the whole screen was dimming including the flash game. The required changes can be seen here (https://vborg.vbsupport.ru/showpost.php?p=2328824&postcount=24) and have been integrated into the instructions above.

*Nothing has changed in the zip archive, no need to download if upgrading, just carry out the template edits

Gemma
01-21-2012, 02:09 PM
Reserved

:p:rolleyes:

kylek
01-22-2012, 07:40 PM
Once again, thank you very much Gemma for this updated version, worked great right from the start!

thecore762
01-22-2012, 07:51 PM
Awesome plugin!

wolfsblut01
01-23-2012, 11:02 AM
klasse, danke dir

Noerenberg
03-01-2012, 06:41 PM
hi,

i am not sure what i do wrong but on my site the hole site goes white

Noerenberg
03-01-2012, 06:45 PM
Ok, it works in Firefox but not in Opera.

Can you fix the problem in the browser Opera?

Gemma
03-02-2012, 04:16 PM
Ok, it works in Firefox but not in Opera.

Can you fix the problem in the browser Opera?

I'll have a look but I can't guarantee I'll get it working, I don't use Opera or know the ins and outs of how it works. No idea what needs to be done differently so I'll need to do some research :o

Noerenberg
03-02-2012, 04:37 PM
I'll have a look but I can't guarantee I'll get it working, I don't use Opera or know the ins and outs of how it works. No idea what needs to be done differently so I'll need to do some research :o

Thanks Gemma, i will wait, no problem

ellinofatsa
03-04-2012, 12:51 AM
hi can somewhane make this hack for ipbtoarcade?

Gemma
03-05-2012, 12:21 AM
hi can somewhane make this hack for ipbtoarcade?

I'm sure it has already been done by stangger5, I stopped using IPB years ago so I won't be releasing a version here. (It also works with xenForo Arcade).

If you are requesting it though you would be better posting a request in either the paid or unpaid requests forum :)

team76
03-11-2012, 12:54 PM
works great on vb4.1.10 but since 4.1.11
nothing

**********

sorry I was wrong I had deleted files

Sarab
03-18-2012, 04:37 PM
Hello,

Great way to play in the arcade, thank you =D

One question, is there a way to translate " LIGHT ON " and " LOGHT OFF "?

Best regards,
Sarab

Gemma
03-18-2012, 06:21 PM
Hello,

Great way to play in the arcade, thank you =D

One question, is there a way to translate " LIGHT ON " and " LOGHT OFF "?

Best regards,
Sarab

Sorry, the 'Lights On' and 'Lights Off' is embedded into the flash swf. What do you want it translated to and I'll see if it is possible to change

Sarab
03-19-2012, 01:58 PM
<font face="Tahoma">
Hello Gemma,

I see, I would like to translate it to Arabic where it will be:
LIGHT ON = إضاءة
LIGHT OFF = إطفاء الإضاءة

Can this be done =D?

Best Regards,
Sarab

</font>

Gemma
03-19-2012, 02:51 PM
Hello Gemma,

I see, I would like to translate it to Arabic where it will be:
LIGHT ON = إضاءة
LIGHT OFF = إطفاء الإضاءة

Can this be done =D?

Best Regards,
Sarab


Not sure if the translation has worked out right but try this. Replace the original Lights.swf with the one in this archive.

Edit: removed attachment

Sarab
03-19-2012, 03:52 PM
Not sure if the translation has worked out right but try this. Replace the original Lights.swf with the one in this archive.

Thank you, I just tried it but it didn't work because of the Arabic words, so can you try putting those images instead:
LIGHT OFF:
http://www.phantom-downloads.com/memspace/images_up/7d85df62b20a4e2005aef194b5c0aff0.png
LIGHT ON:
http://www.phantom-downloads.com/memspace/images_up/1e33b28cbbbf47f3ef1480c042030c43.png

Best regards,
Sarab

Gemma
03-19-2012, 04:30 PM
Couldn't use the images, but is this better?

edit: removed link

Sarab
03-20-2012, 10:31 AM
I see ="(

Thank you, but it's looks like the words in mirrors + the Arabic characters should be connected to form a word =D

So how about the swf file be without the LIGHT ON & LIGHT OFF, just the light image =D?

Best Regards,
Sarab

Gemma
03-20-2012, 03:34 PM
I see ="(

Thank you, but it's looks like the words in mirrors + the Arabic characters should be connected to form a word =D

So how about the swf file be without the LIGHT ON & LIGHT OFF, just the light image =D?

Best Regards,
Sarab

There you go, I've removed the text for you.

Sarab
03-24-2012, 05:30 AM
There you go, I've removed the text for you.

Sorry for being late >.<

I want to say thank you, you were really great help and I'm grateful to you T.T

It worked perfect, thanks again for the help =D

Best Regards,
Sarab

datoneer
05-09-2012, 01:48 PM
hi,

i am not sure what i do wrong but on my site the hole site goes white

Just replace #fff with #000 and you will get what you want

C.Birch
05-12-2012, 09:26 PM
Just replace #fff with #000 and you will get what you want

Is problem is the same as i get in firefox, it blacks or whites (going by the colour you set) all the page apart from the lights button, what means you can not see or interact with the flash game when you use the lights out mode.

This seems to be a z-index problem to me, with the flash game needing a index number higher that the one used for the lights out mode.

C.Birch
05-12-2012, 09:58 PM
Here is the fix:
In your v3ARCADE_PLAY do the following edits.

Below:
#fade { /* This is the "dimmed" layer which fades in when the lights go off */
display: none; /* Set the display to none which hides the layer */
background: #000000; /* Set the color to black */
position: fixed; left: 0; top: 0; /* Set the position to fixed so when the user scrolls it stays with them */
width: 100%; height: 100%; /* Set the width and height to 100% of the browser window */
opacity: .90; /* Set the layer's opacity to .90 which is 90% */
z-index:100; /* Set the height on the Z axis to 100 which is below the "light switch" layer */
}


Add:
#standout{
position:relative;
background-color:#ffffff;
z-index:1000;
}

Below:
<td align="center" class="blockbody" valign="top">
<!-- main -->

Add:
<div id = "standout">

Above:
<!-- /main -->
</td>

Add:
</div>

Now save the edits.

Gemma
05-13-2012, 12:23 PM
Update to version 2.0.1 with the above fix. If you're updating, follow the instructions in the post above (#24); these instructions have been included in the OP for those who are installing from scratch.

hunter1985
02-15-2013, 09:31 PM
That looks brill! Nice addon lassie!

doctorsexy
04-25-2013, 04:18 PM
works well with Xf....:D

initiald
06-02-2013, 10:16 AM
NVM. Just change the number.