作者共发了4篇帖子。 内容转换:不转换▼
 
点击 回复
322 3
【功能】怪物编辑器查看怪物定义代码
一派护法 十九级
1楼 发表于:2016-1-19 20:06
一派护法 十九级
2楼 发表于:2016-1-19 20:06
【C++代码】
void DefinitionDialog::Init(void)
{
    ifstream file(manager->fileName);
    string str;
    char ch;
    int i = 0;
    char search[MAX_LOADSTRING_SHORT];
    char keyword[MAX_LOADSTRING_SHORT];
    sprintf_s(search, "this[%d]", monsterId);
    while (ch = file.get(), !file.eof())
    {
        switch (ch)
        {
        case '\t':
            continue;
        case ' ':
        case '.':
        case '\r':
        case '\n':
        case '=':
            i = 0;
            if (strcmp(keyword, search) == 0)
            {
                sprintf_s(keyword, "RXData.Monsters[%d]", monsterId);
                str += keyword;
                str += ch;
                while (ch = file.get(), ch != '\n')
                    str += ch;
                str += "\r\n";
            }
            memset(keyword, 0, MAX_LOADSTRING_SHORT);
            continue;
        }
       
        if (i < MAX_LOADSTRING_SHORT - 1)
            keyword[i++] = ch;
    }
    file.close();

    if (!str.empty())
    {
        // 删除末尾的换行符
        str.pop_back();
        str.pop_back();
    }
    wstring wstr = toWideStr(str);
    SetDlgItemText(hDlg, IDC_EDIT1, wstr.data());
}
一派护法 十九级
3楼 发表于:2016-1-19 20:08
一派护法 十九级
4楼 发表于:2016-1-19 20:11
RXData.Monsters[5] = {};
RXData.Monsters[5].name = "骷髅";
RXData.Monsters[5].image = {};
RXData.Monsters[5].image.filename = "D:\\RPG\\Magic Towers\\Works\\Octopus\\FlashMT1\\RMXP\\Graphics\\Characters\\220-Monster03.png";
RXData.Monsters[5].image.row = 0;
RXData.Monsters[5].HP = 95;
RXData.Monsters[5].atk = 70;
RXData.Monsters[5].pdef = 0;
RXData.Monsters[5].mdef = 3;
RXData.Monsters[5].gold = 5;
RXData.Monsters[5].EXP = 1;
RXData.Monsters[5].properties = 0;
RXData.Monsters[5].boss = 0;

回复帖子

内容:
用户名: 您目前是匿名发表
验证码:
(快捷键:Ctrl+Enter)
 

本帖信息

点击数:322 回复数:3
评论数: ?
作者:巨大八爪鱼
最后回复:巨大八爪鱼
最后回复时间:2016-1-19 20:11
 
©2010-2024 Arslanbar Ver2.0
除非另有声明,本站采用知识共享署名-相同方式共享 3.0 Unported许可协议进行许可。