[give_items] { b interface = true; modal = false; centered = dialog_box_main; skrit = [[ owner = UIWindow; UIListBox box$; int color$; int index$; #include "k_inc_giveitems" void Init$ { box$ = QueryDerivedListbox( UIShell.FindUIWindow( "items_list", "give_items" ) ); color$ = 0xffffffff; index$ = 0; LoadItems$(); } void CloneItem$( int selected$ ) { string template$ = StringTool.GetDelimitedString( GameAuditor.Db.GetString( "ui_giveitems" ), selected$, ',', "" ); if ( template$ != "" ) { Go player$ = GoDb.GetFocusGo.Go; GoCloneReq req$ = MakeGoCloneReq(); req$.SnapToTerrain = true; if( AIQuery.FindSpotRelativeToSource( player$, player$.Mind.PersonalSpaceRange * 0.25, player$.Mind.InnerComfortZoneRange * 0.5, 2.0, player$.Mind.TempPos1 ) ) { req$.StartingPos = player$.Mind.TempPos1; } else { req$.StartingPos = player$.Placement.Position; } GoDb.RSCloneGo( req$, template$ ); } else { Report.Screenf( "There was no item associated with index %d", selected$ ); } } void CloneSelectedItem$ { CloneItem$( QueryDerivedListbox( UIShell.FindUIWindow( "items_list", "give_items" ) ).SelectedTag ); } void CloneAllItems$ { //if there are any values at all, there is a trailing comma, so subtract one from the count int i$ = StringTool.GetNumDelimitedValues( GameAuditor.Db.GetString( "ui_giveitems" ), ',' ) - 1; while ( i$ > 0 ) { i$ -= 1; CloneItem$( i$ ); } } ]]; [t:dialog_box,n:dialog_box_main] { f alpha = 1.000000; b common_control = true; common_template = cpbox_wide; x draw_order = 0x00000001; rect = 175,203,616,382; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; topmost = true; [messages] { onshow = call(Init$) & command(UIShell.HideInterface("in_game_menu")); onrbuttondown = command(UIShell.HideInterface("give_items")) & notify(resume_game); } } [t:dialog_box,n:dialog_box_heading] { f alpha = 1.000000; b common_control = true; common_template = cpbox; x draw_order = 0x00000003; rect = 255,214,531,240; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; topmost = true; } [t:text,n:text_heading] { f alpha = 1.000000; b common_control = false; common_template = ; x draw_order = 0x00000004; x font_color = 0xFFFFFFFF; x font_size = 0x00000000; font_type = b_gui_fnt_12p_copperplate-light; justify = center; rect = 258,219,526,235; text = "Elfgirl Test Items"; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; topmost = true; } [t:dialog_box,n:dialog_box_main2] { f alpha = 1.000000; b common_control = true; common_template = cpbox; x draw_order = 0x00000002; rect = 195,245,594,345; //175,203,616,382; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; topmost = true; } [t:listbox,n:items_list] { //has_border = true; //border_color = 0; alpha = 1.000000; common_control = true; common_template = ; draw_order = 68000; font_type = b_gui_fnt_12p_copperplate-light; rect = 200,250,589,340; //241,161,398,238; //241,161,398,278; //144,184,241,427; text_color = 0xffffffff; texture = none; //b_gui_cmn_textbox_bg; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; consumable = true; //rollover_select = true; rollover_select = false; topmost = true; [t:selection_box,n:selection_box] { alpha = 0.5; texture = b_gui_cmn_selection; } [messages] { oncreated = setelementheight(18); onldoubleclick = call(CloneSelectedItem$); } } [t:button,n:button_clone_selected] { f alpha = 1.000000; b common_control = true; common_template = button_4; x draw_order = 0x00000005; rect = 269,351,369,367; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; [t:text,n:text_confirm] { f alpha = 1.000000; b common_control = false; common_template = ; x draw_order = 0x00000007; x font_color = 0xFFFFFFFF; x font_size = 0x00000000; font_type = b_gui_fnt_12p_copperplate-light; justify = center; rect = 275,351,363,365; text = "Give Selected"; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; topmost = true; } [messages] { //onbuttonpress = notify(save_delete_confirm); onbuttonpress = call(CloneSelectedItem$); } topmost = true; } [t:button,n:button_clone_all] { f alpha = 1.000000; b common_control = true; common_template = button_4; x draw_order = 0x00000006; rect = 413,351,513,367; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; [t:text,n:text_cancel] { f alpha = 1.000000; b common_control = false; common_template = ; x draw_order = 0x00000008; x font_color = 0xFFFFFFFF; x font_size = 0x00000000; font_type = b_gui_fnt_12p_copperplate-light; justify = center; rect = 418,351,509,365; text = "Give All"; uvcoords = 0.000000,0.000000,1.000000,1.000000; wrap_mode = clamp; topmost = true; } [messages] { //onbuttonpress = notify(save_delete_cancel); onbuttonpress = call(CloneAllItems$); } topmost = true; } }