wishlist – How to move Wish List next to Qty input box in product detail page?

To move the element next to the input box you have to create these files in your local theme:

app/design/frontend/Custom/default/Magento_Wishlist/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="view.addto.wishlist" remove="true"/>
        <referenceBlock name="product.info.addtocart">
            <block class="MagentoWishlistBlockCatalogProductViewAddToWishlist" name="add-to-wishlist" template="Magento_Wishlist::catalog/product/view/addto/wishlist.phtml"/>
        </referenceBlock>
    </body>
</page>

app/design/frontend/Custom/default/Magento_Catalog/templates/product/view/addtocart.phtml

<?php
/** @var $block MagentoCatalogBlockProductView */
?>
<?php $_product = $block->getProduct(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
<?php if ($_product->isSaleable()) :?>
<div class="box-tocart">
    <div class="fieldset">
        <?php if ($block->shouldRenderQuantity()) :?>
        <div class="field qty">
            <label class="label" for="qty"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
            <div class="control">
                <input type="number"
                       name="qty"
                       id="qty"
                       min="0"
                       value="<?= $block->getProductDefaultQty() * 1 ?>"
                       title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
                       class="input-text qty"
                       data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                       />
                <span class="product-social-links">
                    <span clas="product-addto-links" data-role="add-to-links">
                        <?= $block->getBlockHtml('add-to-wishlist') ?>
                    </span>
                </span>

            </div>

        </div>

        <?php endif; ?>
        <div class="actions">
            <button type="submit"
                    title="<?= $block->escapeHtmlAttr($buttonTitle) ?>"
                    class="action primary tocart"
                    id="product-addtocart-button" disabled>
                <span><?= $block->escapeHtml($buttonTitle) ?></span>
            </button>
            <?= $block->getChildHtml('', true) ?>
        </div>
    </div>
</div>
<?php endif; ?>
<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "Magento_Catalog/js/validate-product": {}
        }
    }
</script>

The wishlist block will then appear next to the input field in the dom. You will have to use css for the finishing touch:

enter image description here

unity – How to move one Game unit with every key press?

I have a tile board set up with 500 x 500 pixels = 1 unit. I have code that will move the object over time.

    void Update()
{
    Vector2 pos = transform.position;

    if (Input.GetKey("w"))
    {
        pos.y += speed * Time.deltaTime;
    }
    if (Input.GetKey("s"))
    {
        pos.y -= speed * Time.deltaTime;
    }
    if (Input.GetKey("d"))
    {
        pos.x += speed * Time.deltaTime;
    }
    if (Input.GetKey("a"))
    {
        pos.x -= speed * Time.deltaTime;
    }
    transform.position = pos;
}

I want to move 1 unit after each button press and only by integer values. Speed is a public variable that sets how fast the object moves.

Thanks for the help.

dnd 5e – Does the bonus-action shove from the (UA) Telekinetic feat move the target through the air, or only on the ground?

Imagine a party of PCs exploring a dungeon inside a volcano. After a climactic confrontation with the Big Bad, the volcano begins to erupt, and the PCs must flee for their lives. Unfortunately, one of the PCs — Tarly Target — is badly injured and can barely walk. Working together to carry Target, the PCs race toward the volcano’s mouth. Just as freedom nears, a sudden quake tears open the path before them, creating a 15-foot chasm that begins filling with molten lava. There’s no way Target can make the jump.

Psimon Psion, a PC with the Telekinetic feat (from Unearthed Arcana: Psionic Options Revisited), proposes to use the feat to try to hurl Target across the chasm. The feat’s third bullet says:

As a bonus action, you can try to telekinetically shove one creature you can see within 30 feet of you. When you do so, roll your Psionic Talent die, and the target must succeed on a Strength saving throw (DC 8 + your proficiency bonus + the ability modifier of the score increased by this feat) or be moved toward you or away from you a number of feet equal to 5 times the number you rolled. A creature can willingly fail this save.

Assuming Psion could roll a 3 or greater on his Psionic Talent Die, sufficient to move Target the full 15 feet required to clear the chasm, is this a viable use of the feat? Must Target remain in contact with the ground the entire time he’s being moved by the shove, such that he’d immediately plunge to his doom once moved over the chasm? Or can the shove actually propel him through the air to the other side?

For completeness’s sake, I note the following:

  • The normal shove action (PHB p. 195-196) only moves a creature a maximum of 5 feet, so it does not offer much guidance here.
  • The telekinesis spell (PHB p. 280-281) can move a creature, but the move is not characterized as a shove and explicitly can hold the target in mid-air, so it is not helpful here either.

unity – How can I move object to target then do something when reaching the target and then to move back to it’s original position?

Inside Update :

if (finalLookWeight > 0.95f) // here you can play with a value between 0.95f -> 1.0f
                {
                    if (primaryTarget.interactableMode == InteractableItem.InteractableMode.Action
                        && IsAlreadyThrown == false)
                    {
                        // call your funtion to shoot something here
                        StartCoroutine(ThrowObject(objToThrow.transform, primaryTarget.transform, throwSpeed));
                        IsAlreadyThrown = true;
                    }
                }

I’m using a helper flag IsAlreadyThrown so the Coroutine will not start over and over again nonstop.
But I also want to be able from outside this script using in other script to change the flag IsAlreadyThrown back to false at some places/times in the game. How can I make that I can change the flag to false from other scripts ?

And inside the ThrowObject method I did :

IEnumerator ThrowObject(Transform objectToMove, Transform toPosition, float duration)
    {
        float counter = 0;

        while (counter < duration)
        {
            counter += Time.deltaTime;
            Vector3 currentPos = objectToMove.position;

            float time = Vector3.Distance(currentPos, toPosition.position) / (duration - counter) * Time.deltaTime;

            objectToMove.position = Vector3.MoveTowards(currentPos, toPosition.position, time);

            yield return null;
        }

        //StartCoroutine(ThrowBack(objectToMove, toPosition, duration));
    }

And :

IEnumerator ThrowBack(Transform objectToMove, Transform toPosition, float duration)
{
    float counter = 0;

    while (counter < duration)
    {
        counter += Time.deltaTime;
        Vector3 currentPos = objectToMove.position;

        float time = Vector3.Distance(currentPos, toPosition.position) / (duration - counter) * Time.deltaTime;

        objectToMove.position = Vector3.MoveTowards(toPosition.position, currentPos, time);

        yield return null;
    }
}

The first part is working fine the ThrowObject but then I tried to start the second Coroutine ThrowBack but it’s just not doing anything. The object is not moving and stay in the target position. It’s getting to the line :

objectToMove.position = Vector3.MoveTowards(toPosition.position, currentPos, time);

but the objectToMove just stay in position.

This is what I want to do more or less :

IEnumerator ThrowObject(Transform objectToMove, Transform toPosition, float duration)
    {
        float counter = 0;

        while (counter < duration)
        {
            counter += Time.deltaTime;
            Vector3 currentPos = objectToMove.position;

            float time = Vector3.Distance(currentPos, toPosition.position) / (duration - counter) * Time.deltaTime;

            objectToMove.position = Vector3.MoveTowards(currentPos, toPosition.position, time);

            yield return null;
        }

        DoStuff(objectToMove, toPosition, duration);
    }

    void DoStuff(Transform objectToMove, Transform toPosition, float duration)
    {
        // do things when finish start the ThrowBack

        StartCoroutine(ThrowBack(objectToMove, toPosition, duration));
    }

At least this is the logic I want to do.

dnd 5e – Does the bonus action shove from Unearthed Arcana’s Telekinetic feat move the target through the air, or only on the ground?

Imagine a party of PCs exploring a dungeon inside a volcano. After a climactic confrontation with the Big Bad, the volcano begins to erupt, and the PCs must flee for their lives. Unfortunately, one of the PCs — Tarly Target — is badly injured and can barely walk. Working together to carry Target, the PCs race toward the volcano’s mouth. Just as freedom nears, a sudden quake tears open the path before them, creating a 15-foot chasm that begins filling with molten lava. There’s no way Target can make the jump.

Psimon Psion, a PC with the Telekinetic feat from Unearthed Arcana’s “Psionic Options Revisited”, proposes to use the feat to try to hurl Target across the chasm. The feat’s third bullet says:

As a bonus action, you can try to telekinetically shove one creature you can see within 30 feet of you. When you do so, roll your Psionic Talent die, and the target must succeed on a Strength saving throw (DC 8 + your proficiency bonus + the ability modifier of the score increased by this feat) or be moved toward you or away from you a number of feet equal to 5 times the number you rolled. A creature can willingly fail this save.

Assuming Psion could roll a 3 or greater on his Psionic Talent Die, sufficient to move Target the full 15 feet required to clear the chasm, is this a viable use of the feat? Must Target remain in contact with the ground the entire time he’s being moved by the shove, such that he’d immediately plunge to his doom once moved over the chasm? Or can the shove actually propel him through the air to the other side?

For completeness’s sake, I note the following:

  • The normal shove action (PHB p. 195-196) only moves a creature a maximum of 5 feet, so it does not offer much guidance here.
  • The telekinesis spell (PHB p. 280-281) can move a creature, but the move is not characterized as a shove and explicitly can hold the target in mid-air, so it is not helpful here either.

hard drive – How do I move a partition in on macOS?

I’m migrating data from a 525GB drive to a 1TB drive. Part of the reason I’m doing this is the APFS container got messed up on the 525GB drive (I have backups).

The first thing did was dd the data from the 525GB drive to the 1TB drive (partition table and all). Of course, the partition table was wrong (and diskutil verifyDisk reported this) since it was too small for the 1TB drive. I fixed that with diskutil repairDisk.

Then I deleted the APFS container (since it was messed up and I plan to copy the data from a Time Machine backup). The space where the APFS container was is the Untitled partition.

So now the partition table looks like this:

/dev/disk2 (internal, physical):
   #:                       TYPE NAME                           SIZE        IDENTIFIER
   0:      GUID_partition_scheme                               *960.2 GB    disk2
   1:                        EFI EFI                            209.7 MB    disk2s1
   2:                  Apple_HFS Untitled                       314.0 GB    disk2s2
   3:                  Apple_HFS UEFI Boot Manager              1.0 GB      disk2s3
   4:       Microsoft Basic Data BOOTCAMP                       209.6 GB    disk2s4

As you can see, the sizes of the partitions don’t add up to the size of the disk. I’d like to resize disk2s2 to fill the remaining space on my 1TB drive. However, diskutil resizeVolume won’t expand that partition any further because it’s already up against disk2s3 and disk2s4. I’d like to move my disk2s3 and disk2s4 partitions to the end of the drive (right now they’re at the end of the first 525GB of the drive.

How do I move partitions in macOS?

keyboard – Can’t move the cursor in text editor with left and right arrow

I’m having an annoying issue and need your help. While typing in a text editor or chat, I can’t move my typing cursor by left and right arrows. However, if I press (command + left/right), the cursor can move to the next word. I think I may unconsciously change a setting somewhere.

Any help is appreciated. Thank you!

How to move shared item to “my drive” (for later sync to harddrive) in Google drive

Google recently made a change to how files are shared in Google Drive according to this article.

https://www.androidpolice.com/2020/04/10/google-completely-ruined-shared-folders-in-drive/

When this change first came about you could still access the “move to my drive” feature by the obscure shift + z shortcut.

It seems now however that this shortcut ALSO only offers the option of creating a link, just a dragging the item to “my drive” does now.

Was this a loop hole that Google decided to remove or have they hid the feature behind yet another obscure keyboard shortcut?

I apologize that the screenshot is in swedish, but the button now says “Add shortcut” where it previously said “Add” (as in “Add to my drive”)

enter image description here

dnd 5e – Can Specters move into the ground to avoid Attacks of Opportunity?

In 5e, Specters have Incorporeal Movement which says

The specter can move through other creatures and objects as if they were difficult terrain. It takes 5(1d10) force damage if it ends its turn inside an object.

Therefore, I assume Specters can move through ground as if it were difficult terrain.

Could a specter attack a creature, move into its space and then move straight down into the ground to avoid an Attack of Opportunity? Regardless if it would be intelligent enough to do so, would the AoO happen before it is fully submerged below ground or would the ground protect the Specter?

My guess would be the ground would protect it because once it leaves the 5ft reach of its target, it would be mostly submerged.