I hate ruby
This commit is contained in:
parent
12eb014d73
commit
ff714cd0ac
|
|
@ -279,6 +279,7 @@ set(BINDING_SOURCE
|
||||||
binding-mri/journal-binding.cpp
|
binding-mri/journal-binding.cpp
|
||||||
binding-mri/chroma-binding.cpp
|
binding-mri/chroma-binding.cpp
|
||||||
binding-mri/niko-binding.cpp
|
binding-mri/niko-binding.cpp
|
||||||
|
binding-mri/time-binding.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS})
|
source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS})
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ void windowBindingInit();
|
||||||
void tilemapBindingInit();
|
void tilemapBindingInit();
|
||||||
void windowVXBindingInit();
|
void windowVXBindingInit();
|
||||||
void tilemapVXBindingInit();
|
void tilemapVXBindingInit();
|
||||||
|
void TimeBindingInit();
|
||||||
|
|
||||||
void inputBindingInit();
|
void inputBindingInit();
|
||||||
void audioBindingInit();
|
void audioBindingInit();
|
||||||
|
|
@ -107,6 +108,8 @@ static void mriBindingInit(){
|
||||||
windowBindingInit();
|
windowBindingInit();
|
||||||
tilemapBindingInit();
|
tilemapBindingInit();
|
||||||
|
|
||||||
|
TimeBindingInit();
|
||||||
|
|
||||||
inputBindingInit();
|
inputBindingInit();
|
||||||
audioBindingInit();
|
audioBindingInit();
|
||||||
graphicsBindingInit();
|
graphicsBindingInit();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
#include <ruby.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
static VALUE get_month(VALUE self) {
|
||||||
|
time_t now = time(NULL);
|
||||||
|
struct tm *ltm = localtime(&now);
|
||||||
|
return INT2NUM(1 + ltm->tm_mon);
|
||||||
|
}
|
||||||
|
|
||||||
|
static VALUE get_day(VALUE self) {
|
||||||
|
time_t now = time(NULL);
|
||||||
|
struct tm *ltm = localtime(&now);
|
||||||
|
return INT2NUM(ltm->tm_mday);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TimeBindingInit() {
|
||||||
|
printf("[TimeBindingInit] Initializing Time binding\n");
|
||||||
|
VALUE m = rb_define_module("CTime");
|
||||||
|
rb_define_module_function(m, "month", get_month, 0);
|
||||||
|
rb_define_module_function(m, "day", get_day, 0);
|
||||||
|
printf("[TimeBindingInit] Done\n");
|
||||||
|
}
|
||||||
|
|
@ -291,7 +291,7 @@ class Game_Player < Game_Character
|
||||||
@wheel_squeak = false
|
@wheel_squeak = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Audio.se_play("Audio/SE/#{name}.wav", (vol * volume).to_i, pitch.to_i)
|
Audio.se_play("Audio/SE/#{name}.wav", vol * volume, pitch)
|
||||||
end
|
end
|
||||||
emit_footsplash(@direction)
|
emit_footsplash(@direction)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,8 @@ module RPG
|
||||||
#lowercasing facepic name to be more case insensitive
|
#lowercasing facepic name to be more case insensitive
|
||||||
#to catch the few instances where we use "Niko" instead of "niko"
|
#to catch the few instances where we use "Niko" instead of "niko"
|
||||||
filename = filename.downcase
|
filename = filename.downcase
|
||||||
|
|
||||||
#april fools!
|
#april fools!
|
||||||
t = Time.now
|
if CTime.month == 4 && CTime.day == 1 && filename.start_with?("niko")
|
||||||
if t.month == 4 && t.day == 1 && filename.start_with?("niko")
|
|
||||||
filename = "af"
|
filename = "af"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
class Scene_Title
|
class Scene_Title
|
||||||
MENU_X = 640 - 150
|
MENU_X = 640 - 150
|
||||||
MENU_Y = 480 - 100
|
MENU_Y = 480 - 100
|
||||||
|
SDLVer = "#{Sunshine::SDLVersion_major}.#{Sunshine::SDLVersion_minor}.#{Sunshine::SDLVersion_micro}"
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Main Processing
|
# * Main Processing
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
@ -68,11 +68,14 @@ class Scene_Title
|
||||||
@menu = Sprite.new
|
@menu = Sprite.new
|
||||||
@menu.z += 1
|
@menu.z += 1
|
||||||
@menu.bitmap = Bitmap.new(640, 480)
|
@menu.bitmap = Bitmap.new(640, 480)
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
|
#Debug info like in minecraft Forge :P
|
||||||
|
@menu.bitmap.draw_text(5, 5, 150, 20, tr("Ruby: #{RUBY_VERSION}"))
|
||||||
|
@menu.bitmap.draw_text(5, 25, 150, 20, tr("SDL: #{SDLVer}"))
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
end
|
end
|
||||||
Language.register_text_sprite(self.class.name + "_contents", @menu.bitmap)
|
Language.register_text_sprite(self.class.name + "_contents", @menu.bitmap)
|
||||||
# Make cursor graphic
|
# Make cursor graphic
|
||||||
|
|
@ -131,11 +134,13 @@ class Scene_Title
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def update
|
def update
|
||||||
@menu.bitmap.clear
|
@menu.bitmap.clear
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
|
@menu.bitmap.draw_text(5, 5, 150, 20, tr("Ruby: #{RUBY_VERSION}"))
|
||||||
|
@menu.bitmap.draw_text(5, 25, 150, 20, tr("SDL: #{SDLVer}"))
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
# @menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
end
|
end
|
||||||
# Handle cursor movement
|
# Handle cursor movement
|
||||||
if !@window_settings_title.visible
|
if !@window_settings_title.visible
|
||||||
|
|
|
||||||
|
|
@ -394,8 +394,7 @@ class Window_Message < Window_Selectable
|
||||||
else
|
else
|
||||||
if @blip >= BLIP_TIME
|
if @blip >= BLIP_TIME
|
||||||
#april fools
|
#april fools
|
||||||
t = Time.now
|
if $game_temp.message_face != nil && CTime.month == 4 && CTime.day == 1 && $game_temp.message_face.start_with?("niko")
|
||||||
if $game_temp.message_face != nil && t.month == 4 && t.day == 1 && $game_temp.message_face.start_with?("niko")
|
|
||||||
niko_sounds = [ "cat_2"]
|
niko_sounds = [ "cat_2"]
|
||||||
@blipsound = niko_sounds[rand(niko_sounds.length)]
|
@blipsound = niko_sounds[rand(niko_sounds.length)]
|
||||||
Audio.se_play("Audio/SE/#{@blipsound}.wav", 50, rand(100..125)) unless @text.empty?
|
Audio.se_play("Audio/SE/#{@blipsound}.wav", 50, rand(100..125)) unless @text.empty?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue