コード例 #1
0
static char *
construct_moniker (void)
{
	const char *prefs_key;
	char       *iid;
	char       *size;
	char       *orient;
	char       *ret_value;

	iid = get_combo_value (applet_combo);
	g_assert (iid != NULL);
	size = get_combo_value (size_combo);
	g_assert (size != NULL);
	orient = get_combo_value (orient_combo);
	g_assert (orient != NULL);

	prefs_key = gtk_entry_get_text (GTK_ENTRY (prefs_dir_entry));

	ret_value= g_strdup_printf ("%s!prefs_key=%s;size=%s;orient=%s",
				    iid, prefs_key, size, orient);
	g_free (iid);
	g_free (size);
	g_free (orient);

	return ret_value;
}
コード例 #2
0
G_GNUC_UNUSED void
on_execute_button_clicked (GtkButton *button,
			   gpointer   dummy)
{
	char *title;

	title = get_combo_applet_id (applet_combo);

	load_applet_into_window (title,
				 gtk_entry_get_text (GTK_ENTRY (prefs_path_entry)),
				 get_combo_value (size_combo),
				 get_combo_value (orient_combo));
	g_free (title);
}
コード例 #3
0
ファイル: zeppelin.cpp プロジェクト: fcjailybo/asgp
/**
 * \brief Function called when the explosition starts.
 */
void rp::zeppelin::explose()
{ 
  set_transportability(false);
  kill_interactive_item();
  drop();
  m_hit = true;
  util::create_floating_score(*this,750);

  bear::universe::position_type pos = get_center_of_mass();
  pos.x -= get_width()/4;

  for ( unsigned int i = 0; i != 3; ++i )
    {
      explosion* item = new explosion(15,20,0.6);
      item->set_z_position(get_z_position() + 1000);
      item->set_combo_value(get_combo_value());
      item->set_center_of_mass(pos);
      new_item( *item );
      CLAW_ASSERT( item->is_valid(),
                   "The explosion of bomb isn't correctly initialized" );
      
      bear::universe::forced_tracking m;
      m.set_reference_point_on_center(*this);
      item->set_forced_movement(m);
      pos.x += get_width()/4;
    }

  start_model_action("explose");
} // zeppelin::explose()
コード例 #4
0
ファイル: tnt.cpp プロジェクト: fcjailybo/asgp
/**
 * \brief Create an explosion.
 * \param nb_explosions Number of explosions to display.
 * \param radius The radius of the explosion.
 */
void rp::tnt::create_explosion
(unsigned int nb_explosions, bear::universe::coordinate_type radius)
{ 
  explosion* item = new explosion(nb_explosions,radius, 0.6);
      
  item->set_z_position(get_z_position() + 10);
  item->set_combo_value(get_combo_value());
  item->set_center_of_mass(get_center_of_mass());
  new_item( *item );
  CLAW_ASSERT( item->is_valid(),
               "The explosion of tnt isn't correctly initialized" );
} // tnt::create_explosion()
コード例 #5
0
G_GNUC_UNUSED void
on_execute_button_clicked (GtkButton *button,
			   gpointer   dummy)
{
	char *moniker;
	char *title;

	moniker = construct_moniker ();
	title = get_combo_value (applet_combo);
	load_applet_into_window (moniker, title);
	g_free (moniker);
	g_free (title);
}
コード例 #6
0
ファイル: zeppelin.cpp プロジェクト: fcjailybo/asgp
/**
 * \brief Drop the item.
 */
void rp::zeppelin::drop()
{
  if ( m_drop_item != handle_type(NULL) )
    {
      entity* e = dynamic_cast<entity*>(m_drop_item.get());
  
      if ( e != NULL ) 
        e->set_combo_value(get_combo_value());
      
      m_drop_item->clear_forced_movement();
      m_drop_item = handle_type(NULL);
    }
} // zeppelin::drop()