Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
55 changes: 55 additions & 0 deletions .github/workflows/anylinux-appimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: AnyLinux AppImage (sharun, portable total)

on:
workflow_dispatch:

jobs:
build:
name: "Trinity AnyLinux (${{ matrix.arch }})"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runs-on: ubuntu-24.04
- arch: aarch64
runs-on: ubuntu-24.04-arm
# Regla anylinux: compilar SOLO en Arch Linux (Fedora/Ubuntu rompen el deploy)
container: ghcr.io/pkgforge-dev/archlinux:latest

steps:
- name: Clonar repositorio Trinity
uses: actions/checkout@v4

# El engine viaja vendoreado en mcpe-nx/ (subtree de SrDicov/mcpe-next):
# cero credenciales extra en CI.
- name: Construir AppImage AnyLinux
run: |
sleep 10 # el runner a veces monta el checkout del commit anterior
sh ./trinity-appimage.sh

- name: Subir artefacto
uses: actions/upload-artifact@v4
with:
name: Trinity_Launcher-${{ matrix.arch }}-anylinux
path: dist

release:
if: ${{ needs.build.result == 'success' }}
needs: [build]
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: Trinity_Launcher-*-anylinux
merge-multiple: true

- name: Subir a Release (latest)
uses: softprops/action-gh-release@v2
with:
tag_name: latest
files: |
Trinity_Launcher-*.AppImage
*.zsync
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AGENTS.md

Qt6/C++17 desktop launcher for Minecraft Bedrock on Linux. Frontend only — game execution needs external `mcpelauncher` binaries.

## Build / run (use these, don't guess)

- First time: `make start` (deps + release build + run). Dev loop: `make run`. Release only: `make build`. Debug: `make debug`.
- Direct equivalent: `./build.sh --release --run` (dev, foreground logs) or `./build.sh --release --run --detached` (background). Binary lands at `build/app/trinity`.
- Deps only: `make deps` / `./build.sh --deps-only`. Clean: `make clean` (also fixes root-owned `build/` perms). Install: `make install` (`/usr/local/bin` + icons, prompts sudo internally).
- Never run `build.sh`/`make` with `sudo` — the script calls `sudo` itself only for deps/install. `CONTRIBUTING.md`'s `qmake` snippet is stale; use CMake/`build.sh`.
- `build.sh` forces `clang++`, `-msse3`, and Ninja when available. Manual configure must match: `cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang` then `cmake --build build --parallel $(nproc)`.
- CI (`.github/workflows/compilar.yml`) is just `./build.sh --deps` then `./build.sh --release` on ubuntu-latest. No tests, linter, or typecheck exist — verify by compiling + running.
- AppImage release: `.github/workflows/anylinux-appimage.yml` (matrix x86_64 + aarch64) runs `sh ./trinity-appimage.sh` inside `ghcr.io/pkgforge-dev/archlinux:latest`. AnyLinux rules: build on Arch only, install everything to `/usr` before deploy, pass binaries as args to `quick-sharun` (never copy `.so` by hand), never use `linuxdeploy`. Legacy Ubuntu+linuxdeploy workflows (`simple-`, `nightly-`, `appimage-arm-`, `qt5-old-`) are superseded — don't copy their `LD_LIBRARY_PATH` AppRun pattern.

## Runtime prerequisite

- `mcpelauncher-client` and `mcpelauncher-extract` must be on `PATH` (built separately from `mcpelauncher-manifest`, `qt6` branch — see `docs/BUILD.md`). Without them the UI runs but launch/extract fails.
- Never delete `~/.local/share/mcpelauncher/` (worlds/saves live there); uninstall preserves it.
- On x86_64, Bedrock >26.33 is unsupported; `TrinityUI` compiles in a `SHOW_X86_64_WARNING` banner (opt out with `-DDISABLE_X86_64_WARNING=ON`).

## Layout

- Entry: `app/src/main.cpp` → `qt_add_executable(trinity)` in `app/CMakeLists.txt`, links `TrinityCore` + `TrinityUI`.
- `src/TrinityLib/core/` + `include/TrinityLib/core/` → static `TrinityCore`: `version_manager`, `game_launcher`, `pack_installer`, `version_config`, `exporter`, `discord_manager`, `color_extractor`.
- `src/TrinityLib/ui/` + `include/TrinityLib/ui/` → static `TrinityUI` (links `TrinityCore` privately): `windows/launcher_window`, `windows/trinito_window`, `dialogs/extract_dialog`, `widgets/version_selector`, `app_helpers`.
- Root `CMakeLists.txt` wires `src/TrinityLib/core` → `src/TrinityLib/ui` → `app` → `src/mini-matugen-j`, then embeds translations. Qt modules: `Core Widgets Concurrent Network LinguistTools`.
- Assets live in `resources/` (`resources.qrc`, `fonts/`, `branding/`, `shortcuts/`, `runtime/`, `i18n/`). Nix (`flake.nix`) and Docker (`Dockerfile`, `compose.yaml`) are alternate envs only; `packaging/` is distro packaging.

## Translations (easy to break)

- Source of truth: `resources/i18n/*.ts` (Spanish `trinity_es.ts` is the base). Update strings with `make translations` / `./build.sh --update-ts` (runs `lupdate src/ include/` + `lrelease`), never hand-edit `.qm` files.
- Adding a language requires 3 touches: new `.ts` file, register in root `CMakeLists.txt` (`qt_standard_project_setup` langs + `TS_FILES`/`QM_FILES`), and add the `.qm` alias under `<qresource prefix="/i18n">` in `resources/resources.qrc`. See `TRANSLATION.md`; keep `%1`-style placeholders and `&` shortcuts intact.

## Conventions

- `camelCase` funcs/vars, `PascalCase` classes, `UPPER_SNAKE_CASE` consts, `snake_case` files, lowercase dirs. Doxygen-comment public functions (`/** ... */`).
- Conventional Commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`). Keep diffs minimal — project prioritizes stability over optimization; don't unsolicitedly refactor/optimize.
34 changes: 34 additions & 0 deletions mcpe-nx/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Linux, macOS]
- Version [e.g. v0.3.0-AppImage-x86_64-0.0.677 (build 677)]
- Installation Type [e.g. AppImage, flatpak, dmg or built from source]

Not supported is a similar looking app in the snap store.

**Additional context**
Add any other context about the problem here.
8 changes: 8 additions & 0 deletions mcpe-nx/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Checkout the wiki
url: https://mcpelauncher.readthedocs.io
about: You find useful information about this launcher
- name: Ask on Discord
url: https://discord.gg/TaUNBXr
about: You can ask for help here!
20 changes: 20 additions & 0 deletions mcpe-nx/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 4 additions & 0 deletions mcpe-nx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build-browser/
build-remote/
beta-test/
build/
162 changes: 162 additions & 0 deletions mcpe-nx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
cmake_minimum_required(VERSION 3.5)

enable_language(C CXX ASM)

set(CMAKE_CXX_STANDARD 17)

set(IS_64BIT FALSE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(IS_64BIT TRUE)
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

string(TIMESTAMP BUILD_TIMESTAMP "%Y%m%d-%H%M%S" UTC)

set(IS_ARM_BUILD FALSE)
set(IS_ARMHF_BUILD FALSE)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
set(IS_ARM_BUILD TRUE)
set(IS_ARMHF_BUILD TRUE)
elseif(BUILD_X86)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -m32")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
if(APPLE)
set(CMAKE_LIBRARY_ARCHITECTURE "i386-apple-darwin")
set(CMAKE_CXX_COMPILER_TARGET "i686-apple-darwin")
else()
set(CMAKE_LIBRARY_ARCHITECTURE "i386-linux-gnu")
set(CMAKE_CXX_COMPILER_TARGET "i686-linux-gnu")
endif()
endif()

set(DEB_OS_NAME "none" CACHE STRING "Specifies the target OS for building the debs (ubuntu-xenial, ubuntu-bionic, ubuntu-disco)")
mark_as_advanced(DEB_OS_NAME)

find_program(GIT_EXEC git)
mark_as_advanced(GIT_EXEC ADVANCED)
function(git_commit_hash DIR OUT_VAL)
if (GIT_EXEC)
execute_process(
COMMAND ${GIT_EXEC} log -1 --format=%h
WORKING_DIRECTORY ${DIR}
OUTPUT_VARIABLE OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(${OUT_VAL} ${OUTPUT} PARENT_SCOPE)
else()
set(${OUT_VAL} "" PARENT_SCOPE)
endif()
endfunction()
git_commit_hash(${CMAKE_SOURCE_DIR} MANIFEST_GIT_COMMIT_HASH)

option(BUILD_CLIENT "Enables building of the client launcher." ON)
option(BUILD_UI "Enables building of the client ui requires qt." ON)
option(BUILD_TESTING "Build tests for cll-telemetry (requires GTest)" OFF)

if (APPLE)
set(NATIVES_PATH_DIR "${CMAKE_SOURCE_DIR}/mcpelauncher-mac-bin")
set(NATIVES_PATH_LIB_DIR "${NATIVES_PATH_DIR}/lib")
else()
set(NATIVES_PATH_DIR "${CMAKE_SOURCE_DIR}/mcpelauncher-linux-bin")
set(NATIVES_PATH_LIB_DIR "${NATIVES_PATH_DIR}/lib")
endif()

option(ENABLE_DEV_PATHS "Enables lookup in source directories for misc files required by the launcher. This should be disabled for package builds." ON)
if (ENABLE_DEV_PATHS)
add_definitions(-DDEV_EXTRA_PATHS="${NATIVES_PATH_DIR}:${CMAKE_BINARY_DIR}/gamecontrollerdb")
endif()

option(USE_OWN_CURL "Builds CURL as an ExternalProject dependency" ON)
if (USE_OWN_CURL)
include(ext/curl.cmake)
endif()

include(ext/json.cmake)

option(USE_GAMECONTROLLERDB "Downloads gamecontrollerdb.txt from gabomdq/SDL_GameControllerDB" ON)
if (USE_GAMECONTROLLERDB AND BUILD_CLIENT)
include(ext/gamepad_mappings.cmake)
endif()

option(USE_SNMALLOC "Use the snmalloc allocator" OFF)
option(USE_SDL3_AUDIO "Always use SDL audio" ON)

if (BUILD_CLIENT)
if (USE_SNMALLOC)
include(ext/snmalloc.cmake)
endif()

include(game-window/BuildSettings.cmake)
if (USE_SDL3_AUDIO OR GAMEWINDOW_SYSTEM STREQUAL "SDL3")
if(NOT GAMEWINDOW_SYSTEM STREQUAL "SDL3")
set(SDL_WAYLAND OFF CACHE BOOL "" FORCE)
endif()
include(ext/sdl3.cmake)
endif()
if (GAMEWINDOW_SYSTEM STREQUAL "EGLUT")
add_subdirectory(eglut)
add_subdirectory(linux-gamepad)
elseif (GAMEWINDOW_SYSTEM STREQUAL "GLFW")
include(ext/glfw.cmake)
endif()
endif()

option(BUILD_WEBVIEW "Build webview for xboxlive login" ON)
if (BUILD_WEBVIEW AND BUILD_UI)
add_subdirectory(mcpelauncher-webview)
endif()

if (APPLE)
add_subdirectory(osx-elf-header)
add_subdirectory(epoll-shim)
endif()

if (BUILD_CLIENT)
add_subdirectory(logger)
add_subdirectory(base64)
add_subdirectory(file-util)
add_subdirectory(properties-parser)
add_subdirectory(arg-parser)

add_subdirectory(mcpelauncher-linker)
add_subdirectory(libc-shim)
# MSA is only required with the client
add_subdirectory(simple-ipc)
add_subdirectory(daemon-utils/client)
add_subdirectory(daemon-utils/server)
add_subdirectory(msa-daemon-client)

add_subdirectory(file-picker)
add_subdirectory(game-window)

add_subdirectory(cll-telemetry)

add_subdirectory(minecraft-imported-symbols)
add_subdirectory(mcpelauncher-common)
add_subdirectory(mcpelauncher-core)
add_subdirectory(mcpelauncher-apkinfo)
add_subdirectory(axml-parser)
endif()

if (BUILD_CLIENT)
add_subdirectory(android-support-headers)
set(JNIVM_ENABLE_RETURN_NON_ZERO ON CACHE BOOL "" FORCE)
set(JNIVM_FAKE_JNI_MINECRAFT_LINUX_COMPAT ON CACHE BOOL "" FORCE)
add_subdirectory(libjnivm)
add_subdirectory(mcpelauncher-client)
endif()
if (BUILD_CLIENT OR BUILD_UI)
add_subdirectory(mcpelauncher-errorwindow)
endif()

install(DIRECTORY ${NATIVES_PATH_LIB_DIR} COMPONENT mcpelauncher-bin-libs DESTINATION share/mcpelauncher PATTERN "*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)

option(MSA_DAEMON_PATH "Additional paths in which the MSA daemon should be looked in. Relative to the application directory." )
if (MSA_DAEMON_PATH)
target_compile_definitions(mcpelauncher-client PRIVATE -DMSA_DAEMON_PATH="${MSA_DAEMON_PATH}")
endif()
Loading