81 #ifdef PLATFORM_CONSOLE
82 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/character_creation/xbox/character_creation.layout");
83 m_CharacterSaved =
false;
85 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/character_creation/pc/character_creation.layout");
89 m_Apply = layoutRoot.FindAnyWidget(
"apply");
90 m_Save = layoutRoot.FindAnyWidget(
"save");
94 m_DetailsRoot = layoutRoot.FindAnyWidget(
"menu_details_tooltip");
101 g_Game.GetVersion(version);
102 #ifdef PLATFORM_CONSOLE
103 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
105 version =
"#main_menu_version" +
" " + version;
114 m_NameSelector =
new OptionSelectorEditbox(layoutRoot.FindAnyWidget(
"character_name_setting_option"),
m_Scene.GetIntroCharacter().GetCharacterName(), null,
false);
116 if (
m_Scene.GetIntroCharacter().IsCharacterFemale())
154 obj = scene_char.GetInventory().FindAttachment(
InventorySlots.LEGS);
158 obj = scene_char.GetInventory().FindAttachment(
InventorySlots.FEET);
251 m_Scene.GetIntroCharacter().SetToDefaultCharacter();
256 if (
m_Scene.GetIntroCharacter().IsCharacterFemale())
269 g_Game.GetMenuDefaultCharacterData().GenerateRandomEquip();
455 #ifndef PLATFORM_CONSOLE
456 bool show = header !=
"" && desc !=
"";
464 float parent_pos_x, parent_pos_y;
465 float parent_size_x, parent_size_y;
466 float layout_size_x, layout_size_y;
468 w.GetScreenPos(parent_pos_x,parent_pos_y);
469 w.GetScreenSize(parent_size_x,parent_size_y);
470 layoutRoot.GetScreenSize(layout_size_x,layout_size_y);
472 float set_x = layout_size_x - parent_pos_x;
473 float set_y = layout_size_y - parent_pos_y - parent_size_y;
485 bool show_widgets =
m_Scene.GetIntroCharacter().IsDefaultCharacter();
486 layoutRoot.FindAnyWidget(
"character_gender_button").Show(show_widgets);
487 layoutRoot.FindAnyWidget(
"character_head_button").Show(show_widgets);
488 layoutRoot.FindAnyWidget(
"character_top_button").Show(show_widgets);
489 layoutRoot.FindAnyWidget(
"character_bottom_button").Show(show_widgets);
490 layoutRoot.FindAnyWidget(
"character_shoes_button").Show(show_widgets);
514 #ifdef PLATFORM_CONSOLE
515 if (
g_Game.GetUserManager() &&
g_Game.GetUserManager().GetSelectedUser())
517 name =
g_Game.GetUserManager().GetSelectedUser().GetName();
518 if (
name.LengthUtf8() > 16)
525 name =
m_Scene.GetIntroCharacter().GetCharacterName();
533 g_Game.GetVersion(version);
534 #ifdef PLATFORM_CONSOLE
535 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
537 m_Apply.Show(m_CharacterSaved || !
m_Scene.GetIntroCharacter().IsDefaultCharacter());
538 m_Save.Show(!m_CharacterSaved &&
m_Scene.GetIntroCharacter().IsDefaultCharacter());
540 version =
"#main_menu_version" +
" " + version;
542 m_Save.Show(
m_Scene.GetIntroCharacter().IsDefaultCharacter());
546 if (
m_Scene.GetIntroCharacter().IsDefaultCharacter())
557 #ifdef PLATFORM_CONSOLE
565 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
570 if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
575 if (
GetUApi().GetInputByID(UAUIRight).LocalPress())
580 if (
GetUApi().GetInputByID(UAUILeft).LocalPress())
585 #ifdef PLATFORM_CONSOLE
586 if (
GetUApi().GetInputByID(UAUICtrlY).LocalPress())
588 if (
m_Scene.GetIntroCharacter().IsDefaultCharacter() && !m_CharacterSaved)
625 if (w.IsInherited(ButtonWidget))
627 ButtonWidget button = ButtonWidget.Cast(w);
628 button.SetTextColor(
ARGB(255, 200, 0, 0));
631 w.SetColor(
ARGB(255, 0, 0, 0));
636 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() +
"_image"));
637 Widget option =
Widget.Cast(w.FindAnyWidget(w.GetName() +
"_option_wrapper"));
638 Widget option_label = w.FindAnyWidget(
"option_label");
642 text1.SetColor(
ARGB(255, 255, 0, 0));
647 text2.SetColor(
ARGB(255, 255, 0, 0));
652 text3.SetColor(
ARGB(255, 255, 0, 0));
658 image.SetColor(
ARGB(255, 200, 0, 0));
663 option.SetColor(
ARGB(255, 255, 0, 0));
666 #ifndef PLATFORM_CONSOLE
669 option_label.SetColor(
ARGB(255, 255, 0, 0));
676 if (w.IsInherited(ButtonWidget))
678 ButtonWidget button = ButtonWidget.Cast(w);
685 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() +
"_image"));
686 Widget option = w.FindAnyWidget(w.GetName() +
"_option_wrapper");
687 Widget option_label = w.FindAnyWidget(
"option_label");
712 option.SetColor(
ARGB(150, 255, 255, 255));
715 #ifndef PLATFORM_CONSOLE
725 #ifndef PLATFORM_CONSOLE
731 ButtonWidget button = ButtonWidget.Cast(w);
741 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() +
"_image"));
742 Widget option =
Widget.Cast(w.FindAnyWidget(w.GetName() +
"_option_wrapper"));
743 Widget option_label = w.FindAnyWidget(
"option_label");
771 #ifndef PLATFORM_CONSOLE
789 #ifdef PLATFORM_CONSOLE
792 if (!m_CharacterSaved &&
m_Scene.GetIntroCharacter().IsDefaultCharacter())
797 if (
m_Scene.GetIntroCharacter().IsDefaultCharacter())
800 string result =
string.Format(
"<image set=\"%1\" name=\"%2\" scale=\"%3\" />",
"playstation_buttons",
"DPAD_left_short", 1.92);
801 string result2 =
string.Format(
"<image set=\"%1\" name=\"%2\" scale=\"%3\" />",
"playstation_buttons",
"DPAD_right_short", 1.92);
803 string result =
string.
Format(
"<image set=\"%1\" name=\"%2\" scale=\"%3\" />",
"xbox_buttons",
"DPAD_left_short", 1.92);
804 string result2 =
string.
Format(
"<image set=\"%1\" name=\"%2\" scale=\"%3\" />",
"xbox_buttons",
"DPAD_right_short", 1.92);
806 text +=
string.
Format(
" %1%2 %3", result, result2,
"#layout_character_creation_toolbar_select");
809 toolbar_text.SetText(text);
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.