Skip to content

Commit

Permalink
Merge pull request #676 from WhiteCloud0123/develop
Browse files Browse the repository at this point in the history
develop -> before_reality_bubble
  • Loading branch information
WhiteCloud0123 authored Jun 8, 2024
2 parents 3f33a4d + 20b836d commit 8263aea
Show file tree
Hide file tree
Showing 26 changed files with 202 additions and 87 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export CCACHE_COMMENTS=1
# Explicitly let 'char' to be 'signed char' to fix #18776
OTHERS += -fsigned-char

VERSION = CDDA-Breeze-8.2
VERSION = CDDA-Breeze-8.3

TARGET_NAME = cataclysm
TILES_TARGET_NAME = $(TARGET_NAME)-tiles
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# CDDA-微风
# CDDA-Breeze

CDDA-微风(CDDA-Breeze)是[Cataclysm: Dark Days Ahead](https://github.com/CleverRaven/Cataclysm-DDA)的一个分支,在CDDA-0.G的基础之上进行开发。关于此分支的具体内容可以查看[内容汇总](内容汇总.md)

## Breeze核心发展重点

* 游戏的性能优化

* 游戏的趣味性
CDDA-Breeze是[Cataclysm-DDA](https://github.com/CleverRaven/Cataclysm-DDA)的一个分支,在CDDA-0.G的基础之上进行开发,注重游戏的性能优化和趣味性。关于此分支的具体内容可以查看[内容汇总](内容汇总.md)

## 表达对此项目的支持

Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ android {
defaultConfig {
minSdkVersion override_minSdkVersion
targetSdkVersion override_targetSdkVersion
versionCode 62
versionName "8.2"
versionCode 63
versionName "8.3"
if (buildAsApplication) {
applicationId "WhiteCloud.CDDA_Breeze"
setProperty("archivesBaseName", "CDDA-Breeze-" + versionName)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SplashScreen extends Activity {
private AlertDialog accessibilityServicesAlert;

public CharSequence[] mSettingsNames;
public boolean[] mSettingsValues = { false, true, true, false };
public boolean[] mSettingsValues = { false, true, false };

private String getVersionName() {
try {
Expand Down Expand Up @@ -259,7 +259,6 @@ public void onClick(DialogInterface dialog, int id) {

mSettingsNames = new CharSequence[] {
getString(R.string.softwareRendering),
getString(R.string.forceFullscreen),
getString(R.string.trapBackButton),
getString(R.string.nativeAndroidUI)
};
Expand All @@ -275,9 +274,8 @@ public void onClick(DialogInterface dialog, int which, boolean isChecked) {
.setPositiveButton(getString(R.string.startGame), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Software rendering", SplashScreen.this.mSettingsValues[0]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Force fullscreen", SplashScreen.this.mSettingsValues[1]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Trap Back button", SplashScreen.this.mSettingsValues[2]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Native Android UI", SplashScreen.this.mSettingsValues[3]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Trap Back button", SplashScreen.this.mSettingsValues[1]).commit();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Native Android UI", SplashScreen.this.mSettingsValues[2]).commit();
SplashScreen.this.startGameActivity(false);
return;
}
Expand Down
7 changes: 6 additions & 1 deletion android/app/src/main/java/org/libsdl/app/SDLActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public enum NativeState {

Button tabButton;

private static boolean forceFullScreen = true;

public void setExtraButtonVisibility(boolean visible) {

this.runOnUiThread(new Runnable() {
Expand All @@ -118,6 +120,10 @@ public void run() {
});
}

public void set_force_full_screen(boolean value) {
forceFullScreen = value;
}

protected static SDLGenericMotionListener_API12 getMotionListener() {
if (mMotionListener == null) {
if (Build.VERSION.SDK_INT >= 26) {
Expand Down Expand Up @@ -679,7 +685,6 @@ public void handleMessage(Message msg) {
int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;
window.getDecorView().setSystemUiVisibility(flags);
Context appContext = context.getApplicationContext();
boolean forceFullScreen = PreferenceManager.getDefaultSharedPreferences(appContext).getBoolean("Force fullscreen", false);
window.addFlags(forceFullScreen ? WindowManager.LayoutParams.FLAG_FULLSCREEN : WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
window.clearFlags(forceFullScreen ? WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN : WindowManager.LayoutParams.FLAG_FULLSCREEN);
SDLActivity.mFullscreenModeActive = forceFullScreen;
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ deps=./deps.zip

# This property controls which override version number to use
# You can override this from the command line by passing "-Poverride_version=#"
override_version=CDDA-Breeze-8.2
override_version=CDDA-Breeze-8.3

# This property controls path where overridden version number header should be generated
# You can override this from the command line by passing "-Pversion_header_path=#"
Expand Down
2 changes: 1 addition & 1 deletion data/credits/en.credits
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lines longer than 78 characters will be wrapped automatically
# The following line is for reference
##############################################################################
<color_white>CDDA-微风 项目管理者:</color>
<color_white>CDDA-Breeze 项目管理者:</color>

<color_yellow>WhiteCloud0123</color>

Expand Down
2 changes: 1 addition & 1 deletion data/credits/zh_CN.credits
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 超过78个字符的段落将自动换行
# 下面这行这么长
##############################################################################
<color_white>CDDA-微风 项目管理者:</color>
<color_white>CDDA-Breeze 项目管理者:</color>

<color_yellow>WhiteCloud0123</color>

Expand Down
Binary file modified lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo
Binary file not shown.
4 changes: 0 additions & 4 deletions lang/po/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -423579,10 +423579,6 @@ msgstr "强制游戏崩溃(测试崩溃处理)"
msgid "Activate EOC"
msgstr "启用 EOC"

#: src/debug_menu.cpp:446
msgid "Quit to main menu"
msgstr "退出至主菜单"

#: src/debug_menu.cpp:450 src/debug_menu.cpp:529
msgid "Game…"
msgstr "游戏…"
Expand Down
11 changes: 0 additions & 11 deletions src/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,17 +712,6 @@ void game::draw_weather( const weather_printable &w ) const
return;
}

if (use_particle_system) {
weather_type_id& id = get_weather().weather_id;
if (id == weather_snowing || id == weather_rain || id == weather_drizzle) {
return;
}

}




tilecontext->init_draw_weather( w, w.wtype->tiles_animation );
}

Expand Down
9 changes: 8 additions & 1 deletion src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,14 @@ void cata_tiles::draw( const point &dest, const tripoint &center, int width, int
void_line();
}
if( do_draw_weather ) {
draw_weather_frame();
const std::string& id = get_weather().weather_id.str();
if (use_particle_system && particle_system_weather.is_support_weather(id)) {
particle_system_weather.set_style_for_weather(id, renderer.get());
particle_system_weather.draw();
}
else {
draw_weather_frame();
}
void_weather();
}
if( do_draw_sct ) {
Expand Down
2 changes: 1 addition & 1 deletion src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static int game_uilist()
{ uilist_entry( debug_menu_index::SHOW_MSG, true, 'd', _( "Show debug message" ) ) },
{ uilist_entry( debug_menu_index::CRASH_GAME, true, 'C', _( "Crash game (test crash handling)" ) ) },
{ uilist_entry( debug_menu_index::ACTIVATE_EOC, true, 'E', _( "Activate EOC" ) ) },
{ uilist_entry( debug_menu_index::QUIT_NOSAVE, true, 'Q', _( "Quit to main menu" ) ) },
{ uilist_entry( debug_menu_index::QUIT_NOSAVE, true, 'Q', "退出到游戏开始界面")},
{ uilist_entry( debug_menu_index::QUICKLOAD, true, 'q', _( "Quickload" ) ) },
};

Expand Down
1 change: 1 addition & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ jmethodID method_id_toast;
jmethodID method_id_showToastMessage;
jmethodID method_id_getDefaultSetting;
jmethodID method_id_getSystemLang;
jmethodID method_id_set_force_full_screen;

#endif

Expand Down
1 change: 1 addition & 0 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ extern jmethodID method_id_toast;
extern jmethodID method_id_showToastMessage;
extern jmethodID method_id_getDefaultSetting;
extern jmethodID method_id_getSystemLang;
extern jmethodID method_id_set_force_full_screen;


#endif
Expand Down
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "ordered_static_globals.h"
#include "path_info.h"
#include "rng.h"
#include "sdltiles.h"
#include "system_locale.h"
#include "translations.h"
#include "type_id.h"
Expand Down Expand Up @@ -729,14 +730,14 @@ int main( int argc, const char *argv[] )
method_id_showToastMessage = jni_env->GetMethodID(j_class, "showToastMessage", "(Ljava/lang/String;)V");
method_id_getDefaultSetting = jni_env->GetMethodID(j_class, "getDefaultSetting", "(Ljava/lang/String;Z)Z");
method_id_getSystemLang = jni_env->GetMethodID(j_class, "getSystemLang", "()Ljava/lang/String;");

method_id_set_force_full_screen = jni_env->GetMethodID(j_class, "set_force_full_screen", "(Z)V");
jni_env->DeleteLocalRef(temp_activity);
jni_env->DeleteLocalRef(temp_class);


#endif


particle_system_weather.init_weather_content();



Expand Down
10 changes: 8 additions & 2 deletions src/npctalk_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,16 +1098,22 @@ void talk_function::goto_location( npc &p )
iter->camp_name(), iter->camp_omt_pos().to_string() );
}
selection_menu.addentry( i++, true, MENU_AUTOASSIGN, _( "My current location" ) );
if (!player_character.omt_path.empty()) {
selection_menu.addentry(i++, true, MENU_AUTOASSIGN, "我指定的位置");
}
selection_menu.addentry( i, true, MENU_AUTOASSIGN, _( "Cancel" ) );
selection_menu.selected = 0;
selection_menu.query();
int index = selection_menu.ret;
if( index < 0 || index > static_cast<int>( camps.size() + 1 ) ||
index == static_cast<int>( camps.size() + 1 ) ) {
if (index < 0 || index >= i) {
return;
}
if( index == static_cast<int>( camps.size() ) ) {
destination = player_character.global_omt_location();
}
else if (index == static_cast<int>(camps.size()) + 1) {
// This looks nuts, but omt_path is emplaced in reverse order. So the front of the vector is our destination
destination = player_character.omt_path.front();
} else {
const basecamp *selected_camp = camps[index];
destination = selected_camp->camp_omt_pos();
Expand Down
24 changes: 19 additions & 5 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,8 +1625,8 @@ void options_manager::add_options_interface()

add_empty_line();

add("显示独立角色的图片", "interface", to_translation("显示独立角色的图片"),
to_translation("开启后,在与独立角色进行交谈时,将显示该角色的图片。"),
add("显示特殊NPC的图片", "interface", to_translation("显示特殊NPC的图片"),
to_translation("开启后,在与特殊NPC进行交谈时,将显示该角色的图片。"),
true
);
add("派系态度以数值显示", "interface", to_translation("派系态度以数值显示"), to_translation("当此选项的值为 是 时,在派系界面,对你的态度会显示具体的数值。"), false);
Expand Down Expand Up @@ -2012,8 +2012,8 @@ void options_manager::add_options_graphics()
};


add("启用粒子特效", "graphics", to_translation("启用粒子特效"),
to_translation("目前是测试阶段。开启后,将在游戏的一些地方应用粒子特效,同时提高游戏画面的刷新频率。目前已在 细雨、雨、雪 这三种天气上应用。"),
add("启用粒子系统", "graphics", to_translation("启用粒子系统"),
to_translation("目前是测试阶段。开启后,将在游戏的一些地方使用粒子系统。"),
false
);

Expand Down Expand Up @@ -2705,6 +2705,11 @@ void options_manager::add_options_android()
android_get_default_setting( "Trap Back button", true )
);

add("强制全屏", "android", to_translation("强制全屏"),
to_translation("强制全屏。修改后需要重新启动。"),
true
);

add( "ANDROID_NATIVE_UI", "android", to_translation( "Use native Android UI menus" ),
to_translation( "If true, native Android dialogs are used for some in-game menus, "
"such as popup messages and yes/no dialogs." ),
Expand Down Expand Up @@ -3683,7 +3688,7 @@ static void update_options_cache()
fov_3d_z_range = ::get_option<int>( "FOV_3D_Z_RANGE" );
keycode_mode = ::get_option<std::string>( "SDL_KEYBOARD_MODE" ) == "keycode";
use_pinyin_search = ::get_option<bool>("USE_PINYIN_SEARCH");
use_particle_system = ::get_option<bool>("启用粒子特效");
use_particle_system = ::get_option<bool>("启用粒子系统");
use_show_creature_hp_bar = ::get_option<bool>("显示生物血条");
use_show_player_move_point = ::get_option<bool>("显示玩家的剩余行动点");
use_animation =::get_option<bool>("ANIMATIONS");
Expand Down Expand Up @@ -3724,6 +3729,11 @@ bool options_manager::save() const

update_music_volume();

#if defined(__ANDROID__)
jni_env->CallVoidMethod(j_activity, method_id_set_force_full_screen, ::get_option<bool>("强制全屏"));
#endif


return write_to_file( savefile, [&]( std::ostream & fout ) {
JsonOut jout( fout, true );
serialize( jout );
Expand All @@ -3740,6 +3750,10 @@ void options_manager::load()
update_global_locale();
update_options_cache();

#if defined(__ANDROID__)
jni_env->CallVoidMethod(j_activity, method_id_set_force_full_screen, ::get_option<bool>("强制全屏"));
#endif

#if defined(SDL_SOUND)
sounds::sound_enabled = ::get_option<bool>( "SOUND_ENABLED" );
#endif
Expand Down
Loading

0 comments on commit 8263aea

Please sign in to comment.