当前位置: 首页>>代码示例>>C++>>正文


C++ screen_load函数代码示例

本文整理汇总了C++中screen_load函数的典型用法代码示例。如果您正苦于以下问题:C++ screen_load函数的具体用法?C++ screen_load怎么用?C++ screen_load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了screen_load函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wiz_create_item

/*
 * Wizard routine for creating objects		-RAK-
 * Heavily modified to allow magification and artifactification  -Bernd-
 *
 * Note that wizards cannot create objects on top of other objects.
 *
 * Hack -- this routine always makes a "dungeon object", and applies
 * magic to it, and attempts to decline cursed items.
 */
static void wiz_create_item(void)
{
	object_type	forge;
	object_type *q_ptr;

	int k_idx;


	/* Save the screen */
	screen_save();

	/* Get object base type */
	k_idx = wiz_create_itemtype();

	/* Restore the screen */
	screen_load();


	/* Return if failed */
	if (!k_idx) return;

	if (k_info[k_idx].gen_flags & TRG_INSTA_ART)
	{
		int i;

		/* Artifactify */
		for (i = 1; i < max_a_idx; i++)
		{
			/* Ignore incorrect tval */
			if (a_info[i].tval != k_info[k_idx].tval) continue;

			/* Ignore incorrect sval */
			if (a_info[i].sval != k_info[k_idx].sval) continue;

			/* Create this artifact */
			(void)create_named_art(i, py, px);

			/* All done */
			msg_print("Allocated(INSTA_ART).");

			return;
		}
	}

	/* Get local object */
	q_ptr = &forge;

	/* Create the item */
	object_prep(q_ptr, k_idx);

	/* Apply magic */
	apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);

	/* Drop the object from heaven */
	(void)drop_near(q_ptr, -1, py, px);

	/* All done */
	msg_print("Allocated.");
}
开发者ID:motemen,项目名称:hengband-lua,代码行数:68,代码来源:wizard2.c

示例2: spell_menu_select

/**
 * Run the spell menu to select a spell.
 */
static int spell_menu_select(menu_type *m, const char *noun, const char *verb)
{
    struct spell_menu_data *d = menu_priv(m);

    screen_save();

    region_erase_bordered(&m->active);
    prt(format("%^s which %s? ", verb, noun), 0, 0);

    screen_save();
    menu_select(m, 0);
    screen_load();

    screen_load();

    return d->selected_spell;
}
开发者ID:artes-liberales,项目名称:FAangband,代码行数:20,代码来源:ui-spell.c

示例3: do_cmd_wiz_help

/*
 * Display the debug commands help file.
 */
static void do_cmd_wiz_help(void) 
{
	char buf[80];
	strnfmt(buf, sizeof(buf), "debug.txt");
	screen_save();
	show_file(buf, NULL, 0, 0);
	screen_load();
}
开发者ID:mtadd,项目名称:angband,代码行数:11,代码来源:wizard.c

示例4: trap_menu

/**
 * Display list of monster traps.
 */
bool trap_menu(void)
{
    menu_type menu;
    menu_iter menu_f = { trap_tag, 0, trap_display, trap_action, 0 };
    region area = { 15, 1, 48, -1 };
    ui_event_data evt = { EVT_NONE, 0, 0, 0, 0 };

    size_t i, num = 0;

    u16b *choice;

    /* See how many traps available */
    if (player_has(PF_EXTRA_TRAP))
        num = 1 + (p_ptr->lev / 4);
    else
        num = 1 + (p_ptr->lev / 6);

    /* Create the array */
    choice = C_ZNEW(num, u16b);

    /* Obvious */
    for (i = 0; i < num; i++) {
        choice[i] = i;
    }

    /* Clear space */
    area.page_rows = num + 2;

    /* Return here if there are no traps */
    if (!num) {
        FREE(choice);
        return FALSE;
    }


    /* Save the screen and clear it */
    screen_save();

    /* Help text */

    /* Set up the menu */
    WIPE(&menu, menu);
    menu_init(&menu, MN_SKIN_SCROLL, &menu_f);
    menu.title = "Choose an advanced monster trap (ESC to cancel):";
    menu_setpriv(&menu, num, choice);
    menu_layout(&menu, &area);
    prt("", area.row + 1, area.col);

    /* Select an entry */
    evt = menu_select(&menu, 0);

    /* Free memory */
    FREE(choice);

    /* Load screen */
    screen_load();
    return (evt.type != EVT_ESCAPE);
}
开发者ID:artes-liberales,项目名称:FAangband,代码行数:61,代码来源:trap.c

示例5: do_control_inven

bool do_control_inven(void)
{
	if (!p_ptr->control) return FALSE;
	screen_save();
	prt("Carried items", 0, 0);
	// DGDGDGDG	show_monster_inven(p_ptr->control, monst_list);
	inkey();
	screen_load();
	return TRUE;
}
开发者ID:jcubic,项目名称:ToME,代码行数:10,代码来源:monster3.c

示例6: do_cmd_help

/*
 * Peruse the On-Line-Help
 */
void do_cmd_help(void)
{
	/* Save screen */
	screen_save();

	/* Peruse the main help file */
	(void)show_file("help.hlp", NULL, 0, 0);

	/* Load screen */
	screen_load();
}
开发者ID:Daedelus01,项目名称:angband,代码行数:14,代码来源:ui-help.c

示例7: _on_browse

static void _on_browse(int which)
{
    bool screen_hack = screen_is_saved();
    if (screen_hack) screen_load();

    display_weapon_mode = which;
    do_cmd_knowledge_weapon();
    display_weapon_mode = 0;

    if (screen_hack) screen_save();
}
开发者ID:poschengband,项目名称:poschengband,代码行数:11,代码来源:mystic.c

示例8: do_cmd_monlist

/*
 * Display the main-screen monster list.
 */
void do_cmd_monlist(void)
{
	/* Save the screen and display the list */
	screen_save();
	display_monlist();

	/* Wait */
	anykey();

	/* Return */
	screen_load();
}
开发者ID:Abigail,项目名称:angband,代码行数:15,代码来源:cmd-misc.c

示例9: do_cmd_itemlist

/**
 * Display the main-screen monster list.
 */
extern void do_cmd_itemlist(void)
{
    /* Save the screen and display the list */
    screen_save();
    display_itemlist();

    /* Wait */
    inkey_ex();

    /* Return */
    screen_load();
}
开发者ID:mjdrinen,项目名称:FAangband,代码行数:15,代码来源:cmd-misc.c

示例10: jump_menu

/**
 * Display list of places to jump to.
 */
bool jump_menu(int level, int *location)
{
    menu_type menu;
    menu_iter menu_f = { jump_tag, 0, jump_display, jump_action, 0 };
    region area = { 15, 1, 48, -1 };
    ui_event_data evt = { EVT_NONE, 0, 0, 0, 0 };
    int cursor = 0, j = 0;
    size_t i;
    u16b *choice;

    /* Dungeon only is easy */
    if (OPT(adult_dungeon))
    {
        *location = level + 1;
        return TRUE;
    }

    /* Create the array */
    choice = C_ZNEW(15, u16b);

    /* Get the possible stages */
    for (i = 0; i < NUM_STAGES; i++)
        if ((stage_map[i][DEPTH] == level) && (stage_map[i][LOCALITY] != 0))
            choice[j++] = i;

    /* Clear space */
    area.page_rows = j + 2;

    /* Save the screen and clear it */
    screen_save();

    /* Set up the menu */
    WIPE(&menu, menu);
    menu.title = "Which region do you want to be transported to?";
    menu.cmd_keys = " \n\r";
    menu_init(&menu, MN_SKIN_SCROLL, &menu_f);
    menu_setpriv(&menu, j, choice);
    menu_layout(&menu, &area);

    /* Select an entry */
    evt = menu_select(&menu, cursor);

    /* Set it */
    if (evt.type == EVT_SELECT)
        *location = place;

    /* Free memory */
    FREE(choice);

    /* Load screen */
    screen_load();
    return (evt.type != EVT_ESCAPE);
}
开发者ID:mjdrinen,项目名称:FAangband,代码行数:56,代码来源:wizard2.c

示例11: sval_menu

/**
 * Display list of svals to be ignored.
 */
static bool sval_menu(int tval, const char *desc)
{
	struct menu *menu;
	region area = { 1, 2, -1, -1 };

	ignore_choice *choices;

	int n_choices = ignore_collect_kind(tval, &choices);
	if (!n_choices)
		return false;

	/* Sort by name in ignore menus except for categories of items that are
	 * aware from the start */
	switch (tval)
	{
		case TV_LIGHT:
		case TV_MAGIC_BOOK:
		case TV_PRAYER_BOOK:
		case TV_DRAG_ARMOR:
		case TV_GOLD:
			/* leave sorted by sval */
			break;

		default:
			/* sort by name */
			sort(choices, n_choices, sizeof(*choices), cmp_ignore);
	}


	/* Save the screen and clear it */
	screen_save();
	clear_from(0);

	/* Help text */
	prt(format("Ignore the following %s:", desc), 0, 0);

	/* Run menu */
	menu = menu_new(MN_SKIN_COLUMNS, &ignore_sval_menu);
	menu_setpriv(menu, n_choices, choices);
	menu->cmd_keys = "Tt";
	menu_layout(menu, &area);
	menu_set_cursor_x_offset(menu, 1); /* Place cursor in brackets. */
	menu_select(menu, 0, false);

	/* Free memory */
	mem_free(choices);

	/* Load screen */
	screen_load();
	return true;
}
开发者ID:CrypticGator,项目名称:angband,代码行数:54,代码来源:ui-options.c

示例12: spell_menu_browse

/**
 * Run the spell menu, without selections.
 */
static void spell_menu_browse(menu_type * m, const char *noun)
{
	struct spell_menu_data *d = menu_priv(m);

	screen_save();

	region_erase_bordered(&m->active);
	prt(format("Browsing %ss.  Press Escape to exit.", noun), 0, 0);

	d->browse = TRUE;
	menu_select(m, 0, TRUE);

	screen_load();
}
开发者ID:NickMcConnell,项目名称:Beleriand,代码行数:17,代码来源:ui-spell.c

示例13: spell_menu_browse

/**
 * Run the spell menu, without selections.
 */
static void spell_menu_browse(struct menu *m, const char *noun)
{
	struct spell_menu_data *d = menu_priv(m);

	screen_save();

	region_erase_bordered(&m->active);
	prt(format("Browsing %ss. ('?' to toggle description)", noun), 0, 0);

	d->browse = TRUE;
	menu_select(m, 0, TRUE);

	screen_load();
}
开发者ID:Elfin-Jedi,项目名称:My-Angband-4.0.5,代码行数:17,代码来源:ui-spell.c

示例14: do_cmd_spoilers

/**
 * Create Spoiler files
 */
void do_cmd_spoilers(void)
{
	if (!spoil_menu) {
		spoil_menu = menu_new_action(spoil_actions, N_ELEMENTS(spoil_actions));
		spoil_menu->selections = lower_case;
		spoil_menu->title = "Create spoilers";
	}

	screen_save();
	clear_from(0);
	menu_layout(spoil_menu, &SCREEN_REGION);
	menu_select(spoil_menu, 0, false);
	screen_load();
}
开发者ID:CrypticGator,项目名称:angband,代码行数:17,代码来源:wiz-spoil.c

示例15: o_xtra_act

/*
 * Special key actions for object inscription.
 */
static void o_xtra_act(struct keypress ch, int oid)
{
	object_kind *k_ptr = &k_info[oid];
	s16b idx = get_autoinscription_index(oid);

	/* Forget it if we've never seen the thing */
	if (!k_ptr->everseen)
		return;

	/* Uninscribe */
	if (ch.code == '}') {
		if (idx != -1)
			remove_autoinscription(oid);
		return;
	}

	/* Inscribe */
	else if (ch.code == '{') {
		char note_text[80] = "";

		/* Avoid the prompt getting in the way */
		screen_save();

		/* Prompt */
		prt("Inscribe with: ", 0, 0);

		/* Default note */
		if (idx != -1)
			strnfmt(note_text, sizeof(note_text), "%s",
					get_autoinscription(oid));

		/* Get an inscription */
		if (askfor_aux(note_text, sizeof(note_text), NULL)) {
			/* Remove old inscription if existent */
			if (idx != -1)
				remove_autoinscription(oid);

			/* Add the autoinscription */
			add_autoinscription(oid, note_text);

			/* Notice stuff (later) */
			p_ptr->notice |= (PN_AUTOINSCRIBE);
			p_ptr->redraw |= (PR_INVEN | PR_EQUIP);
		}

		/* Reload the screen */
		screen_load();
	}
}
开发者ID:NickMcConnell,项目名称:Beleriand,代码行数:52,代码来源:ui-knowledge.c


注:本文中的screen_load函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。