Giter Site home page Giter Site logo

flameddogo99 / eaglermobile Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 15.0 2.44 MB

A userscript that allows EaglerCraft to run on mobile browsers. As of June 15, 2023, the Eagler Mobile script is directly integrated with the main EaglerCraft website!

License: Apache License 2.0

eaglercraft javascript userscript eaglerforge eaglermobile modding

eaglermobile's Introduction

Eagler Mobile LogoEagler Mobile

About

Eagler Mobile brings new functionality and benefits for the EaglerCraft web client by providing mobile-friendly touch controls, keyboard access, and other settings configurable through the EaglerCraft client.

Eagler Mobile Screenshot

Installation

The easiest way to use Eagler Mobile is to use a userscript application such as Greasemonkey, however since Eagler Mobile is plain JavaScript you can easily deploy it in other ways as well. As an example we've included eaglermobile.ef.js which can be run as a mod on EaglerForge.

See more examples
  1. Self hosted

If you are hosting the EaglerCraft client on your own server, you can include the mobile script in the index.html folder as a script.

<script type="text/javascript" src="yourDirectory/eaglermobile.user.js"></script>
  1. Other userscript applications

Non-mobile browsers:

  • Chrome, FireFox, Safari, Edge, Opera Next, Microsoft Edge: Tampermonkey

iOS:

Android:


If you want to download the source, no building is required. The best way to download the source is with Git:

git clone https://github.com/FlamedDogo99/EaglerMobile.git

Contributing

Suggestions and bug reports

If you found a bug or have a suggestion create an issue after checking for duplicates.

Code

Before contributing code, please read our contributing guidelines.

Features and documentation

Fake API's

  • Pointerlock methods such as Element.prototype.requestPointerLock, document.pointerLockElement, and document.exitPointerLock are replaced with vanilla JavaScript that mimics pointerlock functionality. This allows the EaglerCraft client to load.
  • Fullscreen methods such as Element.prototype.requestFullscreen, document.fullscreenElement, and document.exitFullscreen are replaced with vanilla JavaScript that mimics fullscreen functionality. This fixes a crash due with viewport dimensions.

Keyboard Events

  • The EaglerCraft client captures keypress through a keydown event listener. Because Android devices currently have an issue with keydown and keyup events, Eagler Mobile dynamically toggles between capturing keydown and input events. The state is saved in window.keyboardFix, and is toggled if a faulty keyboard event is detected.
  • To dispatch keyboard events, Eagler Mobile requires the use of the keyEvent function, in order to maintain functionality for input event listeners. For example, typing an uppercase h in the chat is as simple as:
    keyEvent("shift", "keydown"); 
    keyEvent("h", "keydown");

Mobile controls

  • Eagler Mobile controls can either be shown in-game or in-menu. When creating a an element you can achieve this simply by either adding the inGame or inMenu class.
  • Simple gesture controls such as scrolling, single pressing, and long pressing have been implemented, however there are currently no functions provided to easily bring this functionality to other elements.

File uploads

  • On MacOS and iOS safari, the EaglerCraft client's implementation of triggering the file selection dialog does not work. A rudimentary fix has been added for now.

License

Eagler Mobile is licensed under the terms of the Apache License, Version 2.0.

Intended future features

  • Gamepad support: Mapping gamepad inputs to keyEvent, wheelEvent and mouseEvent functions, and implenting a controllable fake cursor for menus.
  • File upload improvements: Adding a cancel button and improving the styling
  • Dynamic enable and disable of features: Seperating gamepad controls, touch controls, pointerlock fix, and upload fix into seperate functions which can be enabled and disabled by the user

eaglermobile's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eaglermobile's Issues

Half of features listed made

Hey I didn't make a pull request but I did make a github repo of the code updated. Here is what has been done to it:

  • Chat bug fix
  • Pause button not always showing
  • UI positioning change
  • Hold crouch lock
  • Separate sprint button
  • Strafe forward left/right added
  • Custom icons

(It's in my profile)

[Bug] Inconsistent Behavior for World Upload

Describe the Bug
Uploading a vanilla Minecraft world either leads to a crash, or the file uploader won’t dismiss itself
Steps to Reproduce

  1. Start EaglerCraft client with EaglerMobile userscript
  2. Tap the screen to start the client, and wait for it to load
  3. Navigate to the main menu by hitting done when presented with the edit profile menu
  4. Select single player, create new world, import world, and then upload the world file attached below
  5. Observe a crash, or the file uploader not disappearing

Additional Information
My user agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1

Eagler Mobile version: 2.4

Screenshot of the file uplaoder not being dismissed after selecting a file:
IMG_0602

The vanilla Minecraft world used in the screenshot:
20 MORE Doors in 100 Seconds! - Copy.zip

[Bug] Can't type in chat

Describe the Bug
Reported by @RealPlurr:

You cannot type into the chat

Steps to Reproduce

  1. Start EaglerCraft client with Eagler Mobile
  2. Join a server or create a new world
  3. Press the chat 💬 button on the top row of buttons
  4. Press the keyboard ⌨️ button on the top row of buttons
  5. Note that typing does not type into the chat

Additional Information
Browser google and chrome. Latest version available from google play market. Phone redmi 8 using google keyboard and android version 10, MIUI 12.5.3 (stable version)
337540109-5adc1b21-62a0-4dd4-ab78-ae4e27f32181

There is also no blinking "_" when opening the chat

[Bug] Keyboard issue on Android mobile devices

Describe the Bug
Keyboard doesn't work correctly (or at all) on android phone (redmi 8). Wont type in chat or and wont type in username field.

Steps to Reproduce
Start launcher, click keyboard button try to type and see it works broken or dont work at all.

Additional Information
Browser google and chrome. Latest version available from google play market. Phone redmi 8 using google keyboard and android version 10, MIUI 12.5.3 (stable version)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.