3 private TextListboxWidget m_LstPositionList;
8 private PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed;
9 private ButtonWidget m_TeleportButton;
10 private ButtonWidget m_CancelButton;
15 void UIPopupScriptPositionManager(
Widget wgt )
17 m_ConfigDebugProfileFixed = PluginConfigDebugProfileFixed.Cast(
GetPlugin( PluginConfigDebugProfileFixed ) );
18 m_LstPositionList = TextListboxWidget.Cast( wgt.FindAnyWidget(
"tls_ppp_pm_positions_list") );
19 m_TxtSelectedX =
EditBoxWidget.Cast( wgt.FindAnyWidget(
"pnl_ppp_pm_selected_x_value") );
20 m_TxtSelectedY =
EditBoxWidget.Cast( wgt.FindAnyWidget(
"pnl_ppp_pm_selected_y_value") );
21 m_TxtCurrentX =
EditBoxWidget.Cast( wgt.FindAnyWidget(
"pnl_ppp_pm_current_x_value") );
22 m_TxtCurrentY =
EditBoxWidget.Cast( wgt.FindAnyWidget(
"pnl_ppp_pm_current_y_value") );
23 m_TeleportButton = ButtonWidget.Cast( wgt.FindAnyWidget(
"btn_ppp_pm_teleport") );
24 m_CancelButton = ButtonWidget.Cast( wgt.FindAnyWidget(
"btn_ppp_pm_cancel") );
38 override void OnOpen(
Param param )
40 if( PluginSceneManager.GetInstance() )
42 if( PluginSceneManager.GetInstance().GetSelectedSceneObject() )
44 vector player_pos = PluginSceneManager.GetInstance().GetSelectedSceneObject().GetPosition();
46 m_TxtCurrentX.SetText( player_pos[0].
ToString() );
47 m_TxtCurrentY.SetText( player_pos[2].
ToString() );
57 if ( w == m_TeleportButton )
59 float pos_x = m_TxtSelectedX.GetText().ToFloat();
60 float pos_z = m_TxtSelectedY.GetText().ToFloat();
62 PluginSceneManager.GetInstance().SelectedObjectSetPosX( pos_x );
63 PluginSceneManager.GetInstance().SelectedObjectSetPosZ( pos_z );
67 else if ( w == m_CancelButton )
75 void OnItemSelected(
Widget w,
int x,
int y,
int row,
int column,
int oldRow,
int oldColumn )
84 string GetCurrentLocationName()
86 if ( m_LstPositionList.GetSelectedRow() != -1 )
89 m_LstPositionList.GetItemText( m_LstPositionList.GetSelectedRow(), 0, position_name );