diff --git a/app/src/main/java/com/coldmint/rust/pro/CreateUnitActivity.kt b/app/src/main/java/com/coldmint/rust/pro/CreateUnitActivity.kt index 35ce337..1a99bd8 100644 --- a/app/src/main/java/com/coldmint/rust/pro/CreateUnitActivity.kt +++ b/app/src/main/java/com/coldmint/rust/pro/CreateUnitActivity.kt @@ -4,8 +4,11 @@ import com.coldmint.rust.pro.base.BaseActivity import android.os.Bundle import android.content.Intent import android.view.LayoutInflater +import android.view.Menu +import android.view.MenuItem import android.widget.* import androidx.activity.result.contract.ActivityResultContracts +import com.coldmint.dialog.CoreDialog import com.coldmint.rust.pro.adapters.CreateUnitPageAdapter import com.coldmint.rust.pro.databinding.ActivityCreateUnitBinding import com.google.android.material.tabs.TabLayoutMediator @@ -21,6 +24,23 @@ class CreateUnitActivity : BaseActivity() { } } + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.menu_create_unit, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + if (item.itemId == R.id.help) { + val dialog = + CoreDialog(this).setTitle(R.string.help).setMessage(R.string.template_help_message) + dialog.setPositiveButton(R.string.dialog_ok) { + + } + dialog.show() + } + return super.onOptionsItemSelected(item) + } + fun initView() { val intent = intent val bundle = intent.getBundleExtra("data") diff --git a/app/src/main/java/com/coldmint/rust/pro/SettingsActivity.kt b/app/src/main/java/com/coldmint/rust/pro/SettingsActivity.kt index d10d6d2..c8961cb 100644 --- a/app/src/main/java/com/coldmint/rust/pro/SettingsActivity.kt +++ b/app/src/main/java/com/coldmint/rust/pro/SettingsActivity.kt @@ -12,6 +12,7 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatDelegate import androidx.preference.* import com.bumptech.glide.Glide +import com.coldmint.rust.core.tool.AppOperator import com.coldmint.rust.core.tool.FileOperator import com.coldmint.rust.pro.databinding.ActivitySettingsBinding import com.coldmint.rust.pro.tool.GlobalMethod @@ -76,6 +77,12 @@ class SettingsActivity : BaseActivity() { true } + val obtainSourceCode = manager.findPreference(requireContext().getString(R.string.setting_obtain_source_code)) + obtainSourceCode!!.onPreferenceClickListener = Preference.OnPreferenceClickListener { + AppOperator.useBrowserAccessWebPage(requireContext(),"https://github.com/Cold-Mint/RustAssistant") + true + } + val game = manager.findPreference("set_game_pack") game!!.onPreferenceClickListener = Preference.OnPreferenceClickListener { startActivity(Intent(context, ApplicationListActivity::class.java)) diff --git a/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt b/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt index 1cf7e03..11901fb 100644 --- a/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt +++ b/app/src/main/java/com/coldmint/rust/pro/fragments/AllUnitsFragment.kt @@ -87,7 +87,7 @@ class AllUnitsFragment( addFileToHistory(file, handler = handler, whenAddComplete = { val intent = Intent(requireContext(), EditActivity::class.java) intent.putExtra("data", bundle) - fragmentActivity?.startActivityForResult(intent, 2) + requireActivity().startActivity(intent) }) } } diff --git a/app/src/main/res/drawable/baseline_help_outline_24.xml b/app/src/main/res/drawable/baseline_help_outline_24.xml new file mode 100644 index 0000000..d2f9639 --- /dev/null +++ b/app/src/main/res/drawable/baseline_help_outline_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/menu/menu_create_unit.xml b/app/src/main/res/menu/menu_create_unit.xml new file mode 100644 index 0000000..dfcf9b2 --- /dev/null +++ b/app/src/main/res/menu/menu_create_unit.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2cda001..82cc183 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -550,7 +550,6 @@ 位于%1$s第%2$d行: 您正在尝试导入低版本的模板包(%1$s),当前版本(%2$s),这将覆盖更新的内容。要继续嘛? %1$s已存在,这将覆盖旧的内容。要继续嘛? - 使用文档 无法为空文件制作模板。 使用\",\"分割参数,也可以使用\"[\"和\"]\"注解参数。例如:[喜欢:like],喜欢将被显示给用户,选中后,写入like。 模板添加完成,请现在退出模板制作器嘛? @@ -947,5 +946,9 @@ 编译错误 很抱歉,源文件编译失败了。错误信息为:\n%1$s 登录后即可解锁关注系统 - + 帮助 + 助手使用模板创建单位,模板的本质是一段json描述。助手模板解析器会解析json,构建出用户界面。您可以在\"模板社区\"订阅您感兴趣的模板。订阅后会随时保持更新。 + 在Github上查看铁锈助手的源代码,助手已开源,欢迎二次开发。 + 获取源代码 + ObtainSourceCode \ No newline at end of file diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index e21bc97..b91f654 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -266,6 +266,11 @@ app:key="developerModeGroup" app:title="@string/sync_header"> + +