add the loyall-minetest-mod to version control

master
dave loyall 2018-07-16 10:02:11 -05:00
parent 8aed0e9c74
commit 0318b2481f
12 changed files with 347 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~
*.ogg

258
LICENSE Normal file
View File

@ -0,0 +1,258 @@
<!DOCTYPE html>
<html class="devise-layout-html">
<head prefix="og: http://ogp.me/ns#">
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="object" property="og:type">
<meta content="GitLab" property="og:site_name">
<meta content="Sign in" property="og:title">
<meta content="GitLab.com" property="og:description">
<meta content="https://assets.gitlab-static.net/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png" property="og:image">
<meta content="64" property="og:image:width">
<meta content="64" property="og:image:height">
<meta content="https://gitlab.com/users/sign_in" property="og:url">
<meta content="summary" property="twitter:card">
<meta content="Sign in" property="twitter:title">
<meta content="GitLab.com" property="twitter:description">
<meta content="https://assets.gitlab-static.net/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png" property="twitter:image">
<title>Sign in · GitLab</title>
<meta content="GitLab.com" name="description">
<link rel="shortcut icon" type="image/png" href="https://gitlab.com/assets/favicon-7901bd695fb93edb07975966062049829afb56cf11511236e61bcf425070e36e.png" id="favicon" data-original-href="https://gitlab.com/assets/favicon-7901bd695fb93edb07975966062049829afb56cf11511236e61bcf425070e36e.png" />
<link rel="stylesheet" media="all" href="https://assets.gitlab-static.net/assets/application-00218192eb99e497b44466d84dce80711dd32031561e8e4449e16d8b46a8cbde.css" />
<link rel="stylesheet" media="print" href="https://assets.gitlab-static.net/assets/print-c8ff536271f8974b8a9a5f75c0ca25d2b8c1dceb4cff3c01d1603862a0bdcbfc.css" />
<script>
//<![CDATA[
window.gon={};gon.api_version="v4";gon.default_avatar_url="https://assets.gitlab-static.net/assets/no_avatar-849f9c04a3a0d0cea2424ae97b27447dc64a7dbfae83c036c45b403392f0e8ba.png";gon.max_file_size=10;gon.asset_host="https://assets.gitlab-static.net";gon.webpack_public_path="https://assets.gitlab-static.net/assets/webpack/";gon.relative_url_root="";gon.shortcuts_path="/help/shortcuts";gon.user_color_scheme="white";gon.sentry_dsn="https://526a2f38a53d44e3a8e69bfa001d1e8b@sentry.gitlap.com/15";gon.gitlab_url="https://gitlab.com";gon.revision="50497b7";gon.gitlab_logo="https://assets.gitlab-static.net/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png";gon.sprite_icons="https://gitlab.com/assets/icons-07542808fffaf82e9b57b144464ea42620b32f65ce441c01528d23d4b96d5f11.svg";gon.sprite_file_icons="https://gitlab.com/assets/file_icons-7262fc6897e02f1ceaf8de43dc33afa5e4f9a2067f4f68ef77dcc87946575e9e.svg";gon.emoji_sprites_css_path="https://assets.gitlab-static.net/assets/emoji_sprites-289eccffb1183c188b630297431be837765d9ff4aed6130cf738586fb307c170.css";gon.test_env=false;gon.suggested_label_colors=["#0033CC","#428BCA","#44AD8E","#A8D695","#5CB85C","#69D100","#004E00","#34495E","#7F8C8D","#A295D6","#5843AD","#8E44AD","#FFECDB","#AD4363","#D10069","#CC0033","#FF0000","#D9534F","#D1D100","#F0AD4E","#AD8D43"];
//]]>
</script>
<script src="https://assets.gitlab-static.net/assets/webpack/runtime.7424e5fb.bundle.js" defer="defer"></script>
<script src="https://assets.gitlab-static.net/assets/webpack/main.5ab70142.chunk.js" defer="defer"></script>
<script src="https://assets.gitlab-static.net/assets/webpack/raven.3c09a53c.chunk.js" defer="defer"></script>
<script src="https://assets.gitlab-static.net/assets/webpack/commons~pages.ldap.omniauth_callbacks~pages.omniauth_callbacks~pages.sessions~pages.sessions.new.1cd73640.chunk.js" defer="defer"></script>
<script src="https://assets.gitlab-static.net/assets/webpack/pages.sessions.new.7ef701e7.chunk.js" defer="defer"></script>
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="kmwaslZ4onv3GLlbCDTvD/PRTRiZoANIRtd3JMSPDvVKDeiHMoqbxFTxk0a8zWlwMqIdpgd3uzPjvFIUUKwkKw==" />
<meta content="origin-when-cross-origin" name="referrer">
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
<meta content="#474D57" name="theme-color">
<link rel="apple-touch-icon" type="image/x-icon" href="https://assets.gitlab-static.net/assets/touch-icon-iphone-5a9cee0e8a51212e70b90c87c12f382c428870c0ff67d1eb034d884b78d2dae7.png" />
<link rel="apple-touch-icon" type="image/x-icon" href="https://assets.gitlab-static.net/assets/touch-icon-ipad-a6eec6aeb9da138e507593b464fdac213047e49d3093fc30e90d9a995df83ba3.png" sizes="76x76" />
<link rel="apple-touch-icon" type="image/x-icon" href="https://assets.gitlab-static.net/assets/touch-icon-iphone-retina-72e2aadf86513a56e050e7f0f2355deaa19cc17ed97bbe5147847f2748e5a3e3.png" sizes="120x120" />
<link rel="apple-touch-icon" type="image/x-icon" href="https://assets.gitlab-static.net/assets/touch-icon-ipad-retina-8ebe416f5313483d9c1bc772b5bbe03ecad52a54eba443e5215a22caed2a16a2.png" sizes="152x152" />
<link color="rgb(226, 67, 41)" href="https://assets.gitlab-static.net/assets/logo-d36b5212042cebc89b96df4bf6ac24e43db316143e89926c0db839ff694d2de4.svg" rel="mask-icon">
<meta content="https://assets.gitlab-static.net/assets/msapplication-tile-1196ec67452f618d39cdd85e2e3a542f76574c071051ae7effbfde01710eb17d.png" name="msapplication-TileImage">
<meta content="#30353E" name="msapplication-TileColor">
</head>
<body class="ui-indigo login-page application navless" data-page="sessions:new">
<div class="page-wrap">
<header class="navbar fixed-top navbar-empty">
<div class="container">
<div class="mx-auto">
<svg width="24" height="24" class="tanuki-logo" viewBox="0 0 36 36">
<path class="tanuki-shape tanuki-left-ear" fill="#e24329" d="M2 14l9.38 9v-9l-4-12.28c-.205-.632-1.176-.632-1.38 0z"/>
<path class="tanuki-shape tanuki-right-ear" fill="#e24329" d="M34 14l-9.38 9v-9l4-12.28c.205-.632 1.176-.632 1.38 0z"/>
<path class="tanuki-shape tanuki-nose" fill="#e24329" d="M18,34.38 3,14 33,14 Z"/>
<path class="tanuki-shape tanuki-left-eye" fill="#fc6d26" d="M18,34.38 11.38,14 2,14 6,25Z"/>
<path class="tanuki-shape tanuki-right-eye" fill="#fc6d26" d="M18,34.38 24.62,14 34,14 30,25Z"/>
<path class="tanuki-shape tanuki-left-cheek" fill="#fca326" d="M2 14L.1 20.16c-.18.565 0 1.2.5 1.56l17.42 12.66z"/>
<path class="tanuki-shape tanuki-right-cheek" fill="#fca326" d="M34 14l1.9 6.16c.18.565 0 1.2-.5 1.56L18 34.38z"/>
</svg>
</div>
</div>
</header>
<div class="login-page-broadcast">
</div>
<div class="container navless-container">
<div class="content">
<div class="flash-container flash-container-page">
<div class="flash-alert">
<div class="container-fluid container-limited ">
<span>You need to sign in or sign up before continuing.</span>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-7 brand-holder">
<h1>
GitLab.com
</h1>
<p dir="auto">GitLab.com offers free unlimited (private) repositories and unlimited collaborators.</p>&#x000A;&#x000A;<ul dir="auto">&#x000A;<li>&#x000A;<a href="https://gitlab.com/explore/projects/trending">Explore projects on GitLab.com</a> (no login needed)</li>&#x000A;<li><a href="https://about.gitlab.com/gitlab-com/" rel="nofollow noreferrer noopener" target="_blank">More information about GitLab.com</a></li>&#x000A;<li><a href="https://gitlab.com/gitlab-com/support-forum/issues">GitLab.com Support Forum</a></li>&#x000A;<li><a href="https://about.gitlab.com" rel="nofollow noreferrer noopener" target="_blank">GitLab Homepage</a></li>&#x000A;</ul>&#x000A;&#x000A;<p dir="auto">By signing up for and by signing in to this service you accept our:</p>&#x000A;&#x000A;<ul dir="auto">&#x000A;<li><a href="https://about.gitlab.com/privacy/" rel="nofollow noreferrer noopener" target="_blank">Privacy policy</a></li>&#x000A;<li>&#x000A;<a href="https://about.gitlab.com/terms/#gitlab_com" rel="nofollow noreferrer noopener" target="_blank">GitLab.com Terms</a>.</li>&#x000A;</ul>
</div>
<div class="col-sm-5 new-session-forms-container">
<div>
<ul class="nav-links new-session-tabs nav-tabs nav" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" data-toggle="tab" href="#login-pane" role="tab">Sign in</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" data-toggle="tab" href="#register-pane" role="tab">Register</a>
</li>
</ul>
<div class="tab-content">
<div class="login-box tab-pane active" id="login-pane" role="tabpanel">
<div class="login-body">
<form class="new_user gl-show-field-errors" aria-live="assertive" id="new_user" action="/users/sign_in" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="authenticity_token" value="TzvV/qkfdhL3wva77fNYa6LfMcsI+0NALh/zMiaIkCeXWifLze1PrVQr3KZZCt4UY6xhdZYs+zuLdNYCsqu6+Q==" /><div class="form-group">
<label for="user_login">Username or email</label>
<input class="form-control top" autofocus="autofocus" autocapitalize="off" autocorrect="off" required="required" title="This field is required." type="text" name="user[login]" id="user_login" />
</div>
<div class="form-group">
<label for="user_password">Password</label>
<input class="form-control bottom" required="required" title="This field is required." type="password" name="user[password]" id="user_password" />
</div>
<div class="remember-me">
<label for="user_remember_me">
<input name="user[remember_me]" type="hidden" value="0" /><input class="remember-me-checkbox" type="checkbox" value="1" name="user[remember_me]" id="user_remember_me" />
<span>Remember me</span>
</label>
<div class="float-right forgot-password">
<a href="/users/password/new">Forgot your password?</a>
</div>
</div>
<div></div>
<div class="submit-container move-submit-down">
<input type="submit" name="commit" value="Sign in" class="btn btn-save" />
</div>
</form>
</div>
</div>
<div class="tab-pane login-box" id="register-pane" role="tabpanel">
<div class="login-body">
<form class="new_new_user gl-show-field-errors" aria-live="assertive" id="new_new_user" action="/users" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="authenticity_token" value="OZPSbLb/quru/82V9zwX1anNC23YFCxl7LesZGXhXZ3h8iBZ0g2TVU0W54hDxZGqaL5b00bDlB5J3IlU8cJ3Qw==" /><div class="devise-errors">
</div>
<div class="form-group">
<label for="new_user_name">Full name</label>
<input class="form-control top" required="required" title="This field is required." type="text" name="new_user[name]" id="new_user_name" />
</div>
<div class="username form-group">
<label for="new_user_username">Username</label>
<input class="form-control middle" pattern="[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*[a-zA-Z0-9_\-]|[a-zA-Z0-9_]" required="required" title="Please create a username with only alphanumeric characters." type="text" name="new_user[username]" id="new_user_username" />
<p class="validation-error hide">Username is already taken.</p>
<p class="validation-success hide">Username is available.</p>
<p class="validation-pending hide">Checking username availability...</p>
</div>
<div class="form-group">
<label for="new_user_email">Email</label>
<input class="form-control middle" required="required" title="Please provide a valid email address." type="email" value="" name="new_user[email]" id="new_user_email" />
</div>
<div class="form-group">
<label for="new_user_email_confirmation">Email confirmation</label>
<input class="form-control middle" required="required" title="Please retype the email address." type="email" name="new_user[email_confirmation]" id="new_user_email_confirmation" />
</div>
<div class="form-group append-bottom-20" id="password-strength">
<label for="new_user_password">Password</label>
<input class="form-control bottom" required="required" pattern=".{8,}" title="Minimum length is 8 characters." type="password" name="new_user[password]" id="new_user_password" />
<p class="gl-field-hint">Minimum length is 8 characters</p>
</div>
<div class="form-group">
<input type="checkbox" name="terms_opt_in" id="terms_opt_in" value="1" required="required" />
<label for="terms_opt_in">I accept the <a target="_blank" href="/-/users/terms">Terms of Service and Privacy Policy</a>
</label></div>
<div class="form-group">
<input name="new_user[email_opted_in]" type="hidden" value="0" /><input type="checkbox" value="1" name="new_user[email_opted_in]" id="new_user_email_opted_in" />
<label for="new_user_email_opted_in">I&#39;d like to receive updates via email about GitLab.</label>
</div>
<div></div>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey="6LfAERQTAAAAAL4GYSiAMGLbcLyUIBSfPrDNJgeC"></div>
<noscript>
<div style="width: 302px; height: 352px;">
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe
src="https://www.google.com/recaptcha/api/fallback?k=6LfAERQTAAAAAL4GYSiAMGLbcLyUIBSfPrDNJgeC"
frameborder="0" scrolling="no"
style="width: 302px; height:352px; border-style: none;">
</iframe>
</div>
<div style="width: 250px; height: 80px; position: absolute; border-style: none;
bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;">
<textarea id="g-recaptcha-response" name="g-recaptcha-response"
class="g-recaptcha-response"
style="width: 250px; height: 80px; border: 1px solid #c1c1c1;
margin: 0px; padding: 0px; resize: none;" value="">
</textarea>
</div>
</div>
</div>
</noscript>
<div class="submit-container">
<input type="submit" name="commit" value="Register" class="btn-register btn" />
</div>
</form></div>
</div>
<div class="clearfix submit-container">
<p>
<span class="light">Didn't receive a confirmation email?</span>
<a href="/users/confirmation/new">Request a new one</a>.
</p>
</div>
</div>
<div class="clearfix">
<div class="omniauth-container">
<p>
<span class="light">
Sign in with &nbsp;
</span>
<span class="light">
<a class="oauth-login oauth-image-link" id="oauth-login-google_oauth2" rel="nofollow" data-method="post" href="/users/auth/google_oauth2"><img alt="Google" title="Sign in with Google" data-src="https://assets.gitlab-static.net/assets/auth_buttons/google_64-37d98b7033cc7059a484199ffdd766adf69babbc6e5fc64b43006ca866629f17.png" class=" lazy" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" /></a>
</span>
<span class="light">
<a class="oauth-login oauth-image-link" id="oauth-login-twitter" rel="nofollow" data-method="post" href="/users/auth/twitter"><img alt="Twitter" title="Sign in with Twitter" data-src="https://assets.gitlab-static.net/assets/auth_buttons/twitter_64-86860edb139fb2f62fc25ef62a4213a5c8b20122fd8752ab0df09e740eb53deb.png" class=" lazy" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" /></a>
</span>
<span class="light">
<a class="oauth-login oauth-image-link" id="oauth-login-github" rel="nofollow" data-method="post" href="/users/auth/github"><img alt="GitHub" title="Sign in with GitHub" data-src="https://assets.gitlab-static.net/assets/auth_buttons/github_64-84041cd0ea392220da96f0fb9b9473c08485c4924b98c776be1bd33b0daab8c0.png" class=" lazy" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" /></a>
</span>
<span class="light">
<a class="oauth-login oauth-image-link" id="oauth-login-bitbucket" rel="nofollow" data-method="post" href="/users/auth/bitbucket"><img alt="Bitbucket" title="Sign in with Bitbucket" data-src="https://assets.gitlab-static.net/assets/auth_buttons/bitbucket_64-eceb0f98bfa1a0bdc088138f970e1bc209114a8934c1372b596e9d137e611c21.png" class=" lazy" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" /></a>
</span>
<fieldset class="prepend-top-10 remember-me">
<label>
<input type="checkbox" name="remember_me" id="remember_me" class="remember-me-checkbox" />
<span>
Remember me
</span>
</label>
</fieldset>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr class="footer-fixed">
<div class="container footer-container">
<div class="footer-links">
<a href="/explore">Explore</a>
<a href="/help">Help</a>
<a href="https://about.gitlab.com/">About GitLab</a>
</div>
</div>
</div>
</body>
</html>

1
README.txt Normal file
View File

@ -0,0 +1 @@
This minetest mod adds two blocks. When they are placed adjacently, they resemble a stereo or record player. One block contains code that makes it play music when the player hits it to activate it. The player can deactivate the music by hitting it again. It plays a single music file with a hard-coded filename (patches welcome) and I didn't include that file because I don't have a license to redistribute it.

85
init.lua Normal file
View File

@ -0,0 +1,85 @@
minetest.register_node("loyall:stereo_left", {
description = "Left side of Stero",
tiles = {
--0 //top
"stereo_left_top.png",
--1 //bottom
"stereo_bottom.png",
--2 //back
"stereo_right_back.png",
--3
"stereo_left_front.png",
--4
"stereo_bottom.png",
--5
"stereo_bottom.png"
},
groups = {cracky = 1}
})
minetest.register_node("loyall:stereo_right", {
description = "Right side of Stero",
tiles = {
"stereo_right_top.png",
"stereo_bottom.png",
"stereo_left_back.png",
"stereo_right_front.png",
"stereo_bottom.png",
"stereo_bottom.png"
},
groups = {cracky = 1}
})
--from https://forum.minetest.net/viewtopic.php?f=9&t=1412
soundblocks_music={} --This is needed because you cannot save the handle of the sound in param2 of the node
minetest.register_node("loyall:musicblock", {
description = "Music Block",
tile_images = {"default_wood.png"},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
})
--Some functions that you need to save the handle in soundblocks_music:
function soundblocks_get_handle(pos)
local i=0
while soundblocks_music[i]~=nil do
if soundblocks_music[i].pos.x==pos.x and soundblocks_music[i].pos.y==pos.y and soundblocks_music[i].pos.z==pos.z then
return soundblocks_music[i].handle
end
i=i+1
end
return 0
end
function soundblocks_set_handle(pos, handle)
local i=0
while soundblocks_music[i]~=nil do
if soundblocks_music[i].pos.x==pos.x and soundblocks_music[i].pos.y==pos.y and soundblocks_music[i].pos.z==pos.z then
soundblocks_music[i].handle=handle
return
end
i=i+1
end
soundblocks_music[i]={}
soundblocks_music[i].pos=pos
soundblocks_music[i].handle=handle
end
--This is the actual code that plays the sound:
minetest.register_on_punchnode(function(pos, node, puncher)
if node.name=="loyall:stereo_right" then
if soundblocks_get_handle(pos)==0 then
local handle=0
handle = minetest.sound_play("03_Istanbul_Not_Constantinople", { --name of sound, file name extension is .ogg
pos = pos, --pos where sound comes from
gain = 10.0,
max_hear_distance = 2560,}) --sound gets lower the farer you get away from the jukebox
soundblocks_set_handle(pos, handle)
else
minetest.sound_stop(soundblocks_get_handle(pos))
soundblocks_set_handle(pos, 0)
end
end
end)

1
sounds/README.txt Normal file
View File

@ -0,0 +1 @@
Put your OGG files here.

BIN
textures/stereo_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B