GameLogic.cpp
上传用户:lian_0917
上传日期:2013-03-24
资源大小:1151k
文件大小:19k
- /********************************************************************
- created: 2004/07/02
- created: 2:7:2004 22:40
- filename: d:WorksGamelibGameLogic.cpp
- file path: d:WorksGamelib
- file base: GameLogic
- file ext: cpp
- author: lazybug
-
- purpose: 游戏逻辑的总管,对Delphi部分的接口函数全部由此提供,在这里创建ActorManager和
- EventManager,并处理用户输入,管理菜单等等。
- *********************************************************************/
- #include "StdAfx.h"
- #include <mmsystem.h>
- #include <iostream>
- #include <cmath>
- #include "GameLogic.h"
- #pragma comment(lib,"Winmm.lib")
- using namespace std ;
- const double PI = 3.1415926 ;
- CGameLogic::CGameLogic(void)
- {
- this->LoadResInfo() ;
- this->LoadLogicalMap(".\Scenes\bedroom.map") ;
- this->LoadLogicalMap(".\Scenes\garden.map") ;
- this->LoadLogicalMap(".\Scenes\客厅.map") ;
- this->LoadLogicalMap(".\Scenes\厨房.map") ;
- this->LoadLogicalMap(".\Scenes\地道入口.map") ;
- this->LoadLogicalMap(".\Scenes\柴房.map") ;
- this->LoadLogicalMap(".\Scenes\地下室5.map") ;
- this->LoadLogicalMap(".\Scenes\地下室6.map") ;
- this->LoadLogicalMap(".\Scenes\地下室7.map") ;
- this->LoadLogicalMap(".\Scenes\地下室8.map") ;
- this->UseLogicalMap(0) ;
- m_bAccept_user_inputs = true ;
- m_talking_board.actived = false ;
- m_discovery_board.actived = false ;
- m_is_fighting = false ;
- m_current_menu = -1 ;
- m_walking_speed = FASTMODE ;
- m_is_dead = false ;
- m_is_success = false ;
- m_walking_angel_up = 22.0 ;
- m_walking_angel_left = 31.0 ;
- // 敏感距离和室内外相关
- m_sensitive_length = 25 ;
- //m_walking_state = STOP ;
- m_ActorManager = new CActorManager(this) ;
- m_ActorManager->CreateActors() ;
- m_EventManager = new CEventManager(this) ;
- m_EventManager->LoadScene("scene1.script") ;
- // 初始化随机种子
- srand( timeGetTime() ) ;
- }
- CGameLogic::~CGameLogic(void)
- {
- delete m_ActorManager ;
- delete m_EventManager ;
- }
- void CGameLogic::enumObj(void* object )
- {
- static CBaseStruct emptyObj ;
- emptyObj.ResID = 0 ;
- CPlayer* myPlayer ;
- if (( myPlayer = m_ActorManager->enumActor() ) != NULL )
- {
- memcpy(object, (CBaseStruct*)myPlayer, sizeof(CBaseStruct) ) ;
- }
- else
- {
- memcpy( object, &emptyObj, sizeof(CBaseStruct) ) ;
- }
- }
- void CGameLogic::AutoUpdate()
- {
- static DWORD last_time = 0 ;
- /*
- * 执行脚本
- */
- if ( m_EventManager->Has_something_todo() && !m_EventManager->is_wait_for_enter() && m_GameState != MENUING )
- {
- m_EventManager->Continue_Doing() ;
- }
- if ( timeGetTime() - last_time < 30 )
- return;
- last_time = timeGetTime() ;
- /*
- * 间隔一段时间给npc状态自动更新
- */
- CPlayer* myPlayer = m_ActorManager->enumActor() ;
-
- while ( myPlayer != NULL )
- {
- myPlayer->AutoUpdate() ;
- myPlayer = m_ActorManager->enumActor() ;
- }
- }
- void CGameLogic::UserInput(int keymap )
- {
- static DWORD last_time = 0 ;
- static int oldkey = 0 ;
- size_t elpsedtime ;
- int dx1 = (int)( m_walking_speed * cos(m_walking_angel_up / 180 * PI) ) ; /*22, 29.5 */
- int dy1 = (int)( m_walking_speed * sin(m_walking_angel_up / 180 * PI) ) ;
- int dx2 = (int)( m_walking_speed * cos(m_walking_angel_left / 180 * PI) ) ; /*31, 21.0*/
- int dy2 = (int)( m_walking_speed * sin(m_walking_angel_left / 180 * PI) ) ;
- CPlayer& Actor = m_ActorManager->GetActiveActor() ;
- if (m_GameState == MENUING)
- {
- elpsedtime = 0 ;
- }
- else
- {
- elpsedtime = 40 ;
- }
-
- if ( timeGetTime() - last_time < elpsedtime)
- return ;
- last_time = timeGetTime() ;
- if ( oldkey != keymap && Actor.state != FIGHTING )
- {
- //m_walking_state = STOP ;
- Actor.state = STOP ;
- }
- if ( ( keymap & 1 ) && (m_bAccept_user_inputs) ) /* 上 */
- {
- if ( oldkey == keymap )
- {
- //m_walking_state = WALKING ;
- Actor.state = WALKING ;
- }
- this->ActiveMove(dx2,-dy2) ;
-
- /* 向上移动菜单焦点 */
- if ( m_GameState == MENUING )
- {
- if ( (oldkey ^ keymap) & 1 )
- {
- oldkey = keymap ;
- }
- else
- {
- return ;
- }
- if ( m_focused_menu_item == m_scroll_point )
- {
- if ( Scrolled( UPWARD ) )
- {
- m_focused_menu_item-- ;
- }
- }
- else
- {
- m_focused_menu_item-- ;
- }
- }
- // 返回,不接收同时输入
- oldkey = keymap ;
- return ;
- }
- if ( ( keymap & 2 ) && (m_bAccept_user_inputs) ) /* 下 */
- {
- if ( oldkey == keymap )
- {
- //m_walking_state = WALKING ;
- Actor.state = WALKING ;
- }
- ActiveMove(-dx2, dy2) ;
- /* 移动菜单焦点 */
- if ( m_GameState == MENUING )
- {
- if ( (oldkey ^ keymap) & 2 )
- {
- oldkey = keymap ;
- }
- else
- {
- return ;
- }
- if ( !is_enum_item_end( m_focused_menu_item ) )
- {
- m_focused_menu_item++ ;
- if ( is_enum_item_end(m_focused_menu_item) )
- {
- m_focused_menu_item-- ;
- }
- if ( m_focused_menu_item - m_scroll_point == MAXSCROLLITEM )
- {
- if (!Scrolled( DOWNWARD ))
- {
- m_focused_menu_item-- ;
- }
- }
- }
-
- }
- // 返回,不接收同时输入
- oldkey = keymap ;
- return ;
- }
- if ( ( keymap & 4 ) && (m_bAccept_user_inputs) ) /* 左 */
- {
- if ( oldkey == keymap )
- {
- //m_walking_state = WALKING ;
- Actor.state = WALKING ;
- }
- ActiveMove(-dx1, -dy1) ;
- // 返回,不接收同时输入
- oldkey = keymap ;
- return ;
- }
- if ( ( keymap & 8 ) && (m_bAccept_user_inputs) ) /* 右 */
- {
- if ( oldkey == keymap )
- {
- //m_walking_state = WALKING ;
- Actor.state = WALKING ;
- }
- ActiveMove(dx1, dy1) ;
- // 返回,不接收同时输入
- oldkey = keymap ;
- return ;
- }
- if ( keymap & 32 )
- {
- if ( (oldkey ^ keymap) & 32 )
- {
- oldkey = keymap ;
- }
- else
- {
- return ;
- }
- if ( m_EventManager->is_wait_for_enter() )
- {
- m_EventManager->UserPressedEnter() ;
- }
- else
- {
- if ( m_bAccept_user_inputs && !Actor.is_dead )
- {
- if ( m_GameState == MENUING )
- {
- SelectItem() ;
- }
- else
- {
- Research() ;
- }
- }
- }
-
- }
- /* 呼出菜单 */
- if ( keymap & 64 )
- {
- // todo: 激活菜单
- BringUpMenu( MENU1 ) ;
- }
- if ( keymap & 128 )
- {
- // todo: 二号菜单
- BringUpMenu( MENU2 ) ;
- }
- if ( keymap & 256 )
- {
- // todo:三号菜单
- //BringUpMenu( MENU3 ) ;
- }
- if ( keymap & 512 )
- {
- // todo: 四号菜单
- //BringUpMenu( MENU4 ) ;
- }
- /* 关闭菜单 */
- if ( keymap & 1024 )
- {
- m_GameState = NORMAL ;
- m_current_menu = NOMENU ;
- }
- oldkey = keymap ;
- }
- const STalking_Board* CGameLogic::QueryTalking()
- {
- if ( m_talking_board.actived )
- {
- return &m_talking_board ;
- }
- else
- {
- return NULL ;
- }
- }
- const SDiscovery_Board* CGameLogic::QueryDiscovery()
- {
- if ( m_discovery_board.actived )
- {
- return &m_discovery_board ;
- }
- else
- {
- return NULL ;
- }
- }
- void CGameLogic::ActiveMove(int dx, int dy )
- {
- CPlayer& Actor = m_ActorManager->GetActiveActor() ;
- int ix = Actor.x + dx ;
- int iy = Actor.y + dy ;
-
- int event_id = this->m_LogicMap[m_current_map][ix/granularity][iy/granularity] ;
- if ( event_id != 0 && this->m_current_menu == NOMENU )
- {
- if ( !Actor.DetectOtherActor(dx, dy) )
- {
- Actor.x = ix ;
- Actor.y = iy ;
- }
- if ( dx > 0 && dy > 0 )
- Actor.facing = 1 ;
- if ( dx < 0 && dy < 0 )
- Actor.facing = 3 ;
- if ( dy < 0 && dx > 0 )
- Actor.facing = 2 ;
- if ( dy > 0 && dx < 0 )
- Actor.facing = 0 ;
- if ( event_id != 1 && event_id != -1 && event_id < 256 )
- {
- m_EventManager->Do_Event(event_id) ;
- }
- }
- }
- /*
- * 读取地图目标
- */
- void CGameLogic::LoadLogicalMap(const std::string& name)
- {
- int i, j, map_no ;
- ifstream in ;
- in.open(name.c_str(), ios::in) ;
- if ( in.is_open() )
- {
- in >> map_no ;
- for (i = 0; i < 600 / granularity ; i++)
- {
- for ( j = 0; j < 800 / granularity ; j++)
- in >> m_LogicMap[map_no][j][i] ;
- }
- }
- else
- {
- throw exception("map file not found!") ;
- }
- }
- /*
- * 读取资源信息
- */
- void CGameLogic::LoadResInfo()
- {
- ifstream in ;
- GameRes info ;
- string index ;
- in.open( ".\Scenes\GameRes.res" ) ;
-
- if ( in.is_open() )
- {
- while ( !in.eof() )
- {
- in >> index >> info.filename >> info.h_frame >> info.v_frame >> info.color_key ;
- m_game_res.insert( make_pair(index, info) ) ;
- }
- }
-
- else
- {
- throw exception("GameResInfo file not found!") ;
- }
- }
- /*
- * 从资源库根据名字得到资源描述结构体
- */
- GameRes* CGameLogic::GetRes(const std::string& res_name)
- {
- map<string,GameRes>::iterator pos = m_game_res.find(res_name) ;
- if ( pos != m_game_res.end())
- {
- return &(pos->second) ;
- }
- else
- {
- throw exception("try to get an nonexsisted resource!") ;
- }
- }
- /*
- * 枚举菜单项
- */
- void CGameLogic::enumMenuItem(void* pItem )
- {
- static SMenuItem item ;
- static string temp ;
- stringstream stream ;
- CPlayer& player = m_ActorManager->GetActiveActor() ;
- if ( !( m_enumPointer == m_scroll_point + MAXSCROLLITEM ) && !is_enum_item_end( m_enumPointer ) )
- {
- item.pic_id = m_enumPointer->icon_id ;
- item.description = m_enumPointer->description.c_str() ;
-
- item.x = 38 ;
- item.height = 60 ;
- item.width = 210 ;
- item.y += 50 ;
- if ( m_enumPointer == m_focused_menu_item )
- {
- item.is_focus = true ;
- }
- else
- {
- item.is_focus = false ;
- }
- memcpy(pItem, &item, sizeof( SMenuItem ) ) ;
- item.y += 28 ;
- m_enumPointer++ ;
- }
- else
- {
- item.pic_id = -1 ;
- item.description = NULL ;
- item.x = 0 ;
- item.y = 0 ;
- memcpy(pItem, &item, sizeof( SMenuItem ) ) ;
- reset_enum_pointer(m_enumPointer) ;
- }
- }
- /*
- * 菜单指针有没有到结尾
- */
- bool CGameLogic::is_enum_item_end(const std::vector<SPropertyItem>::iterator& pos)
- {
- switch ( m_current_menu ) {
- case MENU1:
- return pos == m_gerneral_menu.end() ;
- break;
- case MENU2:
- return pos == m_ActorManager->GetActiveActor().m_tools.end() ;
- break;
- case MENU3:
- return pos == m_ActorManager->GetActiveActor().m_skills.end() ;
- break ;
- case MENU4:
- return pos == m_gerneral_menu.end() ;
- break ;
- default:
- break ;
- }
- return true ;
- }
- /*
- * 菜单指针是不是到开头
- */
- bool CGameLogic::is_enum_item_begin(const std::vector<SPropertyItem>::iterator& pos)
- {
- switch ( m_current_menu ) {
- case MENU1:
- return pos == m_gerneral_menu.begin() ;
- break;
- case MENU2:
- return pos == m_ActorManager->GetActiveActor().m_tools.begin() ;
- break;
- case MENU3:
- return pos == m_ActorManager->GetActiveActor().m_skills.begin() ;
- break ;
- case MENU4:
- return pos == m_gerneral_menu.begin() ;
- break ;
- default:
- break ;
- }
- return true ;
- }
- /*
- * 重置枚举指针到开始
- */
- void CGameLogic::reset_enum_pointer(std::vector<SPropertyItem>::iterator& pos)
- {
- pos = m_scroll_point ;
- }
- /*
- * 当前人物调查地图
- */
- void CGameLogic::Research()
- {
- CPlayer& Actor = m_ActorManager->GetActiveActor() ;
- int ix = Actor.x ;
- int iy = Actor.y ;
- int new_event ;
- /*
- * 自身所在位置的调查
- */
- int event_id = this->m_LogicMap[m_current_map][ix/granularity][iy/granularity] ;
- /* 先根据地图处理地图事件 */
- if ( event_id > 256 )
- {
- /* 调用触发事件 */
- m_EventManager->Call_Event( event_id ) ;
- /* 如果触发事件有后续事件,则改动逻辑地图 */
- if ( (new_event = m_EventManager->Following_Event(event_id)) != -1)
- {
- this->m_LogicMap[m_current_map][ix/granularity][iy/granularity] = new_event ;
- }
- return ;
- }
- /*
- * 自身周边的位置调查
- */
- for (int dx = -1; dx <= 1; dx ++ )
- {
- for ( int dy = -1; dy <= 1; dy++ )
- {
- event_id = this->m_LogicMap[m_current_map][ix/granularity + dx ][iy/granularity + dy ] ;
- if ( event_id >= 300 && event_id <= 310 )
- {
- /* 调用触发事件 */
- m_EventManager->Call_Event( event_id ) ;
- /* 修改地图 */
- this->m_LogicMap[m_current_map][ix/granularity + dx][iy/granularity + dy] = 1 ;
- return ;
- }
- }
- }
- /* 看看是否有用户关注的npc,如果有,引发菜单*/
- if ( m_ActorManager->GetUserAttention() != NULL )
- {
- BringUpMenu( MENU4 ) ;
- }
- }
- /*
- * 对菜单选择的处理
- */
- void CGameLogic::SelectItem()
- {
- CPlayer& Actor = m_ActorManager->GetActiveActor() ;
- CPlayer* npc = NULL ;
- vector<string> Argu ;
- switch (m_current_menu)
- {
- case MENU1 : /* 人物属性菜单:回车不作为 */
- break;
- case MENU2 : /* 物品菜单:回车就使用物品 */
- if ( !is_enum_item_end( m_focused_menu_item ) )
- {
- // 改变人物属性
- Actor.ChangeProperty( m_focused_menu_item->name, m_focused_menu_item->val ) ;
- // 从装备中删除节点
- Actor.m_tools.erase( m_focused_menu_item ) ;
-
- // 枚举指针恢复到第一条
- m_enumPointer = Actor.m_tools.begin() ;
- // 恢复焦点指针到第一位
- m_focused_menu_item = m_enumPointer ;
-
- /* 卷屏点也恢复到开始 */
- m_scroll_point = m_enumPointer ;
- }
-
- break;
- case MENU3 :
- /* 三号菜单:招数菜单,选择招数进行攻击 */
-
- if ( m_focused_menu_item->val != 999 )
- {
- /* actor状态变成攻击,播放攻击帧 */
- Actor.Attack( m_focused_menu_item->description, m_npcFighter ) ;
- }
- else
- {
- Actor.TryEscape( m_npcFighter ) ;
- }
-
- m_GameState = NORMAL ;
- m_current_menu = NOMENU ;
- break ;
- case MENU4 :
- /* 四号菜单:人物调查菜单:选择不同的行为 */
- switch ( m_focused_menu_item->val )
- {
- /* 和关注npc聊天 */
- case 0 :
- Argu.push_back(m_ActorManager->GetUserAttention()->name) ;
- Argu.push_back(m_ActorManager->GetActiveActor().name) ;
- m_GameState = NORMAL ;
- m_current_menu = NOMENU ;
- m_EventManager->Call_Event(m_ActorManager->GetUserAttention()->TalkScript(), &Argu) ;
- break ;
- /* 和关注的npc战斗 */
- case 1 :
- Argu.push_back(m_ActorManager->GetActiveActor().name) ;
- Argu.push_back(m_ActorManager->GetUserAttention()->name) ;
- m_GameState = NORMAL ;
- m_current_menu = NOMENU ;
- m_EventManager->Call_Event("fight", &Argu) ;
- break ;
- /* 啥也不作,关掉菜单 */
- case 2 :
- m_GameState = NORMAL ;
- m_current_menu = NOMENU ;
- break ;
- /* 出人物生平简介 */
- case 3 :
- Argu.push_back(m_ActorManager->GetUserAttention()->name) ;
- Argu.push_back(m_ActorManager->GetActiveActor().name) ;
- m_GameState = NORMAL ;
- m_current_menu = NOMENU ;
- m_EventManager->Call_Event("show", &Argu) ;
- break ;
- default:
- break ;
- }
- break ;
- }
- }
- /*
- * 卷动菜单:返回false如果卷动到底不作为
- */
- bool CGameLogic::Scrolled( int waypoint )
- {
- if ( waypoint == DOWNWARD )
- {
- if ( !is_enum_item_end( m_scroll_point + MAXSCROLLITEM ) )
- {
- m_scroll_point++ ;
- reset_enum_pointer( m_enumPointer ) ;
- return true ;
- }
- }
- else
- {
- if ( !is_enum_item_begin( m_scroll_point ) )
- {
- m_scroll_point-- ;
- reset_enum_pointer( m_enumPointer ) ;
- return true ;
- }
- }
- return false ;
- }
- /*
- * 查询战斗状态:不在战斗状态返回-1
- */
- void CGameLogic::QueryBattleState(int* x, int* y, int* radius )
- {
- if ( !m_is_fighting )
- {
- *x = 0 ;
- *y = 0 ;
- *radius = -1 ;
- }
- else
- {
- *x = m_lightspot_x ;
- *y = m_lightspot_y ;
- *radius = m_lightspot_radius ;
- }
- }
- /*
- * 设定对战的npcActor
- */
- void CGameLogic::StartFight(const std::string& name, const string& npc_name)
- {
- CPlayer& actor = this->m_ActorManager->GetActor(name) ;
- CPlayer& npc = this->m_ActorManager->GetActor(npc_name) ;
- m_is_fighting = true ;
- this->m_npcFighter = npc_name ;
- if ( m_walking_speed <= SLOWMODE )
- {
- SetLightSpot( (actor.x + npc.x) / 2, ( actor.y + npc.y ) / 2 , 90 ) ;
- }
- else
- {
- SetLightSpot( (actor.x + npc.x) / 2, ( actor.y + npc.y ) / 2 , 150 ) ;
- }
- }
- void CGameLogic::EndFight(const string& name)
- {
- m_is_fighting = false ;
- if ( name == "牛二" )
- {
- m_ActorManager->GetActiveActor().Die() ;
- m_EventManager->Do_Event("Die_event") ;
- return ;
- }
- // 从战斗脚本里退出
- m_EventManager->Return_from_Event() ;
- }
- void CGameLogic::BringUpMenu(int id )
- {
- SPropertyItem item ;
- switch (id)
- {
- /* 人物属性菜单 */
- case MENU1 :
- /* 拷贝菜单项 */
- dump_property_menu() ;
- m_enumPointer = m_gerneral_menu.begin() ;
- m_focused_menu_item = m_gerneral_menu.begin() ;
- m_scroll_point = m_enumPointer ;
- Speak("菜单") ;
- break;
- /* 人物装备菜单 */
- case MENU2 :
- m_enumPointer = m_ActorManager->GetActiveActor().m_tools.begin() ;
- m_focused_menu_item = m_ActorManager->GetActiveActor().m_tools.begin() ;
- m_scroll_point = m_enumPointer ;
- Speak("菜单") ;
- break;
- /* 战斗时人物技能菜单 */
- case MENU3 :
- m_enumPointer = m_ActorManager->GetActiveActor().m_skills.begin() ;
- m_focused_menu_item = m_ActorManager->GetActiveActor().m_skills.begin() ;
- m_scroll_point = m_enumPointer ;
- break ;
- /* 利用通用菜单的人物调查菜单 */
- case MENU4 :
- memset(&item, 0, sizeof(item) ) ;
- m_gerneral_menu.clear() ;
- item.icon_id = -1 ;
- item.description = "<size=12> </p> 看看他到底是什么人" ;
- item.val = 3 ;
- m_gerneral_menu.push_back(item) ;
- /* 出现在菜单上的描述 */
- item.description = "<size=12> </p> 和他聊一聊吧" ;
- /* 菜单的id,用于按键时判断菜单的选择项 */
- item.val = 0 ;
- m_gerneral_menu.push_back(item) ;
- item.description = "<size=12> </p> 真不爽,打他丫的" ;
- item.val = 1 ;
- m_gerneral_menu.push_back(item) ;
- item.description = "<size=12> </p> 不理他,走人" ;
- item.val = 2 ;
- m_gerneral_menu.push_back(item) ;
- m_enumPointer = m_gerneral_menu.begin() ;
- m_focused_menu_item = m_gerneral_menu.begin() ;
- m_scroll_point = m_enumPointer ;
- break ;
- default:
- throw( exception("try to use invalide menu!") ) ;
- }
- m_GameState = MENUING ;
- m_current_menu = id ;
- }
- void CGameLogic::dump_property_menu()
- {
- CPlayer& actor = m_ActorManager->GetActiveActor() ;
- SPropertyItem* property ;
- SPropertyItem item ;
- stringstream stream ;
- string empty ;
- memset(&item, 0, sizeof(item) ) ;
- m_gerneral_menu.clear() ;
- property = actor.Property("生命力") ;
- item.icon_id = m_ActorManager->GetSimpleObj( property->name ).ResID ;
- stream << "<size=13>生命力" << ": <color=255>" << property->val ;
- property = actor.Property("生命力上限") ;
- stream << "<color=16777215>/" << property->val << "</p>" << property->description ;
- item.description = stream.str() ;
- m_gerneral_menu.push_back(item) ;
-
- stream.rdbuf()->str( empty ) ;
- property = actor.Property("魔法力") ;
- item.icon_id = m_ActorManager->GetSimpleObj( property->name ).ResID ;
- stream << "<size=13>法术" << ": " << property->val ;
- property = actor.Property("魔法力上限") ;
- stream << "/" << property->val << "</p>" << property->description ;
- item.description = stream.str() ;
- m_gerneral_menu.push_back(item) ;
- stream.rdbuf()->str( empty ) ;
- property = actor.Property("攻击力") ;
- item.icon_id = m_ActorManager->GetSimpleObj( property->name ).ResID ;
- stream << "<size=13>攻击力" << ": " << property->val ;
- property = actor.Property("攻击力上限") ;
- stream << "/" << property->val << "</p>" << property->description ;
- item.description = stream.str() ;
- m_gerneral_menu.push_back(item) ;
- stream.rdbuf()->str( empty ) ;
- property = actor.Property("等级") ;
- item.icon_id = m_ActorManager->GetSimpleObj( property->name ).ResID ;
- stream << "<size=13>等级" << ":" << property->val << "</p>" << property->description ;
- item.description = stream.str() ;
- m_gerneral_menu.push_back(item) ;
- stream.rdbuf()->str( empty ) ;
- property = actor.Property("经验") ;
- item.icon_id = m_ActorManager->GetSimpleObj( property->name ).ResID ;
- stream << "<size=13>江湖经验" << ": " << property->val << "</p>" << property->description ;
- item.description = stream.str() ;
- m_gerneral_menu.push_back(item) ;
- stream.rdbuf()->str( empty ) ;
- }