update for game logic
This commit is contained in:
@ -173,7 +173,7 @@ class DestinationController extends GetxController {
|
||||
is_in_checkin.value = false;
|
||||
});
|
||||
}
|
||||
else if(is_in_rog.value == true)
|
||||
else if(is_in_rog.value == true && indexController.rog_mode == 1)
|
||||
{
|
||||
print("----- in location popup checkin cp - ${d.cp}----");
|
||||
chekcs = 2;
|
||||
@ -244,7 +244,7 @@ class DestinationController extends GetxController {
|
||||
print("--- loc already checked in ${location_already_checked_in} ---");
|
||||
if(isUser_logged_in && d.cp == -1 && location_already_checked_in){
|
||||
//check for rogaining
|
||||
if(is_at_goal.value == false && rogaining_counted.value && indexController.rog_mode == 1){
|
||||
if(is_at_goal.value == false && rogaining_counted.value){
|
||||
//goal
|
||||
print("---- in goal -----");
|
||||
chekcs = 5;
|
||||
@ -369,11 +369,15 @@ class DestinationController extends GetxController {
|
||||
// }
|
||||
|
||||
void resetRogaining(){
|
||||
currentSelectedDestinations.forEach((element) {
|
||||
deleteDestination(element);
|
||||
});
|
||||
|
||||
is_in_checkin.value = false;
|
||||
is_in_rog.value = false;
|
||||
is_at_start.value = false;
|
||||
is_at_goal.value = false;
|
||||
destinations.clear();
|
||||
|
||||
|
||||
_start = 0;
|
||||
chekcs = 0;
|
||||
|
||||
@ -181,23 +181,6 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
destinationController.is_photo_shoot.value = true;
|
||||
Get.back();
|
||||
|
||||
// showMaterialModalBottomSheet(
|
||||
// expand: true,
|
||||
// context: Get.context!,
|
||||
// backgroundColor: Colors.transparent,
|
||||
// builder: (context) => BottomSheetNew()
|
||||
// ).whenComplete(() {
|
||||
// });
|
||||
|
||||
// showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||
// //builder:((context) => CameraPage())
|
||||
// builder:((context) => Container(child: Text("model"),))
|
||||
// ).whenComplete((){
|
||||
// // destinationController.makeCheckin(indexController.currentDestinationFeature[0], true);
|
||||
// // if(indexController.currentDestinationFeature[0].cp != -1){
|
||||
// // destinationController.rogaining_counted.value =true;
|
||||
// // }
|
||||
// });
|
||||
}
|
||||
else{
|
||||
destinationController.makeCheckin(indexController.currentDestinationFeature[0], true, "");
|
||||
@ -213,6 +196,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
//Get.back();
|
||||
},
|
||||
child: Text(
|
||||
//Checkin
|
||||
indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false ?
|
||||
"チェックイン"
|
||||
:
|
||||
@ -233,6 +217,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
ExternalService().StartRogaining().then((value) => Get.back());
|
||||
},
|
||||
child: Text(
|
||||
// start
|
||||
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
|
||||
"ロゲイニングを開始"
|
||||
:
|
||||
@ -251,6 +236,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
//goal
|
||||
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
|
||||
"ロゲイニングを終える"
|
||||
:
|
||||
@ -372,35 +358,44 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Obx(() =>
|
||||
indexController.currentDestinationFeature.isNotEmpty && destinationController.is_in_checkin.value == true ?
|
||||
Row(
|
||||
children: [
|
||||
ElevatedButton(
|
||||
Obx(() =>
|
||||
indexController.currentDestinationFeature.isNotEmpty && indexController.currentDestinationFeature[0].cp == -1 && indexController.currentDestinationFeature[0].checkedin == false && destinationController.is_at_start.value == true ?
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
destinationController.is_in_rog.value = true;
|
||||
destinationController.addToRogaining(destinationController.current_lat, destinationController.current_lon, indexController.currentDestinationFeature[0].location_id!);
|
||||
ExternalService().StartRogaining().then((value) => Get.back());
|
||||
},
|
||||
child: Text(
|
||||
// start
|
||||
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
|
||||
"ロゲイニングを開始"
|
||||
:
|
||||
"間違った目的地..."
|
||||
)
|
||||
)
|
||||
:
|
||||
Container(),
|
||||
|
||||
),
|
||||
Obx(() =>
|
||||
destinationController.is_at_goal.value == true && destinationController.rogaining_counted ==true ?
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
if(indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false){
|
||||
destinationController.makeCheckin(indexController.currentDestinationFeature[0], true, "");
|
||||
if(indexController.currentDestinationFeature[0].cp != -1){
|
||||
destinationController.rogaining_counted.value =true;
|
||||
}
|
||||
}
|
||||
else{
|
||||
destinationController.makeCheckin(indexController.currentDestinationFeature[0], false, "");
|
||||
}
|
||||
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false ?
|
||||
"チェックイン"
|
||||
//goal
|
||||
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
|
||||
"ロゲイニングを終える"
|
||||
:
|
||||
"チェックアウト"
|
||||
"間違った目的地 ..."
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
:
|
||||
Container(),
|
||||
),
|
||||
)
|
||||
:
|
||||
Container(),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user