Skip to content

Commit

Permalink
Merge pull request #50 from TML233/develop
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
TML233 committed May 12, 2019
2 parents 11d8e0b + 2d6e816 commit 4790f56
Show file tree
Hide file tree
Showing 52 changed files with 743 additions and 48 deletions.
7 changes: 4 additions & 3 deletions datafiles/locale/english/string/menu.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"menu.begin" "Begin Game"
"menu.settings" "Settings"
"menu.save.continue" "Continue"
"menu.save.reset" "Reset"
"menu.save.reset.true" "True Reset"
"menu.continue" "Continue"
"menu.reset" "Reset"
"menu.reset.true" "True Reset"
"menu.naming.title" "Name the fallen human."
"menu.naming.quit" "Quit"
"menu.naming.backspace" "Backspace"
"menu.naming.done" "Done"
"menu.confirm.title" "Is this name correct?"
"menu.confirm.title.reset" "A name has already&been chosen."
"menu.confirm.title.aaaaaa" "Not very creative...?"
"menu.confirm.title.alphys" "D-don't do that."
"menu.confirm.title.alphy" "Uh.... OK?"
Expand Down
6 changes: 5 additions & 1 deletion datafiles/locale/english/string/ui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
"ui.save.name.empty" "EMPTY"
"ui.save.save" "Save"
"ui.save.return" "Return"
"ui.save.saved" "File Saved."
"ui.save.saved" "File Saved."

"ui.box.inventory" "INVENTORY"
"ui.box.box" "BOX"
"ui.box.finish" "Press [X] to finish"
3 changes: 2 additions & 1 deletion objects/char_player/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ _moveable_dialog=true;
_moveable_menu=true;
_moveable_save=true;
_moveable_warp=true;
_moveable_encounter=true;
_moveable_encounter=true;
_moveable_box=true;
15 changes: 7 additions & 8 deletions objects/menu/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
_menu=0;
_mode=file_exists(Flag_GetSavePath(FLAG_TYPE.INFO));
_mode=0;

_prefix="{gui true}{instant true}{shadow false}{font 1}{scale 2}";
_inst_instruction=noone;
_inst_begin=noone;
_inst_settings=noone;
_inst_save_name=noone;
_inst_save_lv=noone;
_inst_save_time=noone;
_inst_save_room=noone;
_inst_save_continue=noone;
_inst_save_reset=noone;
_inst_save_settings=noone;
_inst_name=noone;
_inst_lv=noone;
_inst_time=noone;
_inst_room=noone;
_inst_continue=noone;
_inst_reset=noone;
_inst_settings=noone;
_inst_naming_title=noone;
_inst_naming_letters=noone;
_inst_naming_quit=noone;
Expand Down
2 changes: 1 addition & 1 deletion objects/menu/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if(_menu==0){
if(_mode==1){
//draw_sprite(spr_bg_area_1,0,0,-120);
draw_sprite(spr_bg_area_1,0,0,-120);
}
}
52 changes: 37 additions & 15 deletions objects/menu/Other_10.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
///@desc Menu Switch
if(_menu==0){
_mode=file_exists(Flag_GetSavePath(FLAG_TYPE.INFO));
if(_mode==0){
_inst_instruction=instance_create_depth(170,40,0,text_typer);
_inst_instruction.text=_prefix+"{color_text `gray_light`} --- Instruction ---{space_y -1}&&{space_y 2}[Z or ENTER] - Confirm&[X or SHIFT] - Cancel&[C or CTRL] - Menu (In-game)&[F4] - Fullscreen&[Hold ESC] - Quit&When HP is 0, you lose.";
Expand All @@ -11,6 +12,30 @@ if(_menu==0){
event_user(15);
}
event_user(2);
}else{
Flag_Load(FLAG_TYPE.INFO);
_inst_name=instance_create_depth(140,124,0,text_typer);
_inst_name.text=_prefix+Flag_Get(FLAG_TYPE.INFO,FLAG_INFO.NAME,Lang_GetString("ui.save.name.empty"));
_inst_lv=instance_create_depth(308,124,0,text_typer);
_inst_lv.text=_prefix+"LV "+string(Flag_Get(FLAG_TYPE.INFO,FLAG_INFO.LV));
_inst_time=instance_create_depth(452,124,0,text_typer);
var time=Flag_Get(FLAG_TYPE.INFO,FLAG_INFO.TIME);
var minute=time div 60;
var second=time mod 60;
_inst_time.text=_prefix+string(minute)+":"+(second<10 ? "0" : "")+string(second);
_inst_room=instance_create_depth(140,160,0,text_typer);
_inst_room.text=_prefix+Player_GetRoomName(Flag_Get(FLAG_TYPE.INFO,FLAG_INFO.ROOM));
_inst_continue=instance_create_depth(170,210,0,text_typer);
_inst_continue.text=_prefix+Lang_GetString("menu.continue");
_inst_continue.override_color_text_enabled=true;
_inst_reset=instance_create_depth(390,210,0,text_typer);
_inst_reset.text=_prefix+Lang_GetString("menu.reset");
_inst_reset.override_color_text_enabled=true;
_inst_settings=instance_create_depth(264,250,0,text_typer);
_inst_settings.text=_prefix+Lang_GetString("menu.settings");
_inst_settings.override_color_text_enabled=true;
event_user(2);

}
}else{
if(instance_exists(_inst_instruction)){
Expand All @@ -22,26 +47,23 @@ if(_menu==0){
if(instance_exists(_inst_settings)){
instance_destroy(_inst_settings);
}
if(instance_exists(_inst_save_name)){
instance_destroy(_inst_save_name);
}
if(instance_exists(_inst_save_lv)){
instance_destroy(_inst_save_lv);
if(instance_exists(_inst_name)){
instance_destroy(_inst_name);
}
if(instance_exists(_inst_save_time)){
instance_destroy(_inst_save_time);
if(instance_exists(_inst_lv)){
instance_destroy(_inst_lv);
}
if(instance_exists(_inst_save_room)){
instance_destroy(_inst_save_room);
if(instance_exists(_inst_time)){
instance_destroy(_inst_time);
}
if(instance_exists(_inst_save_continue)){
instance_destroy(_inst_save_continue);
if(instance_exists(_inst_room)){
instance_destroy(_inst_room);
}
if(instance_exists(_inst_save_reset)){
instance_destroy(_inst_save_reset);
if(instance_exists(_inst_continue)){
instance_destroy(_inst_continue);
}
if(instance_exists(_inst_save_settings)){
instance_destroy(_inst_save_settings);
if(instance_exists(_inst_reset)){
instance_destroy(_inst_reset);
}
}

Expand Down
4 changes: 4 additions & 0 deletions objects/menu/Other_12.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ if(_mode==0){
_change_inst=_inst_settings;
_change_color=(_choice==1 ? c_yellow : c_white);
event_user(1);
}else{
_inst_continue.override_color_text=(_choice==0 ? c_yellow : c_white);
_inst_reset.override_color_text=(_choice==1 ? c_yellow : c_white);
_inst_settings.override_color_text=(_choice==2 ? c_yellow : c_white);
}
42 changes: 41 additions & 1 deletion objects/menu/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,46 @@ if(_menu==0){
room_goto(room_settings);
}
}
}else{
if(Input_CheckPressed(INPUT.LEFT)){
if(_choice==1){
_choice=0;
event_user(2);
}
}else if(Input_CheckPressed(INPUT.RIGHT)){
if(_choice==0){
_choice=1;
event_user(2);
}
}else if(Input_CheckPressed(INPUT.DOWN)){
if(_choice!=2){
_choice=2;
event_user(2);
}
}else if(Input_CheckPressed(INPUT.UP)){
if(_choice==2){
_choice=0;
event_user(2);
}
}else if(Input_CheckPressed(INPUT.CONFIRM)){
if(_choice==0){
Flag_Load(FLAG_TYPE.STATIC);
Flag_Load(FLAG_TYPE.DYNAMIC);
var target=Flag_Get(FLAG_TYPE.STATIC,FLAG_STATIC.ROOM,-1);
if(room_exists(target)){
room_goto(target);
}else{
show_message("ERROR:\nAttempt to goto an unexisting room "+string(target));
}
}else if(_choice==1){
_menu=2;
_naming_name=Flag_Get(FLAG_TYPE.INFO,FLAG_INFO.NAME,Lang_GetString("ui.save.name.empty"));
_confirm_title=Lang_GetString("menu.confirm.title.reset");
event_user(0);
}else if(_choice==2){
room_goto(room_settings);
}
}
}
}else if(_menu==1){
if(_choice_naming==0){
Expand Down Expand Up @@ -148,7 +188,7 @@ if(_menu==0){
}
}else if(Input_CheckPressed(INPUT.CONFIRM)){
if(_choice_confirm==0){
_menu=1;
_menu=(_mode==0 ? 1 : 0);
event_user(0);
}else{
_menu=3;
Expand Down
7 changes: 6 additions & 1 deletion objects/text_typer/Other_10.gml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ if(_char!=" "&&_char!=" "){
ds_list_add(_list_inst,INST);

if(!_voice_played&&!_skipping&&!_instant&&_voice>=0){
var sound=_group_voice[_voice,irandom(array_length_2d(_group_voice,_voice)-1)];
var sound=-1;
if(_voice_single>=0&&_voice_single<array_length_2d(_group_voice,_voice)){
sound=_group_voice[_voice,_voice_single];
}else{
sound=_group_voice[_voice,irandom(array_length_2d(_group_voice,_voice)-1)];
}
if(audio_exists(sound)){
audio_stop_sound(sound);
audio_play_sound(sound,0,false);
Expand Down
8 changes: 8 additions & 0 deletions objects/text_typer/Other_12.gml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ switch(cmd[|0]){
}
break;

case "voice_single":
if(is_real(cmd[|1])){
if(cmd[|1]==-1 || cmd[|1]>=0 && cmd[|1]<array_length_2d(_group_voice,_voice)){
_voice_single=cmd[|1];
}
}
break;

case "font":
if(is_real(cmd[|1])){
if(cmd[|1]>=0&&cmd[|1]<array_height_2d(_group_font)){
Expand Down
10 changes: 9 additions & 1 deletion objects/text_typer/Other_15.gml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
///@desc Group & Macro
ds_map_add(_map_macro,"true",true);
ds_map_add(_map_macro,"false",false);

ds_map_add(_map_macro,"DIR.UP",DIR.UP);
ds_map_add(_map_macro,"DIR.DOWN",DIR.DOWN);
ds_map_add(_map_macro,"DIR.LEFT",DIR.LEFT);
ds_map_add(_map_macro,"DIR.RIGHT",DIR.RIGHT);

ds_map_add(_map_macro,"FONT.DIALOG",0);
ds_map_add(_map_macro,"FONT.MENU",1);
ds_map_add(_map_macro,"FONT.BATTLE",2);

ds_map_add(_map_macro,"VOICE.NULL",-1);
ds_map_add(_map_macro,"VOICE.DEFAULT",0);
ds_map_add(_map_macro,"VOICE.TYPER",1);

_group_font[0,0]=Lang_GetFont(Lang_GetString("font.dialog.0"));
_group_font_scale_x[0,0]=real(Lang_GetString("font.dialog.0.scale.x"));
_group_font_scale_y[0,0]=real(Lang_GetString("font.dialog.0.scale.y"));
Expand Down Expand Up @@ -38,6 +47,5 @@ _group_font_space_y[2]=real(Lang_GetString("font.battle.space.y"));

_group_voice[0,0]=snd_text_voice_default;
_group_voice[1,0]=snd_text_voice_typer;
_group_voice[2,0]=snd_text_voice_toriel;

_group_face[0]=face;
15 changes: 11 additions & 4 deletions objects/text_typer/Step_2.gml
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,17 @@ if(override_alpha_enabled||override_color_text_enabled){
INST.alpha=override_alpha;
}
if(override_color_text_enabled){
INST.color_text[0]=override_color_text[0];
INST.color_text[1]=override_color_text[1];
INST.color_text[2]=override_color_text[2];
INST.color_text[3]=override_color_text[3];
if(is_array(override_color_text)){
INST.color_text[0]=override_color_text[0];
INST.color_text[1]=override_color_text[1];
INST.color_text[2]=override_color_text[2];
INST.color_text[3]=override_color_text[3];
}else{
INST.color_text[0]=override_color_text;
INST.color_text[1]=override_color_text;
INST.color_text[2]=override_color_text;
INST.color_text[3]=override_color_text;
}
}
}
proc+=1;
Expand Down
18 changes: 18 additions & 0 deletions objects/ui_box/CleanUp_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if(instance_exists(_inst_inventory)){
instance_destroy(_inst_inventory);
}
if(instance_exists(_inst_box)){
instance_destroy(_inst_box);
}
if(instance_exists(_inst_item_inventory)){
instance_destroy(_inst_item_inventory);
}
if(instance_exists(_inst_item_box)){
instance_destroy(_inst_item_box);
}
if(instance_exists(_inst_finish)){
instance_destroy(_inst_finish);
}
if(instance_exists(char_player)){
char_player._moveable_box=true;
}
18 changes: 18 additions & 0 deletions objects/ui_box/Create_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
depth=DEPTH_UI.PANEL;

box_slot=0;
_state=-1;
_choice_mode=0;
_choice_item=0;

_prefix="{shadow false}{scale 2}{font 1}{instant true}{gui true}{depth "+string(DEPTH_UI.TEXT)+"}";

_inst_inventory=noone;
_inst_box=noone;
_inst_item_inventory=noone;
_inst_item_box=noone;
_inst_finish=noone;

if(instance_exists(char_player)){
char_player._moveable_box=false;
}
Empty file added objects/ui_box/Draw_0.gml
Empty file.
23 changes: 23 additions & 0 deletions objects/ui_box/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
if(_state==0){
draw_sprite_ext(spr_pixel,0,16,16,610,450,0,c_white,1);
draw_sprite_ext(spr_pixel,0,16+6,16+6,610-6*2,450-6*2,0,c_black,1);

draw_sprite_ext(spr_pixel,0,16+6+299,16+6+72,1,300,0,c_white,1);
draw_sprite_ext(spr_pixel,0,16+6+301,16+6+72,1,300,0,c_white,1);

var proc=0;
repeat(8){
if(!Item_IsValid(Item_Get(proc))){
draw_sprite_ext(spr_pixel,0,16+6+58,16+6+71+32*proc,180,1,0,c_red,1);
}
proc+=1;
}
proc=0;
repeat(10){
if(!Item_IsValid(Box_Get(box_slot,proc))){
draw_sprite_ext(spr_pixel,0,16+6+58+302,16+6+71+32*proc,180,1,0,c_red,1);
}
proc+=1;
}
draw_sprite(spr_battle_soul_red,0,16+6+27+302*_choice_mode,16+6+69+32*_choice_item);
}
10 changes: 10 additions & 0 deletions objects/ui_box/Other_10.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if(_state==0){
_inst_inventory=instance_create_depth(16+6+82,16+6+8,0,text_typer);
_inst_inventory.text=_prefix+Lang_GetString("ui.box.inventory");
_inst_box=instance_create_depth(16+6+426,16+6+8,0,text_typer);
_inst_box.text=_prefix+Lang_GetString("ui.box.box");
_inst_finish=instance_create_depth(16+6+178,16+6+384,0,text_typer);
_inst_finish.text=_prefix+Lang_GetString("ui.box.finish");

event_user(1);
}
24 changes: 24 additions & 0 deletions objects/ui_box/Other_11.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if(instance_exists(_inst_item_inventory)){
instance_destroy(_inst_item_inventory);
}
if(instance_exists(_inst_item_box)){
instance_destroy(_inst_item_box);
}

_inst_item_inventory=instance_create_depth(16+6+46,16+6+50,0,text_typer);
_inst_item_inventory.text=_prefix;
var proc=0;
repeat(8){
_inst_item_inventory.text+=Item_GetName(Item_Get(proc));
_inst_item_inventory.text+="&";
proc+=1;
}

_inst_item_box=instance_create_depth(16+6+46+302,16+6+50,0,text_typer);
_inst_item_box.text=_prefix;
proc=0;
repeat(10){
_inst_item_box.text+=Item_GetName(Box_Get(box_slot,proc));
_inst_item_box.text+="&";
proc+=1;
}
Loading

0 comments on commit 4790f56

Please sign in to comment.