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


C++ StringTable::GetString方法代码示例

本文整理汇总了C++中StringTable::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringTable::GetString方法的具体用法?C++ StringTable::GetString怎么用?C++ StringTable::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringTable的用法示例。


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

示例1: if

Setting *CamBoxTransitionMethod::GetSetting(long index) const {
	StringTable *table = &StringTable("text/Camera");

	if (index == 0) {
		const char *title = table->GetString(StringID('CAMR', 'CSCL'));
		return (new TextSetting('SCLE', Text::FloatToString((float) scale), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 1) {
		static const unsigned long axisID[3] =	{ 'cmkx', 'cmky', 'cmkz' };
		
		long selection = 0;
		if (axis == ky) selection = 1;
		else if (axis == kz) selection = 2;
		
		const char *title = table->GetString(StringID('CAMR', 'CAXS', 'CPMT'));
		MenuSetting *menu = new MenuSetting('AXIS', selection, title, 3);
		for (natural a = 0; a < 3; a++) menu->SetMenuItemString(a, table->GetString(StringID('CAMR', 'CAXS', axisID[a])));
		
		return (menu);
	}

	// start
	else if(index == 2) {
		const char *title = table->GetString(StringID('CAMR', 'STRT', 'DIST'));
		return (new TextSetting('SDIS', Text::FloatToString((float) strtDist), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 3) {
		const char *title = table->GetString(StringID('CAMR', 'STRT', 'RAZM'));
		return (new TextSetting('SAZM', Text::FloatToString((float) strtAzm), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 4) {
		const char *title = table->GetString(StringID('CAMR', 'STRT', 'RALT'));
		return (new TextSetting('SALT', Text::FloatToString((float) strtAlt), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 5) {
		const char *title = table->GetString(StringID('CAMR', 'STRT', 'OFFX'));
		return (new TextSetting('SOFX', Text::FloatToString((float) strtXY), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 6) {
		const char *title = table->GetString(StringID('CAMR', 'STRT', 'OFFZ'));
		return (new TextSetting('SOFZ', Text::FloatToString((float) strtZ), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}

	// goal
	else if(index == 7) {
		const char *title = table->GetString(StringID('CAMR', 'GOAL', 'DIST'));
		return (new TextSetting('GDIS', Text::FloatToString((float) goalDist), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 8) {
		const char *title = table->GetString(StringID('CAMR', 'GOAL', 'RAZM'));
		return (new TextSetting('GAZM', Text::FloatToString((float) goalAzm), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 9) {
		const char *title = table->GetString(StringID('CAMR', 'GOAL', 'RALT'));
		return (new TextSetting('GALT', Text::FloatToString((float) goalAlt), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 10) {
		const char *title = table->GetString(StringID('CAMR', 'GOAL', 'OFFX'));
		return (new TextSetting('GOFX', Text::FloatToString((float) goalXY), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}
	else if(index == 11) {
		const char *title = table->GetString(StringID('CAMR', 'GOAL', 'OFFZ'));
		return (new TextSetting('GOFZ', Text::FloatToString((float) goalZ), title, 7, &EditableTextElement::FloatNumberKeyFilter));
	}

	// bools
	else if(index == 12) {
		const char *title = table->GetString(StringID('CAMR', 'BOOL', 'DIST'));
		return (new BooleanSetting('BDIS', ((boolFlags & kbDist) != 0), title));
	}
	else if(index == 13) {
		const char *title = table->GetString(StringID('CAMR', 'BOOL', 'RAZM'));
		return (new BooleanSetting('BAZM', ((boolFlags & kbAzm) != 0), title));
	}
	else if(index == 14) {
		const char *title = table->GetString(StringID('CAMR', 'BOOL', 'RALT'));
		return (new BooleanSetting('BALT', ((boolFlags & kbAlt) != 0), title));
	}
	else if(index == 15) {
		const char *title = table->GetString(StringID('CAMR', 'BOOL', 'OFFX'));
		return (new BooleanSetting('BOFX', ((boolFlags & kbXY) != 0), title));
	}
	else if(index == 16) {
		const char *title = table->GetString(StringID('CAMR', 'BOOL', 'OFFZ'));
		return (new BooleanSetting('BOFZ', ((boolFlags & kbZ) != 0), title));
	}
	return (nullptr);
}
开发者ID:alecgoebel,项目名称:div2,代码行数:88,代码来源:AdvCameraScripts.cpp


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