Merge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
gooseman 2022-09-03 15:08:04 -07:00
commit f727ab4a2e
35 changed files with 49 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -176,7 +176,7 @@ if (document.readyState === "complete" ||
document.addEventListener("DOMContentLoaded", bsTriggerOnReady);
}
function post_toast(t, url, button1, button2, classname) {
function post_toast(t, url, button1, button2, classname, extra_actions) {
let isShopConfirm = t.id.startsWith('buy1-go') || t.id.startsWith('buy2-go');
if (!isShopConfirm)
@ -208,6 +208,8 @@ function post_toast(t, url, button1, button2, classname) {
document.getElementById(button2).classList.toggle(classname);
}
}
if (extra_actions) extra_actions(xhr);
} else {
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];

View File

@ -40,13 +40,13 @@ def buy_hat(v, hat_id):
if request.values.get("mb"):
if v.procoins < hat.price: return {"error": "Not enough marseybux."}, 400
v.procoins -= hat.price
hat.author.procoins += hat.price * 0.05
hat.author.procoins += hat.price * 0.1
currency = "marseybux"
else:
if v.coins < hat.price: return {"error": "Not enough coins."}, 400
v.coins -= hat.price
v.coins_spent_on_hats += hat.price
hat.author.coins += hat.price * 0.05
hat.author.coins += hat.price * 0.1
currency = "coins"
new_hat = Hat(user_id=v.id, hat_id=hat.id)
@ -58,7 +58,7 @@ def buy_hat(v, hat_id):
if v.id != hat.author.id:
send_repeatable_notification(
hat.author.id,
f":marseycapitalistmanlet: @{v.username} has just bought `{hat.name}`, you have received your 5% cut ({int(hat.price * 0.05)} {currency}) :!marseycapitalistmanlet:"
f":marseycapitalistmanlet: @{v.username} has just bought `{hat.name}`, you have received your 10% cut ({int(hat.price * 0.05)} {currency}) :!marseycapitalistmanlet:"
)
if v.num_of_owned_hats >= 250:

View File

@ -478,12 +478,15 @@ def transfer_bux(v, username):
if not v.shadowbanned:
receiver.procoins += amount
log_message = f"@{v.username} has transferred {amount} Marseybux to @{receiver.username}"
send_repeatable_notification(GIFT_NOTIF_ID, log_message)
log_message = f"@{v.username} has transferred {amount} marseybux to @{receiver.username}"
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount} marseybux!"
notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount} Marseybux!"
if reason:
if len(reason) > 200: return {"error": "Reason is too long, max 200 characters"},400
notif_text += f"\n\n> {reason}"
log_message += f"\n\n> {reason}"
send_repeatable_notification(GIFT_NOTIF_ID, log_message)
send_repeatable_notification(receiver.id, notif_text)
g.db.add(receiver)

View File

@ -16,6 +16,25 @@
{% endblock %}
{% block content %}
<script>
function equip_hat(t, hat_id, hat_name) {
const old_unequip_btn = document.querySelector(".unequip:not(.d-none)");
const profile_img = document.getElementById("profile-pic-35-hat");
function extra_actions(xhr) {
if(xhr.status != 200) return
if (old_unequip_btn) {
old_unequip_btn.classList.add('d-none');
old_unequip_btn.nextElementSibling.classList.remove('d-none');
}
profile_img.src = `/i/hats/${hat_name}.webp?v=1`
profile_img.classList.remove('d-none')
}
post_toast(t, `/equip_hat/${hat_id}`, `equip-${hat_id}`, `unequip-${hat_id}`, `d-none`, extra_actions)
}
</script>
<pre>
</pre>
@ -53,22 +72,20 @@
<div id="if-not-owned-{{hat.id}}">
<a id="buy1-{{hat.id}}" class="btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy1-go-{{hat.id}}').classList.remove('d-none')"><span class="m-auto">Buy</span></a>
<a id="buy1-go-{{hat.id}}" class="d-none btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" role="button" onclick="post_toast(this, '/buy_hat/{{hat.id}}', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none')"><span class="m-auto">Are you sure?</span></a>
<a id="buy1-go-{{hat.id}}" class="d-none btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" role="button" onclick="post_toast(this, '/buy_hat/{{hat.id}}', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-coins-amount').innerHTML-={{hat.price}}})"><span class="m-auto">Are you sure?</span></a>
{% if FEATURES['PROCOINS'] %}
<a id="buy2-{{hat.id}}" class="marseybux btn btn-success {% if v.procoins < hat.price %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy2-go-{{hat.id}}').classList.remove('d-none')"><span class="m-auto">MBux</span></a>
<a id="buy2-go-{{hat.id}}" class="d-none marseybux btn btn-success {% if v.procoins < hat.price %}disabled{% endif %}" role="button" onclick="post_toast(this, '/buy_hat/{{hat.id}}?mb=true', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none')"><span class="m-auto">Are you sure?</span></a>
<a id="buy2-go-{{hat.id}}" class="d-none marseybux btn btn-success {% if v.procoins < hat.price %}disabled{% endif %}" role="button" onclick="post_toast(this, '/buy_hat/{{hat.id}}?mb=true', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-bux-amount').innerHTML-={{hat.price}}})"><span class="m-auto">Are you sure?</span></a>
{% endif %}
</div>
{% endif %}
<div id="if-owned-{{hat.id}}" {% if hat.id not in owned_hat_ids %}class="d-none"{% endif %}>
{% if hat.id == v.equipped_hat.id %}
<a class="unequip btn btn-success" role="button" onclick="post_toast(this,'/unequip_hat', true)"><span class="m-auto">Unequip</span></a>
{% else %}
<a class="equip btn btn-success" role="button" onclick="post_toast(this,'/equip_hat/{{hat.id}}', true)"><span class="m-auto">Equip</span></a>
{% endif %}
<a id="unequip-{{hat.id}}" class="unequip {% if hat.id != v.equipped_hat.id %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this, '/unequip_hat', 'equip-{{hat.id}}', 'unequip-{{hat.id}}', 'd-none');document.getElementById('profile-pic-35-hat').classList.add('d-none')"><span class="m-auto">Unequip</span></a>
<a id="equip-{{hat.id}}" class="equip {% if hat.id == v.equipped_hat.id %}d-none{% endif %} btn btn-success" role="button" onclick="equip_hat(this, '{{hat.id}}', '{{hat.name}}')"><span class="m-auto">Equip</span></a>
</div>
</td>
</tr>

View File

@ -5,7 +5,7 @@
<nav class="shadow-md fixed-top">
<style>
body {padding-top: 83.9px !important}
body {padding-top: 83.8px !important}
@media (max-width: 767.98px) {
body {
padding-top: 69.55px !important
@ -207,7 +207,9 @@
<div class="profile-pic-35-wrapper">
<img loading="lazy" src="{{v.profile_url}}" class="profile-pic-35">
{% if v.hat_active -%}
<img class="profile-pic-35-hat hat" loading="lazy" src="/i/hats/{{v.hat_active}}?v=1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
<img id="profile-pic-35-hat" class="profile-pic-35-hat hat" loading="lazy" src="/i/hats/{{v.hat_active}}?v=1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
{% elif request.path == '/hats' %}
<img id="profile-pic-35-hat" class="profile-pic-35-hat hat d-none" loading="lazy" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
{%- endif %}
</div>
<div class="text-left pl-2">

View File

@ -17,7 +17,7 @@ set CACHE_VER = {
'css/win98.css': 63,
'js/award_modal.js': 255,
'js/bootstrap.js': 279,
'js/bootstrap.js': 280,
'js/category_modal.js': 200,
'js/comments+submission_listing.js': 269,
'js/comments_admin.js': 255,

View File

@ -1484,10 +1484,10 @@ insert into hat_defs (name, description, author_id, price) values
('Top Hat (leprechaun)', 'LLM but Irish', 2, 500),
('Drinky Beer Hat', 'I actually didn''t know these were real things until I made this', 2, 500),
('Viking', 'Rape, pillage, never bathe. Live the dream.', 2, 500),
('Nonspecific Military Officer Hat', '[removed]', 2, 1000),
('Soviet Officer I', 'OUR hat', 2, 1000),
('Nonspecific Military Officer Hat II', '[removed]', 2, 1000),
('Soviet Officer II', 'High fashion war criminal chic', 2, 1000),
('Nonspecific Military Officer Hat', '[removed]', 2, 500),
('Soviet Officer I', 'OUR hat', 2, 500),
('Nonspecific Military Officer Hat II', '[removed]', 2, 500),
('Soviet Officer II', 'High fashion war criminal chic', 2, 500),
('Southern Gentleman', 'Slaveowner? Fried chicken chain founder? You decide!', 2, 500),
('Cowboy I', 'Make him wish he could quit you', 2, 500),
('Cowboy II', 'You''re my favorite deputy!', 2, 500),

View File

@ -62,10 +62,10 @@ insert into hat_defs (name, description, author_id, price) values
('Top Hat (leprechaun)', 'LLM but Irish', 2, 500),
('Drinky Beer Hat', 'I actually didn''t know these were real things until I made this', 2, 500),
('Viking', 'Rape, pillage, never bathe. Live the dream.', 2, 500),
('Nonspecific Military Officer Hat', '[removed]', 2, 1000),
('Soviet Officer I', 'OUR hat', 2, 1000),
('Nonspecific Military Officer Hat II', '[removed]', 2, 1000),
('Soviet Officer II', 'High fashion war criminal chic', 2, 1000),
('Nonspecific Military Officer Hat', '[removed]', 2, 500),
('Soviet Officer I', 'OUR hat', 2, 500),
('Nonspecific Military Officer Hat II', '[removed]', 2, 500),
('Soviet Officer II', 'High fashion war criminal chic', 2, 500),
('Southern Gentleman', 'Slaveowner? Fried chicken chain founder? You decide!', 2, 500),
('Cowboy I', 'Make him wish he could quit you', 2, 500),
('Cowboy II', 'You''re my favorite deputy!', 2, 500),