Skip to content

Commit

Permalink
Merge pull request #454 from origami-team/v2.0.0_web
Browse files Browse the repository at this point in the history
V2.0.0 web
  • Loading branch information
YouQam authored Apr 18, 2023
2 parents 794e145 + 081dba3 commit 415959b
Show file tree
Hide file tree
Showing 139 changed files with 7,896 additions and 1,868 deletions.
Binary file modified .gradle/5.6.4/fileHashes/fileHashes.lock
Binary file not shown.
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ android {

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-barcode-scanner')
implementation project(':capacitor-keep-screen-on')
implementation project(':capacitor-voice-recorder')

Expand Down
10 changes: 7 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ifgi.geogami">
package="com.ifgi.geogami" xmlns:tools="http://schemas.android.com/tools"
>

<application
android:hardwareAccelerated="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down Expand Up @@ -47,7 +49,7 @@

<uses-permission android:name="android.permission.INTERNET" />
<!-- Camera, Photos, input file -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Geolocation API -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Expand All @@ -60,5 +62,7 @@
<uses-permission android:name="android.permission.CAMERA" />
<!-- Audio -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- needed for running barcode scanner -->
<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />
</manifest>
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/ifgi/geogami/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.getcapacitor.Plugin;

import java.util.ArrayList;
import com.dutchconcepts.capacitor.barcodescanner.BarcodeScanner;

public class MainActivity extends BridgeActivity {
@Override
Expand All @@ -16,6 +17,7 @@ public void onCreate(Bundle savedInstanceState) {
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(BarcodeScanner.class);
}});
}
}
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

include ':capacitor-community-barcode-scanner'
project(':capacitor-community-barcode-scanner').projectDir = new File('../node_modules/@capacitor-community/barcode-scanner/android')

include ':capacitor-keep-screen-on'
project(':capacitor-keep-screen-on').projectDir = new File('../node_modules/capacitor-keep-screen-on/android')

Expand Down
10 changes: 8 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,14 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 2.0.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.ifgi.geogami;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG USE_PUSH";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -392,10 +395,13 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 2.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.ifgi.geogami;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = USE_PUSH;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
2 changes: 1 addition & 1 deletion ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>GeoGami benötigt Zugriff auf deine Kamera um Aufgaben mit Bildern zu versehen.</string>
<string>GeoGami benötigt Zugriff auf deine Kamera.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Deine Position wird für das Spiel selbst sowie für die Auswertung deiner Spielperformance genutzt.</string>
<key>NSLocationWhenInUseUsageDescription</key>
Expand Down
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def capacitor_pods
# Automatic Capacitor Pod dependencies, do not delete
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunityBarcodeScanner', :path => '../../node_modules/@capacitor-community/barcode-scanner'
pod 'CapacitorKeepScreenOn', :path => '../../node_modules/capacitor-keep-screen-on'
pod 'CapacitorVoiceRecorder', :path => '../../node_modules/capacitor-voice-recorder'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"@ionic-native/core": "^5.24.0",
"@ionic-native/device-orientation": "^5.26.0",
"@ionic-native/network": "^5.36.0",
"@ionic-native/splash-screen": "^5.36.0",
"@ionic-native/status-bar": "^5.36.0",
"@ionic/angular": "^6.3.4",
"@ionic/cli": "^6.0.0",
"@ionic/pwa-elements": "^3.0.1",
Expand All @@ -51,7 +53,7 @@
"@types/dom-mediacapture-record": "^1.0.7",
"angular-pipes": "^10.0.0",
"capacitor-keep-screen-on": "^0.0.4",
"capacitor-voice-recorder": "^0.1.4",
"capacitor-voice-recorder": "git+https://github.com/origami-team/capacitor-voice-recorder.git",
"cordova-android": "^11.0.0",
"cordova-browser": "6.0.0",
"cordova-ios": "^6.2.0",
Expand Down
24 changes: 16 additions & 8 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const routes: Routes = [
),
},
{
path: 'play-game/play-game-list/:worldType',
path: 'play-game/play-game-list',
loadChildren: () =>
import('./pages/play-game/play-game-list/play-game-list.module').then(
(m) => m.PlayGameListPageModule
Expand All @@ -37,7 +37,7 @@ const routes: Routes = [
),
},
{
path: 'create-game',
path: 'create-game/:bundle',
loadChildren: () =>
import('./pages/create-game/create-game/create-game.module').then(
(m) => m.CreateGamePageModule
Expand All @@ -53,7 +53,7 @@ const routes: Routes = [
canActivate: [AuthGuard],
},
{
path: 'create-game/create-game-list',
path: 'create-game-list/:bundle',
loadChildren: () =>
import(
'./pages/create-game/create-game-list/create-game-list.module'
Expand All @@ -69,18 +69,18 @@ const routes: Routes = [
canActivate: [AuthGuard],
},
{
path: 'edit-game-list/:worldType',
path: 'edit-game-list',
loadChildren: () =>
import('./pages/edit-game/edit-game-list/edit-game-list.module').then(
(m) => m.EditGameListPageModule
),
canActivate: [AuthGuard],
},
{
path: 'edit-game/:id',
path: 'edit-game-tasks/:bundle',
loadChildren: () =>
import('./pages/edit-game/edit-game-tasks/edit-game-list.module').then(
(m) => m.EditGameListPageModule
import('./pages/edit-game/edit-game-tasks/edit-game-tasks.module').then(
(m) => m.EditGameTasksPageModule
),
canActivate: [AuthGuard],
},
Expand Down Expand Up @@ -184,13 +184,21 @@ const routes: Routes = [
m => m.PlayGameMenuPageModule)
},
{
path: 'create-game-virtual-menu',
path: 'create-game-virtual-menu/:bundle',
loadChildren: () => import('./pages/create-game/create-game-virtual-menu/create-game-virtual-menu.module').then( m => m.CreateGameVirtualMenuPageModule)
},
{
path: 'user/user-management',
loadChildren: () => import('./pages/user/user-management/user-management.module').then( m => m.UserManagementPageModule)
},
{
path: 'game-type-menu/:worldType',
loadChildren: () => import('./pages/multiplayer/game-type-menu/game-type-menu.module').then( m => m.GameTypeMenuPageModule)
},
{
path: 'barcode-scanner',
loadChildren: () => import('./pages/barcode-scanner/barcode-scanner.module').then( m => m.BarcodeScannerPageModule)
},
];
@NgModule({
imports: [
Expand Down
10 changes: 5 additions & 5 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { FormsModule } from '@angular/forms';

// Modals
import { CreateTaskModalPage } from './pages/create-game/create-task-modal/create-task-modal.page';
import { CreateFreeTaskModalComponent } from './pages/create-game/create-free-task-modal/create-free-task-modal.component';
import { CreateModuleModalPage } from './pages/create-game/create-module-modal/create-module-modal.page';
import { MapFeaturesModalPage } from './pages/create-game/map-features-modal/map-features-modal.page';
import { CreateInfoModalComponent } from './pages/create-game/create-info-modal/create-info-modal.component';
Expand Down Expand Up @@ -50,6 +49,8 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
// import { Network } from '@awesome-cordova-plugins/network/ngx';
import { Network } from '@ionic-native/network/ngx';

// import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';

// AoT requires an exported function for factories
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
Expand All @@ -59,15 +60,14 @@ export function createTranslateLoader(http: HttpClient) {
* Using sockit.IO for receiving data from VR App
*/
import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io';
// import { PopupComponent } from './components/popup/popup.component';
const config: SocketIoConfig = { url: 'https://geogami-ve-singlemode.azurewebsites.net/', options: {} }; // multi single users at once
const config: SocketIoConfig = { url: 'https://goegami-ve.azurewebsites.net/', options: {} }; // azure server - branch (multiplayer - realworld - V1)


@NgModule({
declarations: [
AppComponent,
PopoverComponent,
CreateTaskModalPage,
CreateFreeTaskModalComponent,
MapFeaturesModalPage,
CreateModuleModalPage,
CreateInfoModalComponent,
Expand All @@ -86,7 +86,6 @@ const config: SocketIoConfig = { url: 'https://geogami-ve-singlemode.azurewebsit
entryComponents: [
PopoverComponent,
CreateTaskModalPage,
CreateFreeTaskModalComponent,
MapFeaturesModalPage,
CreateModuleModalPage,
CreateInfoModalComponent,
Expand Down Expand Up @@ -117,6 +116,7 @@ const config: SocketIoConfig = { url: 'https://geogami-ve-singlemode.azurewebsit
}),
MarkdownModule.forRoot(),
BrowserAnimationsModule,
// NgxQRCodeModule
// FormControl
],
providers: [
Expand Down
1 change: 1 addition & 0 deletions src/app/interfaces/iUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface IUser { //--- ToDo
type: string;
value: string;
};
// ToDo: update it to be list
role: {
type: string;
value: string;
Expand Down
34 changes: 19 additions & 15 deletions src/app/mapControllers/track-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,25 @@ export class TrackControl {

// keep track permanent impl.
addPermanentTrack(taskId, path = this.path){
// // console.log("(track) P index:", taskId,"path: ",path)
this.map.addSource(`permanentTrack${taskId}`, { type: 'geojson', data: path });
this.map.addLayer({
id: `permanentTrack${taskId}`,
type: 'line',
source: `permanentTrack${taskId}`,
paint: {
'line-color': "#fbff00", // warning color (yellow)
'line-opacity': 0.5,
'line-width': 5
},
layout: {
'line-cap': 'round'
}
});
// console.log("(track) P index:", taskId,"path: ",path)

//* to avoid error caused when swaping between tasks
if(this.map.getLayer(`permanentTrack${taskId}`)){
this.map.addSource(`permanentTrack${taskId}`, { type: 'geojson', data: path });
this.map.addLayer({
id: `permanentTrack${taskId}`,
type: 'line',
source: `permanentTrack${taskId}`,
paint: {
'line-color': "#fbff00", // warning color (yellow)
'line-opacity': 0.5,
'line-width': 5
},
layout: {
'line-cap': 'round'
}
});
}
}

// keep track temporary impl.
Expand Down
29 changes: 18 additions & 11 deletions src/app/mapControllers/view-direction-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ export class ViewDirectionControl {
// VR world
isVirtualWorld: boolean = false;
initialAvatarLoc: any;
initialAvatarDir: number;
private avatarPositionSubscription: Subscription;
private avatarOrientationSubscription: Subscription;

constructor(map: MapboxMap, private geolocationService: OrigamiGeolocationService, private orientationService: OrigamiOrientationService,
isVirtualWorld: boolean, initialAvatarLoc: any) {
isVirtualWorld: boolean, initialAvatarLoc: any, initialAvatarDir: number) {
this.map = map;
this.isVirtualWorld = isVirtualWorld;
this.initialAvatarLoc = initialAvatarLoc;
this.initialAvatarDir = initialAvatarDir;
console.log("🚀 ~ ViewDirectionControl ~ initialAvatarLoc:", initialAvatarLoc)

if (!isVirtualWorld) {
this.positionSubscription = this.geolocationService.geolocationSubscription.subscribe(
Expand Down Expand Up @@ -69,22 +72,25 @@ export class ViewDirectionControl {
}
});

this.avatarOrientationSubscription = this.orientationService.avatarOrientationSubscription.subscribe(avatarHeading => {
if (this.map.getLayer('viewDirection')) {
this.map.setLayoutProperty(
'viewDirection',
'icon-rotate',
avatarHeading - this.map.getBearing()
);
}
});
this.avatarOrientationSubscription = this.orientationService.avatarOrientationSubscription.subscribe(avatarHeading => {
if (this.map.getLayer('viewDirection')) {
this.map.setLayoutProperty(
'viewDirection',
'icon-rotate',
avatarHeading - this.map.getBearing()
);
}
});
}

this.map.loadImage(
'/assets/icons/directionv2.png',
(error, image) => {
if (error) throw error;

//* if image already exist remove it
// if (this.map.hasImage('view-direction')) this.map.removeImage('view-direction');

this.map.addImage('view-direction', image);

this.map.addSource('viewDirection', {
Expand All @@ -101,7 +107,8 @@ export class ViewDirectionControl {
layout: {
'icon-image': 'view-direction',
'icon-size': 0.65,
'icon-offset': [0, -8]
'icon-offset': [0, -8],
'icon-rotate': (this.isVirtualWorld ? this.initialAvatarDir : 0), //* V.E.: to control initial avatar rotation
}
});
this.map.setLayoutProperty('viewDirection', 'visibility', 'none');
Expand Down
3 changes: 3 additions & 0 deletions src/app/models/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ export class Game {
public tracking: boolean,
public tasks: Task[],
public bbox: any,
public isMultiplayerGame: boolean,
public numPlayers: number,
public mapSectionVisible: boolean,
public geofence: boolean,
public isVRWorld: boolean,
public isVRMirrored: boolean,
public virEnvType: string,
public isVisible: boolean,
public isCuratedGame: boolean
) { }
Expand Down
Loading

0 comments on commit 415959b

Please sign in to comment.