void b_load_clicked(GtkWidget *obj, gpointer user_data) { pk_freeMoveFile(&moveFile); pk_openMoveFile(&moveFile, "../resources/data/moves.pke"); updateMoves(); }
void TB_PokemonBody::updateAbility() { /* Abilities may ruin move combinations, for example dream world abilities (implemented) or 4th gen abilities with 3rd gen moves on first stage evos (non implemented) */ poke()->runCheck(); updateMoves(); }
/* returns 0 if not in check * returns 1 if in check */ int updateAllMovesSim(struct board * b) { for(int a = 0 ; a< b->s_pieces; a++) { if(b->pieces[a]->p == KING) { continue; } updateMoves(b,b->pieces[a]); } }
void Tile::Reset() { isRunning = 0; Moves=0; updateMoves(); for (int i = 1; i < 16; i++) { QPushButton *button = idtoButton(i); QString str; button->show(); button->setText(str.setNum(i)); } QPushButton *button = idtoButton(16); button->hide(); button->setText("16"); }
void b_update_clicked(GtkWidget *obj, gpointer user_data) { if(currMove == -1) { return; } // Set script text moveFile.moves[currMove].script = getTextViewText(tv_script); moveFile.moves[currMove].scriptLen = getTextViewLen(tv_script); // Gtk sets currMove to -1 when entries are removed int tmpCurrMove = currMove; editMove((char*)gtk_entry_get_text(GTK_ENTRY(e_name)), currMove); updateMoves(); gtk_combo_box_set_active(GTK_COMBO_BOX(cbt_move), tmpCurrMove); }
int main(int argc, char **argv) { newMapFile(); GtkBuilder *builder; GtkWidget *window; gtk_init (&argc, &argv); builder = gtk_builder_new (); gtk_builder_add_from_file (builder, "MoveMakerWind.glade", NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); cbt_move = GTK_WIDGET(gtk_builder_get_object(builder, "cbt_move")); cbt_type = GTK_WIDGET(gtk_builder_get_object(builder, "cbt_type")); e_name = GTK_WIDGET(gtk_builder_get_object(builder, "e_name")); tv_script = GTK_WIDGET(gtk_builder_get_object(builder, "tv_script")); b_update = GTK_WIDGET(gtk_builder_get_object(builder, "b_update")); sb_pp = GTK_WIDGET(gtk_builder_get_object(builder, "sb_pp")); gtk_builder_connect_signals(builder, NULL); g_object_unref(G_OBJECT(builder)); newMove("NEW"); updateMoves(); loadTypes("../resources/data/types.pke"); toggleEditable(FALSE); gtk_widget_show(window); gtk_main(); pk_freeMoveFile(&moveFile); return 0; }
void Tile::swapButtons(QPushButton *button, QPushButton *button_neighbour) { button->hide(); button_neighbour->setText(button->text()); button->setText("16"); button_neighbour->show(); button_neighbour->setFocus(); if (isRunning) { Moves++; updateMoves(); } if (isRunning && isSolved()) { isRunning = 0; switch (QMessageBox::information(this, "Solved!", "Hooray, you solved it!\nShuffle again?", "&Yes","&No")) { case 0: Shuffle(); default: break; } } }
int updateAllMoves(struct board * b) { struct piece * k0 = NULL; struct piece * k1 = NULL; for(int a = 0 ; a< b->s_pieces; a++) { // saves kings for later, all other pieces must // be updated BEFORE the king if(b->pieces[a]->p == KING) { if(b->pieces[a]->player == 0) k0 = b->pieces[a]; else k1 = b->pieces[a]; continue; } updateMoves(b,b->pieces[a]); } for(int a = 0 ; a< b->s_pieces; a++) { if(b->pieces[a]->p == ROOK) { addCastleing(b,b->pieces[a]); } } if(k0 != NULL) { for(int a = 0 ; a< b->s_pieces; a++) { if(b->pieces[a]->player == 1) continue; for(int c = 0 ; c < b->pieces[a]->s_moves;c++) { if(b->pieces[a]->moves[c]-> type == 2 ||b->pieces[a]->moves[c]-> type == 4) { continue; } if(simCheck(b,b->pieces[a],b->pieces[a]->moves[c],k0) == 1) { removeMove(b->pieces[a],c); } } } } if(k1 != NULL) { for(int a = 0 ; a< b->s_pieces; a++) { if(b->pieces[a]->player == 0) continue; for(int c = 0 ; c < b->pieces[a]->s_moves;c++) { if(simCheck(b,b->pieces[a],b->pieces[a]->moves[c],k1) == 1) { removeMove(b->pieces[a],c); } } } } if(k0 != NULL) { updateMoves(b,k0); } if(k1 != NULL) { updateMoves(b,k1); } specialKingMoveCheck(b,k0, k1); }
void b_newmove_clicked(GtkWidget *obj, gpointer user_data) { newMove("NEW"); updateMoves(); }
void updateSouthMoves(Karl *k, int *totMoves, int *moves) { updateMoves(totMoves, moves); (k -> h)++; }
void updateEastMoves(Karl *k, int *totMoves, int *moves) { updateMoves(totMoves, moves); (k -> w)++; }
void updateWestMoves(Karl *k, int *totMoves, int *moves) { updateMoves(totMoves, moves); (k -> w)--; }
void updateNorthMoves(Karl *k, int *totMoves, int *moves) { updateMoves(totMoves, moves); (k -> h)--; }