<commit_before>/*
 * created @ 2012 09 10
 *
 * created by fvi@
 *
 *
 */

exports.openCivilView = function() {
	height = Ti.Platform.displayCaps.platformHeight, width = Ti.Platform.displayCaps.platformWidth;
	var food_arr = [];

	var background_path = require('/util/getbackPathWithTime').getPath();
	var view = Titanium.UI.createView({
		backgroundImage : background_path
	});
	

	
	var house_image = Titanium.UI.createImageView({
		image : '/images/civ/ancient/house/house1.png',
		width : 'auto',
		height : 'auto',
		center : {
			x : width * 0.3,
			y : height * 0.4
		}
	});
	

	view.add(house_image);

	var man_image = Titanium.UI.createImageView({
		images : ['/images/civ/ancient/man/man0.png', '/images/civ/ancient/man/man10.png', '/images/civ/ancient/man/man11.png', '/images/civ/ancient/man/man12.png'],
		duration : 1500,
		repeatCount : 0,
		width : 'auto',
		height : 'auto',
		top : height * 0.5
	});
	man_image.start();

	man_image.addEventListener('click', function(e) {

		require('/ui/common/serifView/Serif').openView(view);
		Titanium.App.Properties.setString('first_contact', 'need_apple')

	});

	view.add(man_image);

	var cupcell_image = Titanium.UI.createImageView({
		image : '/images/civ/cupcell/cupcell.png',
		width : 'auto',
		height : 'auto',
		center : {
			x : width * 0.5,
			y : -1 * height
		}
	});

	view.add(cupcell_image);

	var item_button = Titanium.UI.createButton({
		backgroundImage : '/images/button/give/give.png',
		height : height * 0.1,
		width : width * 0.3,
		center : {
			x : width * 0.7,
			y : height * 0.9
		}
	});

	view.add(item_button);

	item_button.addEventListener('click', function(e) {
		var item_view = require('/ui/common/SelectBoard/selectItems').openView(view);
		item_button.setTouchEnabled(false);
		//StartAnimation(); このメソッドでアニメーションを開始するよ
		
	});

	//変更　アイテムに関するアニメーションを関数に変更
	function StartAnimation() {
		cupcell_image.animate({
			center : {
				x : width * 0.5,
				y : height * 0.65
			},
			duration : 1500
		}, function(e) {
			//second animation
			cupcell_image.animate({
				center : {
					x : width * 0.5,
					y : height * 0.6
				},
				duration : 500
			}, function(e) {
				//third animation
				cupcell_image.setImage('/images/civ/cupcell/cupcell_open.png');
				food_arr.push(Ti.UI.createImageView({
					image : '/images/civ/food/apple.png',
					width : 'auto',
					height : 'auto',
					center : {
						x : width * 0.5,
						y : height * 0.4
					}
				}));
				view.add(food_arr[0]);

				var disappear_time = setTimeout(function(e) {
					//cupcell_image.setCenter({x:width * 0.5,y:-1 * height});
					cupcell_image.setImage('/images/civ/cupcell/cupcell.png');
					cupcell_image.animate({
						center : {
							x : width * 0.5,
							y : -1 * height
						},
						duration : 500
					})
					item_button.setTouchEnabled(true);

					clearTimeout(disappear_time);

				}, 2000);

				var item_disappear_time = setTimeout(function(e) {
					//STUB的処理
					view.remove(food_arr[0]);
					clearTimeout(item_disappear_time);
				}, 2500);
			})
		})
	}

	var invest_button = Titanium.UI.createButton({
		backgroundImage : '/images/button/invest/investment.png',
		height : height * 0.1,
		width : width * 0.3,

		center : {
			x : width * 0.3,
			y : height * 0.9
		}

	});

	invest_button.addEventListener('click', function(e) {
		//背景黒のビューを設定
		var invest_view = require('/ui/common/SelectBoard/SelectBoard').openView(view);
		var invest_label = Titanium.UI.createLabel({
			text : 'これはてすとです',
			textAlign : 'center',
			color : 'black',
			width : invest_view.width * 0.9,<commit_msg>change message<commit_after>/*
 * created @ 2012 09 10
 *
 * created by fvi@
 *
 *
 */

exports.openCivilView = function() {
	height = Ti.Platform.displayCaps.platformHeight, width = Ti.Platform.displayCaps.platformWidth;
	var food_arr = [];

	var background_path = require('/util/getbackPathWithTime').getPath();
	
	var view = Titanium.UI.createView({
		backgroundImage : background_path
	});
	

	
	var house_image = Titanium.UI.createImageView({
		image : '/images/civ/ancient/house/house1.png',
		width : 'auto',
		height : 'auto',
		center : {
			x : width * 0.3,
			y : height * 0.4
		}
	});
	

	view.add(house_image);

	var man_image = Titanium.UI.createImageView({
		images : ['/images/civ/ancient/man/man0.png', '/images/civ/ancient/man/man10.png', '/images/civ/ancient/man/man11.png', '/images/civ/ancient/man/man12.png'],
		duration : 1500,
		repeatCount : 0,
		width : 'auto',
		height : 'auto',
		top : height * 0.5
	});
	man_image.start();

	man_image.addEventListener('click', function(e) {

		require('/ui/common/serifView/Serif').openView(view);
		Titanium.App.Properties.setString('first_contact', 'need_apple')

	});

	view.add(man_image);

	var cupcell_image = Titanium.UI.createImageView({
		image : '/images/civ/cupcell/cupcell.png',
		width : 'auto',
		height : 'auto',
		center : {
			x : width * 0.5,
			y : -1 * height
		}
	});

	view.add(cupcell_image);

	var item_button = Titanium.UI.createButton({
		backgroundImage : '/images/button/give/give.png',
		height : height * 0.1,
		width : width * 0.3,
		center : {
			x : width * 0.7,
			y : height * 0.9
		}
	});

	view.add(item_button);

	item_button.addEventListener('click', function(e) {
		var item_view = require('/ui/common/SelectBoard/selectItems').openView(view);
		item_button.setTouchEnabled(false);
		//StartAnimation(); このメソッドでアニメーションを開始するよ
		
	});

	//変更　アイテムに関するアニメーションを関数に変更
	function StartAnimation() {
		cupcell_image.animate({
			center : {
				x : width * 0.5,
				y : height * 0.65
			},
			duration : 1500
		}, function(e) {
			//second animation
			cupcell_image.animate({
				center : {
					x : width * 0.5,
					y : height * 0.6
				},
				duration : 500
			}, function(e) {
				//third animation
				cupcell_image.setImage('/images/civ/cupcell/cupcell_open.png');
				food_arr.push(Ti.UI.createImageView({
					image : '/images/civ/food/apple.png',
					width : 'auto',
					height : 'auto',
					center : {
						x : width * 0.5,
						y : height * 0.4
					}
				}));
				view.add(food_arr[0]);

				var disappear_time = setTimeout(function(e) {
					//cupcell_image.setCenter({x:width * 0.5,y:-1 * height});
					cupcell_image.setImage('/images/civ/cupcell/cupcell.png');
					cupcell_image.animate({
						center : {
							x : width * 0.5,
							y : -1 * height
						},
						duration : 500
					})
					item_button.setTouchEnabled(true);

					clearTimeout(disappear_time);

				}, 2000);

				var item_disappear_time = setTimeout(function(e) {
					//STUB的処理
					view.remove(food_arr[0]);
					clearTimeout(item_disappear_time);
				}, 2500);
			})
		})
	}

	var invest_button = Titanium.UI.createButton({
		backgroundImage : '/images/button/invest/investment.png',
		height : height * 0.1,
		width : width * 0.3,

		center : {
			x : width * 0.3,
			y : height * 0.9
		}

	});

	invest_button.addEventListener('click', function(e) {
		//背景黒のビューを設定
		var invest_view = require('/ui/common/SelectBoard/SelectBoard').openView(view);
		var invest_label = Titanium.UI.createLabel({
			text : '今現時点のあなたの文明は\n人類の夜明け\nの段階です',
			textAlign : 'center',
			color : 'black',
			width : invest_view.width * 0.9,
{'fraction_non_alphanumeric': 0.1597222222222222, 'fraction_numerical': 0.024166666666666666, 'mean_word_length': 2.965308370044053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7238409', 'n_tokens_mistral': 3313, 'n_tokens_neox': 2671, 'n_words': 440}