Exemplo n.º 1
0
void ZVote::DoRender(ZMap &the_map)
{
	if(in_progress && vote_in_progress_img.GetBaseSurface())
	{
		int shift_x, shift_y, view_w, view_h;

		int x, y;

		the_map.GetViewShiftFull(shift_x, shift_y, view_w, view_h);

		x = view_w - vote_in_progress_img.GetBaseSurface()->w;
		//y = view_h - vote_in_progress_img.GetBaseSurface()->h;

		x -= 4;
		y = 4;

		x += shift_x;
		y += shift_y;

		vote_in_progress_img.SetAlpha(200);
		description_img.SetAlpha(200);
		have_img.SetAlpha(200);
		needed_img.SetAlpha(200);
		for_img.SetAlpha(200);
		against_img.SetAlpha(200);

		the_map.RenderZSurface(&vote_in_progress_img, x, y);

		//the_map.RenderZSurface(&description_img, x+7, y+37, false, true);
		the_map.RenderZSurface(&description_img, x+57, y+36+5, false, true);

		the_map.RenderZSurface(&have_img, x+57, y+46+7, false, true);
		the_map.RenderZSurface(&needed_img, x+57, y+57+7, false, true);
		the_map.RenderZSurface(&for_img, x+22, y+57+7, false, true);
		the_map.RenderZSurface(&against_img, x+91, y+57+7, false, true);
	}
}
Exemplo n.º 2
0
void GWFactoryList::DoRender(ZMap &the_map, SDL_Surface *dest)
{
	int shift_x, shift_y, view_w, view_h;
	int tx, ty;

	if(!show) return;
	if(!finished_init) return;
	if(!ols) return;
	if(our_team == NULL_TEAM) return;

	the_map.GetViewShiftFull(shift_x, shift_y, view_w, view_h);

	x = shift_x;
	y = shift_y + view_h;

	DetermineHeight(view_h);

	y -= height;

	//top
	the_map.RenderZSurface(&main_top_img, x, y);

	//entries
	DoRenderEntries(the_map, dest);

	//right
	{
		tx = x + (main_top_img.GetBaseSurface()->w - main_right_img.GetBaseSurface()->w);
		ty = y + main_top_img.GetBaseSurface()->h;

		while(ty < shift_y + view_h)
		{
			the_map.RenderZSurface(&main_right_img, tx, ty);
			ty += main_right_img.GetBaseSurface()->h;
		}
	}

	if(entry_list.size())
	{
		int scroll_top;
		int scroll_bottom;
		int scroll_missing_entries;

		//buttons
		up_button.SetOffsets(123, main_top_img.GetBaseSurface()->h + 2);
		up_button.DoRender(the_map, dest, x, y);

		down_button.SetOffsets(123, height - 11);
		down_button.DoRender(the_map, dest, x, y);

		//scrollbar
		scroll_top = main_top_img.GetBaseSurface()->h + 14;
		scroll_bottom = height - 14;
		scroll_bar.SetOffsets(123, scroll_top);
		scroll_bar.SetHeight(scroll_bottom - scroll_top);

		scroll_missing_entries = entry_list.size() - show_able_entries;
		if(scroll_missing_entries > 0)
			scroll_bar.SetPercentDown(1.0 * show_start_entry / scroll_missing_entries);
		else
			scroll_bar.SetPercentDown(0);
		scroll_bar.SetPercentViewable(1.0 * show_able_entries / entry_list.size());

		scroll_bar.DoRender(the_map, dest, x, y);
	}
}