• R/O
  • SSH
  • HTTPS

jinrousiki: コミット


コミットメタ情報

リビジョン2727 (tree)
日時2021-06-11 17:23:11
作者umethyl

ログメッセージ

RoomOptionManager::IsChange()

変更サマリ

差分

--- trunk/include/controller/room_manager_class.php (revision 2726)
+++ trunk/include/controller/room_manager_class.php (revision 2727)
@@ -39,13 +39,13 @@
3939
4040 //村作成画面出力
4141 public static function OutputCreate() {
42- if (ServerConfig::DISABLE_ESTABLISH || DatabaseConfig::DISABLE) {
42+ if (ServerConfig::DISABLE_ESTABLISH || DatabaseConfig::DISABLE) { //無効判定
4343 Text::Output(RoomManagerMessage::NOT_ESTABLISH);
4444 return;
4545 }
4646
47- OptionManager::Stack()->Set('change', RQ::Get()->room_no > 0);
48- if (OptionManager::IsChange()) {
47+ RoomOptionManager::Stack()->Set('change', RQ::Get()->room_no > 0);
48+ if (RoomOptionManager::IsChange()) {
4949 self::LoadOutputCreateInChange();
5050 HTML::OutputHeader(RoomManagerMessage::TITLE_CHANGE, 'room_manager');
5151 HTML::OutputHeaderTitle(RoomManagerMessage::TITLE_CHANGE);
@@ -74,7 +74,7 @@
7474 }
7575
7676 if (true === RQ::Get()->change_room) {
77- OptionManager::Stack()->Set('change', true);
77+ RoomOptionManager::Stack()->Set('change', true);
7878 self::LoadCreateInChange();
7979 } else {
8080 self::ValidateEstablishLimit();
--- trunk/include/html/controller/room_manager_html_class.php (revision 2726)
+++ trunk/include/html/controller/room_manager_html_class.php (revision 2727)
@@ -4,7 +4,7 @@
44 //村作成画面表示
55 public static function OutputCreate() {
66 //パラメータセット
7- if (OptionManager::IsChange()) {
7+ if (RoomOptionManager::IsChange()) {
88 $url = sprintf('?room_no=%d', RQ::Get()->room_no);
99 $command = 'change_room';
1010 $submit = RoomManagerMessage::SUBMIT_CHANGE;
@@ -29,7 +29,7 @@
2929 Text::Printf(self::GetCreateHeader(), $url, $command);
3030 OptionForm::Output();
3131 Text::Printf(self::GetCreateFooter(), $password, $submit);
32- if (OptionManager::IsChange()) {
32+ if (RoomOptionManager::IsChange()) {
3333 HTML::OutputFooter();
3434 }
3535 }
--- trunk/include/html/option/option_form_html_class.php (revision 2726)
+++ trunk/include/html/option/option_form_html_class.php (revision 2727)
@@ -50,7 +50,7 @@
5050 public static function GenerateTextbox(OptionText $filter) {
5151 $size = sprintf('%s_input', $filter->name);
5252 $str = $filter->GetExplain();
53- if (OptionManager::IsChange()) {
53+ if (RoomOptionManager::IsChange()) {
5454 $name = Text::CutPop($filter->name);
5555 $value = DB::$ROOM->$name;
5656 } else {
--- trunk/include/option/chaos_open_cast.php (revision 2726)
+++ trunk/include/option/chaos_open_cast.php (revision 2727)
@@ -16,7 +16,7 @@
1616 }
1717
1818 protected function LoadValue() {
19- if (OptionManager::IsChange()) {
19+ if (RoomOptionManager::IsChange()) {
2020 $this->SetFormValue('key');
2121 }
2222 }
--- trunk/include/option/close_room.php (revision 2726)
+++ trunk/include/option/close_room.php (revision 2727)
@@ -4,7 +4,7 @@
44 */
55 class Option_close_room extends OptionCheckbox {
66 protected function Ingore() {
7- return false === OptionManager::IsChange();
7+ return false === RoomOptionManager::IsChange();
88 }
99
1010 protected function LoadValue() {
--- trunk/include/option/dummy_boy.php (revision 2726)
+++ trunk/include/option/dummy_boy.php (revision 2727)
@@ -7,7 +7,7 @@
77 public $type = OptionFormType::RADIO;
88
99 protected function FilterEnable() {
10- if (true === $this->enable && OptionManager::IsChange()) {
10+ if (true === $this->enable && RoomOptionManager::IsChange()) {
1111 $this->enable = (false === DB::$ROOM->IsOption('gm_login'));
1212 }
1313 }
--- trunk/include/option/dummy_boy_selector.php (revision 2726)
+++ trunk/include/option/dummy_boy_selector.php (revision 2727)
@@ -57,7 +57,7 @@
5757 }
5858
5959 //-- チェック位置判定 --//
60- if (OptionManager::IsChange() && DB::$ROOM->IsOption('gm_login')) {
60+ if (RoomOptionManager::IsChange() && DB::$ROOM->IsOption('gm_login')) {
6161 $stack['gm_login']->value = true;
6262 } elseif (isset($stack[$this->value])) {
6363 $stack[$this->value]->value = true;
--- trunk/include/option/gm_login.php (revision 2726)
+++ trunk/include/option/gm_login.php (revision 2727)
@@ -7,13 +7,13 @@
77 public $type = OptionFormType::RADIO;
88
99 protected function FilterEnable() {
10- if (true === $this->enable && OptionManager::IsChange()) {
10+ if (true === $this->enable && RoomOptionManager::IsChange()) {
1111 $this->enable = DB::$ROOM->IsOption($this->name);
1212 }
1313 }
1414
1515 public function LoadPost() {
16- if (OptionManager::IsChange()) { //GM ログアウト判定 (クイズ村は無効)
16+ if (RoomOptionManager::IsChange()) { //GM ログアウト判定 (クイズ村は無効)
1717 if (RQ::Get()->dummy_boy_selector == 'gm_logout' && false === DB::$ROOM->IsQuiz()) {
1818 RQ::Get()->gm_logout = true;
1919 return;
--- trunk/include/option/gm_logout.php (revision 2726)
+++ trunk/include/option/gm_logout.php (revision 2727)
@@ -7,8 +7,8 @@
77 public $type = OptionFormType::RADIO;
88
99 protected function FilterEnable() {
10- if (true === $this->enable && OptionManager::IsChange()) {
11- $this->enable = DB::$ROOM->IsOption('gm_login') && false === DB::$ROOM->IsQuiz();
10+ if (true === $this->enable && RoomOptionManager::IsChange()) {
11+ $this->enable = (DB::$ROOM->IsOption('gm_login') && false === DB::$ROOM->IsQuiz());
1212 } else {
1313 $this->enable = false;
1414 }
--- trunk/include/option/gm_password.php (revision 2726)
+++ trunk/include/option/gm_password.php (revision 2727)
@@ -6,7 +6,7 @@
66 public $type = OptionFormType::PASSWORD;
77
88 protected function FilterEnable() {
9- if (OptionManager::IsChange()) {
9+ if (RoomOptionManager::IsChange()) {
1010 $this->enable = false;
1111 } else {
1212 $this->enable = GameOptionConfig::$gm_login_enable;
--- trunk/include/option/max_user.php (revision 2726)
+++ trunk/include/option/max_user.php (revision 2727)
@@ -6,7 +6,7 @@
66 public $group = OptionGroup::NONE;
77
88 protected function LoadValue() {
9- if (OptionManager::IsChange()) {
9+ if (RoomOptionManager::IsChange()) {
1010 $this->value = DB::$ROOM->max_user;
1111 } else {
1212 $this->value = RoomConfig::$default_max_user;
--- trunk/include/option/no_dummy_boy.php (revision 2726)
+++ trunk/include/option/no_dummy_boy.php (revision 2727)
@@ -7,7 +7,7 @@
77 public $type = OptionFormType::RADIO;
88
99 protected function FilterEnable() {
10- if (OptionManager::IsChange()) {
10+ if (RoomOptionManager::IsChange()) {
1111 $this->enable = false;
1212 }
1313 }
--- trunk/include/option/not_open_cast_selector.php (revision 2726)
+++ trunk/include/option/not_open_cast_selector.php (revision 2727)
@@ -9,7 +9,7 @@
99
1010 protected function LoadValue() {
1111 $this->value = GameOptionConfig::$default_not_open_cast;
12- if (OptionManager::IsChange()) {
12+ if (RoomOptionManager::IsChange()) {
1313 $this->SetFormValue('value');
1414 }
1515 }
--- trunk/include/option/option_class.php (revision 2726)
+++ trunk/include/option/option_class.php (revision 2727)
@@ -9,24 +9,6 @@
99
1010 //-- オプションマネージャ --//
1111 class OptionManager {
12- //スタック取得
13- public static function Stack() {
14- static $stack;
15-
16- if (is_null($stack)) {
17- $stack = new Stack();
18- }
19- return $stack;
20- }
21-
22- //村オプション変更判定
23- public static function IsChange() {
24- if (self::Stack()->IsEmpty('change')) {
25- self::Stack()->Set('change', false);
26- }
27- return self::Stack()->Get('change');
28- }
29-
3012 //オプション存在判定
3113 public static function Exists($type) {
3214 foreach (OptionFilterData::$$type as $option) {
@@ -249,7 +231,7 @@
249231 $this->form_value = $this->value;
250232 }
251233
252- if (OptionManager::IsChange()) {
234+ if (RoomOptionManager::IsChange()) {
253235 switch ($this->type) {
254236 case OptionFormType::CHECKBOX:
255237 case OptionFormType::LIMITED_CHECKBOX:
@@ -463,7 +445,7 @@
463445
464446 //制限設定値取得
465447 final public function GetLimitedCount() {
466- if (OptionManager::IsChange() && DB::$ROOM->IsOption($this->name)) {
448+ if (RoomOptionManager::IsChange() && DB::$ROOM->IsOption($this->name)) {
467449 switch ($this->group) {
468450 case OptionGroup::GAME:
469451 $list = DB::$ROOM->game_option->list;
--- trunk/include/option/option_form_class.php (revision 2726)
+++ trunk/include/option/option_form_class.php (revision 2727)
@@ -84,7 +84,7 @@
8484 //境界線出力
8585 private static function OutputSeparator($group) {
8686 OptionFormHTML::OutputSeparator();
87- if (OptionManager::IsChange()) {
87+ if (RoomOptionManager::IsChange()) {
8888 return;
8989 }
9090
@@ -122,7 +122,7 @@
122122
123123 //チェックボックス生成 (リアルタイム制専用)
124124 private static function GenerateRealtime(Option_real_time $filter) {
125- if (OptionManager::IsChange()) {
125+ if (RoomOptionManager::IsChange()) {
126126 $day = DB::$ROOM->game_option->list[$filter->name][0];
127127 $night = DB::$ROOM->game_option->list[$filter->name][1];
128128 } else {
@@ -151,7 +151,7 @@
151151 $str .= OptionFormHTML::GenerateSelectorOption($code, $selected, $label);
152152 }
153153
154- if (! OptionManager::IsChange() && isset($filter->javascript)) {
154+ if (false === RoomOptionManager::IsChange() && isset($filter->javascript)) {
155155 self::$javascript[] = $filter->javascript;
156156 }
157157
--- trunk/include/option/replace_human_selector.php (revision 2726)
+++ trunk/include/option/replace_human_selector.php (revision 2727)
@@ -10,7 +10,7 @@
1010 }
1111
1212 protected function LoadValue() {
13- if (OptionManager::IsChange()) {
13+ if (RoomOptionManager::IsChange()) {
1414 $this->SetFormValue('int');
1515 }
1616 }
--- trunk/include/option/room_option_manager_class.php (revision 2726)
+++ trunk/include/option/room_option_manager_class.php (revision 2727)
@@ -12,6 +12,14 @@
1212 return $stack;
1313 }
1414
15+ //村オプション変更判定
16+ public static function IsChange() {
17+ if (self::Stack()->IsEmpty('change')) {
18+ self::Stack()->Set('change', false);
19+ }
20+ return self::Stack()->Get('change');
21+ }
22+
1523 //村作成オプション入力情報ロード
1624 public static function LoadPost() {
1725 self::LoadPostBase();
--- trunk/include/option/special_role.php (revision 2726)
+++ trunk/include/option/special_role.php (revision 2727)
@@ -14,7 +14,7 @@
1414 }
1515
1616 protected function LoadValue() {
17- if (OptionManager::IsChange()) {
17+ if (RoomOptionManager::IsChange()) {
1818 $this->SetFormValue('int');
1919 }
2020 }
--- trunk/include/option/sub_role_limit.php (revision 2726)
+++ trunk/include/option/sub_role_limit.php (revision 2727)
@@ -20,7 +20,7 @@
2020 }
2121
2222 protected function LoadValue() {
23- if (OptionManager::IsChange()) {
23+ if (RoomOptionManager::IsChange()) {
2424 $this->SetFormValue('key');
2525 }
2626 }
--- trunk/include/option/topping.php (revision 2726)
+++ trunk/include/option/topping.php (revision 2727)
@@ -8,7 +8,7 @@
88 }
99
1010 protected function LoadValue() {
11- if (OptionManager::IsChange() && DB::$ROOM->IsOption($this->name)) {
11+ if (RoomOptionManager::IsChange() && DB::$ROOM->IsOption($this->name)) {
1212 $this->value = DB::$ROOM->option_role->list[$this->name][0];
1313 }
1414 }
旧リポジトリブラウザで表示