This component is a basic rewrite of the original "games" component. It features DIABLO, DOOM II, and a dosbox interface that gives you numerous other games. You can easily modify it to feature other games that you can embed by changing the arcade.php file to link to them.
v1.0 - Includes Diablo, Doom II, and a link to DosBox games.
v1.1 - Added a full screen button for Diablo.
v1.2 - Complete rewrite. Made two separate pages for Diablo and Doom II (with DosBox). Full screen buttons for both games now. Installs an Arcade menu item with a submenu for the games. Easily change out the games and code for even more games in the arcade with this easy to edit and use component!
v1.3 - Added a 3rd game port to Diablo 2! Game only works on desktop and requires present or previous Diablo 2 purchase.
v1.4 - Added a 4th game to the line up, the original DOOM!!! Plus, altered the code so that Doom and Doom II are now mobile friendly.
v1.5 - Removed exorbitant code and added special icons for the games.
v1.6 - Added Duke Nukem, Wolfenstein, The Legend of Zelda, and Sonic the Hedgehog to the games roster!
Yeah, you're almost done!
Change your css to
.menu-section-item-diablo:before {
content: '' !important;
background-image: url("<?php echo ossn_site_url();?>components/Arcade/images/diablo.png");
background-repeat: no-repeat;
height: 25px;
width: 25px;
margin-right: 7px;
}
Depending on the pngs you may have to twist the dimensions and margins a bit, but basically that's the way to address image icons.
And don't forget to remove your undefinded $icon lines from the com file - PHP8 will bomb out with a code like that.
Just uploaded a new version 1.4 with small code addition to show basic font awesome icons to the left of the games. Woohoo! Now, if someone can please help me make it show the special icons I made for the included games that would be awesome!
@~Z~ Man ... ok so I've been able to make a basic font awesome icon show by putting in the proper statement in the css page arcade.php. It reads like this...
.menu-section-item-diablo:before {
font-family: FontAwesome;
content: "\f11b"; }
However, I want to use my special icons located in the images folder. How do I change the content here to do such?
Hmm ... maybe I'd better login as Arsalan Shah next time before giving advices? ;)
Anyway, the next step is right-clicking that '>
' in front of a game name and choosing 'Inspect'
This should open the browser's developer console and point you to a <li class='.....'>
What's the name of that class?
@Arsalan ... Thanks for clearing that up. I have uploaded a corrected version that has ossn removed from the function names.
see https://www.opensource-socialnetwork.org/wiki/view/739/naming-convention-for-components-and-themes
It means that you should not name functions like ossn_arcade_init
or ossn_arcade_pages
name them like arcade_init
or arcade_pages
@~Z~ Man ... Not sure what you mean by there being any conflict with regard to functions on this one. There are only 2 functions defined in this component...
function ossn_arcade_init()
and
function ossn_arcade_pages($pages)
and that's it! There is no conflict with any other function and will likely never be. As for the issue with $icon, I've already indicated that this is a minor coding issue that I need help with. Any help is appreciated!
Allon,
again please read
https://www.opensource-socialnetwork.org/wiki/view/739/naming-convention-for-components-and-themes
PHP doesn't allow to use the same function more than once, and it's not acceptable for Arsalan to browse dozens of third party components for already exitsting functions with the same name if he wants to implement a new core function.
Next: What should the statement 'icon' => ($icon),
do? I don't see $icon
ever getting initialized.
Just uploaded a slight variation. This one has extra special icons for all the games. Still not able to get them to show. Any help is appreciated. I'd even be willing to throw some coin at anyone who can help. Other than that, I renamed the game Diablo 2 to Diablo II for consistencies sake. It all works pretty good!
Just uploaded a special v1.3 that now has 3 games... still having icon issues. Need help!
@David ... I haven't recieved your email yet. It's been a little while. Can you please resend? If you've found the solution please feel free to share here. Thanks!