Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; //andr
using UnityEngine.SceneManagement;
using System.IO; //
using UnityEngine.Video;//streaming
using UnityEngine.Networking;
using static CommunicationEvents;
using static UIconfig;
using static StreamingAssetLoader;
using static CheckServer;
public class SaveNetwAddr_mobile : MonoBehaviour
{
public GameObject SaveSlot1_B_GObj;
public GameObject SaveSlot2_B_GObj;
public GameObject SaveSlot3_B_GObj;
private Color32 firstColB;
private float transCol;
private ColorBlock tempColB;
void Start()
{
Update();
}
private void Update()
{
UpdateUI_3_f();
UpdateUI_4_f();
UpdateUI_5_f();
}
void UpdateUI_3_f()
{
//------------------------------------------------------------------------
tempColB = SaveSlot1_B_GObj.GetComponent<Button>().colors;
tempColB.pressedColor = colPressed;
tempColB.selectedColor = colSelect;
if (CommunicationEvents.ServerRunningA[3] == 0)
{
tempColB.normalColor = colOffline;
if (string.IsNullOrEmpty(CommunicationEvents.IPslot1))// || CommunicationEvents.IPslot1.Length < 1)
{
SaveSlot1_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \n< empty >";
}
else
{
SaveSlot1_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \nServer " + CommunicationEvents.IPslot1 + " (Offline)";
}
}
else
{
if (CommunicationEvents.ServerRunningA[3] == 2)
{
tempColB.normalColor = colOnline;
SaveSlot1_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \nServer " + CommunicationEvents.IPslot1 + " (Online)";
}
else
{
tempColB.normalColor = colOffline;
SaveSlot1_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \n< empty >";
}
}
SaveSlot1_B_GObj.GetComponent<Button>().colors = tempColB;
}
void UpdateUI_4_f()
{
//-------------------------------------------------------------------------
tempColB = SaveSlot2_B_GObj.GetComponent<Button>().colors;
tempColB.pressedColor = colPressed;
tempColB.selectedColor = colSelect;
if (CommunicationEvents.ServerRunningA[4] == 0)
{
tempColB.normalColor = colOffline;
if (string.IsNullOrEmpty(CommunicationEvents.IPslot2))// || CommunicationEvents.IPslot2.Length<1)
{
SaveSlot2_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \n< empty >";
}
else
{
SaveSlot2_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \nServer " + CommunicationEvents.IPslot2 + " (Offline)";
}
}
else
{
if (CommunicationEvents.ServerRunningA[4] == 2)
{
tempColB.normalColor = colOnline;
SaveSlot2_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \nServer " + CommunicationEvents.IPslot2 + " (Online)";
}
else
{
tempColB.normalColor = colOffline;
SaveSlot2_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \n< empty >";
}
}
SaveSlot2_B_GObj.GetComponent<Button>().colors = tempColB;
}
void UpdateUI_5_f()
{
//---------------------------------------------------------------------------
tempColB = SaveSlot3_B_GObj.GetComponent<Button>().colors;
tempColB.pressedColor = colPressed;
tempColB.selectedColor = colSelect;
if (CommunicationEvents.ServerRunningA[5] == 0)
{
tempColB.normalColor = colOffline;
if (string.IsNullOrEmpty(CommunicationEvents.IPslot3))// || CommunicationEvents.IPslot3.Length < 1)
{
SaveSlot3_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \n< empty >";
}
else
{
SaveSlot3_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \nServer " + CommunicationEvents.IPslot3 + " (Offline)";
}
}
else
{
if (CommunicationEvents.ServerRunningA[5] == 2)
{
tempColB.normalColor = colOnline;
SaveSlot3_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \nServer " + CommunicationEvents.IPslot3 + " (Online)";
}
else
{
tempColB.normalColor = colOffline;
SaveSlot3_B_GObj.GetComponentInChildren<Text>().text = "OVERWRITE: \n< empty >";
}
}
SaveSlot3_B_GObj.GetComponent<Button>().colors = tempColB;
}
public void Slot1_s()
{
CommunicationEvents.IPslot1 = CommunicationEvents.newIP;
//CommunicationEvents.ServerAdress = "http://" + CommunicationEvents.ServerAddress1;
Update();
NetworkJSON_Save();
//CSform.CheckIPAdr();
}
public void Slot2_s()
{
//CommunicationEvents.ServerAdress = "http://" + CommunicationEvents.ServerAddress2;
CommunicationEvents.IPslot2 = CommunicationEvents.newIP;
Update();
NetworkJSON_Save();
//CSform.CheckIPAdr();
}
public void Slot3_s()
{
//CheckServer ani = new CheckServer();//= obj.AddComponent<CheckServer>();
// ani.StartCheck();
CommunicationEvents.IPslot3 = CommunicationEvents.newIP;
Update();
NetworkJSON_Save();
//CSform.CheckIPAdr();
}
}