105 Commits
Author SHA1 Message Date
Ghabry 22f028e842 Migrate to std::string_view 2025-03-02 19:38:55 +01:00
Ghabry f973842eeb Font: Prepare for HarfBuzz shaping support
First make all Font handling go through Text namespace.
Text contains the high level API for interacting with the Font class.

This makes it possible to simplify the Font class by only handling char32_t.
2023-03-01 16:43:10 +01:00
rueter37 fb286adc5b Make the number of level digits dependent on the global maximum level
The number of level digits is now dependent on the global maximum
level setting instead of the maximum level of the actor. This fixes
a small optical issue with the level indent if you have actors in
the party which can reach level 100 or greater and actors which
can reach at most level 99.
2022-05-07 05:18:17 +02:00
Ghabry a7a160f2bb Improve code for GetMaxLevel
Clamp Exp values
2021-08-31 17:33:19 +02:00
Ghabry 48bda49b62 Pass all MaxHp/Sp/StatValue through Game_Battler
Makes the code easier to read and easier to extend later when there are per-battler limits
2021-08-31 17:33:19 +02:00
rueter37 1caca701d5 Add setting for maximum level
The maximum level can now be set in the database. If it is
unset, the default value is used depending on the engine.
2021-08-31 17:33:19 +02:00
rueter37 961164f09e Add setting for maximum EXP value
The maximum EXP value can now be set in the database. If it is
unset, the default value is used depending on the engine.
2021-08-31 17:33:19 +02:00
rueter37 170c16533c Add GetValueFontColor function
The function GetValueFontColor has been added now. This returns a
color value depending on the value in relation to the maximum
value.
2021-04-13 17:38:18 +02:00
rueter37 9497461718 Add DrawActorHpValue and DrawActorSpValue functions
The new DrawActorHpValue and DrawActorSpValue functions draws the HP
or SP value without the stat name and maximum value. This is used now
in RPG Maker 2003 traditional battle mode where only the HP value
(without maximum) is shown in the battle window.
2021-04-13 17:38:18 +02:00
rueter37 6f0f03c943 Battle 2k3: Add transparent gauge in alternative battle mode
If the battle mode is alternative and the window is set to opaque,
then display the gauges with an alpha of 96.
2021-04-13 17:38:14 +02:00
Matthew Fioravante 60d3d45544 Battle2k Refactor UI windows 2021-03-11 20:14:26 -05:00
rueter37 84de7d2310 Disallow system updates on closing windows
System changes are now applied after the window has been closed.
2021-02-10 09:22:59 +01:00
Matthew Fioravante e38d5951af Use Game_System object 2020-09-30 10:06:33 -04:00
Matthew Fioravante 57d0108e9b Terms: Use DBString 2020-09-01 16:45:19 -04:00
Matthew Fioravante 155257f898 Game_Actor::GetFaceName - use StringView 2020-09-01 16:45:18 -04:00
Matthew Fioravante 91c81feeb3 Fix gauge_w div by 0 bug 2020-07-12 10:06:16 -04:00
Matthew Fioravante 3827a22a61 Fix divide by 0 bug in atb gauge rendering 2020-07-12 09:57:26 -04:00
Matthew Fioravante 3b11e72576 Apply lcf/rpg namespace and header changes 2020-05-23 19:11:03 -04:00
Matthew Fioravante d8d30f2149 Use namespaced liblcf 2020-05-23 19:11:02 -04:00
Matthew Fioravante d3597b279a Battle 2k3: Fix ATB Gauge update algorithm 2020-05-10 16:25:34 -04:00
Matthew Fioravante cb1b434058 Introduce Drawable::Flags 2020-01-24 20:01:42 -05:00
Matthew Fioravante 96de8a8050 Fix HP and SP display in skills menu and others. 2020-01-09 20:37:03 -05:00
Matthew Fioravante 599090ba15 Fix SP and EXP display in menu for 2k3 2020-01-08 11:54:23 -05:00
Matthew Fioravante a823a5426a Add F12 Quit window.
When you hold F12 a window appears and counts down. Once
countdown is complete, we reset to title screen.

Replaces 2k3e Alt+F12 feature. Enabled for all versions of the engine.

Also fixes a crash with F12, we capture old_scene before
checking for reset.
2019-12-27 02:17:42 -05:00
Matthew Fioravante 5e6f315b2e Refactor Opacity
* Move to header
* Make constexpr
2019-12-22 12:09:31 -05:00
Matthew Fioravante c9dd155ba7 Refactor Cache::System() again
Make Cache::System() return null and add
Cache::SystemOrBlack().

This would avoid potential flickering in cases where
async system graphic change from nothing to something.

Also, consistent with Cache::System2()
2019-08-15 19:07:07 -04:00
Matthew Fioravante 35fcca59b5 Refactor system2
* Only load system2 in one place - on first 2k3 battle.
* Don't draw anything if there is no system2 graphic (RPG_RT)
2019-08-15 19:07:07 -04:00
Matthew Fioravante 78e74efec9 Refactor game system
* RPG_RT compatible LSD chunks
* If graphics_name.empty(), message_stretch and font_id are 0
  and we fallback to database
* If !graphics_name.empty(), all 3 parameters are taken literally

* Refactor the Game_System Set() interface to uphold these invariants
* Refactor the Game_System Get() interface to fallback

* Encapsulate graphic change logic within the Cache to simplify users of
system graphics.

* Reset system graphic when returning the to the title screen.
2019-08-15 19:07:07 -04:00
Matthew Fioravante 36dc4b2704 AsyncHandler: Add IsGraphicFile() concept
Any graphical asset gets this flag.
2019-04-07 10:44:19 -04:00
Matthew Fioravante 9f90421e0b Fix first frame flicker when battle menu moves - rm2k 2018-11-18 18:51:12 -05:00
Albeleon 25b5605220 "2.3: RM2000 + RM2003: The battle command window (both left [manual, automatic, escape] and right [attack, skill, defend, objects]) should move smoothly of position from one another instead of immediately (in RM2003, type of Window Battle Screen B and C)." 2018-11-18 18:51:11 -05:00
Ghabry fc41741694 Fix sanity check mistakes. Add additional checks and comments. 2017-12-06 22:01:21 +01:00
Ghabry 6a98d1516b Add sanity checks to all LCF data structure access to reduce crashes and exploit surface.
This uses a new helper function ReaderUtil::GetElement for 1-based arrays in liblcf.
2017-12-06 22:01:16 +01:00
Ghabry 9448f9e84b Add Priorities for Below/Same/Above Events and Below/Above Tiles. Rewording and cleanup. 2017-05-27 16:51:58 +02:00
Ghabry 14dd7b9af6 Add PriorityBattleUi, remove more magic numbers 2016-10-16 00:02:40 +02:00
Ghabry e8765f3e6b Categorize Z Priorities in groups. 2016-10-15 23:36:53 +02:00
rohkea 8f9521fc5a Hardcode Font::Default into Bitmap::TextDraw 2017-04-22 15:17:23 +03:00
rohkea eeaeccfef3 Remove FontRef from Bitmap, pass it to TextDraw
I've decided against overloading TextDraw to allow calling it
without font because this function is already overloaded too
much. Instead, I've made font a required argument, and added
calls to Font::Default() in the places where TextDraw is called.
2017-04-15 16:12:49 +03:00
Zegeri 28f592e5a8 Remove some unused or empty methods of the Bitmap class
Also reorganize bitmap.cpp and bitmap.h
2016-09-25 17:50:25 +02:00
Ghabry caef6a9a82 Rename GetTwoSwordStyle to HasTwoWeapons 2016-07-09 23:00:56 +02:00
Zegeri 7017f16bfd Use std::bind instead of boost::bind in async handling
cassert has to be included in some files where it was included by
boost/bind.hpp.
In addition, now FileRequestAsync::Bind supports variadic arguments.
2016-03-23 21:31:32 +01:00
Ghabry 74b582b4e8 Handle states correctly in DrawActorState 2016-03-05 19:07:51 +01:00
Ghabry 2546191107 Implement message tile and stretch. Thx to carstene1ns. Fixes #479 2016-02-27 23:58:30 +01:00
Ghabry 0794df3d99 Async: Fix Face/Chara rendering issues in Menu, Shop and message 2016-02-19 01:41:12 +01:00
Ghabry e5a797581e AsyncHandler: Prevent race conditions via shared_ptr 2016-02-18 22:09:32 +01:00
Ghabry a135333c6b Opacity values got lost when using some blits. Disable tone changes for battle animations for now, because this breaks transparency. 2015-09-06 16:45:30 +02:00
Ghabry 56c6f9f6d7 Don't make message box transparent when battle mode is traditional 2015-09-06 16:45:29 +02:00
Ghabry 27aa79f23f Fix Hp/Sp alignment in 2k3 2015-09-06 16:45:29 +02:00
Ghabry 2bac059485 change signature of FileRequest func to FileRequestResult. Async all remaining calls except ShopParty and Music/Sound 2015-05-01 22:07:21 +02:00
Ghabry 8b0be11857 Async loading of system graphic when changed by event. 2015-05-01 02:00:16 +02:00