Yeah, RegExp. (QRegExp) Basically, ive found some issue. For when people does " + lalla + " they can do it like "+lala+" "+ lala+" "+ lala+", etc. Think that would be an issue?
Well here is an example of what ive said: You can do in your script " + sys.name(src) + " "+sys.name(src)+" " +sys.name(src) + " "+ sys.name(src)+ ", etc. I think you found the difference between them, right? Well, if you find the diferences, youll know of what im taliking about hehe.
Creating lot of Regular Expressions since people can use different ways to show something? The spaces, the spaces are the problem...
Use the \s class with the ? quantifier or something. o-o Can you possibly post the code you have for the highlighter? http://pastebin.com
Well, i managed to add Animated Gifs (Well, still not in-game, done tests and seems to work fine.) of Pokemons. Waiting to see if this will be accepted by coyo and the others before i commit it. (Still need the gifs so we'll have to wait). Uploading an image (Well, video?) in a little. :) EDIT: Seems hard to implement on PO since the way it displays the pokemon images. I'm using QMovie and a QLabel to display it when PO uses QPixmap, etc, etc to display images. I'll wait for some answer before doing something. ;)
Well. Pokemoninfo.cpp Code (CPP): QMovie *PokemonInfo::AnimatedPicture(const Pokemon::uniqueId &pokeid, int gender, bool shiney, bool back) { QString archive; archive = path("") + "Animated Sprites/"; QString file; file = QString("%1/%2%3%4.gif").arg(pokeid.toString(), back?"b":"f", (gender==Pokemon::Female)?"f":"", shiney?"s":""); QMovie *animationReturn = new QMovie; animationReturn->setFileName(QString("%1%2").arg(archive, file)); animationReturn->start(); return animationReturn; } But here i got the issue. If the Pokemon has no Female Sprite it sets to invisible. How do icheck if it has female sprite? Advanced.cpp Code (CPP): void TB_Advanced::updatePokeImage() { QSettings s; if(s.value("enable_animated_sprites").toBool() == 1) { // We need to do it DIRECTLY. If we do it in the same way that poke()->picture() works it'll result // In a program crash. QMovie *MyMovie = new QMovie(); MyMovie = PokemonInfo::AnimatedPicture(poke()->num(), poke()->gender(), poke()->shiny(), false); pokeImage->setMovie(MyMovie); MyMovie->start(); } else { pokeImage->setFixedSize(poke()->picture().size()); pokeImage->setPixmap(poke()->picture()); } } EDIT 3: The issue seems to be related with the gif, nothing with code. ^_^ EDIT 4: Video. [video=youtube;GKUC0RNJQz8]http://www.youtube.com/watch?v=GKUC0RNJQz8[/video]
After updating my fork with the changes done in nixeagle's one got warns & errors while compiling: EDIT: Those file exists o.O
Did you merge testing or master? Testing is borken currently, but also merging master might get your code screwed up. Branches have diverged so much.
I'll try re-downloading all the source from my fork, since all changes are there now. I'm also thinking to go back on Windows XP, Developer Preview (WIn 8) becomes slower everytime you use it. ;_; EDIT: Files are there, moves1.cpp is a copy of moves.cpp. But we'll wait for him to see.
moves1.cpp is not a copy. Those files contain different move implementations. The file had to be split because it became too huge to compile.
Lol, the errors magically fixed. Weird. Still the unsigned and signed int comparison warns lol. EDIT: Lel, i love the image of the server. Code (CPP): // basebattlewindow.cpp Also in case SentOut and case SendBack case UseAttack: { qint16 attack; in >> attack; QSettings s; if(!qApp->activeWindow() && flashWhenMoved()) { qApp->alert(this, 0); } printHtml(tr("%1 used %2!").arg(escapeHtml(tu(nick(spot))), toBoldColor(MoveInfo::Name(attack), Theme::TypeColor(MoveInfo::Type(attack, gen()))))); break; } bool BaseBattleWindow::flashWhenMoved() const { QSettings s; return s.value("flash_when_enemy_moves").toBool(); } // client.cpp QAction * flashmove = menuActions->addAction(tr("Flash when a move is done")); flashmove->setCheckable(true); flashmove->setChecked(s.value("flash_when_attack_is_done").toBool()); void Client::flashEnable(bool b) { QSettings s; s.setValue("flash_when_attack_is_done", b); } // mainwindow.cpp setDefaultValue(s, "flash_when_attack_is_done", true); Of working, it works.
Good, but couple of things: Make it a class variable in BaseBattleWindow (or better, even in Client), so the settings file isn't read every time attack is made. Add a button to basebattlewindow to toggle it.
Code (CPP): mylayout->addWidget(flashWhenMoveDone = new QCheckBox(tr("Flash when a move is done")), 1, 2, 1, 2); QSettings s; musicOn->setChecked(s.value("play_battle_music").toBool()); flashWhenMoveDone->setChecked(s.value("flash_when_enemy_moves").toBool()); bool BaseBattleWindow::flashWhenMoved() const { return flashWhenMoveDone->isChecked(); } // Same thing in SendOut SendBack and UseAttack if(!this->window()->isActiveWindow() && flashWhenMoved()) { qApp->alert(this, 0); } :P (Seems like in 30 mins i go to sleep. 3:00 AM lol)
I'll. (When i find out how to put the button in the BaseBattleWindow without having to move other things x)) Also a question for Animated Sprites. Know how to do it but since QMovie doesn't have a readFromData() like QPixmap does it won't be able to read from zip files. Also, i have issues while pokemon changes formes. :(
It does have a constructor with QIODevice as its parameter. You can pass ie. QBuffer to it which encapsulates the data read from zips.
Well, actually by trying to see how this type of things works (QIODevice and QFile) i got this. Now to make it work with QIODevice (Which is a pain lol) Code (CPP): QMovie *PokemonInfo::AnimatedPicture(const Pokemon::uniqueId &pokeid, int gender, bool shiney, bool back) { QString archive = path("black_white_animated.zip"); QString file = QString("%1/%2%3%4.gif").arg(pokeid.toString(), back?"b":"f", (gender==Pokemon::Female)?"f":"", shiney?"s":""); QMovie *AnimatedSprite = new QMovie(); QByteArray data = readZipFile(archive.toUtf8(), file.toUtf8()); QFile file2(path("") + "temp.gif"); file2.open(QIODevice::ReadWrite); file2.write(data); file2.close(); AnimatedSprite->setFileName(path("") + "temp.gif"); AnimatedSprite->start(); return AnimatedSprite; } :D
QMovie *AnimatedSprite = new QMovie(QBuffer(data)); works no? You don't need the QFile at all, just remove it :x
Yah i know lol, i had that to test (I'm the type of guy that tests eveeeeeeerything. .-.) i had commented lot of code for doing this. :P It'll be harder i think hehe.
Got it! ;) Code (CPP): QMovie *PokemonInfo::AnimatedPicture(const Pokemon::uniqueId &pokeid, int gender, bool shiney, bool back) { QString archive = path("black_white_animated.zip"); QString file = QString("%1/%2%3%4.gif").arg(pokeid.toString(), back?"b":"f", (gender==Pokemon::Female)?"f":"", shiney?"s":""); QByteArray *data = new QByteArray(readZipFile(archive.toUtf8(), file.toUtf8())); QBuffer *animatedSpriteData = new QBuffer(data); QMovie *animatedSprite = new QMovie(animatedSpriteData); if (data->length() == 0) { if (gender == Pokemon::Female) return PokemonInfo::AnimatedPicture(pokeid, Pokemon::Male, shiney, back); if (shiney) return PokemonInfo::AnimatedPicture(pokeid, Pokemon::Male, false, back); if (pokeid.subnum != 0) return PokemonInfo::AnimatedPicture(OriginalForme(pokeid), Pokemon::Male, false, back); animatedSprite->start(); return animatedSprite; } animatedSprite->start(); return animatedSprite; } :D Also why doing it with load of functions and not directly? Code (CPP): if(s.value("enable_animated_sprites").toBool() == 1) { setAnimatedPicture(PokemonInfo::AnimatedPicture(poke.num(), poke.gender(), poke.shiny(), false)); }else{ setPicture(poke.picture()); } void PokeBodyWidget::setPicture(const QPixmap &picture) { pokeImage->setFixedSize(picture.size()); pokeImage->setPixmap(picture); } void PokeBodyWidget::setAnimatedPicture(QMovie *movie) { pokeImage->setMovie(movie); }
This is what i have planned for the next version (With all the new stuff and blabla): I don't know if i'll get all this finished, but i think i'll (Won't sleep at night!). (Don't take anything from thiz list </3) -New Plugins Player Stats: Let's you retrieve some player stats (Such as win, loses, ties, battles, etc) Global Stats (Server-Side): Same as the Player Stats but for the Server (Means, stadistics of the server, not just a client). Battle Data Functions (Server-Side): Now, instead of having them in Script Side (I prefer doing this, but seems like not many people uses it. ;_;) we have them as a plugin. (Although i don't know how to make them available to call though sys. like all script functions. -Client Side Update the Plugin Manager to show some description about the plugins and not just the name. Tweaks to the plugin system Animated Sprites in the new Teambuilder. (If i get how to, same in the old Battle Window) [*]Multipeople PM: Talk with multiple people at same time in same window. [*]Tabbed PM: Instead of having private messages in separate windows, let's have them in tabs! :) Voice Chat: Let's you talk with people using Microphone. (Though, it's possible, but bandwidth, etc.) Improve the Ignore System: No idea of how to do this though, well, a little yes. Players can select their default channel when joining a server. [*]Fix Replays Name: So we avoid using illegal characters for filenames. Add a Tooltip when you put mouse over Item label in new teambuilder. -Server Side Update the Plugin Manager to show some description about the plugins and not just the name. Tweaks to the plugin system [*]sys.hostName(player_ip): Retrieves the hostname of the player ip. Translation for Server. (It's annoying to have it in some different language.) Ability to handle multiple scripts files. (I mean, instead of having one file and need to change it each time, you can have multiple files. And you can select them using a checkbox or something). (Things in green mean they're done. ;)) Coyo: A few questions :3 -Would be possible to move all the Plugins inside a "Plugins" folder? So it's more organizated. -Can i create a "Plugins Thread" and a "Request a Plugin Thread"? Most likely so people can download plugins and in the request a plugin thread people can request some sort of plugin to be created. (Some dev take it and create it) -Do we need to have the plugins in the Client/Server download? Can't we give the download links in the Plugins Thread? Coyo Note: All of this features, will go inside devel, right? :3 I'll do the changes on the source, if you want to merge them into the main source code it's fine. ;) Just so i don't have to wait for an official answer. Btw, could i have this thread clean? I meant, delete posts. <3 ---------------- I'll keep adding things to this list before the 1.0.54 or whatever. <3
Is tabbed PMs optional? I would not use it, to see several PMs at time. (I suggested you to make 'attachable' and 'detachable' tabs instead of yes / no, best would be dragging them on top of each other to attach, detaching can be done by dragging or clicking a detach button) Depending on if the feature will be need protocol or new teambuilder, implement it into devel branch, but if it would be working without the new massive changes, I see no reason to not make it into master branch.
@coyo: http://pokemon-online.eu/forums/sho...te-Trainer-Info-and-Team-Details-into-2-parts What about this? (Adding a menu after File Menu). Just askin.
Well, this of school is killing me off, my activity will be reduced a bit but this weekend i'll get to work on the sim again. (Those classes ;_;)