44 *
55 */
66
7+ #include " Common/Cpp/Time.h"
8+ #include " Common/Cpp/PrettyPrint.h"
79#include " PokemonSV_TeraMoveTable.h"
810
911// #include <iostream>
@@ -43,7 +45,7 @@ const EnumDropdownDatabase<TeraTarget>& tera_target_enum_database(){
4345std::string TeraMoveEntry::to_str () const {
4446 switch (type){
4547 case TeraMoveType::Wait:
46- return " Wait for " + std::to_string (seconds) + " second(s) ." ;
48+ return " Wait for " + tostr_u_commas (duration. count ()) + " milliseconds ." ;
4749 case TeraMoveType::Move1:
4850 case TeraMoveType::Move2:
4951 case TeraMoveType::Move3:
@@ -76,12 +78,12 @@ TeraMoveTableRow::~TeraMoveTableRow(){
7678TeraMoveTableRow::TeraMoveTableRow (EditableTableOption& parent_table)
7779 : EditableTableRow(parent_table)
7880 , type(tera_move_enum_database(), LockMode::UNLOCK_WHILE_RUNNING, TeraMoveType::Move1)
79- , seconds (LockMode::UNLOCK_WHILE_RUNNING, 5 )
81+ , duration (LockMode::UNLOCK_WHILE_RUNNING, " 5000 ms " )
8082 , target(tera_target_enum_database(), LockMode::UNLOCK_WHILE_RUNNING, TeraTarget::Opponent)
8183 , notes(false , LockMode::UNLOCK_WHILE_RUNNING, " " , " (e.g. Screech, Belly Drum)" )
8284{
8385 PA_ADD_OPTION (type);
84- PA_ADD_OPTION (seconds );
86+ PA_ADD_OPTION (duration );
8587 PA_ADD_OPTION (target);
8688 PA_ADD_OPTION (notes);
8789
@@ -91,19 +93,19 @@ TeraMoveTableRow::TeraMoveTableRow(EditableTableOption& parent_table)
9193std::unique_ptr<EditableTableRow> TeraMoveTableRow::clone () const {
9294 std::unique_ptr<TeraMoveTableRow> ret (new TeraMoveTableRow (parent ()));
9395 ret->type .set (type);
94- ret->seconds .set (seconds );
96+ ret->duration .set (duration. current_text () );
9597 ret->target .set (target);
9698 ret->notes .set (notes);
9799 return ret;
98100}
99101TeraMoveEntry TeraMoveTableRow::snapshot () const {
100- return TeraMoveEntry{type, seconds , target};
102+ return TeraMoveEntry{type, duration , target};
101103}
102104void TeraMoveTableRow::on_config_value_changed (void * object){
103105 TeraMoveType type = this ->type ;
104106// cout << "Enter: type = " << (int)type << endl;
105107
106- seconds .set_visibility (
108+ duration .set_visibility (
107109 type == TeraMoveType::Wait
108110 ? ConfigOptionState::ENABLED
109111 : ConfigOptionState::HIDDEN
@@ -146,7 +148,7 @@ std::vector<TeraMoveEntry> TeraMoveTable::snapshot(){
146148std::vector<std::string> TeraMoveTable::make_header () const {
147149 return {
148150 " Move" ,
149- " Wait (seconds )" ,
151+ " Wait (ms )" ,
150152 " Target" ,
151153 " Notes" ,
152154 };
0 commit comments