Пример #1
0
/*
======================================================================
Interface()

XPanels Interface.  Called when the user presses the "Options"
button.
====================================================================== */
int Atmosphere::Interface( int version, LWInterface *local, void *serverData )
{
	UNUSED(serverData);
	UNUSED(version);

	if ( !txedf ) return AFUNC_BADGLOBAL;
	
	LWXPanelHint hint[] = {
		XpLABEL( 0, "VFog Settings" ),
		XpBUTNOTIFY( ID_TXBT, XPanelInterface::LWXPanelBtnClickFunc ),
		XpSTRLIST( ID_RES, quality ),
		XpSTRLIST( ID_MARCH, render ),

		XpGROUP_( ID_GGRP ),
			XpH( ID_HI ), XpH( ID_LO ), XpH( ID_FA ), XpH( ID_DEN ), XpEND,
		XpGROUP_( ID_SGRP ),
			XpH( ID_LUM ), XpH( ID_OPA ), XpH( ID_BCK ), XpH( ID_COL ), XpEND,
		XpGROUP_( ID_RGRP ),
			XpH( ID_RES ), XpH( ID_TXTR ), XpH( ID_TXBT ), XpEND,

		XpENABLE_( ID_MARCH ),
			XpH( ID_RGRP ), XpEND,
		XpENABLE_MAP_( ID_BCK, bckMap ),
			XpH( ID_COL ), XpEND,

		XpMIN( ID_LUM, 0 ), XpMAX( ID_LUM, 1 ),
		XpMIN( ID_OPA, 0 ), XpMAX( ID_OPA, 1 ),
		XpMIN( ID_FA, 0 ),  XpMAX( ID_FA, 1 ),

		XpEND
	}; // end hint[]
		
	CreateViewXPanel (ctrl_list, data_descrip, hint);

	// FINE because the callback it is in our class
	LW_XPanel.setUserData(this, ID_TXBT);

	local->panel = LW_XPanel.getID();

	local->options = NULL;
	local->command = NULL;

	return AFUNC_OK;
}
Пример #2
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool Nullify_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*xpanels->destroy)( panel );
    panel = NULL;
  }

  // Create the control array
  static LWXPanelControl controls[] = {
    { NUI_ABOUT,               "About",                       "vButton"  },
    { NUI_PREFIX,              "Prefix With",                 "string"   },
    { NUI_SUFFIX,              "Suffix With",                 "string"   },
    { NUI_NULLIFY_DECENDANTS,  "Nullify Decendants",          "iBoolean" },
    { NUI_REMOVE_BONES,        "Remove Bones",                "iBoolean" },
    { NUI_DISABLE_SHADOWS,     "Disable Shadow Options",      "iBoolean" },
    { NUI_STORE_ORIGINAL_NAME, "Store Original Names",        "iBoolean" },
    { NUI_REMOVE_MORPH_MIXER,  "Remove Morph Mixer",          "iBoolean" },
    { 0 } };

  // Create the data array
  static LWXPanelDataDesc data[] = {
    { NUI_ABOUT,               "About",                       ""        },
    { NUI_PREFIX,              "Prefix With",                 "string"  },
    { NUI_SUFFIX,              "Suffix With",                 "string"  },
    { NUI_NULLIFY_DECENDANTS,  "Nullify Decendants",          "integer" },
    { NUI_REMOVE_BONES,        "Remove Bones",                "integer" },
    { NUI_DISABLE_SHADOWS ,    "Disable Shadow Options",      "integer" },
    { NUI_STORE_ORIGINAL_NAME, "Store Original Names",        "integer" },
    { NUI_REMOVE_MORPH_MIXER,  "Remove Morph Mixer",          "integer" },
    { 0 } };

  // Panel Hints Array
  char title_string[256];
  sprintf( title_string, "Nullify -- %c2000-2001 Joe Angell, TM Productions", 169 );
  static LWXPanelHint panel_hints[] = {
    XpLABEL( 0, title_string ),
    XpGROUP_( NUI_GROUP_NAME ),
      XpH( NUI_PREFIX ),
      XpH( NUI_SUFFIX ),
      XpH( 0 ),

    XpGROUP_( NUI_GROUP_OPTIONS ),
      XpH( NUI_NULLIFY_DECENDANTS ),
      XpH( NUI_REMOVE_BONES ),
      XpH( NUI_DISABLE_SHADOWS ),
      XpH( NUI_REMOVE_MORPH_MIXER ),
      XpH( 0 ),

    XpBUTNOTIFY( NUI_ABOUT, HandleAbout ),

    XpEND };

  // Get XPanels
  xpanels = (LWXPanelFuncs *)global( LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT );
  if( xpanels == NULL ) {
    retval = AFUNC_BADGLOBAL;
    return false;
  }

  // Create the Panel
  panel = (*xpanels->create)( LWXP_FORM, controls );
  if( panel == NULL ) {
    (*message->error)( "Nullify Error: Unable to create XPanels interface", NULL );
    is_ok = false;
    return false;
  }

  // Set up other panel data
  (*xpanels->describe)( panel, data, NULL, NULL );
  (*xpanels->hint)( panel, 0, panel_hints );

  // Set up initial values for the panel
  (*xpanels->formSet)( panel, NUI_PREFIX, prefix );
  (*xpanels->formSet)( panel, NUI_SUFFIX, suffix );
  FSETINT( xpanels, panel, NUI_NULLIFY_DECENDANTS,  (nullify_decendants  ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_REMOVE_BONES,        (remove_bones        ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_DISABLE_SHADOWS,     (disable_shadows     ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_STORE_ORIGINAL_NAME, (store_original_name ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_REMOVE_MORPH_MIXER,  (remove_morph_mixer  ? 1 : 0) );

  // Open the panel
  if( (*xpanels->post)( panel ) != 1 )  { // User Cancel
    user_abort = true;
    return false;
  }

  return IsOK();
}
Пример #3
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool ObjectShadowOptions_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*xpanels->destroy)( panel );
    panel = NULL;
  }

  // Create the control array
  static LWXPanelControl controls[] = {
    { OUI_ABOUT,               "About",                       "vButton"    },
    { OUI_LIMIT_TO,            "Limit To",                    "iPopChoice" },
    { OUI_MATCH_TOGGLE,        "Match Name",                  "iBoolean"   },
    { OUI_MATCH_STRING,          "Name Contains",               "string"     },
    { OUI_SELF_SHADOW,         "Self Shadow",                 "iBoolean"   },
    { OUI_CAST_SHADOW,         "Cast Shadow",                 "iBoolean"   },
    { OUI_RECEIVE_SHADOW,      "Receive Shadow",              "iBoolean"   },
    { OUI_UNSEEN_BY_RAYS,      "Unseen By Rays",              "iBoolean"   },
    { OUI_UNSEEN_BY_CAMERA,    "Unseen By Camera",            "iBoolean"   },
    { 0 } };

  // Create the data array
  static LWXPanelDataDesc data[] = {
    { OUI_ABOUT,               "About",                       ""           },
    { OUI_LIMIT_TO,            "Limit To",                    "integer"    },
    { OUI_MATCH_TOGGLE,        "Match Name",                  "integer"    },
    { OUI_MATCH_STRING,          "Name Contains",               "string"     },
    { OUI_SELF_SHADOW,         "Self Shadow",                 "integer"    },
    { OUI_CAST_SHADOW,         "Cast Shadow",                 "integer"    },
    { OUI_RECEIVE_SHADOW,      "Receive Shadow",              "integer"    },
    { OUI_UNSEEN_BY_RAYS,      "Unseen By Rays",              "integer"    },
    { OUI_UNSEEN_BY_CAMERA,    "Unseen By Camera",            "integer"    },
    { 0 } };

  // Panel Hints Array
  char title_string[256];
  sprintf( title_string, "ObjectShadowOptions -- %c2001 Foundation Imaging, written by Joe Angell", 169 );
  static LWXPanelHint panel_hints[] = {
    XpLABEL( 0, title_string ),

    XpGROUP_( OUI_GROUP_LIMIT ),
      XpH( OUI_LIMIT_TO ),
      XpH( 0 ),

    XpGROUP_( OUI_GROUP_MATCH ),
      XpH( OUI_MATCH_TOGGLE ),
      XpH( OUI_MATCH_STRING ),
      XpH(0),
    
    XpGROUP_( OUI_GROUP_SHADOW ),
      XpH( OUI_SELF_SHADOW ),
      XpH( OUI_CAST_SHADOW ),
      XpH( OUI_RECEIVE_SHADOW ),
      XpH( 0 ),

    XpGROUP_( OUI_GROUP_RENDER ),
      XpH( OUI_UNSEEN_BY_RAYS ),
      XpH( OUI_UNSEEN_BY_CAMERA ),
      XpH( 0 ),

    XpBUTNOTIFY( OUI_ABOUT, HandleAbout ),

    XpPOPFUNCS(  OUI_LIMIT_TO, LimitCount, LimitName ),

    XpENABLE_( OUI_MATCH_TOGGLE ),
      XpH( OUI_MATCH_STRING ),
      XpH( 0 ),

    XpEND };

  // Get XPanels
  xpanels = (LWXPanelFuncs *)global( LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT );
  if( xpanels == NULL ) {
    retval = AFUNC_BADGLOBAL;
    return false;
  }

  // Create the Panel
  panel = (*xpanels->create)( LWXP_FORM, controls );
  if( panel == NULL ) {
    (*message->error)( "Nullify Error: Unable to create XPanels interface", NULL );
    is_ok = false;
    return false;
  }

  // Set up other panel data
  (*xpanels->describe)( panel, data, NULL, NULL );
  (*xpanels->hint)( panel, 0, panel_hints );

  // Set up initial values for the panel
  FSETINT( xpanels, panel, OUI_LIMIT_TO,         limit_to         );
  FSETINT( xpanels, panel, OUI_MATCH_TOGGLE,     match_toggle     );
  FSETINT( xpanels, panel, OUI_SELF_SHADOW,      self_shadow      );
  FSETINT( xpanels, panel, OUI_RECEIVE_SHADOW,   receive_shadow   );
  FSETINT( xpanels, panel, OUI_CAST_SHADOW,      cast_shadow      );
  FSETINT( xpanels, panel, OUI_UNSEEN_BY_CAMERA, unseen_by_camera );
  FSETINT( xpanels, panel, OUI_UNSEEN_BY_RAYS,   unseen_by_rays   );

  (*xpanels->formSet)( panel, OUI_MATCH_STRING, match_string );

  // Open the panel
  if( (*xpanels->post)( panel ) != 1 )  { // User Cancel
    user_abort = true;
    return false;
  }

  return IsOK();
}
Пример #4
0
static LWXPanelID get_panel( AtmosphereData *dat )
{
   static LWXPanelControl ctrl_list[] = {
      { ID_MARCH, "Render Type",        "iPopChoice" },
      { ID_HI,    "Top",                "distance"   },
      { ID_LO,    "Bottom",             "distance"   },
      { ID_FA,    "Falloff",            "percent"    },
      { ID_DEN,   "Nominal Distance",   "distance"   },
      { ID_LUM,   "Luminosity",         "percent"    },
      { ID_OPA,   "Opacity",            "percent"    },
      { ID_BCK,   "Use Backdrop Color", "iBoolean"   },
      { ID_COL,   "Color",              "color"      },
      { ID_RES,   "Quality",            "iPopChoice" },
      { ID_TXTR,  "Use Texture",        "iBoolean"   },
      { ID_TXBT,  "Edit Texture",       "vButton"    },
      { 0 }
   };

   static LWXPanelDataDesc data_descrip[] = {
      { ID_MARCH, "Render Type",        "integer"    },
      { ID_HI,    "Top",                "distance"   },
      { ID_LO,    "Bottom",             "distance"   },
      { ID_FA,    "Falloff",            "percent"    },
      { ID_DEN,   "Nominal Distance",   "distance"   },
      { ID_LUM,   "Luminosity",         "percent"    },
      { ID_OPA,   "Opacity",            "percent"    },
      { ID_BCK,   "Use Backdrop Color", "integer"    },
      { ID_COL,   "Color",              "color"      },
      { ID_RES,   "Quality",            "integer"    },
      { ID_TXTR,  "Use Texture",        "integer"    },
      { ID_TXBT,  "Edit Texture",       NULL         },
      { 0 },
   };

   static char *quality[] = { "Very Low", "Low", "Medium", "Good", "Very Good", NULL };
   static char *render[] = { "Fast Fog", "Ray Marcher", NULL };
   static int bckMap[] = { 1, 0 };

   static LWXPanelHint hint[] = {
      XpLABEL( 0, "VFog Settings" ),
      XpDESTROYNOTIFY( destroy_notify ),
      XpBUTNOTIFY( ID_TXBT, button_event ),
      XpSTRLIST( ID_RES, quality ),
      XpSTRLIST( ID_MARCH, render ),

      XpGROUP_( ID_GGRP ),
         XpH( ID_HI ), XpH( ID_LO ), XpH( ID_FA ), XpH( ID_DEN ), XpEND,
      XpGROUP_( ID_SGRP ),
         XpH( ID_LUM ), XpH( ID_OPA ), XpH( ID_BCK ), XpH( ID_COL ), XpEND,
      XpGROUP_( ID_RGRP ),
         XpH( ID_RES ), XpH( ID_TXTR ), XpH( ID_TXBT ), XpEND,

      XpENABLE_( ID_MARCH ),
         XpH( ID_RGRP ), XpEND,
      XpENABLE_MAP_( ID_BCK, bckMap ),
         XpH( ID_COL ), XpEND,

      XpMIN( ID_LUM, 0 ), XpMAX( ID_LUM, 1 ),
      XpMIN( ID_OPA, 0 ), XpMAX( ID_OPA, 1 ),
      XpMIN( ID_FA, 0 ),  XpMAX( ID_FA, 1 ),

      XpEND
   };

   LWXPanelID panel;


   panel = xpanf->create( LWXP_VIEW, ctrl_list );
   if ( panel ) {
      xpanf->describe( panel, data_descrip, ui_get, ui_set );
      xpanf->hint( panel, 0, hint );
      xpanf->viewInst( panel, dat );
      xpanf->setData( panel, ID_TXBT, dat );
      xpanf->setData( panel, 0, dat );

      if ( !dat->txedID )
         dat->txedID = txedf->subscribe( "FogTexture",
            TEF_ALL - TEF_USEBTN, NULL, NULL, NULL, NULL );
   }

   return panel;
}