⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendstate.cpp

📁 robocuo相关资料robocuo相关资料
💻 CPP
字号:
#include <QTextStream>#include "SendState.h"#include "ui_SendState.h"#include "../common.h"#include "ActionWindow.h"#include <fcntl.h>#include <stddef.h>#include <stdio.h> #include <dirent.h>#include <sstream>using namespace std;SendState::SendState(ActionWindow *a,int *p){	ui = new Ui_SendState;	ui->setupUi(this);	pipe = p;	parent = a;}void SendState::on_send_clicked(){	if(*pipe == 0)		*pipe=open("/tmp/trainer_pipe", O_RDWR | O_NONBLOCK);	ostringstream oss;	action *a = new action, *act=parent->act;	for(int i = ui->from->value(); i<=ui->to->value(); i++)		a->arr.push_back(act->arr[i]);	a->repeat = act->repeat - ui->from->value();	if(a->repeat < 0)		a->repeat = 0;	a->save(oss);	a->name = act->name;	string s=oss.str();	write(*pipe, s.c_str(), s.length());}void SendState::on_from_valueChanged(int a){	ui->to->setMinimum(a);	if(ui->to->value() < a)		ui->to->setValue(a);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -