glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0, width, 0, height, -100, 100 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
glDisable( GL_DEPTH_TEST );
Callback<void(const Callback<void(bool)> &)> g_show_stats_callback( g_show_stats_caller );
ToggleItem g_show_stats( g_show_stats_callback );
*/
-BoolExportCaller g_show_stats_caller( g_camwindow_globals_private.m_showStats );
-ToggleItem g_show_stats( g_show_stats_caller );
+
void ShowStatsToggle(){
g_camwindow_globals_private.m_showStats ^= 1;
- g_show_stats.update();
+// g_show_stats.update();
UpdateAllWindows();
}
+typedef FreeCaller<void(), ShowStatsToggle> ShowStatsToggleCaller;
+void ShowStatsExport( const Callback<void(bool)> & importer ){
+ importer( g_camwindow_globals_private.m_showStats );
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowStatsExport> ShowStatsExportCaller;
+
+ShowStatsExportCaller g_show_stats_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_stats_callback( g_show_stats_caller );
+ToggleItem g_show_stats( g_show_stats_callback );
void CamWnd::Cam_Draw(){
glViewport( 0, 0, m_Camera.width, m_Camera.height );
}
*/
-void ShowLightRadiiExport( const BoolImportCallback& importer ){
- importer( GlobalEntityCreator().getLightRadii() );
-}
-typedef FreeCaller1<const BoolImportCallback&, ShowLightRadiiExport> ShowLightRadiiExportCaller;
-ShowLightRadiiExportCaller g_show_lightradii_caller;
-ToggleItem g_show_lightradii_item( g_show_lightradii_caller );
-void ToggleShowLightRadii(){
+void ShowLightRadiiToggle(){
GlobalEntityCreator().setLightRadii( !GlobalEntityCreator().getLightRadii() );
- g_show_lightradii_item.update();
UpdateAllWindows();
}
+typedef FreeCaller<void(), ShowLightRadiiToggle> ShowLightRadiiToggleCaller;
+void ShowLightRadiiExport( const Callback<void(bool)> & importer ){
+ GlobalEntityCreator().getLightRadii();
+}
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowLightRadiiExport> ShowLightRadiiExportCaller;
+
+ShowLightRadiiExportCaller g_show_lightradii_caller;
+Callback<void(const Callback<void(bool)> &)> g_show_lightradii_callback( g_show_lightradii_caller );
+ToggleItem g_show_lightradii( g_show_lightradii_callback );
+
void Entity_constructMenu( ui::Menu menu ){
create_menu_item_with_mnemonic( menu, "_Regroup", "GroupSelection" );
create_menu_item_with_mnemonic( menu, "_Ungroup", "UngroupSelection" );
GlobalCommands_insert( "GroupSelection", makeCallbackF(Entity_groupSelected) );
GlobalCommands_insert( "UngroupSelection", makeCallbackF(Entity_ungroupSelected) );
- GlobalToggles_insert( "ShowLightRadiuses", FreeCaller<ToggleShowLightRadii>(), ToggleItem::AddCallbackCaller( g_show_lightradii_item ) );
+ GlobalToggles_insert( "ShowLightRadiuses", makeCallbackF( ShowLightRadiiToggle ), ToggleItem::AddCallbackCaller( g_show_lightradii ) );
GlobalPreferenceSystem().registerPreference( "SI_Colors5", make_property_string( g_entity_globals.color_entity ) );
GlobalPreferenceSystem().registerPreference( "LastLightIntensity", make_property_string( g_iLastLightIntensity ) );
// gtk_toolbar_set_show_arrow( toolbar, TRUE );
toolbar.show();
+
+ auto space = [&]() {
+ auto btn = ui::ToolItem::from(gtk_separator_tool_item_new());
+ btn.show();
+ toolbar.add(btn);
+ };
+
g_signal_connect( G_OBJECT( toolbar ), "enter_notify_event", G_CALLBACK( ToggleActions0 ), 0 );
toolbar_append_toggle_button( toolbar, "World (ALT + 1)", "f-world.png", "FilterWorldBrushes" );
space();
{
- auto button = toolbar_append_toggle_button( filter_toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
+ auto button = toolbar_append_toggle_button( toolbar, "Areaportals (ALT + 3)\nRightClick: toggle tex\n\tnoDraw\n\tnoDrawNonSolid", "f-areaportal.png", "FilterAreaportals" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Areaportals_button_press ), 0 );
}
toolbar_append_toggle_button( toolbar, "Models (SHIFT + M)", "f-models.png", "FilterModels" );
{
- auto button = toolbar_append_toggle_button( filter_toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
+ auto button = toolbar_append_toggle_button( toolbar, "Triggers (CTRL + SHIFT + T)\nRightClick: tex Trigger", "f-triggers.png", "FilterTriggers" );
g_signal_connect( G_OBJECT( button ), "button_press_event", G_CALLBACK( Trigger_button_press ), 0 );
}
space();
ComponentModes_constructToolbar( toolbar );
- gtk_toolbar_append_space( toolbar );
if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
space();
XYWnd_constructToolbar( toolbar );
- gtk_toolbar_append_space( toolbar );
}
space();
space();
Manipulators_constructToolbar( toolbar );
- gtk_toolbar_append_space( toolbar );
if ( g_Layout_enablePatchToolbar.m_value ) {
space();
Patch_constructToolbar( toolbar );
- gtk_toolbar_append_space( toolbar );
}
space();
toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT + T)", "texture_lock.png", "TogTexLock" );
- gtk_toolbar_append_space( toolbar );
space();
);
page.appendCheckBox(
"", "Main Toolbar",
- LatchedBoolImportCaller( g_Layout_enableMainToolbar ),
- BoolExportCaller( g_Layout_enableMainToolbar.m_latched )
+ make_property( g_Layout_enableMainToolbar )
);
if ( !string_empty( g_pGameDescription->getKeyValue( "no_patch" ) ) ) {
page.appendCheckBox(
*/
bool region_active = false;
-BoolExportCaller g_region_caller( region_active );
+ConstReferenceCaller<bool, void(const Callback<void(bool)> &), PropertyImpl<bool>::Export> g_region_caller( region_active );
+
ToggleItem g_region_item( g_region_caller );
+/*void Map_ToggleRegion(){
+ region_active = !region_active;
+ g_region_item.update();
+}*/
+
Vector3 region_mins( g_MinWorldCoord, g_MinWorldCoord, g_MinWorldCoord );
Vector3 region_maxs( g_MaxWorldCoord, g_MaxWorldCoord, g_MaxWorldCoord );
GlobalCommands_insert( "RegionSetXY", makeCallbackF(RegionXY) );
GlobalCommands_insert( "RegionSetBrush", makeCallbackF(RegionBrush) );
//GlobalCommands_insert( "RegionSetSelection", makeCallbackF(RegionSelected), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "RegionSetSelection", ToggleItem::AddCallbackCaller( g_region_item ), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalToggles_insert( "RegionSetSelection", makeCallbackF(RegionSelected), ToggleItem::AddCallbackCaller( g_region_item ), Accelerator( 'R', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalPreferenceSystem().registerPreference( "LastMap", make_property_string( g_strLastMap ) );
GlobalPreferenceSystem().registerPreference( "LoadLastMap", make_property_string( g_bLoadLastMap ) );
bool g_nodes_be_hidden = false;
-BoolExportCaller g_hidden_caller( g_nodes_be_hidden );
+ConstReferenceCaller<bool, void(const Callback<void(bool)> &), PropertyImpl<bool>::Export> g_hidden_caller( g_nodes_be_hidden );
+
ToggleItem g_hidden_item( g_hidden_caller );
class HideSelectedWalker : public scene::Graph::Walker
}
void Hide_registerCommands(){
- GlobalCommands_insert( "ShowHidden", FreeCaller<Select_ShowAllHidden>(), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalToggles_insert( "HideSelected", FreeCaller<HideSelected>(), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
+ GlobalCommands_insert( "ShowHidden", makeCallbackF( Select_ShowAllHidden ), Accelerator( 'H', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "HideSelected", makeCallbackF( HideSelected ), ToggleItem::AddCallbackCaller( g_hidden_item ), Accelerator( 'H' ) );
}
SelectionSystem_constructPreferences( page );
}
void SelectionSystem_registerPreferencesPage(){
- PreferencesDialog_addSettingsPage( FreeCaller1<PreferenceGroup&, SelectionSystem_constructPage>() );
+ PreferencesDialog_addSettingsPage( FreeCaller<void(PreferenceGroup&), SelectionSystem_constructPage>() );
}
GlobalShaderCache().attachRenderable( getSelectionSystem() );
- GlobalPreferenceSystem().registerPreference( "PreferPointEntsIn2D", BoolImportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ), BoolExportStringCaller( getSelectionSystem().m_bPreferPointEntsIn2D ) );
+ GlobalPreferenceSystem().registerPreference( "PreferPointEntsIn2D", make_property_string( getSelectionSystem().m_bPreferPointEntsIn2D ) );
SelectionSystem_registerPreferencesPage();
}
// Names
void ShowNamesToggle(){
GlobalEntityCreator().setShowNames( !GlobalEntityCreator().getShowNames() );
-// g_show_names.update();
XY_UpdateAllWindows();
}
// Angles
void ShowAnglesToggle(){
GlobalEntityCreator().setShowAngles( !GlobalEntityCreator().getShowAngles() );
-// g_show_angles.update();
XY_UpdateAllWindows();
}
// Blocks
void ShowBlocksToggle(){
g_xywindow_globals_private.show_blocks ^= 1;
-// g_show_blocks.update();
XY_UpdateAllWindows();
}
// Coordinates
void ShowCoordinatesToggle(){
g_xywindow_globals_private.show_coordinates ^= 1;
-// g_show_coordinates.update();
XY_UpdateAllWindows();
}
// Outlines
void ShowOutlineToggle(){
g_xywindow_globals_private.show_outline ^= 1;
-// g_show_outline.update();
XY_UpdateAllWindows();
}
// Axes
void ShowAxesToggle(){
g_xywindow_globals_private.show_axis ^= 1;
-// g_show_axes.update();
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowAxesToggle> ShowAxesToggleCaller;
// Workzone
void ShowWorkzoneToggle(){
g_xywindow_globals_private.d_show_work ^= 1;
-// g_show_workzone.update();
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowWorkzoneToggle> ShowWorkzoneToggleCaller;
// Size
void ShowSizeToggle(){
g_xywindow_globals_private.m_bSizePaint = !g_xywindow_globals_private.m_bSizePaint;
-// g_show_size_item.update();
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowSizeToggle> ShowSizeToggleCaller;
// Crosshair
void ShowCrosshairToggle(){
- g_bCrossHairs ^= 1;
-// g_show_crosshair_item.update();
+ g_xywindow_globals_private.g_bCrossHairs ^= 1;
XY_UpdateAllWindows();
}
typedef FreeCaller<void(), ShowCrosshairToggle> ShowCrosshairToggleCaller;
void ShowCrosshairExport( const Callback<void(bool)> & importer ){
- importer( g_bCrossHairs );
+ importer( g_xywindow_globals_private.g_bCrossHairs );
}
typedef FreeCaller<void(const Callback<void(bool)> &), ShowCrosshairExport> ShowCrosshairExportCaller;
// Grid
void ShowGridToggle(){
g_xywindow_globals_private.d_showgrid = !g_xywindow_globals_private.d_showgrid;
-// g_show_grid_item.update();
XY_UpdateAllWindows();
}
-typedef FreeCaller<void(), ShowGridTToggle> ShowGridTToggleCaller;
+typedef FreeCaller<void(), ShowGridToggle> ShowGridToggleCaller;
void ShowGridTExport( const Callback<void(bool)> & importer ){
importer( g_xywindow_globals_private.d_showgrid );
}
-typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowSizeExportCaller;
+typedef FreeCaller<void(const Callback<void(bool)> &), ShowSizeExport> ShowGridExportCaller;
ShowNamesExportCaller g_show_names_caller;
void XYShow_registerCommands(){
- GlobalToggles_insert( "ToggleSizePaint", FreeCaller<ToggleShowSizeInfo>(), ToggleItem::AddCallbackCaller( g_show_size_item ), Accelerator( 'J' ) );
- GlobalToggles_insert( "ToggleCrosshairs", FreeCaller<ToggleShowCrosshair>(), ToggleItem::AddCallbackCaller( g_show_crosshair_item ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalToggles_insert( "ToggleGrid", FreeCaller<ToggleShowGrid>(), ToggleItem::AddCallbackCaller( g_show_grid_item ), Accelerator( '0' ) );
+ GlobalToggles_insert( "ToggleSizePaint", ShowSizeToggleCaller(), ToggleItem::AddCallbackCaller( g_show_size ), Accelerator( 'J' ) );
+ GlobalToggles_insert( "ToggleCrosshairs", ShowCrosshairToggleCaller(), ToggleItem::AddCallbackCaller( g_show_crosshair ), Accelerator( 'X', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalToggles_insert( "ToggleGrid", ShowGridToggleCaller(), ToggleItem::AddCallbackCaller( g_show_grid ), Accelerator( '0' ) );
GlobalToggles_insert( "ShowAngles", ShowAnglesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_angles ) );
GlobalToggles_insert( "ShowNames", ShowNamesToggleCaller(), ToggleItem::AddCallbackCaller( g_show_names ) );