1
0
DrDuck0117 3 сар өмнө
parent
commit
59d86e6c8f

+ 2 - 3
objects/oMain/Create_0.gml

@@ -42,9 +42,6 @@ global.developer_mode = true;
 // save file
 global.save_data = {};
 global.save_filename = "ddmyx_save.dat";
-application_surface_draw_enable(false);
-
-
 
 // title UI (BETA)
 menu_options = ["CONTINUE", "NEW GAME", "OPTIONS", "EXIT"];
@@ -57,3 +54,5 @@ for (var i = 0; i < array_length(menu_options); i++)
     option_scale[i] = 1;
 
 favour_text = choose("这是一条风味文本");
+
+application_surface_draw_enable(false);

+ 67 - 22
objects/oMain/Step_0.gml

@@ -8,29 +8,25 @@ _up        = ingame.kc(vk_up);
 _down      = ingame.kc(vk_down);
 _inventory = ingame.kcp("I");
 _focus     = ingame.kcp("A");
-
 _return    = ingame.kcp(vk_escape); // for debugging
-
 /*
-if (ingame.kcp(vk_escape)) {
-    autoreg_handle("title", "title", 100); 
-}
-if (title != undefined && title.kcp(vk_escape)) {
-    autodel_handle("title"); 
-}
-*/
 _newgame  = title.kcp(vk_space);
 _continue = title.kcp(vk_enter);
 _quitgame = title.kcp(vk_escape);
+*/
+_left_title  = title.kcp(vk_left);
+_right_title = title.kcp(vk_right);
+_up_title    = title.kcp(vk_up);
+_down_title  = title.kcp(vk_down);
+_select      = title.kcp("Z");
 
-_left_inv = inventory.kcp(vk_left);
-_right_inv= inventory.kcp(vk_right);
-_up_inv   = inventory.kcp(vk_up);
-_down_inv = inventory.kcp(vk_down);
-_close    = inventory.kcp("I") || inventory.kcp(vk_escape);
-
-
+_left_inv  = inventory.kcp(vk_left);
+_right_inv = inventory.kcp(vk_right);
+_up_inv    = inventory.kcp(vk_up);
+_down_inv  = inventory.kcp(vk_down);
+_close     = inventory.kcp("I") || inventory.kcp(vk_escape);
 
+/*
 if global.developer_mode && room == rTitle
 {
 	if _newgame
@@ -51,6 +47,7 @@ if global.developer_mode && room == rTitle
 	if _quitgame
 		game_end();
 }
+*/
 if global.developer_mode && room != rTitle
 	if _return
 	{
@@ -64,13 +61,61 @@ if global.developer_mode && room != rTitle
 		
 		autoreg_handle("title", "title", 100);
 	}
-if _inventory
+
+if _up_title
+{
+    menu_index--;
+    if menu_index < 0
+		menu_index = array_length(menu_options) - 1;
+}
+if _down_title
 {
-	global.inventory = icl(oInventory);
-	autoreg_handle("inventory", "inventory", 10);
+    menu_index++;
+    if menu_index >= array_length(menu_options)
+		menu_index = 0;
 }
-else if _close
+for(var i = 0; i < array_length(menu_options); i++)
 {
-	with(global.inventory) instance_destroy();
-	autodel_handle("inventory");
+    var _target = (i == menu_index) ? 1.2 : 1.0;
+    option_scale[i] = lerp(option_scale[i], _target, lerp_speed);
 }
+if _select
+{
+	var _func, _ripple;
+    switch(menu_index) 
+	{
+        case 0:
+			autodel_handle("title");
+			
+			_func = function()
+			{
+				icl(oRippleExpand);
+				
+				load_game_from_disk();
+			};
+			_ripple = icl(oRippleShrink, 960, 540);
+			_ripple.callback = _func;
+			break;
+
+		case 1:
+			autodel_handle("title");
+			
+			_func = function()
+			{
+				icl(oRippleExpand);
+				
+				global.save_data = get_default_save_data();
+				save_game_to_disk();
+				load_game_from_disk();
+			};
+			
+			_ripple = icl(oRippleShrink, 960, 600);
+			_ripple.callback = _func;
+			break;
+
+		case 2: break;
+        case 3: game_end(); break;
+    }
+}
+
+animation_timer += 0.05;