ZakatTeamI2P 2026-03-30 14:42:20 +04:00
parent 87819a0f66
commit ceceda1f04
9 changed files with 96 additions and 137 deletions

View file

@ -1,86 +1,6 @@
# mkxp-oneshot
# mkxp-sunshine
This is a specialized fork of [mkxp by Ancurio](https://github.com/Ancurio/mkxp) designed for [*OneShot*](http://oneshot-game.com/).
This is a specialized fork of [mkxp-oneshot](https://github.com/elizagamedev/mkxp-oneshot) designed for OneShot: sunshine.
Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimplementation of the journal program!
> mkxp is a project that seeks to provide a fully open source implementation of the Ruby Game Scripting System (RGSS) interface used in the popular game creation software "RPG Maker XP", "RPG Maker VX" and "RPG Maker VX Ace" (trademark by Enterbrain, Inc.), with focus on Linux. The goal is to be able to run games created with the above software natively without changing a single file.
>
> It is licensed under the GNU General Public License v2+.
*OneShot* also makes use of [steamshim](https://hg.icculus.org/icculus/steamshim/) for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details.
## Building (Supported on Windows, Ubuntu Linux, in progress on macOS)
Preface: This only supports Visual Studio on Windows and Xcode on macOS. Ubuntu should work with either GCC or clang. You can probably compile with other platforms/setups, but beware.
With Python 3 and pip installed, install Conan via `pip3 install conan`. Afterwards, add the necessary package repositories by adding running the following commands:
```sh
conan remote add eliza https://rkevin.jfrog.io/artifactory/api/conan/eliza
conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan
conan config set general.revisions_enabled=1
setx CONAN_USE_ALWAYS_SHORT_PATHS 1 (windows only)
```
Prepare to build *OneShot* by installing the necessary dependencies with Conan.
```sh
cd mkxp-oneshot
mkdir build
cd build
conan install .. --build=missing
```
Hopefully, this should complete without error. It may take quite a while to build all of the dependencies.
On Ubuntu, make sure you install the necessary dependencies before building *OneShot* proper:
```sh
sudo apt install libgtk2.0-dev libxfconf-0-dev
```
Finally, you can build the project by running the following:
```sh
conan build ..
```
On Linux, you likely want to generate an AppImage. Please refer to how to build the Journal app below, as this is a prerequisite for building the AppImage. Afterwards, you may run the command, from the root directory of the repository:
```sh
./make-appimage.sh . build /path/to/game/files /path/to/journal/_______ /some/path/OneShot.AppImage`
```
Requires [linuxdeploy](https://github.com/linuxdeploy/linuxdeploy) and [AppImageTool](https://github.com/AppImage/AppImageKit) in your `PATH`.
## Building the Journal app on Unix systems
As a prerequisite on Ubuntu, ensure that the following packages are installed.
```sh
sudo apt install python3-venv libxcb-xinerama
```
Then run the script. From the root of the repository:
```sh
./make-journal-linux.sh . /path/to/journal/parent/directory/
```
This will generate a file called `_______`.
### Supported image/audio formats
These depend on the SDL auxiliary libraries. *OneShot* only makes use of bmp/png for images and oggvorbis/wav for audio.
To run *OneShot*, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed.
## Configuration
*OneShot* reads configuration data from the file "oneshot.conf". The format is ini-style. Do *not* use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'oneshot.conf.sample' for a list of accepted entries.
All option entries can alternatively be specified as command line options. Any options that are not arrays (eg. preloaded scripts) specified as command line options will override entries in oneshot.conf. Note that you will have to wrap values containing spaces in quotes (unlike in oneshot.conf).
The syntax is: `--<option>=<value>`
Example: `./oneshot --gameFolder="oneshot" --vsync=true`
# xScripts.rxdata
./rpgscript.rb scripts/ [GameDir]

View file

@ -153,9 +153,16 @@ class Journal(QWidget):
self.close_label.hide()
self.close_button = False
if lang == 'en': img = os.path.join(base_path, 'images', '{}.png'.format(name))
else: img = os.path.join(base_path, 'images', lang.upper(), '{}.png'.format(name))
if not os.path.exists(img): return
img = img_en = os.path.join(base_path, 'images', '{}.png'.format(name))
if lang != 'en':
img = os.path.join(base_path, 'images', lang.upper(), '{}.png'.format(name))
if not os.path.exists(img):
print("No image {!r} for locale {!r}".format(name, lang), file=sys.stderr)
img = img_en
if not os.path.exists(img):
print("Image not found: {!r}".format(img), file=sys.stderr)
return
self.pixmap = QPixmap(img)
self.label.setPixmap(self.pixmap)

View file

@ -51,6 +51,7 @@ class FastTravel
end
zone = ZONES[$game_fasttravel.zone]
# Create title
@title.bitmap.clear
@title.bitmap.draw_text(0, 0, @title.bitmap.width, @title.bitmap.height, zone.name)

View file

@ -55,27 +55,27 @@ class Game_Map
'codebg'
]
CLAMPED_X = [
]
]
CLAMPED_Y = [
'red_obsdesk',
]
]
ANIMATED = [
'blue_water',
]
]
FADE_ANIMATION_PANORAMA = [
'dark_water',
'green_water',
]
]
ONETOONE = [
'blue_water',
'green_water',
'dark_water',
]
]
NOZOOM = [
'dark_water',
#'green_water',
]
]
ALWAYS_MOVING = [
'codebg'
]
@ -165,10 +165,10 @@ class Game_Map
@clamped_x = false
@clamped_y = false
end
@always_moving = ALWAYS_MOVING.include? @panorama_name
@pan_move_offset = 0
@always_moving = ALWAYS_MOVING.include? @panorama_name
@pan_move_offset = 0
# Animated/One-to-one/zoom
@pan_animate = ANIMATED.include? @panorama_name
@pan_fade_animate = FADE_ANIMATION_PANORAMA.include? @panorama_name
@ -260,51 +260,51 @@ class Game_Map
# Clear refresh request flag
@need_refresh = false
end
#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
if $game_switches[98] == true
if $game_switches[98] == true
@display_y = [@display_y + distance, (self.height - 15) * 128].min
else
else
@display_y += distance
end
end
end
#--------------------------------------------------------------------------
# * Scroll Left
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_left(distance)
if $game_switches[98] == true
if $game_switches[98] == true
@display_x = [@display_x - distance, 0].max
else
else
@display_x -= distance
end
end
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
if $game_switches[98] == true
if $game_switches[98] == true
@display_x = [@display_x + distance, (self.width - 20) * 128].min
else
else
@display_x += distance
end
end
end
#--------------------------------------------------------------------------
# * Scroll Up
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_up(distance)
if $game_switches[98] == true
if $game_switches[98] == true
@display_y = [@display_y - distance, 0].max
else
else
@display_y -= distance
end
end
end
#--------------------------------------------------------------------------
# * Determine Valid Coordinates
@ -341,15 +341,15 @@ class Game_Map
# If blank tile
if event.tile_id == 0 && event.character_name.empty?
return false
# If obstacle bit is set
# If obstacle bit is set
elsif @passages[event.tile_id] & bit != 0
# impassable
return false
# If obstacle bit is set in all directions
# If obstacle bit is set in all directions
elsif @passages[event.tile_id] & 0x0f == 0x0f
# impassable
return false
# If priorities other than that are 0
# If priorities other than that are 0
elsif @priorities[event.tile_id] == 0
# passable
return true
@ -374,11 +374,11 @@ class Game_Map
if @passages[tile_id] & bit != 0
# impassable
return false
# If obstacle bit is set in all directions
# If obstacle bit is set in all directions
elsif @passages[tile_id] & 0x0f == 0x0f
# impassable
return false
# If priorities other than that are 0
# If priorities other than that are 0
elsif @priorities[tile_id] == 0
# passable
return true

View file

@ -104,7 +104,7 @@ class Scene_Load < Scene_File
# check for debug file to add debug items
if File.exists?("debug_tester.dat")
if Window_Settings.DebugIsEnabled = true
# debug save
$game_party.gain_item(54, 1)
# plight skip

View file

@ -5,6 +5,7 @@
#==============================================================================
class Scene_Map
attr_accessor :in_game_timer
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
@ -103,12 +104,12 @@ class Scene_Map
#--------------------------------------------------------------------------
def update
if $game_temp.igt_timer_visible && (Graphics.frame_count != nil)
total_sec = Graphics.frame_count / Graphics.frame_rate
hour = total_sec / 60 / 60
min = total_sec / 60 % 60
sec = total_sec % 60
millisec = ((Graphics.frame_count * 1000) / Graphics.frame_rate) % 1000
time_string = sprintf("%02d:%02d:%02d.%03d", hour, min, sec, millisec)
total_sec = Graphics.frame_count.to_f / Graphics.frame_rate
time_string = sprintf("%02d:%02d:%02d.%03d",
total_sec / 3600,
total_sec / 60 % 60,
total_sec % 60,
total_sec * 1000 % 1000)
@in_game_timer.bitmap.fill_rect(0, 0, 140, 30, Color.new(0, 0, 0, 128))
@in_game_timer.bitmap.draw_text(8, 0, 132, 30, time_string)
@ -320,7 +321,7 @@ class Scene_Map
# Chroma.playAnim("chroma/Random_Keyboard.chroma", false);
#end
# If debug mode is ON and F9 key was pressed
if Input.press?(Input::F9) && File.exists?("debug_tester.dat")
if Input.press?(Input::F9) && Window_Settings.DebugIsEnabled = true
# Set debug calling flag
$game_temp.debug_calling = true
end

View file

@ -33,10 +33,6 @@ class Scene_Title
# Make system object
$game_system = Game_System.new
if File.exists?("igt.ini")
$game_temp.igt_timer_visible = true
end
# Skip title screen if debug mode (or demo, but not GDC)
if $debug || ($demo && !$GDC) || save_exists
$game_map.update
@ -61,7 +57,7 @@ class Scene_Title
end
# check for debug file to add debug items
if File.exists?("debug_tester.dat")
if Window_Settings.DebugIsEnabled = true
# debug save
$game_party.gain_item(54, 1)
# plight skip

View file

@ -2,8 +2,7 @@ PROTO_TEXT = "put me in the big portal"
CEDRIC_TEXT = "put me in the big portal"
RUE_TEXT = "put me in the big portal"
# Gnome 3 does not show desktop entries in Nautilus.
SUPPORTED_DE = ["cinnamon", "mate", "kde", "xfce"]
SUPPORTED_DE = ["cinnamon", "mate", "kde", "xfce", "gnome", "lxde", "lxqt"]
module Script
def self.px

View file

@ -6,7 +6,10 @@ class Window_Settings
VALUE_MARGIN = 270
ACTIVE_MARGIN = MARGIN * 2 + 20
SETTINGS_FILE_NAME = Oneshot::SAVE_PATH + '/settings.conf'
class << self
attr_accessor :DebugIsEnabled
end
@DebugIsEnabled = false
def save_settings
$persistent.save
File.open(SETTINGS_FILE_NAME, 'w') do |file|
@ -17,6 +20,8 @@ class Window_Settings
file.puts('colorblind_mode=' + $game_switches[252].to_s)
file.puts('automash_enabled=' + $game_switches[253].to_s)
file.puts('frameskip=' + Graphics.frameskip.to_s)
file.puts('in_game_timer=' + $game_temp.igt_timer_visible.to_s)
file.puts('debug=' + Window_Settings.DebugIsEnabled.to_s)
end
end
@ -64,16 +69,25 @@ class Window_Settings
elsif vals[1] == "false"
$game_switches[253] = false
end
when "in_game_timer"
timer_enabled = vals[1] == "true"
$game_temp.igt_timer_visible = timer_enabled
$scene.in_game_timer.visible = timer_enabled if $scene.is_a?(Scene_Map)
when "frameskip"
if vals[1] == "true"
Graphics.frameskip = true
elsif vals[1] == "false"
Graphics.frameskip = false
end
when "debug"
if vals[1] == "true"
Window_Settings.DebugIsEnabled = true
elsif vals[1] == "false"
Window_Settings.DebugIsEnabled = false
end
end
end
end
def initialize
@viewport = Viewport.new(0, 0, 640, 480)
@bg = Sprite.new(@viewport)
@ -128,7 +142,9 @@ class Window_Settings
tr('Colorblind mode'),
tr('Skip Text (R)'),
tr('Frameskip'),
tr('In-Game Timer'),
tr('Language'),
tr('Debug mode(DEVELOPERS ONLY!)'),
tr('Configure Controls (Press F1)'),
]
@ -203,9 +219,18 @@ class Window_Settings
else
spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF"))
end
when 7 # Language
when 7 # In-game timer
text = tr($game_temp.igt_timer_visible ? "ON" : "OFF")
spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, text)
when 8 # Language
l = Language::LANGUAGES[@lang_index] rescue Language::LANGUAGES[0]
spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr(l))
when 9
if(Window_Settings.DebugIsEnabled == true)
spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("ON"))
else
spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF"))
end
end
end
@ -423,8 +448,13 @@ class Window_Settings
end
redraw_setting_index(6)
end
when 7 #language
when 7 # In-game timer
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)
$game_temp.igt_timer_visible = !$game_temp.igt_timer_visible
$scene.in_game_timer.visible = $game_temp.igt_timer_visible if $scene.is_a?(Scene_Map)
redraw_setting_index(7)
end
when 8 #language
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::RIGHT)
@lang_index += 1
if @lang_index >= Language::LANGUAGES.length
@ -441,6 +471,11 @@ class Window_Settings
$persistent.lang = Language::LANGUAGES[@lang_index]
redraw_all_settings()
end
when 9
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)
Window_Settings.DebugIsEnabled = !Window_Settings.DebugIsEnabled
redraw_setting_index(9)
end
end
if Input.trigger?(Input::CANCEL)