mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
gamepad icons (pre)
This commit is contained in:
parent
37a61e822e
commit
5f0d83410b
10 changed files with 732 additions and 36 deletions
|
|
@ -4,7 +4,7 @@ include(FindPackageHandleStandardArgs)
|
|||
|
||||
# Options
|
||||
option(STEAM "Build for Steam" OFF)
|
||||
option(DEBUG "Debug mode" OFF)
|
||||
option(DEBUG "Debug mode" ON)
|
||||
option(SANITIZERS "Enable sanitizers" OFF)
|
||||
option(NATIVE "Use native instructions(for local use only)" OFF)
|
||||
#x86, arm64, ia-64
|
||||
|
|
@ -295,6 +295,7 @@ set(BINDING_SOURCE
|
|||
binding-mri/keybindings-binding.cpp
|
||||
binding-mri/lightmap-binding.cpp
|
||||
binding-mri/signalconnection-binding.cpp
|
||||
binding-mri/gamepad-binding.cpp
|
||||
)
|
||||
|
||||
source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS})
|
||||
|
|
|
|||
98
binding-mri/gamepad-binding.cpp
Normal file
98
binding-mri/gamepad-binding.cpp
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
#include <ruby.h>
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
|
||||
VALUE rb_GetGamepadType(VALUE klass){
|
||||
SDL_Gamepad *gamepad = SDL_GetGamepadFromPlayerIndex(0);
|
||||
|
||||
if (gamepad == NULL)
|
||||
return SDL_GAMEPAD_TYPE_UNKNOWN;
|
||||
|
||||
return INT2NUM(SDL_GetGamepadType(gamepad));
|
||||
}
|
||||
|
||||
VALUE rb_GetGamepadID(VALUE klass){
|
||||
SDL_Gamepad *gamepad = SDL_GetGamepadFromPlayerIndex(0);
|
||||
|
||||
if (gamepad == NULL)
|
||||
return Qnil;
|
||||
|
||||
return UINT2NUM(SDL_GetGamepadID(gamepad));
|
||||
}
|
||||
|
||||
VALUE rb_GetGamepadGUID(VALUE klass){
|
||||
SDL_Gamepad *gamepad = SDL_GetGamepadFromPlayerIndex(0);
|
||||
|
||||
if (gamepad == NULL)
|
||||
return Qnil;
|
||||
|
||||
SDL_GUID guid = SDL_GetGamepadGUIDForID(SDL_GetGamepadID(gamepad));
|
||||
|
||||
char buffer[33];
|
||||
SDL_GUIDToString(guid, buffer, sizeof(buffer));
|
||||
|
||||
return rb_str_new_cstr(buffer);
|
||||
}
|
||||
|
||||
void initGamepadBinding(VALUE inputModule){
|
||||
VALUE gamepadModule = rb_define_module_under(inputModule, "GamepadType");
|
||||
|
||||
rb_define_module_function(gamepadModule, "current_type", RUBY_METHOD_FUNC(rb_GetGamepadType), 0);
|
||||
rb_define_module_function(gamepadModule, "current_id", RUBY_METHOD_FUNC(rb_GetGamepadID), 0);
|
||||
rb_define_module_function(gamepadModule, "current_guid", RUBY_METHOD_FUNC(rb_GetGamepadGUID), 0);
|
||||
|
||||
rb_const_set(gamepadModule, rb_intern("UNKNOWN"), INT2FIX(SDL_GAMEPAD_TYPE_UNKNOWN));
|
||||
rb_const_set(gamepadModule, rb_intern("STANDART"), INT2FIX(SDL_GAMEPAD_TYPE_STANDARD));
|
||||
rb_const_set(gamepadModule, rb_intern("XBOX360"), INT2FIX(SDL_GAMEPAD_TYPE_XBOX360));
|
||||
rb_const_set(gamepadModule, rb_intern("XBOXONE"), INT2FIX(SDL_GAMEPAD_TYPE_XBOXONE));
|
||||
rb_const_set(gamepadModule, rb_intern("PS3"), INT2FIX(SDL_GAMEPAD_TYPE_PS3));
|
||||
rb_const_set(gamepadModule, rb_intern("PS4"), INT2FIX(SDL_GAMEPAD_TYPE_PS4));
|
||||
rb_const_set(gamepadModule, rb_intern("PS5"), INT2FIX(SDL_GAMEPAD_TYPE_PS5));
|
||||
rb_const_set(gamepadModule, rb_intern("SWITCH_PRO"), INT2FIX(SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO));
|
||||
rb_const_set(gamepadModule, rb_intern("JOYCON_LEFT"), INT2FIX(SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT));
|
||||
rb_const_set(gamepadModule, rb_intern("JOYCON_RIGHT"), INT2FIX(SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT));
|
||||
rb_const_set(gamepadModule, rb_intern("JOYCON_PAIR"), INT2FIX(SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR));
|
||||
rb_const_set(gamepadModule, rb_intern("GAMECUBE"), INT2FIX(SDL_GAMEPAD_TYPE_GAMECUBE));
|
||||
rb_const_set(gamepadModule, rb_intern("COUNT"), INT2FIX(SDL_GAMEPAD_TYPE_COUNT));
|
||||
|
||||
VALUE gamepadButtonsModule = rb_define_module_under(inputModule, "GamepadButton");
|
||||
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("INVALID"), INT2FIX(SDL_GAMEPAD_BUTTON_INVALID));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("SOUTH"), INT2FIX(SDL_GAMEPAD_BUTTON_SOUTH));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("EAST"), INT2FIX(SDL_GAMEPAD_BUTTON_EAST));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("WEST"), INT2FIX(SDL_GAMEPAD_BUTTON_WEST));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("NORTH"), INT2FIX(SDL_GAMEPAD_BUTTON_NORTH));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("BACK"), INT2FIX(SDL_GAMEPAD_BUTTON_BACK));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("GUIDE"), INT2FIX(SDL_GAMEPAD_BUTTON_GUIDE));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("START"), INT2FIX(SDL_GAMEPAD_BUTTON_START));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("LEFT_STICK"), INT2FIX(SDL_GAMEPAD_BUTTON_LEFT_STICK));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("RIGHT_STICK"), INT2FIX(SDL_GAMEPAD_BUTTON_RIGHT_STICK));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("LEFT_SHOULDER"), INT2FIX(SDL_GAMEPAD_BUTTON_LEFT_SHOULDER));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("RIGHT_SHOULDER"), INT2FIX(SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("DPAD_UP"), INT2FIX(SDL_GAMEPAD_BUTTON_DPAD_UP));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("DPAD_DOWN"), INT2FIX(SDL_GAMEPAD_BUTTON_DPAD_DOWN));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("DPAD_LEFT"), INT2FIX(SDL_GAMEPAD_BUTTON_DPAD_LEFT));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("DPAD_RIGHT"), INT2FIX(SDL_GAMEPAD_BUTTON_DPAD_RIGHT));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("MISC1"), INT2FIX(SDL_GAMEPAD_BUTTON_MISC1));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("RIGHT_PADDLE1"), INT2FIX(SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("LEFT_PADDLE1"), INT2FIX(SDL_GAMEPAD_BUTTON_LEFT_PADDLE1));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("RIGHT_PADDLE2"), INT2FIX(SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("LEFT_PADDLE2"), INT2FIX(SDL_GAMEPAD_BUTTON_LEFT_PADDLE2));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("TOUCHPAD"), INT2FIX(SDL_GAMEPAD_BUTTON_TOUCHPAD));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("MISC2"), INT2FIX(SDL_GAMEPAD_BUTTON_MISC2));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("MISC3"), INT2FIX(SDL_GAMEPAD_BUTTON_MISC3));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("MISC4"), INT2FIX(SDL_GAMEPAD_BUTTON_MISC4));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("MISC5"), INT2FIX(SDL_GAMEPAD_BUTTON_MISC5));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("MISC6"), INT2FIX(SDL_GAMEPAD_BUTTON_MISC6));
|
||||
rb_const_set(gamepadButtonsModule, rb_intern("COUNT"), INT2FIX(SDL_GAMEPAD_BUTTON_COUNT));
|
||||
|
||||
VALUE gamepadAxisModule = rb_define_module_under(inputModule, "GamepadAxis");
|
||||
|
||||
rb_const_set(gamepadAxisModule, rb_intern("INVALID"), INT2FIX(SDL_GAMEPAD_AXIS_INVALID));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("LEFTX"), INT2FIX(SDL_GAMEPAD_AXIS_LEFTX));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("LEFTY"), INT2FIX(SDL_GAMEPAD_AXIS_LEFTY));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("RIGHTX"), INT2FIX(SDL_GAMEPAD_AXIS_RIGHTX));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("RIGHTY"), INT2FIX(SDL_GAMEPAD_AXIS_RIGHTY));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("LEFT_TRIGGER"), INT2FIX(SDL_GAMEPAD_AXIS_LEFT_TRIGGER));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("RIGHT_TRIGGER"), INT2FIX(SDL_GAMEPAD_AXIS_RIGHT_TRIGGER));
|
||||
rb_const_set(gamepadAxisModule, rb_intern("COUNT"), INT2FIX(SDL_GAMEPAD_AXIS_COUNT));
|
||||
}
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
||||
extern void initGamepadBinding(VALUE inputModule);
|
||||
|
||||
RB_METHOD(inputUpdate){
|
||||
RB_UNUSED_PARAM;
|
||||
|
||||
|
|
@ -344,6 +346,8 @@ void inputBindingInit(){
|
|||
printf("[inputBindingInit] Initializing Input binding\n");
|
||||
VALUE module = rb_define_module("Input");
|
||||
|
||||
initGamepadBinding(module);
|
||||
|
||||
// mkxp's input
|
||||
_rb_define_module_function(module, "update", inputUpdate);
|
||||
_rb_define_module_function(module, "press?", inputPress);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
set(scripts
|
||||
Credits_Message.rb
|
||||
Data_Types.rb
|
||||
Data_FastTravel.rb
|
||||
Data_Footsteps.rb
|
||||
Data_Item.rb
|
||||
|
|
|
|||
|
|
@ -219,3 +219,329 @@ module GamepadMapColors
|
|||
259 => WORLD_MACHINE,
|
||||
}
|
||||
end
|
||||
|
||||
module GamepadIcons
|
||||
ICONS_CACHE = []
|
||||
|
||||
ICONS = {
|
||||
# SDL supported types, can be detected automatically
|
||||
# SDL_GAMEPAD_TYPE_UNKNOWN => UNKNOWN
|
||||
# SDL_GAMEPAD_TYPE_STANDARD => STANDART
|
||||
# SDL_GAMEPAD_TYPE_XBOX360 => XBOX360
|
||||
# SDL_GAMEPAD_TYPE_XBOXONE => XBOXONE
|
||||
# SDL_GAMEPAD_TYPE_PS3 => PS3
|
||||
# SDL_GAMEPAD_TYPE_PS4 => PS4
|
||||
# SDL_GAMEPAD_TYPE_PS5 => PS5
|
||||
# SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO => SWITCH_PRO
|
||||
# SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT => JOYCON_LEFT
|
||||
# SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT => JOYCON_RIGHT
|
||||
# SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR => JOYCON_PAIR
|
||||
# SDL_GAMEPAD_TYPE_GAMECUBE => GAMECUBE
|
||||
|
||||
Input::GamepadType::UNKNOWN => {
|
||||
:extends => Input::GamepadType::STANDART,
|
||||
:icon => [8, 16],
|
||||
},
|
||||
Input::GamepadType::STANDART => {
|
||||
:icon => [10, 13],
|
||||
:buttons => {
|
||||
Input::GamepadButton::INVALID => [9, 16],
|
||||
Input::GamepadButton::SOUTH => [0, 0],
|
||||
Input::GamepadButton::EAST => [3, 0],
|
||||
Input::GamepadButton::WEST => [1, 0],
|
||||
Input::GamepadButton::NORTH => [2, 0],
|
||||
Input::GamepadButton::BACK => [4, 5],
|
||||
Input::GamepadButton::GUIDE => [6, 13],
|
||||
Input::GamepadButton::START => [5, 5],
|
||||
Input::GamepadButton::LEFT_STICK => [4, 3],
|
||||
Input::GamepadButton::RIGHT_STICK => [5, 3],
|
||||
Input::GamepadButton::LEFT_SHOULDER => [6, 3],
|
||||
Input::GamepadButton::RIGHT_SHOULDER => [7, 3],
|
||||
Input::GamepadButton::DPAD_UP => [7, 0],
|
||||
Input::GamepadButton::DPAD_DOWN => [4, 0],
|
||||
Input::GamepadButton::DPAD_LEFT => [5, 0],
|
||||
Input::GamepadButton::DPAD_RIGHT => [6, 0],
|
||||
Input::GamepadButton::MISC1 => [0, 18],
|
||||
Input::GamepadButton::RIGHT_PADDLE1 => [7, 6],
|
||||
Input::GamepadButton::LEFT_PADDLE1 => [6, 6],
|
||||
Input::GamepadButton::RIGHT_PADDLE2 => [7, 7],
|
||||
Input::GamepadButton::LEFT_PADDLE2 => [6, 7],
|
||||
Input::GamepadButton::TOUCHPAD => [8, 16],
|
||||
Input::GamepadButton::MISC2 => [1, 18],
|
||||
Input::GamepadButton::MISC3 => [2, 18],
|
||||
Input::GamepadButton::MISC4 => [3, 18],
|
||||
Input::GamepadButton::MISC5 => [4, 18],
|
||||
Input::GamepadButton::MISC6 => [5, 18],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::INVALID => [[9, 16], [9, 16]],
|
||||
Input::GamepadAxis::LEFTX => [[5, 1], [6, 1]],
|
||||
Input::GamepadAxis::LEFTY => [[4, 1], [7, 1]],
|
||||
Input::GamepadAxis::RIGHTX => [[5, 2], [6, 2]],
|
||||
Input::GamepadAxis::RIGHTY => [[4, 2], [7, 2]],
|
||||
Input::GamepadAxis::LEFT_TRIGGER => [[6, 4], [9, 16]],
|
||||
Input::GamepadAxis::RIGHT_TRIGGER => [[7, 4], [9, 16]],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::XBOX360 => {
|
||||
:extends => Input::GamepadType::STANDART,
|
||||
:icon => [8, 14],
|
||||
:buttons => {
|
||||
Input::GamepadButton::GUIDE => [1, 17],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::XBOXONE => {
|
||||
:extends => Input::GamepadType::XBOX360,
|
||||
:icon => [10, 14],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [4, 4],
|
||||
Input::GamepadButton::START => [5, 4],
|
||||
Input::GamepadButton::MISC1 => [5, 6],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::PS3 => {
|
||||
:extends => Input::GamepadType::STANDART,
|
||||
:icon => [8, 12],
|
||||
:buttons => {
|
||||
Input::GamepadButton::SOUTH => [0, 5],
|
||||
Input::GamepadButton::EAST => [3, 5],
|
||||
Input::GamepadButton::WEST => [1, 5],
|
||||
Input::GamepadButton::NORTH => [2, 5],
|
||||
Input::GamepadButton::BACK => [5, 12],
|
||||
Input::GamepadButton::GUIDE => [6, 18],
|
||||
Input::GamepadButton::START => [6, 12],
|
||||
Input::GamepadButton::LEFT_SHOULDER => [6, 9],
|
||||
Input::GamepadButton::RIGHT_SHOULDER => [7, 9],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::LEFT_TRIGGER => [[6, 10], [9, 16]],
|
||||
Input::GamepadAxis::RIGHT_TRIGGER => [[7, 10], [9, 16]],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::PS4 => {
|
||||
:extends => Input::GamepadType::PS3,
|
||||
:icon => [9, 12],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [6, 11],
|
||||
Input::GamepadButton::START => [5, 11],
|
||||
Input::GamepadButton::TOUCHPAD => [4, 11],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::PS5 => {
|
||||
:extends => Input::GamepadType::PS4,
|
||||
:icon => [10, 12],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [4, 9],
|
||||
Input::GamepadButton::GUIDE => [11, 17],
|
||||
Input::GamepadButton::START => [5, 9],
|
||||
Input::GamepadButton::TOUCHPAD => [4, 10],
|
||||
Input::GamepadButton::MISC1 => [7, 11],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::PS5 => {
|
||||
:extends => Input::GamepadType::PS4,
|
||||
:icon => [10, 12],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [4, 9],
|
||||
Input::GamepadButton::START => [5, 9],
|
||||
Input::GamepadButton::TOUCHPAD => [4, 10],
|
||||
Input::GamepadButton::MISC1 => [7, 11],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::SWITCH_PRO => {
|
||||
:extends => Input::GamepadType::JOYCON_PAIR,
|
||||
:icon => [10, 13],
|
||||
:buttons => {
|
||||
Input::GamepadButton::DPAD_UP => [7, 0],
|
||||
Input::GamepadButton::DPAD_DOWN => [4, 0],
|
||||
Input::GamepadButton::DPAD_LEFT => [5, 0],
|
||||
Input::GamepadButton::DPAD_RIGHT => [6, 0],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::JOYCON_PAIR => {
|
||||
:extends => Input::GamepadType::STANDART,
|
||||
:icon => [9, 11],
|
||||
:buttons => {
|
||||
Input::GamepadButton::SOUTH => [3, 0],
|
||||
Input::GamepadButton::EAST => [0, 0],
|
||||
Input::GamepadButton::WEST => [2, 0],
|
||||
Input::GamepadButton::NORTH => [1, 0],
|
||||
Input::GamepadButton::BACK => [5, 13],
|
||||
Input::GamepadButton::START => [4, 13],
|
||||
Input::GamepadButton::DPAD_UP => [3, 15],
|
||||
Input::GamepadButton::DPAD_DOWN => [0, 15],
|
||||
Input::GamepadButton::DPAD_LEFT => [1, 15],
|
||||
Input::GamepadButton::DPAD_RIGHT => [2, 15],
|
||||
Input::GamepadButton::LEFT_SHOULDER => [6, 8],
|
||||
Input::GamepadButton::RIGHT_SHOULDER => [7, 8],
|
||||
Input::GamepadButton::MISC1 => [4, 14],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::LEFT_TRIGGER => [[6, 14], [9, 16]],
|
||||
Input::GamepadAxis::RIGHT_TRIGGER => [[7, 14], [9, 16]],
|
||||
}
|
||||
},
|
||||
Input::GamepadType::JOYCON_LEFT => {
|
||||
:extends => Input::GamepadType::JOYCON_PAIR,
|
||||
:icon => [10, 16],
|
||||
},
|
||||
Input::GamepadType::JOYCON_RIGHT => {
|
||||
:extends => Input::GamepadType::JOYCON_PAIR,
|
||||
:icon => [11, 16],
|
||||
},
|
||||
Input::GamepadType::GAMECUBE => {
|
||||
:extends => Input::GamepadType::STANDART,
|
||||
:icon => [8, 11],
|
||||
:buttons => {
|
||||
Input::GamepadButton::SOUTH => [8, 10],
|
||||
Input::GamepadButton::EAST => [7, 15],
|
||||
Input::GamepadButton::WEST => [9, 10],
|
||||
Input::GamepadButton::NORTH => [5, 15],
|
||||
Input::GamepadButton::START => [5, 14],
|
||||
Input::GamepadButton::LEFT_STICK => [10, 11],
|
||||
Input::GamepadButton::RIGHT_STICK => [10, 10],
|
||||
Input::GamepadButton::RIGHT_SHOULDER => [4, 15],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::LEFT_TRIGGER => [[6, 15], [9, 16]],
|
||||
Input::GamepadAxis::RIGHT_TRIGGER => [[0, 17], [9, 16]],
|
||||
Input::GamepadAxis::LEFTX => [[9, 9], [10, 9]],
|
||||
Input::GamepadAxis::LEFTY => [[8, 9], [11, 9]],
|
||||
Input::GamepadAxis::RIGHTX => [[9, 8], [10, 8]],
|
||||
Input::GamepadAxis::RIGHTY => [[8, 8], [11, 8]],
|
||||
}
|
||||
},
|
||||
|
||||
# GUID gamepads
|
||||
:series_x => {
|
||||
:extends => Input::GamepadType::XBOXONE,
|
||||
:icon => [9, 14],
|
||||
:buttons => {
|
||||
Input::GamepadButton::MISC1 => [5, 6],
|
||||
}
|
||||
},
|
||||
:luna => {
|
||||
:extends => Input::GamepadType::XBOXONE,
|
||||
:icon => [8, 11],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [7, 13],
|
||||
Input::GamepadButton::GUIDE => [7, 12],
|
||||
Input::GamepadButton::START => [6, 12],
|
||||
}
|
||||
},
|
||||
:ouya => {
|
||||
:extends => Input::GamepadType::PS3,
|
||||
:icon => [11, 11],
|
||||
:buttons => {
|
||||
Input::GamepadButton::SOUTH => [0, 10],
|
||||
Input::GamepadButton::EAST => [3, 10],
|
||||
Input::GamepadButton::WEST => [1, 10],
|
||||
Input::GamepadButton::NORTH => [2, 10],
|
||||
Input::GamepadButton::GUIDE => [2, 17],
|
||||
Input::GamepadButton::TOUCHPAD => [4, 12],
|
||||
}
|
||||
},
|
||||
:steam_controller => {
|
||||
:extends => Input::GamepadType::XBOXONE,
|
||||
:icon => [8, 13],
|
||||
:buttons => {
|
||||
Input::GamepadButton::GUIDE => [5, 10],
|
||||
Input::GamepadButton::DPAD_UP => [7, 17],
|
||||
Input::GamepadButton::DPAD_DOWN => [4, 17],
|
||||
Input::GamepadButton::DPAD_LEFT => [5, 17],
|
||||
Input::GamepadButton::DPAD_RIGHT => [6, 17],
|
||||
Input::GamepadButton::RIGHT_PADDLE1 => [7, 8],
|
||||
Input::GamepadButton::LEFT_PADDLE1 => [6, 8],
|
||||
Input::GamepadButton::RIGHT_STICK => [3, 17],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::RIGHTX => [[5, 16], [6, 16]],
|
||||
Input::GamepadAxis::RIGHTY => [[4, 16], [7, 16]],
|
||||
}
|
||||
},
|
||||
:steam_deck => {
|
||||
:extends => Input::GamepadType::XBOXONE,
|
||||
:icon => [9, 13],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [4, 4],
|
||||
Input::GamepadButton::GUIDE => [4, 8],
|
||||
Input::GamepadButton::MISC1 => [5, 8],
|
||||
Input::GamepadButton::START => [5, 4],
|
||||
Input::GamepadButton::LEFT_SHOULDER => [6, 9],
|
||||
Input::GamepadButton::RIGHT_SHOULDER => [7, 9],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::LEFT_TRIGGER => [[6, 10], [9, 16]],
|
||||
Input::GamepadAxis::RIGHT_TRIGGER => [[7, 10], [9, 16]],
|
||||
}
|
||||
},
|
||||
:stadia => {
|
||||
:extends => Input::GamepadType::XBOXONE,
|
||||
:icon => [8, 17],
|
||||
:buttons => {
|
||||
Input::GamepadButton::BACK => [5, 8],
|
||||
Input::GamepadButton::GUIDE => [8, 17],
|
||||
Input::GamepadButton::LEFT_SHOULDER => [6, 9],
|
||||
Input::GamepadButton::RIGHT_SHOULDER => [7, 9],
|
||||
},
|
||||
:axes => {
|
||||
Input::GamepadAxis::LEFT_TRIGGER => [[6, 10], [9, 16]],
|
||||
Input::GamepadAxis::RIGHT_TRIGGER => [[7, 10], [9, 16]],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUIDS = {
|
||||
|
||||
}
|
||||
|
||||
class << self
|
||||
def button(id, skinned = true, gamepad_type = nil)
|
||||
current_gamepad = gamepad_type
|
||||
if !ICONS.has_key?(gamepad_type)
|
||||
current_gamepad = Input::GamepadType.current_type
|
||||
if !ICONS.has_key?(current_gamepad)
|
||||
current_gamepad = Input::GamepadType::UNKNOWN
|
||||
end
|
||||
end
|
||||
|
||||
result = nil
|
||||
while !result
|
||||
if !ICONS[current_gamepad].has_key?(:buttons)
|
||||
current_gamepad = ICONS[current_gamepad][:extends]
|
||||
next
|
||||
end
|
||||
result = ICONS[current_gamepad][:buttons][id].clone
|
||||
end
|
||||
if skinned
|
||||
if id == Input::GamepadButton::SOUTH ||
|
||||
id == Input::GamepadButton::EAST ||
|
||||
id == Input::GamepadButton::WEST ||
|
||||
id == Input::GamepadButton::NORTH
|
||||
result[1] += Settings[:gamepad_face_style]
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def axis(id, dir, gamepad_type = nil)
|
||||
current_gamepad = gamepad_type
|
||||
if !ICONS.has_key?(gamepad_type)
|
||||
current_gamepad = Input::GamepadType.current_type
|
||||
if !ICONS.has_key?(current_gamepad)
|
||||
current_gamepad = Input::GamepadType::UNKNOWN
|
||||
end
|
||||
end
|
||||
|
||||
result = nil
|
||||
while !result
|
||||
if !ICONS[current_gamepad].has_key?(:axes)
|
||||
current_gamepad = ICONS[current_gamepad][:extends]
|
||||
next
|
||||
end
|
||||
result = ICONS[current_gamepad][:axes][id][1 - dir].clone
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -38,6 +38,8 @@ module Settings
|
|||
:SDL_HINT_INVALID_PARAM_CHECKS => false,
|
||||
|
||||
#controls
|
||||
:gamepad_type => -1,
|
||||
:gamepad_face_style => 0,
|
||||
:gamepad_led => true,
|
||||
:gamepad_deadzone => 5,
|
||||
|
||||
|
|
@ -58,66 +60,66 @@ module Settings
|
|||
|
||||
def reset_controls!
|
||||
@data.merge!({
|
||||
:controls_walk_down => [
|
||||
:controls_walk_down => [
|
||||
KeyBind.key(Input::key_from_name("Down")),
|
||||
KeyBind.caxis(Input::c_axis_from_name("LeftY"), KeyBind::Positive),
|
||||
KeyBind.cbutton(Input::c_button_from_name("DpDown"))
|
||||
],
|
||||
:controls_walk_left => [
|
||||
:controls_walk_left => [
|
||||
KeyBind.key(Input::key_from_name("Left")),
|
||||
KeyBind.caxis(Input::c_axis_from_name("LeftX"), KeyBind::Negative),
|
||||
KeyBind.cbutton(Input::c_button_from_name("DpLeft"))
|
||||
],
|
||||
:controls_walk_right => [
|
||||
:controls_walk_right => [
|
||||
KeyBind.key(Input::key_from_name("Right")),
|
||||
KeyBind.caxis(Input::c_axis_from_name("LeftX"), KeyBind::Positive),
|
||||
KeyBind.cbutton(Input::c_button_from_name("DpRight"))
|
||||
],
|
||||
:controls_walk_up => [
|
||||
:controls_walk_up => [
|
||||
KeyBind.key(Input::key_from_name("Up")),
|
||||
KeyBind.caxis(Input::c_axis_from_name("LeftY"), KeyBind::Negative),
|
||||
KeyBind.cbutton(Input::c_button_from_name("DpUp"))
|
||||
],
|
||||
:controls_run => [
|
||||
:controls_run => [
|
||||
KeyBind.key(Input::key_from_name("Left Shift")),
|
||||
KeyBind.caxis(Input::c_axis_from_name("righttrigger"), KeyBind::Positive),
|
||||
KeyBind.cbutton(Input::c_button_from_name("x"))
|
||||
],
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
:controls_action => [
|
||||
:controls_action => [
|
||||
KeyBind.key(Input::key_from_name("Z")),
|
||||
KeyBind.key(Input::key_from_name("Space")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("a")),
|
||||
],
|
||||
:controls_deactivate => [
|
||||
:controls_deactivate => [
|
||||
KeyBind.key(Input::key_from_name("Left Shift")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("back")),
|
||||
KeyBind.caxis(Input::c_axis_from_name("lefttrigger"), KeyBind::Positive),
|
||||
],
|
||||
:controls_cancel => [
|
||||
:controls_cancel => [
|
||||
KeyBind.key(Input::key_from_name("X")),
|
||||
KeyBind.key(Input::key_from_name("Escape")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("b")),
|
||||
],
|
||||
:controls_menu => [
|
||||
:controls_menu => [
|
||||
KeyBind.key(Input::key_from_name("A")),
|
||||
KeyBind.key(Input::key_from_name("Return")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("start")),
|
||||
],
|
||||
:controls_items => [
|
||||
:controls_items => [
|
||||
KeyBind.key(Input::key_from_name("S")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("y")),
|
||||
],
|
||||
:controls_nav_left => [
|
||||
:controls_nav_left => [
|
||||
KeyBind.key(Input::key_from_name("Q")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("leftshoulder")),
|
||||
],
|
||||
:controls_nav_right => [
|
||||
:controls_nav_right => [
|
||||
KeyBind.key(Input::key_from_name("W")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("rightshoulder")),
|
||||
],
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
:controls_debug => [
|
||||
:controls_debug => [
|
||||
KeyBind.key(Input::key_from_name("Left Ctrl")),
|
||||
KeyBind.cbutton(Input::c_button_from_name("rightstick")),
|
||||
],
|
||||
|
|
@ -289,9 +291,50 @@ class Window_Settings
|
|||
},
|
||||
],
|
||||
"Controls" => [
|
||||
{ :type => :sep, :name => "Gamepad" },
|
||||
{
|
||||
:type => :custom,
|
||||
:name => "Face buttons style",
|
||||
:parameter => :gamepad_face_style,
|
||||
:default => 0,
|
||||
:callbacks => {
|
||||
:init => proc { |super_proc|
|
||||
@max_value = 5
|
||||
|
||||
super_proc.call
|
||||
},
|
||||
:get_display_value => proc { |super_proc|
|
||||
"" # meow >w<
|
||||
},
|
||||
:redraw => proc { |super_proc|
|
||||
super_proc.call
|
||||
|
||||
x, y = GamepadIcons.button(Input::GamepadButton::SOUTH, false)
|
||||
y += self.value * ICON_SIZE
|
||||
|
||||
@sprite.bitmap.stretch_blt(Rect.new(PARAMETER_WIDTH - ICON_SIZE * 4 * 2, (PARAMETER_HEIGHT - ICON_SIZE * 2) / 2, ICON_SIZE * 4 * 2, ICON_SIZE * 2), RPG::Cache.menu("gamepad_icons"), Rect.new(x, y, ICON_SIZE * 4, ICON_SIZE))
|
||||
},
|
||||
:value_set => proc { |super_proc, value|
|
||||
if (value != self.value)
|
||||
Audio.se_play(PARAMETER_CHANGE_AUDIO, 70, (value.to_f / @max_value.to_f * 50.0).to_i + 75)
|
||||
end
|
||||
super_proc.call(value)
|
||||
},
|
||||
:value_left => proc { |super_proc|
|
||||
return if @disabled
|
||||
self.value = (self.value - 1) % @max_value
|
||||
@settings_content.redraw_all
|
||||
},
|
||||
:value_right => proc { |super_proc|
|
||||
return if @disabled
|
||||
self.value = (self.value + 1) % @max_value
|
||||
@settings_content.redraw_all
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
:type => :bool,
|
||||
:name => 'Control LED lighting on gamepads',
|
||||
:name => "Control LED lighting on gamepads",
|
||||
:parameter => :gamepad_led
|
||||
},
|
||||
{ :type => :sep, :name => "Walk" },
|
||||
|
|
|
|||
126
scripts/Data_Types.rb
Normal file
126
scripts/Data_Types.rb
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
class Vec2i
|
||||
attr_accessor :x
|
||||
attr_accessor :y
|
||||
|
||||
def initialize(x = 0, y = 0)
|
||||
@x = x
|
||||
@y = y
|
||||
end
|
||||
|
||||
def abs
|
||||
Vec2i.new(@x.abs, @y.abs)
|
||||
end
|
||||
def abs!
|
||||
@x = @x.abs
|
||||
@y = @y.abs
|
||||
end
|
||||
|
||||
def magnitute
|
||||
Math.sqrt(@x * @x + @y * @y)
|
||||
end
|
||||
|
||||
def distance_to(other)
|
||||
if other.is_a? Integer
|
||||
Vec2i.new(
|
||||
@x - other,
|
||||
@y - other
|
||||
).magnitute
|
||||
elsif other.is_a? Float
|
||||
Vec2i.new(
|
||||
@x - other.to_i,
|
||||
@y - other.to_i
|
||||
).magnitute
|
||||
elsif other.is_a? Vec2i
|
||||
Vec2i.new(
|
||||
@x - other.x,
|
||||
@y - other.y
|
||||
).magnitute
|
||||
else
|
||||
raise "Impossible to get distance to an object of type #{other.class} to #{self.class}"
|
||||
end
|
||||
end
|
||||
|
||||
def +(other)
|
||||
if other.is_a? Integer
|
||||
Vec2i.new(
|
||||
@x + other,
|
||||
@y + other
|
||||
)
|
||||
elsif other.is_a? Float
|
||||
Vec2i.new(
|
||||
@x + other.to_i,
|
||||
@y + other.to_i
|
||||
)
|
||||
elsif other.is_a? Vec2i
|
||||
Vec2i.new(
|
||||
@x + other.x,
|
||||
@y + other.y
|
||||
)
|
||||
else
|
||||
raise "Impossible to add an object of type #{other.class} to #{self.class}"
|
||||
end
|
||||
end
|
||||
|
||||
def -(other)
|
||||
if other.is_a? Integer
|
||||
Vec2i.new(
|
||||
@x - other,
|
||||
@y - other
|
||||
)
|
||||
elsif other.is_a? Float
|
||||
Vec2i.new(
|
||||
@x - other.to_i,
|
||||
@y - other.to_i
|
||||
)
|
||||
elsif other.is_a? Vec2i
|
||||
Vec2i.new(
|
||||
@x - other.x,
|
||||
@y - other.y
|
||||
)
|
||||
else
|
||||
raise "Impossible to subtract an object of type #{other.class} to #{self.class}"
|
||||
end
|
||||
end
|
||||
|
||||
def *(other)
|
||||
if other.is_a? Integer
|
||||
Vec2i.new(
|
||||
@x * other,
|
||||
@y * other
|
||||
)
|
||||
elsif other.is_a? Float
|
||||
Vec2i.new(
|
||||
@x * other.to_i,
|
||||
@y * other.to_i
|
||||
)
|
||||
elsif other.is_a? Vec2i
|
||||
Vec2i.new(
|
||||
@x * other.x,
|
||||
@y * other.y
|
||||
)
|
||||
else
|
||||
raise "Impossible to add an object of type #{other.class} to #{self.class}"
|
||||
end
|
||||
end
|
||||
|
||||
def /(other)
|
||||
if other.is_a? Integer
|
||||
Vec2i.new(
|
||||
@x / other,
|
||||
@y / other
|
||||
)
|
||||
elsif other.is_a? Float
|
||||
Vec2i.new(
|
||||
@x / other.to_i,
|
||||
@y / other.to_i
|
||||
)
|
||||
elsif other.is_a? Vec2i
|
||||
Vec2i.new(
|
||||
@x / other.x,
|
||||
@y / other.y
|
||||
)
|
||||
else
|
||||
raise "Impossible to subtract an object of type #{other.class} to #{self.class}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -342,11 +342,11 @@ class Window_Settings
|
|||
@sprite.bitmap = Bitmap.new(PARAMETER_WIDTH, PARAMETER_HEIGHT + 1)
|
||||
@sprite.bitmap.font.size = 20
|
||||
|
||||
if @icon_position
|
||||
@icon = Sprite.new(@settings_content.viewport)
|
||||
@icon.bitmap = Bitmap.new(ICON_SIZE, ICON_SIZE)
|
||||
@icon.zoom_x = @icon.zoom_y = 2
|
||||
end
|
||||
#if @icon_position
|
||||
# @icon = Sprite.new(@settings_content.viewport)
|
||||
# @icon.bitmap = Bitmap.new(ICON_SIZE, ICON_SIZE)
|
||||
# @icon.zoom_x = @icon.zoom_y = 2
|
||||
#end
|
||||
|
||||
Language.register_text_sprite("settings_parameter #{screen_id}-#{position}", @sprite)
|
||||
|
||||
|
|
@ -392,8 +392,9 @@ class Window_Settings
|
|||
|
||||
def redraw_icon()
|
||||
if @icon_position
|
||||
@icon.bitmap.clear
|
||||
@icon.bitmap.blt(0, 0, RPG::Cache.menu("icons"), Rect.new(@icon_position[0] * ICON_SIZE, @icon_position[1] * ICON_SIZE, ICON_SIZE, ICON_SIZE))
|
||||
#@icon.bitmap.clear
|
||||
#@icon.bitmap.blt(0, 0, RPG::Cache.menu("icons"), Rect.new(@icon_position[0] * ICON_SIZE, @icon_position[1] * ICON_SIZE, ICON_SIZE, ICON_SIZE))
|
||||
@sprite.bitmap.stretch_blt(Rect.new(0, 0, 32, 32), RPG::Cache.menu("icons"), Rect.new(@icon_position[0] * ICON_SIZE, @icon_position[1] * ICON_SIZE, ICON_SIZE, ICON_SIZE))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -418,18 +419,18 @@ class Window_Settings
|
|||
@sprite.y = @settings_content.visible_y + @position * PARAMETER_HEIGHT
|
||||
@sprite.opacity = ((1.0 + ((@sprite.y - @settings_content.offset).to_f / 64.0).clamp(-1.0, 0.0)) * @opacity * (@settings_content.opacity.to_f / 255.0) * disabled_opacity * 255.0).to_i
|
||||
|
||||
if @icon_position
|
||||
@icon.opacity = (@opacity * (@settings_content.opacity.to_f / 255.0) * disabled_opacity * 255.0)
|
||||
@icon.x = @sprite.x
|
||||
@icon.y = @sprite.y - (PARAMETER_HEIGHT - ICON_SIZE * 2) / 2
|
||||
end
|
||||
#if @icon_position
|
||||
# @icon.opacity = (@opacity * (@settings_content.opacity.to_f / 255.0) * disabled_opacity * 255.0)
|
||||
# @icon.x = @sprite.x
|
||||
# @icon.y = @sprite.y - (PARAMETER_HEIGHT - ICON_SIZE * 2) / 2
|
||||
#end
|
||||
end
|
||||
|
||||
def dispose()
|
||||
@sprite.dispose
|
||||
if @icon_position
|
||||
@icon.dispose
|
||||
end
|
||||
#if @icon_position
|
||||
# @icon.dispose
|
||||
#end
|
||||
end
|
||||
|
||||
def value_left() end
|
||||
|
|
@ -744,8 +745,20 @@ class Window_Settings
|
|||
@sprite.bitmap.draw_text(offset, 0, @sprite.bitmap.width - PARAMETER_KEY_WIDTH * 4 - offset, @sprite.bitmap.height, tr(@name))
|
||||
for i in 0..3
|
||||
offset = (@selected && i == @selection ? SELECTED_KEYS_MARGIN : 4)
|
||||
parameter_x = @sprite.bitmap.width - PARAMETER_KEY_WIDTH * (4 - i) + offset
|
||||
@sprite.bitmap.draw_text(parameter_x, 0, PARAMETER_KEY_WIDTH - offset * 2, @sprite.bitmap.height, @waiting_for_key && i == @selection ? tr("Press a key") : tr(get_display_value(i)), 1)
|
||||
parameter_x = @sprite.bitmap.width - PARAMETER_KEY_WIDTH * (4 - i)
|
||||
key_bind = @key_binds[i]
|
||||
if key_bind && key_bind.type > KeyBind::Type::Key && key_bind.type < KeyBind::Type::JButton
|
||||
icon_x, icon_y = case key_bind.type
|
||||
when KeyBind::Type::CButton
|
||||
GamepadIcons.button(key_bind.button)
|
||||
when KeyBind::Type::CAxis
|
||||
GamepadIcons.axis(key_bind.axis, key_bind.dir)
|
||||
end
|
||||
|
||||
@sprite.bitmap.stretch_blt(Rect.new(parameter_x + PARAMETER_KEY_WIDTH / 2 - ICON_SIZE, @sprite.bitmap.height / 2 - ICON_SIZE, ICON_SIZE * 2, ICON_SIZE * 2), RPG::Cache.menu("gamepad_icons"), Rect.new(icon_x * ICON_SIZE, icon_y * ICON_SIZE, ICON_SIZE, ICON_SIZE))
|
||||
else
|
||||
@sprite.bitmap.draw_text(parameter_x + offset, 0, PARAMETER_KEY_WIDTH - offset * 2, @sprite.bitmap.height, @waiting_for_key && i == @selection ? tr("Press a key") : tr(get_display_value(i)), 1)
|
||||
end
|
||||
@sprite.bitmap.fill_rect(Rect.new(@sprite.bitmap.width - PARAMETER_KEY_WIDTH * (4 - i) - 1, 1, 2, @sprite.bitmap.height - 2), Color.new(255, 255, 255, 32))
|
||||
end
|
||||
|
||||
|
|
@ -866,4 +879,82 @@ class Window_Settings
|
|||
$game_system.se_play($data_system.buzzer_se)
|
||||
end
|
||||
end
|
||||
|
||||
class CustomParameter < BaseParameter
|
||||
TYPE = :custom
|
||||
def initialize(settings_content, screen_id, position, name, icon, parameter, init_value, callbacks)
|
||||
@callbacks = callbacks
|
||||
|
||||
callback(:init, settings_content, screen_id, position, name, icon, parameter, init_value, callbacks) do
|
||||
super(settings_content, screen_id, position, name, icon, parameter, init_value)
|
||||
end
|
||||
end
|
||||
def callback(name, *args)
|
||||
original = proc { yield if block_given? }
|
||||
|
||||
if proc = @callbacks[name]
|
||||
instance_exec(original, *args, &proc)
|
||||
else
|
||||
original.call
|
||||
end
|
||||
end
|
||||
|
||||
def opacity
|
||||
callback(:opacity_get) do super end
|
||||
end
|
||||
def opacity=(value)
|
||||
callback(:opacity_set, value) do super(value) end
|
||||
end
|
||||
|
||||
def value
|
||||
callback(:value_get) do super end
|
||||
end
|
||||
def value=(value)
|
||||
callback(:value_set, value) do super(value) end
|
||||
end
|
||||
|
||||
def name
|
||||
callback(:name_get) do super end
|
||||
end
|
||||
def name=(name)
|
||||
callback(:name_set, name) do super(name) end
|
||||
end
|
||||
|
||||
def get_display_value
|
||||
callback(:get_display_value) do super end
|
||||
end
|
||||
|
||||
def redraw_icon
|
||||
callback(:redraw_icon) do super end
|
||||
end
|
||||
|
||||
def redraw
|
||||
callback(:redraw) do super end
|
||||
end
|
||||
|
||||
def update
|
||||
callback(:update) do super end
|
||||
end
|
||||
|
||||
def dispose
|
||||
callback(:dispose) do super end
|
||||
end
|
||||
|
||||
def value_left
|
||||
callback(:value_left) do super end
|
||||
end
|
||||
def value_right
|
||||
callback(:value_right) do super end
|
||||
end
|
||||
def action
|
||||
callback(:action) do super end
|
||||
end
|
||||
# only for visual updating, its not selecting for real
|
||||
def select(previous)
|
||||
callback(:select, previous) do super(previous) end
|
||||
end
|
||||
def deselect
|
||||
callback(:deselect) do super end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -72,10 +72,6 @@ class Window_Settings
|
|||
parameter = @content.add_parameter(screen_title, Separator.new(@content, screen_index, parameter_index, ""))
|
||||
else
|
||||
case parameter_info[:type]
|
||||
when :base
|
||||
parameter =
|
||||
@content.add_parameter(screen_title, BaseParameter.new(@content, screen_index, parameter_index,
|
||||
parameter_info[:name], parameter_info[:icon], parameter_info[:parameter], parameter_info[:default]))
|
||||
when :bool
|
||||
parameter =
|
||||
@content.add_parameter(screen_title, BoolParameter.new(@content, screen_index, parameter_index,
|
||||
|
|
@ -119,6 +115,15 @@ class Window_Settings
|
|||
@content.add_parameter(screen_title, ActionParameter.new(@content, screen_index, parameter_index,
|
||||
parameter_info[:name], parameter_info[:icon], parameter_info[:default], parameter_info[:action],
|
||||
parameter_info[:arg1], parameter_info[:arg2], parameter_info[:arg3], parameter_info[:arg4]))
|
||||
when :custom
|
||||
parameter =
|
||||
@content.add_parameter(screen_title, CustomParameter.new(@content, screen_index, parameter_index,
|
||||
parameter_info[:name], parameter_info[:icon], parameter_info[:parameter], parameter_info[:default],
|
||||
parameter_info[:callbacks]))
|
||||
else
|
||||
parameter =
|
||||
@content.add_parameter(screen_title, BaseParameter.new(@content, screen_index, parameter_index,
|
||||
parameter_info[:name], parameter_info[:icon], parameter_info[:parameter], parameter_info[:default]))
|
||||
end
|
||||
end
|
||||
parameter.disabled = true if parameter_info[:disabled] && parameter
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ i18n_English
|
|||
#i18n_Japanese
|
||||
|
||||
# Data
|
||||
Data_Types
|
||||
Data_Item
|
||||
Data_Footsteps
|
||||
Data_SpecialEventData
|
||||
|
|
|
|||
Loading…
Reference in a new issue