Example #1
0
/**
 * @brief Updates the dialog box.
 *
 * This function is called repeatedly by the game
 * while the dialog box exists.
 */
void DialogBox::update() {

  if (!is_enabled()) {
    return; // nothing to update
  }

  // update the text displaying
  update_lines();

  // handle the end of the visible lines
  if (is_full()) {

    // update the message end arrow
    end_lines_sprite.update();

    // show the appropriate action icon
    KeysEffect& keys_effect = game.get_keys_effect();
    if (!end_lines_sprite.is_animation_started()) {

      if (has_more_lines()
          || dialog.has_next()
          || dialog.is_question()) {
        end_lines_sprite.set_current_animation("next");
        keys_effect.set_action_key_effect(KeysEffect::ACTION_KEY_NEXT);
      }
      else {
        keys_effect.set_action_key_effect(KeysEffect::ACTION_KEY_RETURN);
        end_lines_sprite.set_current_animation("last");
      }

      keys_effect.set_sword_key_effect(KeysEffect::SWORD_KEY_HIDDEN);
      Sound::play("message_end");
    }
  }
}
Example #2
0
void TextBlitter::set_text(const std::string & value)
{
    if (value == text && !lines.empty())
        return;
    text = value;
    update_lines();
}
Example #3
0
void ad_grav_wall::update(){
    frame = ofGetFrameNum();
    update_attrs();
    update_points();
    update_lines();
    world.update();
}
Example #4
0
void TextBlitter::set_width(int w)
{
    if (w == width)
        return;
    width = w;
    collision->update_aabb();
    update_lines();
}
Example #5
0
void coco_fdc_device::dskreg_w(UINT8 data)
{
	UINT8 drive = 0;
	UINT8 head = 0;

	if (LOG_FDC)
	{
		logerror("fdc_coco_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n",
			data & 0x80 ? 'H' : 'h',
			data & 0x40 ? '3' : '.',
			data & 0x20 ? 'D' : 'S',
			data & 0x10 ? 'P' : 'p',
			data & 0x08 ? 'M' : 'm',
			data & 0x04 ? '2' : '.',
			data & 0x02 ? '1' : '.',
			data & 0x01 ? '0' : '.',
			data);
	}

	/* An email from John Kowalski informed me that if the DS3 is
     * high, and one of the other drive bits is selected (DS0-DS2), then the
     * second side of DS0, DS1, or DS2 is selected.  If multiple bits are
     * selected in other situations, then both drives are selected, and any
     * read signals get yucky.
     */

	if (data & 0x04)
		drive = 2;
	else if (data & 0x02)
		drive = 1;
	else if (data & 0x01)
		drive = 0;
	else if (data & 0x40)
		drive = 3;

	device_t *floppy[4];

	floppy[0] = subdevice(FLOPPY_0);
	floppy[1] = subdevice(FLOPPY_1);
	floppy[2] = subdevice(FLOPPY_2);
	floppy[3] = subdevice(FLOPPY_3);

	for (int i = 0; i < 4; i++)
	{
		floppy_mon_w(floppy[i], i == drive ? CLEAR_LINE : ASSERT_LINE);
	}

	head = ((data & 0x40) && (drive != 3)) ? 1 : 0;

	m_dskreg = data;

	update_lines();

	wd17xx_set_drive(m_wd17xx, drive);
	wd17xx_set_side(m_wd17xx, head);
	wd17xx_dden_w(m_wd17xx, !BIT(m_dskreg, 5));
}
Example #6
0
void coco_fdc_device_base::dskreg_w(uint8_t data)
{
	uint8_t drive = 0;
	uint8_t head;

	if (LOG_FDC)
	{
		logerror("fdc_coco_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n",
			data & 0x80 ? 'H' : 'h',
			data & 0x40 ? '3' : '.',
			data & 0x20 ? 'D' : 'S',
			data & 0x10 ? 'P' : 'p',
			data & 0x08 ? 'M' : 'm',
			data & 0x04 ? '2' : '.',
			data & 0x02 ? '1' : '.',
			data & 0x01 ? '0' : '.',
			data);
	}

	// An email from John Kowalski informed me that if the DS3 is
	// high, and one of the other drive bits is selected (DS0-DS2), then the
	// second side of DS0, DS1, or DS2 is selected.  If multiple bits are
	// selected in other situations, then both drives are selected, and any
	// read signals get yucky.

	if (data & 0x04)
		drive = 2;
	else if (data & 0x02)
		drive = 1;
	else if (data & 0x01)
		drive = 0;
	else if (data & 0x40)
		drive = 3;

	// the motor is always turned on or off for all drives
	for (int i = 0; i < 4; i++)
	{
		floppy_image_device *floppy = m_floppies[i]->get_device();
		if (floppy)
			floppy->mon_w(BIT(data, 3) ? 0 : 1);
	}

	head = ((data & 0x40) && (drive != 3)) ? 1 : 0;

	set_dskreg(data);

	update_lines();

	floppy_image_device *selected_floppy = m_floppies[drive]->get_device();
	m_wd17xx->set_floppy(selected_floppy);

	if (selected_floppy)
		selected_floppy->ss_w(head);

	m_wd17xx->dden_w(!BIT(dskreg(), 5));
}
Example #7
0
static void
visible_child_changed (GObject    *stack,
                       GParamSpec *pspec)
{
  ExampleAppWindow *win;
  ExampleAppWindowPrivate *priv;

  if (gtk_widget_in_destruction (GTK_WIDGET (stack)))
    return;

  win = EXAMPLE_APP_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (stack)));
  priv = example_app_window_get_instance_private (win);
  gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (priv->searchbar), FALSE);
  update_words (win);
  update_lines (win);
}
Example #8
0
void TextBlitter::append_text(const std::string & value)
{
    text += value;
    update_lines();
}
Example #9
0
void coco_fdc_device::dskreg_w(UINT8 data)
{
	UINT8 drive = 0;
	UINT8 head = 0;

	if (LOG_FDC)
	{
		logerror("fdc_coco_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n",
			data & 0x80 ? 'H' : 'h',
			data & 0x40 ? '3' : '.',
			data & 0x20 ? 'D' : 'S',
			data & 0x10 ? 'P' : 'p',
			data & 0x08 ? 'M' : 'm',
			data & 0x04 ? '2' : '.',
			data & 0x02 ? '1' : '.',
			data & 0x01 ? '0' : '.',
			data);
	}

	/* An email from John Kowalski informed me that if the DS3 is
	 * high, and one of the other drive bits is selected (DS0-DS2), then the
	 * second side of DS0, DS1, or DS2 is selected.  If multiple bits are
	 * selected in other situations, then both drives are selected, and any
	 * read signals get yucky.
	 */

	if (data & 0x04)
		drive = 2;
	else if (data & 0x02)
		drive = 1;
	else if (data & 0x01)
		drive = 0;
	else if (data & 0x40)
		drive = 3;

	floppy_image_device *floppy[4];

	floppy[0] = subdevice<floppy_connector>(WD_TAG ":0")->get_device();
	floppy[1] = subdevice<floppy_connector>(WD_TAG ":1")->get_device();
	floppy[2] = subdevice<floppy_connector>(WD_TAG ":2")->get_device();
	floppy[3] = subdevice<floppy_connector>(WD_TAG ":3")->get_device();

	for (int i = 0; i < 4; i++)
	{
		if (floppy[i])
			floppy[i]->mon_w(i == drive ? CLEAR_LINE : ASSERT_LINE);
	}

	head = ((data & 0x40) && (drive != 3)) ? 1 : 0;

	m_dskreg = data;

	update_lines();

	m_wd17xx->set_floppy(floppy[drive]);

	if (floppy[drive])
		floppy[drive]->ss_w(head);

	m_wd17xx->dden_w(!BIT(m_dskreg, 5));
}