Commit 9ef77c06 authored by shigemi miura's avatar shigemi miura

ライセンス情報対応

不具合 No.108/106対応
parent aa9c5dbc
......@@ -42,7 +42,6 @@ struct ChatTitleView: View {
.scaledToFit()
.frame(width: 12, height: 7)
.foregroundColor(ColorSet.Body.color)
}
.frame(width: 30, height: 30)
}
......
......@@ -14,4 +14,7 @@ struct ResLogin : Codable {
var imo: Int = 0
var mmsi: Int = 0
var enableFuelSwitchTask: Bool = false
var enableNga: Bool = false
var enableCommunication: Bool = false
var enableManual: Bool = false
}
......@@ -15,7 +15,6 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
private let locationManager: CLLocationManager
let ecaTask = EcaTask()
let ngaTask = NgaTask()
let message = GetMessage()
override init() {
let ecaArea = EcaArea()
......@@ -89,6 +88,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
ngaTask.checkNga()
if SharingData.message.mode {
let message = GetMessage()
message.start()
}
}
......@@ -102,7 +102,8 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
self.ngaTask.checkNga()
if SharingData.message.mode {
self.message.start()
let message = GetMessage()
message.start()
}
serverLocationInterval = DateTextLib.Date2UnixTime(date: Date()) + Int64(TimerInterval)
......
......@@ -197,6 +197,9 @@ struct LoginView: View {
SharingData.my.imo = res.imo
SharingData.my.mmsi = res.mmsi
SharingData.my.isFuelSwitchTask = res.enableFuelSwitchTask
SharingData.my.isNga = res.enableNga
SharingData.my.isCommunication = res.enableCommunication
SharingData.my.isManual = res.enableManual
Preferences.shipId = res.shipId
......
......@@ -102,6 +102,9 @@ struct InputUserNameView: View {
SharingData.my.imo = res.imo
SharingData.my.mmsi = res.mmsi
SharingData.my.isFuelSwitchTask = res.enableFuelSwitchTask
SharingData.my.isNga = res.enableNga
SharingData.my.isCommunication = res.enableCommunication
SharingData.my.isManual = res.enableManual
Preferences.shipId = res.shipId
......
......@@ -164,8 +164,9 @@ struct MenuMain: View {
})
.frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color)
.background(!SharingData.my.isFuelSwitchTask ? ColorSet.SecondaryDisable.color : ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30)
.disabled(!SharingData.my.isFuelSwitchTask)
Button(action: {
taskViewModel.viewMode = .NgaNotification
......@@ -176,8 +177,9 @@ struct MenuMain: View {
})
.frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color)
.background(!SharingData.my.isNga ? ColorSet.SecondaryDisable.color : ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30)
.disabled(!SharingData.my.isNga)
}
.onChange(of: taskViewModel.viewMode){ newViewMode in
proxy.scrollTo(0, anchor: .top)
......
......@@ -135,7 +135,7 @@ struct NgaSetting: View {
.padding(.vertical, 20)
.disabled(stateEdit)
let stateRegister = nga.editNga!.points.count < 3 || nga.editNga!.name.isEmpty
let stateRegister = nga.editNga!.points.count < 3 || taskViewModel.ngaName.isEmpty
Button(action: {
if var ngaData = nga.editNga {
ngaData.name = taskViewModel.ngaName
......
......@@ -146,7 +146,7 @@ struct MenuView: View {
path.append(.Manual)
}label: {
MenuContentView(content: .Manual)
}
}.disabled(!SharingData.my.isManual)
Button{
path.append(.Information)
......
......@@ -14,7 +14,7 @@ struct MenuContentView: View {
HStack {
Text(content.title)
.font(FontStyle.EmphasisText.font)
.foregroundColor(ColorSet.Body.color)
.foregroundColor(getFontColor())
Spacer()
......@@ -31,6 +31,19 @@ struct MenuContentView: View {
.background(ColorSet.LineColor04.color)
}
}
/**
* Manual
*/
func getFontColor() -> Color {
var fontColor = ColorSet.Body.color
if content == .Manual {
if !SharingData.my.isManual {
fontColor = ColorSet.BodyDescriptiion.color
}
}
return fontColor
}
}
#Preview {
......
......@@ -18,6 +18,9 @@ class SharingData{
@Published var mmsi: Int = 0
@Published var isUpDate: Bool = false
@Published var isFuelSwitchTask: Bool = false
@Published var isNga: Bool = false
@Published var isCommunication: Bool = false
@Published var isManual: Bool = false
@Published var ecaStatus: EcaState?
......
......@@ -38,8 +38,10 @@ struct MainTabView: View {
@State var isTaskSel: Bool = selectedTabModel.activeTab == .map
TabView(selection: $selectedTabModel.activeTab){
if SharingData.my.isCommunication {
ChatView()
.tag(Tab.chat)
}
ZStack {
MapRepresentable()
......@@ -55,7 +57,8 @@ struct MainTabView: View {
.tag(Tab.menu)
}
.hideNativeTabBar()
.sheet(isPresented: .constant(isTaskSel && isTabShow && SharingData.my.isFuelSwitchTask), content: {
// .sheet(isPresented: .constant(isTaskSel && isTabShow && SharingData.my.isFuelSwitchTask), content: {
.sheet(isPresented: .constant(isTaskSel && isTabShow), content: {
MenuTaskView()
.zIndex(0)
.presentationDragIndicator(.hidden)
......@@ -69,8 +72,10 @@ struct MainTabView: View {
@State var isPopover: Bool = selectedTabModel.isPoppver
TabView(selection: $selectedTabModel.activeTab){
if SharingData.my.isCommunication {
ChatView()
.tag(Tab.chat)
}
ZStack {
MapRepresentable()
......@@ -86,7 +91,8 @@ struct MainTabView: View {
.tag(Tab.menu)
}
.hideNativeTabBar()
.popover(isPresented: .constant(isPopover && SharingData.my.isFuelSwitchTask), attachmentAnchor: .point(.bottom)) {
// .popover(isPresented: .constant(isPopover && SharingData.my.isFuelSwitchTask), attachmentAnchor: .point(.bottom)) {
.popover(isPresented: .constant(isPopover), attachmentAnchor: .point(.bottom)) {
MenuTaskView()
.presentationCompactAdaptation(.popover)
.zIndex(0)
......@@ -179,7 +185,7 @@ struct CustomTabBar: View {
}
} message: {
Text("Do you change an emargency mode?")
Text("Do you change an warning mode?")
}
.alert("Location", isPresented: $selectedTabModel.isLocationAlert) {
Button("Cancel") {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment