mirror of
https://github.com/Bithack/principia.git
synced 2026-06-24 02:04:08 +00:00
Compare commits
355 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
462369618e | ||
|
|
5865ce72ac | ||
|
|
ac9f350134 | ||
|
|
e36bf6a9bc | ||
|
|
1b5dd42b4e | ||
|
|
ff2e8252de | ||
|
|
ec68f7ca47 | ||
|
|
b0cded7e5f | ||
|
|
21942f4c0e | ||
|
|
b19e8106dc | ||
|
|
e7ddb1a19b | ||
|
|
40928c047e | ||
|
|
7f87a48538 | ||
|
|
713331fe0e | ||
|
|
90fd1d87b9 | ||
|
|
c209ca04ce | ||
|
|
068524c0a1 | ||
|
|
0f0ee6a9aa | ||
|
|
99e16dc5a3 | ||
|
|
1596df98f6 | ||
|
|
2be3199384 | ||
|
|
dc4d71e3e7 | ||
|
|
5b209b5e62 | ||
|
|
9422867597 | ||
|
|
6fb9160601 | ||
|
|
1e4dfe80e1 | ||
|
|
55b1506b0d | ||
|
|
303b9d2a2f | ||
|
|
d623a95857 | ||
|
|
22c192b6d2 | ||
|
|
e9d944afa8 | ||
|
|
494de12927 | ||
|
|
1add6eff33 | ||
|
|
e1c948f166 | ||
|
|
1968f347d2 | ||
|
|
d631ca3d55 | ||
|
|
8dccfb17a4 | ||
|
|
c07486f02f | ||
|
|
73f0dd1195 | ||
|
|
e00585b9fe | ||
|
|
15600f1682 | ||
|
|
641b449286 | ||
|
|
74c7cdb517 | ||
|
|
f75299ee8d | ||
|
|
0922b84a69 | ||
|
|
b55735c2a0 | ||
|
|
4c395f09af | ||
|
|
1505be8191 | ||
|
|
a2b7870842 | ||
|
|
9ffb133da5 | ||
|
|
76bd4d9c70 | ||
|
|
df00758dfe | ||
|
|
e1ceb49cd2 | ||
|
|
a22c9ed7e6 | ||
|
|
d54405e45c | ||
|
|
0ad08adab8 | ||
|
|
422e95b14c | ||
|
|
a9fffcd18f | ||
|
|
89ea9eebbd | ||
|
|
9580040c73 | ||
|
|
689163b24e | ||
|
|
a3ffe63962 | ||
|
|
d14bf51465 | ||
|
|
f3e13c4a80 | ||
|
|
eca1b4807b | ||
|
|
c6be936430 | ||
|
|
6689542b27 | ||
|
|
08ab103f44 |
||
|
|
de03bb63fe | ||
|
|
ef59cc871a | ||
|
|
8246880adc | ||
|
|
814eaea412 | ||
|
|
63d60d6a45 | ||
|
|
cfcc169661 | ||
|
|
2a8ad3df09 | ||
|
|
a9408d30ca | ||
|
|
10e05d687b | ||
|
|
6ea828e4d3 | ||
|
|
66923575b4 | ||
|
|
f564ba2e3f | ||
|
|
734fb3f8d7 | ||
|
|
71be99541b | ||
|
|
0051979187 | ||
|
|
01236f4b31 | ||
|
|
f2413ac302 | ||
|
|
2a5a1e98ff |
||
|
|
cdb15b688b | ||
|
|
b86f959b6f | ||
|
|
8771027650 | ||
|
|
fac177b9f1 | ||
|
|
1888998337 | ||
|
|
4eee1846ff | ||
|
|
e7a5b860c3 | ||
|
|
e9893fc481 | ||
|
|
2c99bf67c4 | ||
|
|
e83b594ef0 | ||
|
|
b66c183655 | ||
|
|
f387183b5f | ||
|
|
647b1ca7ce | ||
|
|
fbef2313e9 | ||
|
|
7e54b9a3bc | ||
|
|
100f2815ab | ||
|
|
1620ecaf5a | ||
|
|
24de6fb825 | ||
|
|
ba0c5e183b | ||
|
|
b46ecd8e05 | ||
|
|
b758f343a7 | ||
|
|
9584af22d1 | ||
|
|
8a174edb28 | ||
|
|
45fc40fd59 | ||
|
|
142e56b60f | ||
|
|
ba66b47246 | ||
|
|
9c421ffadc | ||
|
|
786356968b | ||
|
|
3fd68448a0 | ||
|
|
5ce14da7b5 | ||
|
|
c72b8f6646 | ||
|
|
c4e0a1ee01 | ||
|
|
91695dafe7 | ||
|
|
820237874e | ||
|
|
5465fb7aef | ||
|
|
d1c6804c33 | ||
|
|
adf4e8ed23 | ||
|
|
3ea46595b8 | ||
|
|
296f930566 | ||
|
|
8b4b7f43ff | ||
|
|
09dfe62860 | ||
|
|
55c32eb8f3 | ||
|
|
92e1e58c86 | ||
|
|
81d7731665 | ||
|
|
848dce5262 | ||
|
|
faba0b247e | ||
|
|
c55e5fff76 | ||
|
|
9e5a166ba6 | ||
|
|
ecaef6d33a | ||
|
|
cffeaf50d3 | ||
|
|
365856fffc | ||
|
|
894d974316 | ||
|
|
a6704c8d8e | ||
|
|
2034ca87e6 | ||
|
|
8929a3bd86 | ||
|
|
8650947dae | ||
|
|
3ca14754dd | ||
|
|
250f1fb10b | ||
|
|
0104570ba2 | ||
|
|
5d5e4cbb43 | ||
|
|
55bb0c1ea7 | ||
|
|
f9e2feffd6 |
||
|
|
04687679f2 |
||
|
|
6154fd9654 | ||
|
|
c15f657c17 | ||
|
|
5f71326243 |
||
|
|
565ea8f229 |
||
|
|
f71e177c43 | ||
|
|
aa39fe1c05 | ||
|
|
18ce9bcc5b | ||
|
|
d0cb87557a | ||
|
|
ddee2705fa | ||
|
|
41e7fca1ef | ||
|
|
8341ffd839 | ||
|
|
1258b3dc04 | ||
|
|
d5ad479b9a | ||
|
|
4b01060fbf | ||
|
|
a41094c301 | ||
|
|
6f1398a2b2 | ||
|
|
4468e7dfae | ||
|
|
5539861524 | ||
|
|
e178851a2c | ||
|
|
b410bd72da | ||
|
|
b2fcbc6aee | ||
|
|
c4a50dd59d | ||
|
|
485039bbe7 | ||
|
|
3e1e053ac2 | ||
|
|
f468d2fdd0 | ||
|
|
293a563342 | ||
|
|
2fc887dc23 | ||
|
|
6eaf5e1067 | ||
|
|
6b54f51ea6 | ||
|
|
ba3a78c69b | ||
|
|
58a55cc33d | ||
|
|
c0d667a511 | ||
|
|
3a8f57e934 | ||
|
|
90c9a7cad8 | ||
|
|
a1404b55f9 | ||
|
|
043d64ead6 | ||
|
|
ac2efc7cf3 | ||
|
|
818a1517ee | ||
|
|
5e107f1d9e | ||
|
|
75bc7c740b | ||
|
|
2421a1cae0 | ||
|
|
e1fe879b27 | ||
|
|
bb8230e2c1 | ||
|
|
23cf7074c1 | ||
|
|
3950f1fcdc | ||
|
|
db3671b6b8 | ||
|
|
a0979fc604 | ||
|
|
523bc86eee | ||
|
|
d4ef3ce1b2 | ||
|
|
48647533ff | ||
|
|
7d9cef28a4 | ||
|
|
c5f37c3de4 | ||
|
|
4ca11cadfd | ||
|
|
8c57cc8ad3 | ||
|
|
926bcdf7d4 | ||
|
|
5ddec073f9 | ||
|
|
1feee634ba | ||
|
|
716b103599 | ||
|
|
9648b16f1b | ||
|
|
4e6f127a91 | ||
|
|
07e7921719 | ||
|
|
81d0cf49da | ||
|
|
006f12e8d6 | ||
|
|
c4d8ed02e2 | ||
|
|
958f4f5056 | ||
|
|
345f93a8ab | ||
|
|
8b056328fc | ||
|
|
ca3b7580f0 | ||
|
|
9b0adb1adf | ||
|
|
15bfab9e60 | ||
|
|
0101aeb9b1 | ||
|
|
22d7d57e37 | ||
|
|
e4bb88b9d4 | ||
|
|
7e7aca613f | ||
|
|
523f2dc01c | ||
|
|
55388ba923 | ||
|
|
d81049a3a7 | ||
|
|
6837f9b8ae | ||
|
|
6e11074ca1 | ||
|
|
561dd5be4b | ||
|
|
d2bdf059c8 | ||
|
|
1f1917bca8 | ||
|
|
6b61fe8ca7 | ||
|
|
7085fbabe3 | ||
|
|
0b0c9a15a2 | ||
|
|
ce6dcedf4a | ||
|
|
b9317a3d2b | ||
|
|
5cb81c6141 | ||
|
|
8ecccc1653 | ||
|
|
9ff71b6d94 | ||
|
|
f4c79f9c7b | ||
|
|
6bfa36e03c | ||
|
|
d1cdbe27e8 | ||
|
|
40c26c0b7e | ||
|
|
81233f5f21 | ||
|
|
a82a20b398 | ||
|
|
592b467c3d | ||
|
|
2ab1fc11f3 | ||
|
|
d6a16f824c | ||
|
|
1ca6c463d6 | ||
|
|
a6ea7240af | ||
|
|
6a88d7026d | ||
|
|
3d6a1ebe90 | ||
|
|
c17bb97b49 | ||
|
|
466c59d699 | ||
|
|
5884291da0 | ||
|
|
d0d303db5c | ||
|
|
93da889308 | ||
|
|
b2ae0136c9 | ||
|
|
2c493dc1e1 | ||
|
|
902e42e09d | ||
|
|
489ee15363 | ||
|
|
939a25d280 | ||
|
|
8e39f1c6fa | ||
|
|
a334b0fbb6 | ||
|
|
4cefe95dd5 | ||
|
|
df690a95d8 | ||
|
|
11126be31c | ||
|
|
a50833402b | ||
|
|
182ad42dca | ||
|
|
fe202a8595 | ||
|
|
27e8856c0c | ||
|
|
a652f22e30 | ||
|
|
70fbcd0370 | ||
|
|
c0766e75a0 | ||
|
|
30bd25a3ab | ||
|
|
5b141eadd4 | ||
|
|
dd5abcd4c1 | ||
|
|
08d088be83 | ||
|
|
d8be41f519 | ||
|
|
72ac82e896 | ||
|
|
f5f38ee1a5 | ||
|
|
67fad00960 | ||
|
|
8773e540f3 | ||
|
|
125432ba3a | ||
|
|
5abe0a35ce | ||
|
|
7c5b73e8b3 | ||
|
|
1fbc91de68 | ||
|
|
3f8278fa26 | ||
|
|
dc0ad32a00 | ||
|
|
5d042da129 | ||
|
|
2d33dd7717 | ||
|
|
5bfaea61a9 | ||
|
|
1c506dded7 | ||
|
|
4066de5726 | ||
|
|
5897f046ec | ||
|
|
5b8824a59a | ||
|
|
97ab00727d | ||
|
|
1083ebde40 | ||
|
|
c604e53328 | ||
|
|
7cd0ffa13e | ||
|
|
9c6b26f2b5 | ||
|
|
04c18f565b | ||
|
|
bf3a3a3a2e | ||
|
|
fae7194f42 | ||
|
|
b86c71a723 | ||
|
|
0a903f1ab7 | ||
|
|
98c59d326f | ||
|
|
61e49ceb0b | ||
|
|
f9eb173ae0 | ||
|
|
fd51772378 | ||
|
|
6fb3ae7c4c | ||
|
|
17c33bb52d |
||
|
|
36dc0afc80 | ||
|
|
b0d65f66f6 | ||
|
|
5aa4e7bb77 | ||
|
|
9dbc0c9788 | ||
|
|
7499b31ecb | ||
|
|
91549c8309 | ||
|
|
b8945f84d5 | ||
|
|
3810f09063 | ||
|
|
75163f3f09 | ||
|
|
f6fc7ce5f4 | ||
|
|
6f0c50a09f | ||
|
|
40d65b981e | ||
|
|
ae84261d73 | ||
|
|
3fd5a25bfb | ||
|
|
58fe8af35b | ||
|
|
19b7431c78 | ||
|
|
76c67b41cc | ||
|
|
2da509a8b4 | ||
|
|
925975d619 | ||
|
|
40833e6710 | ||
|
|
2575232b94 | ||
|
|
df0fe89b9d | ||
|
|
7e4d00ac1b | ||
|
|
fcbbfc261d | ||
|
|
c57b38d53c | ||
|
|
9e7e841ec8 | ||
|
|
f769daff79 | ||
|
|
251fa8463c | ||
|
|
7ba068c73d |
||
|
|
368db077b4 |
||
|
|
15f4b07b11 | ||
|
|
b3efb77334 | ||
|
|
123e3f4bde | ||
|
|
dcda158110 | ||
|
|
67c6a4774c | ||
|
|
4168c5db08 | ||
|
|
c26e63cfe9 | ||
|
|
d7c10c5f8b | ||
|
|
f3474e84e3 | ||
|
|
0ca655a53c | ||
|
|
160c031c34 | ||
|
|
1586b000bd | ||
|
|
38ebc42712 |
2354 changed files with 138844 additions and 158539 deletions
6
.gitattributes
vendored
6
.gitattributes
vendored
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
# Exclude vendored libraries from GitHub language detection
|
||||
src/lua/* linguist-vendored
|
||||
src/luasocket/* linguist-vendored
|
||||
src/SDL_image/* linguist-vendored
|
||||
src/SDL_mixer/* linguist-vendored
|
||||
src/SDL-mobile/* linguist-vendored
|
||||
lib/* linguist-vendored
|
||||
|
|
|
|||
2
.github/CONTRIBUTING.md
vendored
Normal file
2
.github/CONTRIBUTING.md
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Contributing to Principia
|
||||
Contributions are welcome! Please see [Contributing to the Game](https://principia-web.se/wiki/Contributing_to_the_Game) on the Principia Wiki for more information.
|
||||
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: If you are reporting a bug, please fill out this form with the necessary details.
|
||||
title: ''
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
##### Principia version
|
||||
<!--
|
||||
Describe the version you are running here. Are you on a 1.5.2 Beta build downloaded
|
||||
from principia-web or have you built from source? If you're reporting something from
|
||||
1.5.1 make sure it still exists in the open source version.
|
||||
-->
|
||||
|
||||
##### OS / Hardware
|
||||
<!-- General information about your hardware and operating system -->
|
||||
- Platform:
|
||||
- Operating system:
|
||||
|
||||
<!-- For graphical issues only, feel free to omit if not graphical -->
|
||||
- GPU model:
|
||||
|
||||
##### Summary
|
||||
<!-- Describe your problem here -->
|
||||
|
||||
##### Steps to reproduce
|
||||
<!-- Explain the steps one could take to reproduce it. If reporting a Lua issue, please give a minimal code example to reproduce it. -->
|
||||
40
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
40
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Bug report
|
||||
description: Reporting bugs, crashes and other related issues with the game
|
||||
labels: ["Bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: Thank you for helping to make the game better by reporting issues that you discover. Make sure to describe the necessary details about the bug such that it can be reproduced by others. Additionally please refrain from using LLMs ("AI") to write or "improve" your report, as they typically just make it more verbose without adding any useful information.
|
||||
- type: input
|
||||
attributes:
|
||||
label: Principia version
|
||||
description: Describe the version you are running here. Are you on a stable release or on a nightly build, or have you built from source? To determine where a non-release build was built off of you can press the version number in the bottom right corner of the main menu.
|
||||
placeholder: "Example: 20XX.XX.XX"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Platform
|
||||
description: A lot of times a issue can be specific to a particular platform. Please write the platform you're on, or list the platforms you can reproduce it on.
|
||||
placeholder: "Example: Linux"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: System information
|
||||
description: Give some information about your device that may be relevant for your issue. For example it would be helpful to know your GPU vendor for graphical issues.
|
||||
placeholder: "Example: AMD Radeon RX 560 with Mesa drivers"
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Summary
|
||||
description: Describe the problem here.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Explain the steps one could take to reproduce it. If applicable, providing Lua code snippets or attaching a test level would also be helpful.
|
||||
validations:
|
||||
required: true
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions
|
||||
url: https://principia-web.se/forum/
|
||||
about: For asking more general questions about Principia, please see the Principia forums.
|
||||
11
.github/SECURITY.md
vendored
Normal file
11
.github/SECURITY.md
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
We only support the latest stable version for security issues.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
If you have found a bug that could be exploited by a malicious actor by playing a level or in any other way where an end-user could be victimised, then please responsibly disclose it privately by email to:
|
||||
|
||||
- ROllerozxa, project maintainer \<rollerozxa@voxelmanip.se\>
|
||||
|
||||
We will evaluate possible means of mitigating it on the community site and/or swiftly release a new version of Principia to fix the issue, depending on the severity. If it is deemed to not be a security-critical issue then we'll ask you to file a public bug report issue.
|
||||
46
.github/workflows/android.yml
vendored
Normal file
46
.github/workflows/android.yml
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
name: android
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'android/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/android.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'android/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/android.yml'
|
||||
|
||||
jobs:
|
||||
android:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Build with gradle
|
||||
run: |
|
||||
cd android
|
||||
./gradlew assemblerelease
|
||||
|
||||
- name: Save apk artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: principia-release-unsigned.apk
|
||||
path: android/principia/build/outputs/apk/release/principia-release-unsigned.apk
|
||||
#archive: false
|
||||
if-no-files-found: error
|
||||
125
.github/workflows/build.yml
vendored
125
.github/workflows/build.yml
vendored
|
|
@ -1,125 +0,0 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'build-*/**'
|
||||
- 'data-*/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/**.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'build-*/**'
|
||||
- 'data-*/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/**.yml'
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:bullseye
|
||||
env: { LANG: "C.UTF-8" }
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y g++ libgtk-3-dev libgl-dev libglew-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libfreetype6-dev libsdl2-dev cmake ninja-build desktop-file-utils ca-certificates wget file --no-install-recommends
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
../packaging/build-appimage.sh
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Principia-x86_64.AppImage
|
||||
path: build/Principia-x86_64.AppImage
|
||||
|
||||
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
release: false
|
||||
msystem: UCRT64
|
||||
pacboy: >-
|
||||
gcc:p
|
||||
cmake:p
|
||||
ninja:p
|
||||
glew:p
|
||||
zlib:p
|
||||
gtk3:p
|
||||
libpng:p
|
||||
libjpeg-turbo:p
|
||||
SDL2:p
|
||||
nsis:p
|
||||
7zip:p
|
||||
|
||||
# custom built packages with less dependencies than MSYS' counterparts
|
||||
- name: Install external packages
|
||||
run: |
|
||||
wget https://grejer.voxelmanip.se/msys-pkgs/mingw-w64-ucrt-x86_64-{curl-winssl-8.6.0-2,freetype-2.13.2-1}-any.pkg.tar.zst
|
||||
pacman -U --noconfirm *.pkg.tar.zst
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G Ninja
|
||||
ninja -j4
|
||||
|
||||
- name: Bundle together installer and portable
|
||||
run: |
|
||||
cd build
|
||||
../packaging/windows_release.sh
|
||||
../packaging/windows_portable.sh
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: principia-setup.exe
|
||||
path: build/principia-setup.exe
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: principia-portable.7z
|
||||
path: build/principia-portable.7z
|
||||
|
||||
|
||||
android:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends openjdk-11-jdk-headless
|
||||
|
||||
- name: Build with gradle
|
||||
run: |
|
||||
cd build-android
|
||||
./gradlew assemblerelease
|
||||
|
||||
- name: Save apk artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: principia-release-unsigned.apk
|
||||
path: build-android/principia/build/outputs/apk/release/principia-release-unsigned.apk
|
||||
34
.github/workflows/build_utils.yml
vendored
Normal file
34
.github/workflows/build_utils.yml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
name: build_utils
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'utils/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'utils/**'
|
||||
|
||||
jobs:
|
||||
build_utils:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libjansson-dev
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd utils
|
||||
make
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: principia-utils
|
||||
path: utils/bin/
|
||||
if-no-files-found: error
|
||||
59
.github/workflows/linux.yml
vendored
Normal file
59
.github/workflows/linux.yml
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
name: linux
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/linux.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/linux.yml'
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:bullseye
|
||||
env: { LANG: "C.UTF-8" }
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
clang-16 libgtk-3-dev libgl-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libfreetype6-dev cmake ninja-build desktop-file-utils ca-certificates wget file \
|
||||
libasound2-dev libpulse-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libpipewire-0.3-dev libwayland-dev liburing-dev \
|
||||
--no-install-recommends
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build; cd build
|
||||
../packaging/build-appimage.sh
|
||||
env:
|
||||
CC: clang-16
|
||||
CXX: clang++-16
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: Principia-x86_64.AppImage
|
||||
path: build/Principia-x86_64.AppImage
|
||||
#archive: false
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload debug symbols as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: linux-appimage-dbgsym
|
||||
path: build/principia.debug
|
||||
if-no-files-found: error
|
||||
43
.github/workflows/linux_ss.yml
vendored
Normal file
43
.github/workflows/linux_ss.yml
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
name: linux_ss
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/linux_ss.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/linux_ss.yml'
|
||||
|
||||
jobs:
|
||||
linux_ss:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y g++ libgl-dev libpng-dev libjpeg-dev libfreetype6-dev cmake ninja-build \
|
||||
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libegl1-mesa-dev \
|
||||
--no-install-recommends
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build; cd build
|
||||
cmake .. -DSCREENSHOT_BUILD=ON -G Ninja -DUSE_VENDORED_SDL3=ON
|
||||
ninja -j4
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: screenshotter_artifact
|
||||
path: build/principia
|
||||
if-no-files-found: error
|
||||
55
.github/workflows/macos.yml
vendored
Normal file
55
.github/workflows/macos.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
name: macos
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/macos.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/macos.yml'
|
||||
|
||||
jobs:
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
brew update --auto-update
|
||||
brew install cmake ninja libpng libjpeg-turbo freetype sdl3 gtk+3
|
||||
|
||||
- name: Compile
|
||||
run: |
|
||||
mkdir build; cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
|
||||
-DCMAKE_FIND_FRAMEWORK=LAST \
|
||||
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/lib/"
|
||||
ninja
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
cd build
|
||||
ninja package
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: principia-macos
|
||||
path: build/*.zip
|
||||
#archive: false
|
||||
if-no-files-found: error
|
||||
47
.github/workflows/web.yml
vendored
Normal file
47
.github/workflows/web.yml
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
name: web
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/web.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/web.yml'
|
||||
|
||||
jobs:
|
||||
web:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: emscripten/emsdk:latest
|
||||
env: { LANG: "C.UTF-8" }
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build; cd build
|
||||
emcmake cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX= -DUSE_VENDORED_SDL3=ON
|
||||
ninja
|
||||
DESTDIR=../web ninja install
|
||||
|
||||
- name: Save apk artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: principia-wasm
|
||||
path: web/
|
||||
if-no-files-found: error
|
||||
78
.github/workflows/windows.yml
vendored
Normal file
78
.github/workflows/windows.yml
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
name: windows
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/windows.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'lib/**'
|
||||
- 'data/**'
|
||||
- 'packaging/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/windows.yml'
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
release: false
|
||||
msystem: CLANG64
|
||||
pacboy: >-
|
||||
git:
|
||||
gcc:p
|
||||
cmake:p
|
||||
ninja:p
|
||||
zlib:p
|
||||
gtk3:p
|
||||
libpng:p
|
||||
libjpeg-turbo:p
|
||||
sdl3:p
|
||||
nsis:p
|
||||
7zip:p
|
||||
|
||||
- name: Install external packages
|
||||
run: |
|
||||
./packaging/windows-install-pkgs.sh
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build; cd build
|
||||
cmake .. -G Ninja
|
||||
ninja -j4
|
||||
|
||||
- name: Bundle together installer and portable
|
||||
run: |
|
||||
cd build
|
||||
../packaging/windows_release.sh
|
||||
../packaging/windows_portable.sh
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: principia-setup.exe
|
||||
path: build/principia-setup.exe
|
||||
#archive: false
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload output as artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: principia-portable.7z
|
||||
path: build/principia-portable.7z
|
||||
#archive: false
|
||||
if-no-files-found: error
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -6,8 +6,13 @@ build_*/
|
|||
# Misc. development files
|
||||
.vscode/
|
||||
*.patch
|
||||
local_config.h
|
||||
opengl32.dll
|
||||
.cache/
|
||||
compile_commands.json
|
||||
|
||||
# Doxygen documentation
|
||||
doxy/
|
||||
doxygen-awesome.css
|
||||
|
||||
# Model junk files
|
||||
*.blend1
|
||||
|
|
|
|||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "android/principia/deps-src"]
|
||||
path = android/principia/deps-src
|
||||
url = https://github.com/principia-game/android-deps
|
||||
13
AUTHORS.md
13
AUTHORS.md
|
|
@ -1,18 +1,17 @@
|
|||
Original Authors of Principia
|
||||
===========================
|
||||
=============================
|
||||
|
||||
Emil Romanus
|
||||
**Emil Romanus**<br>
|
||||
Original creator, programming, game design, 3D modeling, graphics
|
||||
|
||||
Rasmus Karlsson
|
||||
**Rasmus Karlsson**<br>
|
||||
Game programming, server development, and more
|
||||
|
||||
Mikael Romanus
|
||||
**Mikael Romanus**<br>
|
||||
3D Modeling, code twiddling
|
||||
|
||||
Contributors
|
||||
-------------
|
||||
------------
|
||||
|
||||
Anders Schanche
|
||||
**Anders Schanche**<br>
|
||||
3D Models (Tesla Gun, Rocket Launcher, and more), testing
|
||||
|
||||
|
|
|
|||
433
CMakeLists.txt
433
CMakeLists.txt
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.9)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(principia)
|
||||
|
||||
|
|
@ -13,14 +13,49 @@ if (NOT CMAKE_BUILD_TYPE)
|
|||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(JPEG REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL REQUIRED)
|
||||
include(DownloadLib)
|
||||
|
||||
add_custom_target(GenerateGitVersion
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D "GENERATE_VERSION_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
-D "GENERATE_VERSION_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/Modules/GenerateGitVersion.cmake"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
option(UNITY_BUILD "Experimental unity build" FALSE)
|
||||
mark_as_advanced(UNITY_BUILD)
|
||||
|
||||
option(USE_VENDORED_SDL3 "Build with vendored SDL3 library" FALSE)
|
||||
|
||||
# Find core dependencies
|
||||
# ----------------------
|
||||
|
||||
if(USE_VENDORED_SDL3)
|
||||
include(cmake/SDL.cmake)
|
||||
else()
|
||||
find_package(SDL3 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
include(PrincipiaAndroidLibs)
|
||||
else()
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(JPEG REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
endif()
|
||||
|
||||
|
||||
# Determine platform and backend
|
||||
# ------------------------------
|
||||
|
||||
if(LINUX)
|
||||
option(SCREENSHOT_BUILD "Build screenshotter build (Linux only)" FALSE)
|
||||
|
|
@ -28,181 +63,282 @@ else()
|
|||
set(SCREENSHOT_BUILD FALSE)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(TMS_BACKEND "windows")
|
||||
elseif(SCREENSHOT_BUILD)
|
||||
set(TMS_BACKEND "screenshot-linux")
|
||||
elseif(HAIKU)
|
||||
set(TMS_BACKEND "haiku")
|
||||
if(EMSCRIPTEN)
|
||||
set(BACKEND_IMGUI TRUE)
|
||||
else()
|
||||
set(TMS_BACKEND "linux")
|
||||
option(BACKEND_IMGUI "Enable incomplete Dear Imgui dialog backend (Experimental)" FALSE)
|
||||
endif()
|
||||
|
||||
set(TMS_FORMFACTOR "PC")
|
||||
if(WIN32)
|
||||
set(TMS_BACKEND "WINDOWS")
|
||||
elseif(ANDROID)
|
||||
set(TMS_BACKEND "ANDROID")
|
||||
set(TMS_FORMFACTOR "MOBILE")
|
||||
elseif(HAIKU)
|
||||
set(TMS_BACKEND "HAIKU")
|
||||
elseif(APPLE)
|
||||
set(TMS_BACKEND "MACOS")
|
||||
elseif(EMSCRIPTEN)
|
||||
set(TMS_BACKEND "EMSCRIPTEN")
|
||||
else()
|
||||
set(TMS_BACKEND "LINUX")
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
option(USE_GLES "Use OpenGL ES on Linux (Experimental)" FALSE)
|
||||
endif()
|
||||
|
||||
if(USE_GLES OR ANDROID OR EMSCRIPTEN)
|
||||
set(SHOULD_USE_GLES TRUE)
|
||||
else()
|
||||
set(SHOULD_USE_GLES FALSE)
|
||||
endif()
|
||||
|
||||
|
||||
# Include dirs and main source files
|
||||
# ----------------------------------
|
||||
|
||||
include_directories(
|
||||
lib/
|
||||
lib/GLAD/include/
|
||||
lib/imgui/
|
||||
lib/lua/
|
||||
lib/SDL_image/
|
||||
lib/SDL_mixer/
|
||||
src/
|
||||
src/lua/
|
||||
src/SDL_image/
|
||||
src/src/
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
${JPEG_INCLUDE_DIRS}
|
||||
${OPENGL_INCLUDE_DIRS}
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS})
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
file(GLOB SRCS
|
||||
src/tms/core/*.c
|
||||
src/tms/math/*.c
|
||||
src/tms/util/*.c
|
||||
src/tms/bindings/cpp/cpp.cc
|
||||
src/tms/modules/3ds.c
|
||||
|
||||
src/lua/*.c
|
||||
src/SDL_image/*.c
|
||||
|
||||
src/src/*.cc
|
||||
src/src/*.c
|
||||
|
||||
src/src/Box2D/Collision/*.cc
|
||||
src/src/Box2D/Collision/Shapes/*.cc
|
||||
src/src/Box2D/Common/*.cc
|
||||
src/src/Box2D/Dynamics/*.cc
|
||||
src/src/Box2D/Dynamics/Contacts/*.cc
|
||||
src/src/Box2D/Dynamics/Joints/*.cc
|
||||
src/src/Box2D/Particle/*.cc
|
||||
file(GLOB SRCS CONFIGURE_DEPENDS
|
||||
lib/GLAD/src/gl.c
|
||||
lib/lua/*.c
|
||||
lib/SDL_image/*.c
|
||||
)
|
||||
|
||||
if(NOT SCREENSHOT_BUILD)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||
find_package(CURL REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
if(UNITY_BUILD)
|
||||
list(APPEND SRCS
|
||||
src/tms/_unity_chunk.c
|
||||
src/_unity_chunk.cc
|
||||
src/game.cc
|
||||
src/game-gearbox-edit.cc
|
||||
src/game-gui.cc
|
||||
src/game-panel-edit.cc
|
||||
src/menu_pkg.cc
|
||||
src/repair_station.cc
|
||||
src/solver_ingame.cc
|
||||
|
||||
include_directories(
|
||||
${CURL_INCLUDE_DIR}
|
||||
${GLEW_INCLUDE_DIRS}
|
||||
${GTK3_INCLUDE_DIRS}
|
||||
src/SDL_mixer/)
|
||||
|
||||
file(GLOB SDL_mixer_SRCS src/SDL_mixer/*.c)
|
||||
set(SRCS ${SRCS} ${SDL_mixer_SRCS})
|
||||
|
||||
option(USE_LUASOCKET "Build with Luasocket support" TRUE)
|
||||
lib/Box2D/_unity_chunk.cc)
|
||||
else()
|
||||
set(USE_LUASOCKET false)
|
||||
file(GLOB MAIN_SRCS CONFIGURE_DEPENDS
|
||||
src/tms/core/*.c
|
||||
src/tms/math/*.c
|
||||
src/tms/cpp.cc
|
||||
src/tms/modules/3ds.c
|
||||
|
||||
src/*.cc
|
||||
src/luascript/*.cc
|
||||
|
||||
lib/Box2D/Collision/*.cc
|
||||
lib/Box2D/Collision/Shapes/*.cc
|
||||
lib/Box2D/Common/*.cc
|
||||
lib/Box2D/Dynamics/*.cc
|
||||
lib/Box2D/Dynamics/Contacts/*.cc
|
||||
lib/Box2D/Dynamics/Joints/*.cc
|
||||
lib/Box2D/Particle/*.cc)
|
||||
list(APPEND SRCS ${MAIN_SRCS})
|
||||
endif()
|
||||
|
||||
# Luasocket
|
||||
if(USE_LUASOCKET)
|
||||
set(LUASOCKET_FLAGS "-DBUILD_LUASOCKET -DLUASOCKET_INET_PTON")
|
||||
if(BACKEND_IMGUI)
|
||||
file(GLOB IMGUI_SRCS CONFIGURE_DEPENDS
|
||||
lib/imgui/*.cpp
|
||||
lib/imgui/misc/freetype/*.cpp
|
||||
src/ui/*.cc)
|
||||
list(APPEND SRCS ${IMGUI_SRCS})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(LUASOCKET_PLAT_SRC src/luasocket/wsocket.c)
|
||||
# Optional dependencies not found on Android or in the screenshot build
|
||||
if(NOT SCREENSHOT_BUILD)
|
||||
if(NOT ANDROID AND NOT EMSCRIPTEN)
|
||||
if(NOT BACKEND_IMGUI)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||
endif()
|
||||
|
||||
if(NOT BACKEND_IMGUI)
|
||||
include_directories(${GTK3_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
find_package(CURL REQUIRED)
|
||||
include_directories(${CURL_INCLUDE_DIR})
|
||||
add_definitions(-DBUILD_CURL)
|
||||
endif()
|
||||
|
||||
file(GLOB SDL_mixer_SRCS CONFIGURE_DEPENDS lib/SDL_mixer/*.c)
|
||||
list(APPEND SRCS ${SDL_mixer_SRCS})
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT UNITY_BUILD)
|
||||
if(SCREENSHOT_BUILD)
|
||||
set(BACKEND_SRC main_screenshotter.cc)
|
||||
else()
|
||||
set(LUASOCKET_PLAT_SRC
|
||||
src/luasocket/usocket.c
|
||||
src/luasocket/unix.c)
|
||||
set(BACKEND_SRC main.cc)
|
||||
list(APPEND SRCS src/tms/backend/pipe.cc)
|
||||
endif()
|
||||
set(SRCS ${SRCS}
|
||||
src/luasocket/auxiliar.c
|
||||
src/luasocket/buffer.c
|
||||
src/luasocket/except.c
|
||||
src/luasocket/inet.c
|
||||
src/luasocket/io.c
|
||||
src/luasocket/luasocket.c
|
||||
src/luasocket/mime.c
|
||||
src/luasocket/options.c
|
||||
src/luasocket/select.c
|
||||
src/luasocket/tcp.c
|
||||
src/luasocket/timeout.c
|
||||
src/luasocket/udp.c
|
||||
${LUASOCKET_PLAT_SRC})
|
||||
endif()
|
||||
|
||||
set(SRCS ${SRCS} src/tms/backends/${TMS_BACKEND}/main.cc)
|
||||
list(APPEND SRCS src/tms/backend/${BACKEND_SRC})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(WINRESOURCE_FILE "packaging/principia.rc")
|
||||
set(WINMANIFEST_FILE "packaging/principia.manifest")
|
||||
|
||||
if(NOT CMAKE_RC_COMPILER)
|
||||
set(CMAKE_RC_COMPILER "windres.exe")
|
||||
endif()
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/principia.rc.o
|
||||
COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_BINARY_DIR}
|
||||
-i${WINRESOURCE_FILE}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/principia.rc.o
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${WINRESOURCE_FILE} ${WINMANIFEST_FILE})
|
||||
set(SRCS ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/principia.rc.o)
|
||||
list(APPEND SRCS packaging/principia.rc)
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SRCS})
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${FREETYPE_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${SDL2_LIBRARIES}
|
||||
${ZLIB_LIBRARIES})
|
||||
|
||||
if(NOT SCREENSHOT_BUILD)
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${CURL_LIBRARIES}
|
||||
${GLEW_LIBRARIES}
|
||||
${GTK3_LIBRARIES})
|
||||
endif()
|
||||
# Add executable (or library for Android)
|
||||
# ---------------------------------------
|
||||
|
||||
set(COMMON_FLAGS "${LUASOCKET_FLAGS} -DTMS_BACKEND_PC -DTMS_FAST_MATH -DLUA_COMPAT_MODULE")
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(${PROJECT_NAME} ws2_32.lib version.lib shlwapi.lib winmm.lib)
|
||||
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -DTMS_BACKEND_WINDOWS -D_WIN32_WINNT=0x0501 -Dsrandom=srand -Drandom=rand -DUNICODE")
|
||||
elseif(SCREENSHOT_BUILD)
|
||||
# Screenshot build doesn't use GLEW
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -DGL_GLEXT_PROTOTYPES -DNO_UI -DTMS_BACKEND_LINUX_SS")
|
||||
elseif(HAIKU)
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -DTMS_BACKEND_HAIKU")
|
||||
if(ANDROID)
|
||||
add_library(${PROJECT_NAME} SHARED ${SRCS})
|
||||
else()
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -DTMS_BACKEND_LINUX")
|
||||
add_executable(${PROJECT_NAME} ${SRCS})
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# Downgrade some errors to warnings when building with Clang
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion")
|
||||
|
||||
# Link libraries against executable
|
||||
# ---------------------------------
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
set(LIBS
|
||||
Freetype::Freetype
|
||||
JPEG::JPEG
|
||||
PNG::PNG
|
||||
ZLIB::ZLIB)
|
||||
|
||||
if(NOT SCREENSHOT_BUILD AND NOT EMSCRIPTEN)
|
||||
list(APPEND LIBS ${CURL_LIBRARIES})
|
||||
|
||||
if(NOT ANDROID AND NOT BACKEND_IMGUI)
|
||||
list(APPEND LIBS ${GTK3_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(COMMON_FLAGS_DEBUG "${COMMON_FLAGS} -O0 -ggdb -ffast-math -Werror=return-type -DDEBUG=1")
|
||||
set(COMMON_FLAGS_RELEASE "${COMMON_FLAGS} -DNDEBUG=1 -fomit-frame-pointer -fvisibility=hidden -fdata-sections -ffunction-sections")
|
||||
list(APPEND LIBS SDL3::SDL3)
|
||||
|
||||
if(SHOULD_USE_GLES)
|
||||
list(APPEND LIBS GLESv2)
|
||||
else()
|
||||
list(APPEND LIBS OpenGL::GL)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
list(APPEND LIBS android dl log OpenSLES)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${LIBS})
|
||||
|
||||
add_dependencies(${PROJECT_NAME} GenerateGitVersion)
|
||||
|
||||
# Compiler flags
|
||||
# --------------
|
||||
|
||||
if(SHOULD_USE_GLES)
|
||||
add_definitions(-DTMS_USE_GLES)
|
||||
endif()
|
||||
|
||||
if(UNITY_BUILD)
|
||||
add_definitions(-DUNITY_BUILD)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||
elseif(SCREENSHOT_BUILD)
|
||||
add_definitions(-DNO_UI -DSCREENSHOT_BUILD)
|
||||
endif()
|
||||
|
||||
if(BACKEND_IMGUI)
|
||||
add_definitions(-DPRINCIPIA_BACKEND_IMGUI -DIMGUI_DEFINE_MATH_OPERATORS)
|
||||
|
||||
if(SHOULD_USE_GLES)
|
||||
add_definitions(-DIMGUI_IMPL_OPENGL_ES2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(-DTMS_BACKEND_${TMS_FORMFACTOR} -DTMS_BACKEND_${TMS_BACKEND})
|
||||
|
||||
# Use a safe subset of fast math flags
|
||||
set(COMMON_FLAGS "-fno-math-errno -fno-trapping-math -fno-signed-zeros")
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "--preload-file ../data/")
|
||||
set(LIBRARY_FLAGS "-sUSE_FREETYPE=1 -sUSE_LIBJPEG=1 -sUSE_LIBPNG=1 -sUSE_ZLIB=1 -pthread")
|
||||
string(APPEND COMMON_FLAGS " ${LIBRARY_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS " ${LIBRARY_FLAGS} -pthread -sPTHREAD_POOL_SIZE=20 -sINITIAL_MEMORY=2013265920 -sALLOW_MEMORY_GROWTH=1 -sTOTAL_STACK=16Mb -sFETCH=1")
|
||||
endif()
|
||||
|
||||
set(COMMON_FLAGS_DEBUG "${COMMON_FLAGS} -O0 -ggdb -DDEBUG=1")
|
||||
set(COMMON_FLAGS_RELEASE "${COMMON_FLAGS} -DNDEBUG=1 -fomit-frame-pointer")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "${COMMON_FLAGS_RELEASE} -O1")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${COMMON_FLAGS_DEBUG}")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_FLAGS_RELEASE} -O2 -fvisibility-inlines-hidden -fno-rtti")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_FLAGS_RELEASE} -O2 -fno-rtti")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_FLAGS_DEBUG}")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-O,-s,--gc-sections")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "-Wl,-O,--gc-sections")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "")
|
||||
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELEASE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-mwindows")
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE "-mwindows ")
|
||||
endif()
|
||||
|
||||
# macOS Clang's linker doesn't like these flags
|
||||
if(NOT APPLE)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-s ")
|
||||
endif()
|
||||
|
||||
# Register protocol handler util on Windows
|
||||
# -----------------------------------------
|
||||
|
||||
if(WIN32)
|
||||
add_executable(register-protocol-handler
|
||||
packaging/register-protocol-handler/main.c
|
||||
packaging/register-protocol-handler/windows.rc)
|
||||
endif()
|
||||
|
||||
# Installation
|
||||
# ------------
|
||||
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
set(BUNDLE_NAME ${PROJECT_NAME}.app)
|
||||
set(BUNDLE_PATH "${BUNDLE_NAME}")
|
||||
|
||||
set(BINDIR ${BUNDLE_NAME}/Contents/MacOS)
|
||||
set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources)
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data" DESTINATION "${SHAREDIR}")
|
||||
|
||||
install(FILES "packaging/principia.icns" DESTINATION "${SHAREDIR}")
|
||||
install(FILES "packaging/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
|
||||
|
||||
elseif(EMSCRIPTEN)
|
||||
|
||||
set(BINDIR .)
|
||||
install(FILES "packaging/index.html" DESTINATION .)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.wasm DESTINATION .)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.data DESTINATION .)
|
||||
|
||||
else()
|
||||
include(GNUInstallDirs)
|
||||
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}")
|
||||
set(BINDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data-pc" DESTINATION "${SHAREDIR}/principia")
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data-shared" DESTINATION "${SHAREDIR}/principia")
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data" DESTINATION "${SHAREDIR}/principia")
|
||||
|
||||
install(FILES "packaging/principia.desktop" DESTINATION "${SHAREDIR}/applications")
|
||||
install(FILES "packaging/principia-url-handler.desktop" DESTINATION "${SHAREDIR}/applications")
|
||||
|
|
@ -210,6 +346,23 @@ if(UNIX)
|
|||
install(FILES "packaging/principia.png" DESTINATION "${SHAREDIR}/icons/hicolor/128x128/apps")
|
||||
|
||||
install(FILES "packaging/se.principia_web.principia.metainfo.xml" DESTINATION "${SHAREDIR}/metainfo")
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
|
||||
endif()
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION ${BINDIR}
|
||||
LIBRARY DESTINATION ${BINDIR}
|
||||
ARCHIVE DESTINATION ${BINDIR}
|
||||
BUNDLE DESTINATION .
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
include(CPack)
|
||||
|
||||
install(CODE "
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BUNDLE_PATH}\" \"\" \"\${CMAKE_INSTALL_PREFIX}/${BINDIR}\")
|
||||
" COMPONENT Runtime)
|
||||
endif()
|
||||
|
|
|
|||
37
Doxyfile
Normal file
37
Doxyfile
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Project properties
|
||||
PROJECT_NAME = Principia
|
||||
PROJECT_LOGO = packaging/principia.png
|
||||
|
||||
# Parsing
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
SORT_MEMBERS_CTORS_1ST = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
BUILTIN_STL_SUPPORT = YES
|
||||
|
||||
# Input
|
||||
RECURSIVE = YES
|
||||
STRIP_FROM_PATH = src
|
||||
INPUT = src/
|
||||
|
||||
# Dot graphs
|
||||
HAVE_DOT = YES
|
||||
CALL_GRAPH = YES
|
||||
CALLER_GRAPH = YES
|
||||
MAX_DOT_GRAPH_DEPTH = 3
|
||||
DOT_MULTI_TARGETS = YES
|
||||
DOT_IMAGE_FORMAT = svg
|
||||
|
||||
# Output
|
||||
OUTPUT_DIRECTORY = doxy/ # /tmp/doxy/
|
||||
GENERATE_LATEX = NO
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
SEARCHENGINE = YES
|
||||
DISABLE_INDEX = YES
|
||||
GENERATE_TREEVIEW = YES
|
||||
HTML_DYNAMIC_SECTIONS = YES
|
||||
HTML_TIMESTAMP = YES
|
||||
HTML_EXTRA_STYLESHEET = doxygen-awesome.css
|
||||
153
README.md
153
README.md
|
|
@ -1,9 +1,9 @@
|
|||
# Principia Open Source Project
|
||||

|
||||
|
||||
Principia is a sandbox physics game originally released in November 2013. It is the successor to the 2011 Android hit game "Apparatus". In August of 2022 Principia was released as open source, and is now being developed as an open source project.
|
||||
Principia is a sandbox physics game originally released in November 2013. It is the successor to the 2011 Android hit game "Apparatus". In August of 2022 Principia was released as open source, and is now being developed as an open source project by the Principia community.
|
||||
|
||||
Principia runs on anything with a recent enough version of Windows, Linux or Android. There exists code to compile for iOS, but is currently not functional. (See [#85](https://github.com/Bithack/principia/issues/85)) An incomplete port to Haiku OS is also available, and work to port Principia to other platforms are very welcome.
|
||||
Principia runs on anything with a recent enough version of Windows, Linux or Android. Experimental ports to Haiku OS and macOS are also available, and work to port Principia to other platforms are very welcome.
|
||||
|
||||
## Useful Links
|
||||
* New community site: https://principia-web.se
|
||||
|
|
@ -18,155 +18,26 @@ Principia runs on anything with a recent enough version of Windows, Linux or And
|
|||
|
||||
* Discord server: https://principia-web.se/discord
|
||||
|
||||
* Matrix room: https://principia-web.se/matrix
|
||||
* Codeberg mirror: https://codeberg.org/principia/principia
|
||||
|
||||
* Mastodon: https://hachyderm.io/@principia
|
||||
|
||||
## Binary builds
|
||||
Every now and then new beta builds for 1.5.2 are made whenever things are stable enough on the `master` branch. These are available for download on the [principia-web downloads page](https://principia-web.se/download).
|
||||
Release builds builds of Principia for Windows, Android and Linux are available on the [download page](https://principia-web.se/download).
|
||||
|
||||
There are also nightly build artifacts for Windows and Android that get automatically built by GitHub CI on each commit, see [Actions](https://github.com/Bithack/principia/actions). Keep in mind these may be broken at times during development, and you are recommended to use the beta builds instead.
|
||||
There are also nightly build artifacts that get automatically built by GitHub Actions CI on each commit and are available for download, see [Nightly Builds](https://principia-web.se/wiki/Nightly_Builds) on the wiki.
|
||||
|
||||
## Getting involved
|
||||
Feel free to fork this project and send in your pull requests. This is a community project and the community decides how the project evolves.
|
||||
|
||||
Most of our discussion and development happens in the `#development` channel of the [Principia Discord server](https://principia-web.se/discord) (also bridged to [Matrix](https://principia-web.se/matrix)), make sure to join it if you want to discuss and participate in the development of the game.
|
||||
For a brief overview on how to get started with contributing to the game, see the [Contributing to the Game](https://principia-web.se/wiki/Contributing_to_the_Game) page on the wiki.
|
||||
|
||||
Also be sure to follow [@principia](https://fosstodon.org/@principia) on Fosstodon for more updates about the project.
|
||||
Also be sure to follow [@principia](https://hachyderm.io/@principia) on Mastodon for more updates about the project.
|
||||
|
||||
## Building and running
|
||||
Below are instructions to build Principia on Windows, Linux and Android from source. See also [this Wiki page](https://principia-web.se/wiki/Compiling_Principia) for notes on running Principia on particular platforms. (e.g. Chrome OS, Raspberry Pi or Haiku OS)
|
||||
## Building from source
|
||||
See [Compiling Principia](https://principia-web.se/wiki/Compiling_Principia) on the wiki for building from source on supported platforms.
|
||||
|
||||
If you have issues building Principia, then please ask in the `#development` channel on Discord.
|
||||
|
||||
### Windows
|
||||
The game engine behind Principia (TMS) is written in the C99 standard of C. Unfortunately, the Visual Studio C compiler does not support the C99 standard. Principia must therefore be compiled using MinGW-w64 toolchain.
|
||||
|
||||
The following build Windows instructions use MSYS2 which is a development environment for Windows including MinGW and other tools. Please download and install the latest version of the MSYS2 installer here: https://www.msys2.org/
|
||||
|
||||
After installation, a terminal opens. Run the following command to update the environment:
|
||||
|
||||
```bash
|
||||
pacman -Syu
|
||||
```
|
||||
|
||||
The terminal will then ask you to shut down the MSYS2 runtime to the finish the update. Proceed with doing so, and then go to the start menu and start the "MSYS2 UCRT64" environment (icon with gold background) again. Run the following command to install the necessary dependencies:
|
||||
|
||||
```bash
|
||||
pacman -S git mingw-w64-ucrt-x86_64-{gcc,cmake,ninja,curl-winssl,gtk3,glew,libpng,libjpeg-turbo,freetype,SDL2}
|
||||
```
|
||||
|
||||
Navigate somewhere you want to clone the Principia source code to, such as on your desktop:
|
||||
|
||||
```bash
|
||||
cd /c/Users/$USER/Desktop/
|
||||
git clone https://github.com/Bithack/principia
|
||||
cd principia
|
||||
```
|
||||
|
||||
Then generate the build files using CMake and start the compilation:
|
||||
|
||||
```bash
|
||||
mkdir build; cd build
|
||||
cmake .. -G Ninja
|
||||
ninja
|
||||
```
|
||||
|
||||
When finished there will be a `principia.exe` file in the build folder. Keep in mind that the built executable can only be run inside of the MSYS2 terminal, to make a release build see below to build the installer:
|
||||
|
||||
#### Windows installer
|
||||
The Windows installer uses NSIS, which must be installed first before building:
|
||||
|
||||
```bash
|
||||
pacman -S mingw-w64-ucrt-x86_64-nsis
|
||||
```
|
||||
|
||||
For making Windows release builds you would run the `packaging/windows_release.sh` script, which will bundle necessary DLLs and other files to make the game run, and builds the installer.
|
||||
|
||||
### Linux
|
||||
If you just want to play Principia on Linux, there are packages available for Arch-based and Debian-based distros as well as NixOS. See the [principia-web downloads page](https://principia-web.se/download) for more info.
|
||||
|
||||
Install dependencies.
|
||||
|
||||
**Debian-based distros:**
|
||||
|
||||
```bash
|
||||
sudo apt install --no-install-recommends cmake ninja-build libgtk-3-dev libgl-dev libglew-dev libasound2-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libfreetype6-dev libsdl2-dev
|
||||
```
|
||||
|
||||
**For Arch-based distros:**
|
||||
|
||||
```bash
|
||||
sudo pacman -S --needed cmake ninja glew gtk3 curl freetype2 libpng libjpeg sdl2
|
||||
```
|
||||
|
||||
**For Fedora:**
|
||||
|
||||
```bash
|
||||
sudo dnf install @development-tools cmake ninja gcc-c++ freetype-devel libcurl-devel libpng-devel libjpeg-turbo-devel gtk3-devel SDL2-devel libXxf86vm-devel glew-devel mesa-libGLU-devel alsa-lib-devel systemd-devel
|
||||
```
|
||||
|
||||
**For Alpine:**
|
||||
|
||||
```bash
|
||||
doas apk add build-base cmake ninja mesa-dev glew-dev gtk+3.0-dev libpng-dev jpeg-dev curl-dev freetype-dev zlib-dev sdl2-dev
|
||||
```
|
||||
|
||||
**For NixOS**, Follow the instructions [here](./nix/README.md).
|
||||
|
||||
Generate the build files using CMake and start compilation:
|
||||
|
||||
```bash
|
||||
mkdir build; cd build
|
||||
cmake .. -G Ninja
|
||||
ninja
|
||||
```
|
||||
|
||||
When finished a `principia` executable will be produced, which can then be run.
|
||||
|
||||
While the game works fine when being run from out of the source tree, additional setup is required for the URL handler to work in order to play community levels. See [this page on the Wiki](https://principia-web.se/wiki/Principia_Protocol#linux) for more details.
|
||||
|
||||
#### Packaging for Linux
|
||||
On Linux Principia will attempt to load data from the following directories:
|
||||
|
||||
1. `./` (data directories are next to the executable)
|
||||
2. `../` (data directories are one directory up relative to the executable)
|
||||
3. `./share/principia/` (for an installed build)
|
||||
|
||||
When doing `ninja install`, the data folders will be installed to `share/principia`. For packaging, you would want to pass `-DCMAKE_INSTALL_PREFIX=/usr` to CMake which when installed will put data where it can get loaded from.
|
||||
|
||||
### Building for Android
|
||||
These instructions assume a Linux system but can likely be easily adapted to build for Android on any platform.
|
||||
|
||||
Download Android Studio from here: https://developer.android.com/studio
|
||||
|
||||
Untar the archive and run studio.sh:
|
||||
|
||||
```bash
|
||||
tar xzf android-studio-*-linux.tar.gz
|
||||
cd bin; ./studio.sh
|
||||
```
|
||||
|
||||
Choose Custom in the Installer, click Next a bunch of times. Android Studio will download components for a while. Once finished, in the "Welcome to Android Studio" dialog, choose "Customize" in the left menu and then click "All Settings..." at the bottom center. Open Appearance -> System Settings -> Android SDK. Click the SDK Tools tab and check the following items:
|
||||
|
||||
- NDK (Side by side)
|
||||
- Android SDK Command-line tools
|
||||
|
||||
Click Apply and wait for the components to download. Close Android Studio **forever**.
|
||||
|
||||
Open a terminal and run the build scripts:
|
||||
|
||||
```bash
|
||||
cd build-android
|
||||
export ANDROID_HOME=/home/EXAMPLE/Android/Sdk
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
ANDROID_HOME should be set to the location where Android Studio installed the SDK (which you chose during setup). You might want to put that export line in your .bashrc file.
|
||||
|
||||
Finally, to install the game on your device:
|
||||
|
||||
```bash
|
||||
./gradew install
|
||||
```
|
||||
(You can also view the plaintext Markdown document [here](https://raw.githubusercontent.com/principia-game/wiki/master/pages/Compiling_Principia.md))
|
||||
|
||||
## License
|
||||
See [LICENSE.md](LICENSE.md)
|
||||
|
|
|
|||
52
THANKS.md
52
THANKS.md
|
|
@ -3,32 +3,32 @@ Thanks
|
|||
|
||||
We would like to send a special thanks to some of the most dedicated Apparatus and Principia players who have supported development and helped the community.
|
||||
|
||||
Alfajim
|
||||
Axohmega
|
||||
BobMonkeypimp
|
||||
Cheddah
|
||||
Cralant
|
||||
Ctjet
|
||||
Demon666
|
||||
Doughnuts108
|
||||
Golden
|
||||
JOELwindows7
|
||||
Nighthawk
|
||||
Ridget
|
||||
Rubicon
|
||||
Sasha from Russia
|
||||
TechZ
|
||||
Tetsu
|
||||
The_Blacksmith_
|
||||
abrackers
|
||||
incrazyboyy
|
||||
mrsimb
|
||||
mznznlt
|
||||
sjoerd1999
|
||||
wokstation
|
||||
woodnut
|
||||
yo man
|
||||
zardOz (RIP)
|
||||
- Alfajim
|
||||
- Axohmega
|
||||
- BobMonkeypimp
|
||||
- Cheddah
|
||||
- Cralant
|
||||
- Ctjet
|
||||
- Demon666
|
||||
- Doughnuts108
|
||||
- Golden
|
||||
- JOELwindows7
|
||||
- Nighthawk
|
||||
- Ridget
|
||||
- Rubicon
|
||||
- Sasha from Russia
|
||||
- TechZ
|
||||
- Tetsu
|
||||
- The_Blacksmith_
|
||||
- abrackers
|
||||
- incrazyboyy
|
||||
- mrsimb
|
||||
- mznznlt
|
||||
- sjoerd1999
|
||||
- wokstation
|
||||
- woodnut
|
||||
- yo man
|
||||
- zardOz (RIP)
|
||||
|
||||
And everyone else in the Principia and Apparatus communities.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
.gradle/
|
||||
.idea/
|
||||
deps/
|
||||
deps
|
||||
principia/build/
|
||||
*.apk
|
||||
*.apk.idsig
|
||||
local.properties
|
||||
.cxx/
|
||||
18
android/build.gradle
Normal file
18
android/build.gradle
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'de.undercouch:gradle-download-task:4.1.1'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.8.1' apply false
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
|
@ -5,3 +5,4 @@ android.nonTransitiveRClass=true
|
|||
org.gradle.daemon=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.parallel.threads=8
|
||||
android.nonFinalResIds=false
|
||||
BIN
android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
|
|
@ -1,6 +1,7 @@
|
|||
#Sun Aug 07 11:51:41 CEST 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
251
android/gradlew
vendored
Executable file
251
android/gradlew
vendored
Executable file
|
|
@ -0,0 +1,251 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
|
@ -4,33 +4,33 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
ndkVersion "23.2.8568313"
|
||||
compileSdk 35
|
||||
ndkVersion "27.2.12479018"
|
||||
namespace 'com.bithack.principia'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.bithack.principia"
|
||||
minSdk 19
|
||||
targetSdk 33
|
||||
versionCode 35
|
||||
versionName "2024.02.29"
|
||||
minSdk 21
|
||||
targetSdk 35
|
||||
versionCode 41
|
||||
versionName "2026.06.19"
|
||||
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
arguments '-j' + Runtime.getRuntime().availableProcessors()
|
||||
}
|
||||
cmake.arguments "-DUSE_VENDORED_SDL3=1"
|
||||
}
|
||||
|
||||
ndk {
|
||||
abiFilters "arm64-v8a", "armeabi-v7a", "x86_64"
|
||||
// "x86", "x86-64"
|
||||
//abiFilters "arm64-v8a" // debugging on phone
|
||||
//abiFilters "x86_64" // debugging on emulator
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
path = file("../jni/Android.mk")
|
||||
cmake {
|
||||
path file("../../CMakeLists.txt")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -56,19 +56,20 @@ dependencies {
|
|||
}
|
||||
|
||||
// get precompiled deps
|
||||
task downloadDeps(type: Download) {
|
||||
src 'https://github.com/principia-game/principia-android-deps/releases/download/latest/deps.zip'
|
||||
dest new File(buildDir, 'deps.zip')
|
||||
overwrite false
|
||||
tasks.register('downloadDeps', Download) {
|
||||
src 'https://github.com/principia-game/android-deps/releases/download/latest/deps.zip'
|
||||
dest new File(buildDir, 'deps.zip')
|
||||
overwrite false
|
||||
}
|
||||
|
||||
task getDeps(dependsOn: downloadDeps, type: Copy) {
|
||||
def deps = new File(buildDir.parent, '../deps')
|
||||
if (!deps.exists()) {
|
||||
deps.mkdir()
|
||||
from zipTree(downloadDeps.dest)
|
||||
into deps
|
||||
}
|
||||
tasks.register('getDeps', Copy) {
|
||||
dependsOn downloadDeps
|
||||
def deps = new File(buildDir.parent, '../deps')
|
||||
if (!deps.exists()) {
|
||||
deps.mkdir()
|
||||
from zipTree(downloadDeps.dest)
|
||||
into deps
|
||||
}
|
||||
}
|
||||
|
||||
preBuild.dependsOn getDeps
|
||||
1
android/principia/deps-src
Submodule
1
android/principia/deps-src
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit f3e15935e822228400064b66677bd3e9d3d7a643
|
||||
1
android/principia/src/assets/data
Symbolic link
1
android/principia/src/assets/data
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../data
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.bithack.principia" android:installLocation="auto">
|
||||
android:installLocation="auto">
|
||||
|
||||
<supports-screens android:resizeable="true" android:smallScreens="false" android:normalScreens="true"
|
||||
android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
|
||||
|
|
@ -17,7 +17,8 @@
|
|||
android:hasFragileUserData="true"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@drawable/icon"
|
||||
android:theme="@style/PrincipiaTheme">
|
||||
android:theme="@style/PrincipiaTheme"
|
||||
android:networkSecurityConfig="@xml/network_security_config">
|
||||
<activity android:screenOrientation="landscape" android:name="com.bithack.principia.PrincipiaActivity"
|
||||
android:exported="true"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation"
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,4 @@
|
|||
package org.libsdl.app;
|
||||
package com.bithack.principia;
|
||||
|
||||
import com.bithack.principia.shared.Settings;
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ public class PrincipiaBackend
|
|||
float creature_absorb_time,
|
||||
float player_respawn_time
|
||||
);
|
||||
public static native void setLevelAllowDerivatives(boolean state);
|
||||
|
||||
public static native void setLevelLocked(boolean state);
|
||||
|
||||
public static native void setarg(String arg);
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import com.bithack.principia.R;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -28,7 +26,7 @@ public class AnimalDialog {
|
|||
s_animal = (Spinner)view.findViewById(R.id.s_animal);
|
||||
String[] consumables = PrincipiaBackend.getAnimals().split(",.,");
|
||||
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(SDLActivity.mSingleton, android.R.layout.select_dialog_item, consumables);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(PrincipiaActivity.mSingleton, android.R.layout.select_dialog_item, consumables);
|
||||
s_animal.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
_dialog = new AlertDialog.Builder(PrincipiaActivity.mSingleton)
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
|
||||
|
|
@ -20,12 +19,12 @@ public class AutosaveDialog
|
|||
.setMessage("Autosave file detected. Open or remove?")
|
||||
.setPositiveButton("Open", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which){
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_OPEN_AUTOSAVE, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_OPEN_AUTOSAVE, 0);
|
||||
}}
|
||||
)
|
||||
.setNegativeButton("Remove", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which){
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_REMOVE_AUTOSAVE, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_REMOVE_AUTOSAVE, 0);
|
||||
}}
|
||||
)
|
||||
.create();
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import android.os.Bundle;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
|
@ -12,7 +12,6 @@ import android.text.Spanned;
|
|||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.widget.EditText;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.Matcher;
|
||||
|
|
@ -204,9 +203,7 @@ public class CodeEditor extends androidx.appcompat.widget.AppCompatEditText
|
|||
private Editable highlight( Editable e )
|
||||
{
|
||||
last_edit = SystemClock.uptimeMillis();
|
||||
if (true) {
|
||||
//return e;
|
||||
}
|
||||
|
||||
Log.v("Principia", "highlight begin");
|
||||
try
|
||||
{
|
||||
|
|
@ -263,7 +260,7 @@ public class CodeEditor extends androidx.appcompat.widget.AppCompatEditText
|
|||
{
|
||||
// remove foreground color spans
|
||||
{
|
||||
ForegroundColorSpan spans[] = e.getSpans(
|
||||
ForegroundColorSpan[] spans = e.getSpans(
|
||||
0,
|
||||
e.length(),
|
||||
ForegroundColorSpan.class );
|
||||
|
|
@ -3,7 +3,7 @@ package com.bithack.principia.shared;
|
|||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -1,18 +1,12 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
|
||||
public class CommunityDialog
|
||||
{
|
||||
|
|
@ -24,13 +18,13 @@ public class CommunityDialog
|
|||
.setMessage("Do you want to return to the community site or to the main menu?")
|
||||
.setPositiveButton("Community", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which){
|
||||
SDLActivity.wv.loadUrl(PrincipiaBackend.getCurrentCommunityUrl());
|
||||
SDLActivity.wv_dialog.show();
|
||||
PrincipiaActivity.wv.loadUrl(PrincipiaBackend.getCurrentCommunityUrl());
|
||||
PrincipiaActivity.wv_dialog.show();
|
||||
}}
|
||||
)
|
||||
.setNegativeButton("Main menu", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which){
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_GOTO_MAINMENU, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_GOTO_MAINMENU, 0);
|
||||
}}
|
||||
)
|
||||
.create();
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -44,7 +43,7 @@ public class ConfirmDialog
|
|||
{
|
||||
final CheckBox cb;
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(SDLActivity.getContext()).create();
|
||||
AlertDialog dialog = new AlertDialog.Builder(PrincipiaActivity.getContext()).create();
|
||||
if (dna_sandbox_back) {
|
||||
View view = LayoutInflater.from(PrincipiaActivity.mSingleton).inflate(R.layout.confirm_sandbox, null);
|
||||
dialog.setView(view);
|
||||
|
|
@ -55,8 +54,8 @@ public class ConfirmDialog
|
|||
cb = null;
|
||||
}
|
||||
dialog.setCancelable(true);
|
||||
dialog.setOnShowListener(SDLActivity.mSingleton);
|
||||
dialog.setOnDismissListener(SDLActivity.mSingleton);
|
||||
dialog.setOnShowListener(PrincipiaActivity.mSingleton);
|
||||
dialog.setOnDismissListener(PrincipiaActivity.mSingleton);
|
||||
dialog.setButton(DialogInterface.BUTTON_POSITIVE, button1, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int buttonId) {
|
||||
if (mListener != null) {
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import android.app.AlertDialog;
|
||||
|
|
@ -28,7 +26,7 @@ public class ConsumableDialog {
|
|||
s_consumable = (Spinner)view.findViewById(R.id.s_consumable);
|
||||
String[] consumables = PrincipiaBackend.getConsumables().split(",");
|
||||
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(SDLActivity.mSingleton, android.R.layout.select_dialog_item, consumables);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(PrincipiaActivity.mSingleton, android.R.layout.select_dialog_item, consumables);
|
||||
s_consumable.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
_dialog = new AlertDialog.Builder(PrincipiaActivity.mSingleton)
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import android.app.AlertDialog;
|
||||
|
|
@ -28,7 +26,7 @@ public class DecorationDialog {
|
|||
s_deco = (Spinner)view.findViewById(R.id.s_deco);
|
||||
String[] consumables = PrincipiaBackend.getDecorations().split(",.,");
|
||||
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(SDLActivity.mSingleton, android.R.layout.select_dialog_item, consumables);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(PrincipiaActivity.mSingleton, android.R.layout.select_dialog_item, consumables);
|
||||
s_deco.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
_dialog = new AlertDialog.Builder(PrincipiaActivity.mSingleton)
|
||||
|
|
@ -4,8 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -64,7 +63,7 @@ public class DigitalDisplayDialog {
|
|||
ll_dd = (LinearLayout)view.findViewById(R.id.ll_dd);
|
||||
ll_wrap = (LinearLayout)view.findViewById(R.id.display_ll_wrap);
|
||||
|
||||
np_initial_position = new com.bithack.principia.shared.NumberPicker(SDLActivity.getContext());
|
||||
np_initial_position = new com.bithack.principia.shared.NumberPicker(PrincipiaActivity.getContext());
|
||||
np_initial_position.setRange(MIN_INITIAL_POS, 40);
|
||||
|
||||
ll_dd.addView((View)np_initial_position);
|
||||
|
|
@ -133,7 +132,7 @@ public class DigitalDisplayDialog {
|
|||
new_str.setCharAt(y, (isChecked?'1':'0'));
|
||||
symbols.set(cur_symbol, new_str.toString());
|
||||
} catch (StringIndexOutOfBoundsException e) {
|
||||
Log.e("Principia", "An unknown error occured: " + e.getMessage());
|
||||
Log.e("Principia", "An unknown error occurred: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -181,7 +180,7 @@ public class DigitalDisplayDialog {
|
|||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
if (num_symbols == 40) {
|
||||
SDLActivity.message("Maximum number of symbols reached.", 0);
|
||||
PrincipiaActivity.message("Maximum number of symbols reached.", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +199,7 @@ public class DigitalDisplayDialog {
|
|||
public boolean onTouch(View v, MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
if (num_symbols == 40) {
|
||||
SDLActivity.message("Maximum number of symbols reached.", 0);
|
||||
PrincipiaActivity.message("Maximum number of symbols reached.", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -312,7 +311,7 @@ public class DigitalDisplayDialog {
|
|||
}
|
||||
}
|
||||
symbols.add(sb.toString());
|
||||
Log.v("Principia", "Got a cool symbol: "+sb.toString());
|
||||
Log.v("Principia", "Got a cool symbol: "+ sb);
|
||||
}
|
||||
|
||||
cur_symbol = initial_position - 1;
|
||||
|
|
@ -4,7 +4,7 @@ import java.util.Locale;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
|||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -218,8 +218,7 @@ public class FactoryDialog {
|
|||
for (int x=0; x<resource_list.length; ++x) {
|
||||
try {
|
||||
np_resources.get(x).setValue(Integer.parseInt(resource_list[x]));
|
||||
} catch (NumberFormatException e) {
|
||||
continue;
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +249,7 @@ public class FactoryDialog {
|
|||
sb.append(";");
|
||||
}
|
||||
|
||||
sb.append(Integer.toString(r.id));
|
||||
sb.append(r.id);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
|
@ -267,7 +266,7 @@ public class FactoryDialog {
|
|||
}
|
||||
}
|
||||
|
||||
Log.v("Principia", "ZZZ: '" + sb.toString() + "'");
|
||||
Log.v("Principia", "ZZZ: '" + sb + "'");
|
||||
|
||||
PrincipiaBackend.setPropertyString(0, sb.toString());
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
|
||||
|
|
@ -23,7 +22,7 @@ public class ImportDialog
|
|||
private final String[] level_names;
|
||||
|
||||
public static ListView lv;
|
||||
public static ArrayAdapter<Level> list_adapter = new ArrayAdapter<Level>(SDLActivity.mSingleton,
|
||||
public static ArrayAdapter<Level> list_adapter = new ArrayAdapter<Level>(PrincipiaActivity.mSingleton,
|
||||
android.R.layout.select_dialog_item);
|
||||
|
||||
public ImportDialog(final boolean is_multiemitter)
|
||||
|
|
@ -32,7 +31,7 @@ public class ImportDialog
|
|||
|
||||
AlertDialog.Builder bld = new AlertDialog.Builder(PrincipiaActivity.mSingleton);
|
||||
|
||||
String level_list = PrincipiaBackend.getLevels(SDLActivity.LEVEL_PARTIAL);
|
||||
String level_list = PrincipiaBackend.getLevels(PrincipiaActivity.LEVEL_PARTIAL);
|
||||
String[] levels = level_list.split("\n");
|
||||
|
||||
level_names = new String[levels.length];
|
||||
|
|
@ -82,7 +81,7 @@ public class ImportDialog
|
|||
this._dialog.setOnShowListener(new OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
ListView lv = _dialog.getListView();
|
||||
ImportDialog.lv = lv;
|
||||
if (lv != null) {
|
||||
|
|
@ -104,7 +103,7 @@ public class ImportDialog
|
|||
}
|
||||
});
|
||||
lv.setAdapter(ImportDialog.list_adapter);
|
||||
SDLActivity.mSingleton.registerForContextMenu(lv);
|
||||
PrincipiaActivity.mSingleton.registerForContextMenu(lv);
|
||||
} else {
|
||||
Log.v("Principia", "listview = null");
|
||||
}
|
||||
|
|
@ -8,23 +8,20 @@ import android.content.DialogInterface;
|
|||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.text.Html;
|
||||
|
||||
public class HelpDialog
|
||||
public class InfoDialog
|
||||
{
|
||||
Dialog _dialog;
|
||||
|
||||
public static String description ="";
|
||||
public static String title = "";
|
||||
public static String description;
|
||||
|
||||
public HelpDialog()
|
||||
public InfoDialog()
|
||||
{
|
||||
AlertDialog.Builder bld = new AlertDialog.Builder(PrincipiaActivity.mSingleton);
|
||||
bld.setTitle(title);
|
||||
bld.setMessage(Html.fromHtml((description.replaceAll("\n", "<br />"))));
|
||||
bld.setTitle("Level description");
|
||||
bld.setMessage(description);
|
||||
|
||||
bld.setNeutralButton("Close", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
}
|
||||
public void onClick(DialogInterface dialog, int which) { }
|
||||
});
|
||||
|
||||
this._dialog = bld.create();
|
||||
|
|
@ -2,7 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -2,7 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -15,9 +15,6 @@ import android.view.View;
|
|||
import android.widget.Spinner;
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class KeyListenerDialog {
|
||||
static Dialog _dialog;
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -43,7 +42,7 @@ public class LoginDialog
|
|||
_dialog.setOnShowListener(new OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
|
||||
Button b = _dialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
|
||||
|
|
@ -55,7 +54,7 @@ public class LoginDialog
|
|||
String password = et_password.getText().toString().trim();
|
||||
|
||||
if (username.length() <= 0 || password.length() <= 0) {
|
||||
SDLActivity.message("You must enter a valid username and password.", 0);
|
||||
PrincipiaActivity.message("You must enter a valid username and password.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +73,7 @@ public class LoginDialog
|
|||
btn_register_account.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SDLActivity.open_dialog(SDLActivity.DIALOG_REGISTER);
|
||||
PrincipiaActivity.open_dialog(PrincipiaActivity.DIALOG_REGISTER);
|
||||
_dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
|
@ -2,7 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
|
|
@ -1,15 +1,5 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import com.bithack.principia.shared.ConfirmDialog.OnOptionSelectedListener;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
|
|
@ -17,33 +7,28 @@ import android.graphics.PorterDuff.Mode;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnFocusChangeListener;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemSelectedListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.OnEditorActionListener;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MultiSelectDialog implements OnSeekBarChangeListener, OnCheckedChangeListener {
|
||||
public static final int NUM_TABS = 3;
|
||||
static Dialog _dialog;
|
||||
|
||||
static View view;
|
||||
|
|
@ -73,7 +58,7 @@ public class MultiSelectDialog implements OnSeekBarChangeListener, OnCheckedChan
|
|||
this.view_id = view_id;
|
||||
this.title = title;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static ArrayList<Tab> tabs = new ArrayList<Tab>();
|
||||
|
||||
|
|
@ -153,8 +138,8 @@ public class MultiSelectDialog implements OnSeekBarChangeListener, OnCheckedChan
|
|||
ll_tabs.addView(tb);
|
||||
}
|
||||
|
||||
btn_apply = (Button)view.findViewById(R.id.btn_apply);
|
||||
btn_close = (Button)view.findViewById(R.id.btn_close);
|
||||
btn_apply = view.findViewById(R.id.btn_apply);
|
||||
btn_close = view.findViewById(R.id.btn_close);
|
||||
|
||||
btn_apply.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
@ -290,13 +275,13 @@ public class MultiSelectDialog implements OnSeekBarChangeListener, OnCheckedChan
|
|||
break;
|
||||
|
||||
case PLASTIC_DENSITY:
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_MULTI_PLASTIC_DENSITY, sb_plastic_density.getProgress());
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_MULTI_PLASTIC_DENSITY, sb_plastic_density.getProgress()/10);
|
||||
message = "Changed the density of all plastic entities.";
|
||||
break;
|
||||
|
||||
case CONNECTION_RENDER_TYPE:
|
||||
{
|
||||
int t = 0; // CONN_RENDER_DEFAULT
|
||||
int t; // CONN_RENDER_DEFAULT
|
||||
switch (render_type.getCheckedRadioButtonId()) {
|
||||
case R.id.rb_small:
|
||||
t = 1; // CONN_RENDER_SMALL
|
||||
|
|
@ -2,8 +2,6 @@ package com.bithack.principia.shared;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -11,7 +9,8 @@ import android.content.DialogInterface.OnCancelListener;
|
|||
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import com.bithack.principia.R;
|
||||
|
||||
public class MultiSpinner extends androidx.appcompat.widget.AppCompatSpinner implements OnMultiChoiceClickListener, OnCancelListener {
|
||||
|
||||
|
|
@ -33,11 +32,7 @@ public class MultiSpinner extends androidx.appcompat.widget.AppCompatSpinner imp
|
|||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
selected[which] = true;
|
||||
} else {
|
||||
selected[which] = false;
|
||||
}
|
||||
selected[which] = isChecked;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -49,7 +44,7 @@ public class MultiSpinner extends androidx.appcompat.widget.AppCompatSpinner imp
|
|||
public boolean performClick() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||
builder.setMultiChoiceItems(
|
||||
items.toArray(new CharSequence[items.size()]), selected, this);
|
||||
items.toArray(new CharSequence[0]), selected, this);
|
||||
builder.setPositiveButton(R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
|
||||
|
|
@ -20,15 +20,15 @@ public class NewLevelDialog
|
|||
AlertDialog.Builder bld = new AlertDialog.Builder(PrincipiaActivity.mSingleton);
|
||||
bld.setTitle("Create new level");
|
||||
|
||||
bld.setMessage("Please select the level type:\nPuzzle\nAdventure - Control a robot\nCustom - Create whatever you want here!");
|
||||
bld.setMessage("Please select the level type:\nAdventure - Control a robot\nCustom - Create whatever you want here!");
|
||||
|
||||
bld.setPositiveButton("Puzzle", new OnClickListener(){
|
||||
/*bld.setPositiveButton("Puzzle", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
PrincipiaBackend.triggerCreateLevel(0);
|
||||
Toast.makeText(PrincipiaActivity.mSingleton, "New Puzzle level created!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
bld.setNeutralButton("Adventure", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
|
|
@ -386,7 +386,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
|
|||
String result = String.valueOf(dest.subSequence(0, dstart))
|
||||
+ filtered
|
||||
+ dest.subSequence(dend, dest.length());
|
||||
String str = String.valueOf(result).toLowerCase(Locale.US);
|
||||
String str = result.toLowerCase(Locale.US);
|
||||
for (String val : mDisplayedValues) {
|
||||
val = val.toLowerCase(Locale.US);
|
||||
if (val.startsWith(str)) {
|
||||
|
|
@ -24,7 +24,6 @@ import android.content.Context;
|
|||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.bithack.principia.R;
|
||||
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
|
|
@ -25,11 +23,11 @@ public class OpenDialog
|
|||
|
||||
public OpenDialog(final boolean is_state)
|
||||
{
|
||||
SDLActivity.open_adapter.clear();
|
||||
PrincipiaActivity.open_adapter.clear();
|
||||
|
||||
AlertDialog.Builder bld = new AlertDialog.Builder(PrincipiaActivity.mSingleton);
|
||||
|
||||
String level_list = PrincipiaBackend.getLevels(is_state ? SDLActivity.LEVEL_LOCAL_STATE : SDLActivity.LEVEL_LOCAL);
|
||||
String level_list = PrincipiaBackend.getLevels(is_state ? PrincipiaActivity.LEVEL_LOCAL_STATE : PrincipiaActivity.LEVEL_LOCAL);
|
||||
Log.v("Principia", "Level list: " + level_list);
|
||||
String[] levels = level_list.split("\n");
|
||||
|
||||
|
|
@ -60,7 +58,7 @@ public class OpenDialog
|
|||
|
||||
Log.v("Principia", "Adding "+name);
|
||||
|
||||
SDLActivity.open_adapter.add(l);
|
||||
PrincipiaActivity.open_adapter.add(l);
|
||||
|
||||
level_names[x] = name;
|
||||
}
|
||||
|
|
@ -82,7 +80,7 @@ public class OpenDialog
|
|||
@Override
|
||||
public void onShow(DialogInterface dialog)
|
||||
{
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
ListView lv = _dialog.getListView();
|
||||
OpenDialog.lv = lv;
|
||||
if (lv != null) {
|
||||
|
|
@ -92,7 +90,7 @@ public class OpenDialog
|
|||
int position, long id) {
|
||||
Level level = (Level)parent.getAdapter().getItem(position);
|
||||
if (is_state) {
|
||||
PrincipiaBackend.openState(level.get_level_type(), level.get_id(), level.get_save_id(), SDLActivity.is_cool); /* XXX */
|
||||
PrincipiaBackend.openState(level.get_level_type(), level.get_id(), level.get_save_id(), PrincipiaActivity.is_cool); /* XXX */
|
||||
} else {
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_OPEN, level.get_id());
|
||||
}
|
||||
|
|
@ -100,8 +98,8 @@ public class OpenDialog
|
|||
}
|
||||
|
||||
});
|
||||
lv.setAdapter(SDLActivity.open_adapter);
|
||||
SDLActivity.mSingleton.registerForContextMenu(lv);
|
||||
lv.setAdapter(PrincipiaActivity.open_adapter);
|
||||
PrincipiaActivity.mSingleton.registerForContextMenu(lv);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -27,7 +26,7 @@ public class PkgLevelDialog {
|
|||
|
||||
view = LayoutInflater.from(PrincipiaActivity.mSingleton).inflate(R.layout.pkg_level_id, null);
|
||||
|
||||
np_level_id = new com.bithack.principia.shared.NumberPicker(SDLActivity.getContext());
|
||||
np_level_id = new com.bithack.principia.shared.NumberPicker(PrincipiaActivity.getContext());
|
||||
np_level_id.setRange(0, 255);
|
||||
np_level_id.setValue(1);
|
||||
|
||||
|
|
@ -3,19 +3,14 @@ package com.bithack.principia.shared;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
|
||||
public class PlayDialog
|
||||
{
|
||||
|
|
@ -25,17 +20,17 @@ public class PlayDialog
|
|||
*/
|
||||
|
||||
static final String[] shared_items = new String[] {
|
||||
SDLActivity.mSingleton.getString(R.string.open_save),
|
||||
SDLActivity.mSingleton.getString(R.string.back_to_sandbox),
|
||||
SDLActivity.mSingleton.getString(R.string.back_to_main_menu),
|
||||
SDLActivity.mSingleton.getString(R.string.cancel)
|
||||
PrincipiaActivity.mSingleton.getString(R.string.open_save),
|
||||
PrincipiaActivity.mSingleton.getString(R.string.back_to_sandbox),
|
||||
PrincipiaActivity.mSingleton.getString(R.string.back_to_main_menu),
|
||||
PrincipiaActivity.mSingleton.getString(R.string.cancel)
|
||||
};
|
||||
|
||||
static final String save_state = SDLActivity.mSingleton.getString(R.string.save_state);
|
||||
static final String save_state = PrincipiaActivity.mSingleton.getString(R.string.save_state);
|
||||
|
||||
static final String[] community_items = new String[] {
|
||||
SDLActivity.mSingleton.getString(R.string.restart_level),
|
||||
SDLActivity.mSingleton.getString(R.string.back_to_community)
|
||||
PrincipiaActivity.mSingleton.getString(R.string.restart_level),
|
||||
PrincipiaActivity.mSingleton.getString(R.string.back_to_community)
|
||||
};
|
||||
|
||||
public static Dialog create_dialog()
|
||||
|
|
@ -45,28 +40,28 @@ public class PlayDialog
|
|||
if (source > 100) {
|
||||
source -= 100;
|
||||
}
|
||||
AlertDialog.Builder bld = new AlertDialog.Builder(SDLActivity.mSingleton);
|
||||
AlertDialog.Builder bld = new AlertDialog.Builder(PrincipiaActivity.mSingleton);
|
||||
List<CharSequence> items = new ArrayList<CharSequence>();
|
||||
|
||||
if (PrincipiaBackend.getLevelFlag(33)) {
|
||||
items.add(save_state);
|
||||
}
|
||||
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.open_save));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.open_save));
|
||||
|
||||
if (PrincipiaBackend.isAdventure()) {
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.selfdestruct));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.selfdestruct));
|
||||
}
|
||||
|
||||
if (source == 1) {
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.restart_level));
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.back_to_community));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.restart_level));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.back_to_community));
|
||||
} else if (source == 0) {
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.back_to_sandbox));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.back_to_sandbox));
|
||||
}
|
||||
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.back_to_main_menu));
|
||||
items.add(SDLActivity.mSingleton.getString(R.string.cancel));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.back_to_main_menu));
|
||||
items.add(PrincipiaActivity.mSingleton.getString(R.string.cancel));
|
||||
|
||||
final CharSequence[] real_items = items.toArray(new CharSequence[items.size()]);
|
||||
|
||||
|
|
@ -75,26 +70,26 @@ public class PlayDialog
|
|||
String cool = real_items[which].toString();
|
||||
|
||||
if (cool.equalsIgnoreCase("open save")) {
|
||||
SDLActivity.mSingleton.runOnUiThread(new Runnable(){
|
||||
PrincipiaActivity.mSingleton.runOnUiThread(new Runnable(){
|
||||
public void run() {
|
||||
try { SDLActivity.mSingleton.removeDialog(SDLActivity.DIALOG_OPEN); } catch(Exception e) {};
|
||||
try { SDLActivity.mSingleton.removeDialog(SDLActivity.DIALOG_OPEN_STATE); } catch(Exception e) {};
|
||||
try { PrincipiaActivity.mSingleton.removeDialog(PrincipiaActivity.DIALOG_OPEN); } catch(Exception e) {};
|
||||
try { PrincipiaActivity.mSingleton.removeDialog(PrincipiaActivity.DIALOG_OPEN_STATE); } catch(Exception e) {};
|
||||
}
|
||||
});
|
||||
SDLActivity.mSingleton.showDialog(SDLActivity.DIALOG_OPEN_STATE);
|
||||
PrincipiaActivity.mSingleton.showDialog(PrincipiaActivity.DIALOG_OPEN_STATE);
|
||||
} else if (cool.equalsIgnoreCase("back to sandbox")) {
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_BACK, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_BACK, 0);
|
||||
} else if (cool.equalsIgnoreCase("back to community")) {
|
||||
SDLActivity.wv.loadUrl(PrincipiaBackend.getCurrentCommunityUrl());
|
||||
SDLActivity.wv_dialog.show();
|
||||
PrincipiaActivity.wv.loadUrl(PrincipiaBackend.getCurrentCommunityUrl());
|
||||
PrincipiaActivity.wv_dialog.show();
|
||||
} else if (cool.equalsIgnoreCase("save state")) {
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_SAVE_STATE, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_SAVE_STATE, 0);
|
||||
} else if (cool.equalsIgnoreCase("back to main menu")) {
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_GOTO_MAINMENU, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_GOTO_MAINMENU, 0);
|
||||
} else if (cool.equalsIgnoreCase("restart level")) {
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_RESTART_LEVEL, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_RESTART_LEVEL, 0);
|
||||
} else if (cool.equalsIgnoreCase("self-destruct")) {
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_SELF_DESTRUCT, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_SELF_DESTRUCT, 0);
|
||||
} else {
|
||||
Log.e("PRINCIPIA", "UNKNOWN THING: " + cool);
|
||||
}
|
||||
|
|
@ -114,7 +109,7 @@ public class PlayDialog
|
|||
.setNeutralButton("Back", new OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_BACK, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_BACK, 0);
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel", new OnClickListener(){
|
||||
|
|
@ -4,7 +4,7 @@ import java.util.Locale;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -41,7 +40,7 @@ public class PromptSettingsDialog
|
|||
_dialog.setOnShowListener(new OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
|
||||
Button b = _dialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
|
||||
|
|
@ -59,12 +58,12 @@ public class PromptSettingsDialog
|
|||
int message_len = message.length();
|
||||
|
||||
if (message_len <= 0) {
|
||||
SDLActivity.message("You must enter a message for the prompt.", 0);
|
||||
PrincipiaActivity.message("You must enter a message for the prompt.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (b1_len <= 0 && b2_len <= 0 && b3_len <= 0) {
|
||||
SDLActivity.message("You must use at least one button.", 0);
|
||||
PrincipiaActivity.message("You must use at least one button.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -24,7 +23,6 @@ public class PublishDialog
|
|||
static EditText et_name;
|
||||
static EditText et_descr;
|
||||
|
||||
static CheckBox cb_allow_derivatives;
|
||||
static CheckBox cb_locked;
|
||||
|
||||
public static Dialog get_dialog()
|
||||
|
|
@ -42,7 +40,7 @@ public class PublishDialog
|
|||
_dialog.setOnShowListener(new OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
|
||||
Button b = _dialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
|
||||
|
|
@ -54,16 +52,15 @@ public class PublishDialog
|
|||
String descr = et_descr.getText().toString().trim();
|
||||
|
||||
if (name.length() <= 0) {
|
||||
SDLActivity.message("You must enter a name for your level!", 0);
|
||||
PrincipiaActivity.message("You must enter a name for your level!", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
PrincipiaBackend.setLevelName(name);
|
||||
PrincipiaBackend.setLevelDescription(descr);
|
||||
PrincipiaBackend.setLevelAllowDerivatives(cb_allow_derivatives.isChecked());
|
||||
PrincipiaBackend.setLevelLocked(cb_locked.isChecked());
|
||||
|
||||
PrincipiaBackend.addActionAsInt(SDLActivity.ACTION_PUBLISH, 0);
|
||||
PrincipiaBackend.addActionAsInt(PrincipiaActivity.ACTION_PUBLISH, 0);
|
||||
|
||||
_dialog.dismiss();
|
||||
}
|
||||
|
|
@ -73,7 +70,6 @@ public class PublishDialog
|
|||
|
||||
et_name = (EditText)view.findViewById(R.id.publish_name);
|
||||
et_descr = (EditText)view.findViewById(R.id.publish_descr);
|
||||
cb_allow_derivatives = (CheckBox)view.findViewById(R.id.publish_allow_derivatives);
|
||||
cb_locked = (CheckBox)view.findViewById(R.id.publish_locked);
|
||||
}
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -16,7 +16,6 @@ import android.os.Bundle;
|
|||
import android.os.Parcelable;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.widget.ImageView;
|
||||
|
||||
/**
|
||||
* Widget that lets users select a minimum and maximum value on a given numerical range. The range value types can be one of Long, Double, Integer, Float, Short, Byte or BigDecimal.<br />
|
||||
|
|
@ -2,15 +2,13 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.DialogInterface.OnShowListener;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
|
@ -45,7 +43,7 @@ public class RegisterDialog
|
|||
_dialog.setOnShowListener(new OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
|
||||
Button b = _dialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
|
||||
|
|
@ -59,22 +57,22 @@ public class RegisterDialog
|
|||
final String email = et_email.getText().toString().trim();
|
||||
|
||||
if (password.length() < 6 || password.length() > 100) {
|
||||
SDLActivity.message("Your password must be at least 3 and at most 100 characters.", 0);
|
||||
PrincipiaActivity.message("Your password must be at least 3 and at most 100 characters.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!password.equals(password_confirm)) {
|
||||
SDLActivity.message("The two passwords you entered don't match.", 0);
|
||||
PrincipiaActivity.message("The two passwords you entered don't match.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (username.length() < 3 || username.length() > 20) {
|
||||
SDLActivity.message("Your username must be at least 3 and at most 20 characters.", 0);
|
||||
PrincipiaActivity.message("Your username must be at least 3 and at most 20 characters.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
SDLActivity.message("You must enter a valid email address.", 0);
|
||||
PrincipiaActivity.message("You must enter a valid email address.", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -4,15 +4,13 @@ import java.util.ArrayList;
|
|||
|
||||
import com.bithack.principia.shared.MultiSpinner.MultiSpinnerListener;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import android.os.Bundle;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
|
|
@ -2,7 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -34,13 +33,13 @@ public class SandboxTipsDialog
|
|||
.setTitle("Tips & tricks")
|
||||
.setPositiveButton("OK", new OnClickListener(){public void onClick(DialogInterface dialog, int which) {}})
|
||||
.setNeutralButton("Next", null)
|
||||
.setNegativeButton("More tips & tricks", new OnClickListener(){public void onClick(DialogInterface dialog, int which){SDLActivity.open_url("https://principia-web.se/wiki/Getting_Started");}})
|
||||
.setNegativeButton("More tips & tricks", new OnClickListener(){public void onClick(DialogInterface dialog, int which){PrincipiaActivity.open_url("https://principia-web.se/wiki/Getting_Started");}})
|
||||
.create();
|
||||
|
||||
_dialog.setOnShowListener(new OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
SDLActivity.on_show(dialog);
|
||||
PrincipiaActivity.on_show(dialog);
|
||||
|
||||
Button b = _dialog.getButton(AlertDialog.BUTTON_NEUTRAL);
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -11,7 +11,6 @@ import android.content.DialogInterface.OnClickListener;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class SaveAsDialog
|
||||
{
|
||||
|
|
@ -1,15 +1,11 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import com.bithack.principia.shared.ConfirmDialog.OnOptionSelectedListener;
|
||||
import com.bithack.principia.shared.CustomLinearLayout.OnKeyboardStateChangedListener;
|
||||
import com.bithack.principia.shared.MultiSpinner.MultiSpinnerListener;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -17,7 +13,6 @@ import android.os.Bundle;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
|
|
@ -63,10 +58,8 @@ public class ScriptDialog {
|
|||
code.setHorizontallyScrolling(true);
|
||||
int ime_options = code.getImeOptions();
|
||||
save = (Button)view.findViewById(R.id.script_save);
|
||||
if (android.os.Build.VERSION.SDK_INT >= 16) {
|
||||
ime_options |= 0x80000000; // force ascii
|
||||
code.setImeOptions(ime_options);
|
||||
}
|
||||
ime_options |= 0x80000000; // force ascii
|
||||
code.setImeOptions(ime_options);
|
||||
cancel = (Button)view.findViewById(R.id.script_cancel);
|
||||
|
||||
save.setOnClickListener(new View.OnClickListener() {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -2,7 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -13,8 +13,7 @@ import android.widget.Spinner;
|
|||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
public class Sfx2Dialog {
|
||||
static Dialog _dialog;
|
||||
|
|
@ -36,7 +35,7 @@ public class Sfx2Dialog {
|
|||
s_sfx = (Spinner)view.findViewById(R.id.s_sfx);
|
||||
String[] sound_effects = PrincipiaBackend.getSounds().split(",.,");
|
||||
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(SDLActivity.mSingleton, android.R.layout.select_dialog_item, sound_effects);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(PrincipiaActivity.mSingleton, android.R.layout.select_dialog_item, sound_effects);
|
||||
s_sfx.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
bld.setTitle("SFX Emitter");
|
||||
|
|
@ -73,6 +72,6 @@ public class Sfx2Dialog {
|
|||
PrincipiaBackend.setPropertyInt8(1, sfx_global.isChecked() ? 1 : 0);
|
||||
//TODO: property_index 2 (sound chunk)
|
||||
PrincipiaBackend.setPropertyInt8(3, sfx_loop.isChecked() ? 1 : 0);
|
||||
SDLActivity.message("Saved properties for SFX Emitter.", 0);
|
||||
PrincipiaActivity.message("Saved properties for SFX Emitter.", 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -33,7 +32,7 @@ public class SfxDialog {
|
|||
s_sfx = (Spinner)view.findViewById(R.id.s_sfx);
|
||||
String[] sound_effects = PrincipiaBackend.getSfxSounds().split(",");
|
||||
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(SDLActivity.mSingleton, android.R.layout.select_dialog_item, sound_effects);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(PrincipiaActivity.mSingleton, android.R.layout.select_dialog_item, sound_effects);
|
||||
s_sfx.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
bld.setTitle("SFX Emitter (Old)");
|
||||
|
|
@ -68,6 +67,6 @@ public class SfxDialog {
|
|||
{
|
||||
PrincipiaBackend.setPropertyInt(0, s_sfx.getSelectedItemId());
|
||||
PrincipiaBackend.setPropertyInt8(1, sfx_global.isChecked() ? 1 : 0);
|
||||
SDLActivity.message("Saved properties for SFX Emitter.", 0);
|
||||
PrincipiaActivity.message("Saved properties for SFX Emitter.", 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ import java.util.Locale;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -11,7 +10,6 @@ import android.content.DialogInterface;
|
|||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.util.Log;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.CheckBox;
|
||||
|
|
@ -34,7 +32,7 @@ public class SoundManDialog {
|
|||
s_sounds = (Spinner)view.findViewById(R.id.sm_sounds);
|
||||
|
||||
String[] array_data = PrincipiaBackend.getSounds().split(",.,");
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(SDLActivity.mSingleton, android.R.layout.select_dialog_item, array_data);
|
||||
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(PrincipiaActivity.mSingleton, android.R.layout.select_dialog_item, array_data);
|
||||
s_sounds.setAdapter(spinnerArrayAdapter);
|
||||
|
||||
_dialog = new AlertDialog.Builder(PrincipiaActivity.mSingleton)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -2,13 +2,11 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
|
@ -107,12 +105,12 @@ public class SynthesizerDialog {
|
|||
synth_freq_vibrato_hz_tv = (TextView)view.findViewById(R.id.synth_freq_vibrato_hz_tv);
|
||||
synth_freq_vibrato_extent_tv = (TextView)view.findViewById(R.id.synth_freq_vibrato_extent_tv);
|
||||
|
||||
synth_pulse_width.setOnSeekBarChangeListener(SDLActivity.mSingleton);
|
||||
synth_bitcrushing.setOnSeekBarChangeListener(SDLActivity.mSingleton);
|
||||
synth_volume_vibrato_hz.setOnSeekBarChangeListener(SDLActivity.mSingleton);
|
||||
synth_volume_vibrato_extent.setOnSeekBarChangeListener(SDLActivity.mSingleton);
|
||||
synth_freq_vibrato_hz.setOnSeekBarChangeListener(SDLActivity.mSingleton);
|
||||
synth_freq_vibrato_extent.setOnSeekBarChangeListener(SDLActivity.mSingleton);
|
||||
synth_pulse_width.setOnSeekBarChangeListener(PrincipiaActivity.mSingleton);
|
||||
synth_bitcrushing.setOnSeekBarChangeListener(PrincipiaActivity.mSingleton);
|
||||
synth_volume_vibrato_hz.setOnSeekBarChangeListener(PrincipiaActivity.mSingleton);
|
||||
synth_volume_vibrato_extent.setOnSeekBarChangeListener(PrincipiaActivity.mSingleton);
|
||||
synth_freq_vibrato_hz.setOnSeekBarChangeListener(PrincipiaActivity.mSingleton);
|
||||
synth_freq_vibrato_extent.setOnSeekBarChangeListener(PrincipiaActivity.mSingleton);
|
||||
|
||||
sp_waveform = (Spinner)view.findViewById(R.id.synth_waveform);
|
||||
sp_waveform.setOnItemSelectedListener(new OnItemSelectedListener() {
|
||||
|
|
@ -132,7 +130,7 @@ public class SynthesizerDialog {
|
|||
});
|
||||
|
||||
String[] waveforms = PrincipiaBackend.getSynthWaveforms().split(",");
|
||||
ArrayAdapter<String> spinner_aa = new ArrayAdapter<String>(SDLActivity.getContext(), android.R.layout.select_dialog_item, waveforms);
|
||||
ArrayAdapter<String> spinner_aa = new ArrayAdapter<String>(PrincipiaActivity.getContext(), android.R.layout.select_dialog_item, waveforms);
|
||||
sp_waveform.setAdapter(spinner_aa);
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
|
||||
|
|
@ -8,7 +8,6 @@ import android.app.AlertDialog;
|
|||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class ToolDialog
|
||||
{
|
||||
|
|
@ -6,7 +6,7 @@ import com.bithack.principia.PrincipiaActivity;
|
|||
import com.bithack.principia.R;
|
||||
import com.bithack.principia.shared.RangeSeekBar.OnRangeSeekBarChangeListener;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
|
|
@ -2,8 +2,7 @@ package com.bithack.principia.shared;
|
|||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -82,9 +81,9 @@ public class VariableDialog {
|
|||
String s = et_name.getText().toString().trim().replaceAll("[^a-zA_Z0-9_-]", "");
|
||||
if (s.length() > 0 && s.length() < 50) {
|
||||
PrincipiaBackend.setPropertyString(0, s);
|
||||
SDLActivity.message("Saved variable name.", 0);
|
||||
PrincipiaActivity.message("Saved variable name.", 0);
|
||||
} else {
|
||||
SDLActivity.message("You must enter a valid variable name. a-zA-Z0-9_- allowed.", 0);
|
||||
PrincipiaActivity.message("You must enter a valid variable name. a-zA-Z0-9_- allowed.", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bithack.principia.shared;
|
||||
|
||||
import org.libsdl.app.PrincipiaBackend;
|
||||
import com.bithack.principia.PrincipiaBackend;
|
||||
|
||||
import com.bithack.principia.PrincipiaActivity;
|
||||
import com.bithack.principia.R;
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue